source: trunk/source/processes/electromagnetic/adjoint/src/G4VAdjointInverseScattering.cc@ 1036

Last change on this file since 1036 was 966, checked in by garnier, 17 years ago

fichier ajoutes

File size: 4.1 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26#include "G4VAdjointInverseScattering.hh"
27#include "G4AdjointCSManager.hh"
28#include "G4AdjointCSMatrix.hh"
29#include "G4AdjointInterpolator.hh"
30#include "G4AdjointCSMatrix.hh"
31#include "G4VEmAdjointModel.hh"
32#include "G4ElementTable.hh"
33#include "G4Element.hh"
34#include "G4Material.hh"
35#include "G4MaterialCutsCouple.hh"
36#include "G4AdjointCSManager.hh"
37#include "G4ParticleChange.hh"
38#include "G4AdjointElectron.hh"
39
40
41G4VAdjointInverseScattering::
42 G4VAdjointInverseScattering(G4String process_name, G4bool whichScatCase):
43 G4VDiscreteProcess(process_name)
44{theAdjointCSManager = G4AdjointCSManager::GetAdjointCSManager();
45 IsScatProjToProjCase=whichScatCase;
46 /*theAdjointEMModel=aModel;
47 IsScatProjToProjCase=whichScatCase;*/
48 fParticleChange=new G4ParticleChange();
49
50}
51//////////////////////////////////////////////////////////////////////////////
52//
53G4VAdjointInverseScattering::
54 ~G4VAdjointInverseScattering()
55{;
56}
57//////////////////////////////////////////////////////////////////////////////
58//
59void G4VAdjointInverseScattering::PreparePhysicsTable(const G4ParticleDefinition&)
60{;
61}
62//////////////////////////////////////////////////////////////////////////////
63//
64void G4VAdjointInverseScattering::BuildPhysicsTable(const G4ParticleDefinition&)
65{
66
67 theAdjointCSManager->BuildCrossSectionMatrices(); //do not worry it will be done just once
68 theAdjointCSManager->BuildTotalSigmaTables();
69
70}
71//////////////////////////////////////////////////////////////////////////////
72//
73G4VParticleChange* G4VAdjointInverseScattering::PostStepDoIt(const G4Track& track, const G4Step& )
74{
75 fParticleChange->Initialize(track);
76
77 theAdjointEMModel->SampleSecondaries(track,
78 IsScatProjToProjCase,
79 fParticleChange);
80
81 ClearNumberOfInteractionLengthLeft();
82 return fParticleChange;
83
84
85
86}
87//////////////////////////////////////////////////////////////////////////////
88//
89G4double G4VAdjointInverseScattering::GetMeanFreePath(const G4Track& track,
90 G4double ,
91 G4ForceCondition* condition)
92{ *condition = NotForced;
93 G4double preStepKinEnergy = track.GetKineticEnergy();
94
95 G4double Sigma =
96 theAdjointEMModel->AdjointCrossSection(track.GetMaterialCutsCouple(),preStepKinEnergy,IsScatProjToProjCase);
97
98
99 G4double mean_free_path = 1./Sigma;
100 //G4cout<<"mean_free_path [mm] "<<mean_free_path/mm<<std::endl;
101 return mean_free_path;
102}
103
Note: See TracBrowser for help on using the repository browser.