Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4LEPTSElasticModel.cc
이 파일의 문서화 페이지로 가기
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 "G4LEPTSElasticModel.hh"
27 
28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30  : G4VLEPTSModel( modelName )
31 {
33 } // constructor
34 
35 
36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
38 }
39 
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
43  const G4DataVector&)
44 {
45  Init();
46  BuildPhysicsTable( *aParticle );
47 
49 
50  // static const G4double proton_mass_c2 = 938.272013 * MeV;
51  // static const G4double neutron_mass_c2 = 939.56536 * MeV;
52  // static const G4double h2o_mass_c2 = 8*neutron_mass_c2 + 10*(proton_mass_c2 + electron_mass_c2);
53  // G4cout << "mme " << h2o_mass_c2/MeV << " " << H2o_mass_c2/MeV << G4endl;
54 
55  const G4MaterialTable * materialTable = G4Material::GetMaterialTable() ;
56  std::vector<G4Material*>::const_iterator matite;
57  for( matite = materialTable->begin(); matite != materialTable->end(); matite++ ) {
58  const G4Material * aMaterial = (*matite);
59  theMassTarget[aMaterial] = theMolecularMass[aMaterial] / (6.02214179e+23/CLHEP::mole) *CLHEP::c_light * CLHEP::c_light;
61 
62  if( verboseLevel >= 1) G4cout << "Material: " << aMaterial->GetName() << " MolecularMass: " << theMolecularMass[aMaterial]/(CLHEP::g/CLHEP::mole) << " g/mole "
63  << " MTarget: " << theMassTarget[aMaterial]/CLHEP::MeV << " MeV" << G4endl;
64  }
65 
66 
67 }
68 
69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
71  const G4ParticleDefinition* aParticle,
73  G4double,
74  G4double)
75 {
76  if( kineticEnergy < theLowestEnergyLimit ) return DBL_MAX;
77  return 1./GetMeanFreePath( mate, aParticle, kineticEnergy );
78 
79 }
80 
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
83 void G4LEPTSElasticModel::SampleSecondaries(std::vector<G4DynamicParticle*>*,
84  const G4MaterialCutsCouple* mateCuts,
85  const G4DynamicParticle* aDynamicParticle,
86  G4double,
87  G4double)
88 {
89  G4double P0KinEn = aDynamicParticle->GetKineticEnergy();
90  G4ThreeVector P0Dir = aDynamicParticle->GetMomentumDirection();
91 
92  if( P0KinEn < theLowestEnergyLimit ) {
97  if( verboseLevel > 2 ) G4cout << " ENERGY LOW " << P0KinEn - theLowestEnergyLimit << G4endl;
98  return;
99  }
100 
101  //- G4ParticleDefinition * particleDefDef = aTrack.GetDefinition();
102  //- G4String partName = particleDefDef->GetParticleName();
103 
104  // G4ThreeVector pos, pos0, dpos;
105 
106  //- G4StepPoG4int * PostPoG4int = aStep.GetPostStepPoG4int();
107  //- G4ThreeVector r = PostPoG4int->GetPosition();
108 
109  //TypeOfInteraction=-10;
110 
111  const G4Material* aMaterial = mateCuts->GetMaterial();
112  G4double ang = SampleAngle(aMaterial, P0KinEn/CLHEP::eV, 0.0);
113  G4ThreeVector P1Dir = SampleNewDirection(P0Dir, ang);
114 #ifdef DEBUG_LEPTS
115  if( verboseLevel >= 2 ) G4cout << " G4LEPTSElasticModel::SampleSecondaries( P1Dir " << P1Dir << " P0Dir " << P0Dir << " ang " << ang << G4endl;
116 #endif
117 
118  //G4ThreeVector P1Dir = SampleNewDirection(P0Dir, P0KinEn/eV, 0.0);
119  //G4double Energylost1= ElasticEnergyTransferWater2(P0KinEn, ang);
120  G4double Energylost = EnergyTransfer(P0KinEn, ang, theMassTarget[aMaterial], theMassProjectile[aMaterial]);
121  if( verboseLevel >= 3 ) G4cout << " ELASTIC Energylost "<< Energylost << " = " << P0KinEn << " " <<ang << " " << theMassTarget[aMaterial] << " " << theMassProjectile[aMaterial] << G4endl;
122 
123  G4double P1KinEn = P0KinEn - Energylost;
124  if( verboseLevel >= 3 ) G4cout << " ELASTIC " << P1KinEn << " = " << P0KinEn << " - " << Energylost << G4endl;
125 #ifdef DEBUG_LEPTS
126  if( verboseLevel >= 2 ) G4cout << " G4LEPTSElasticModel::SampleSecondaries( SetProposedKineticEnergy " << P1KinEn << " " << P0KinEn << " - " << Energylost << G4endl;
127 #endif
131  //G4cout << "elasticEnergyLost: " << Energylost << G4endl;
132 
133 #ifdef DEBUG_LEPTS
134  if( verboseLevel >= 2 ) G4cout << " G4LEPTSElasticModel::SampleSecondaries( ProposeMomentumDirection " << fParticleChangeForGamma->GetProposedMomentumDirection() << G4endl;
135 #endif
136 }
137 
138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
140 {
141  G4double co = std::cos(ang);
142  G4double si = std::sin(ang);
143 
144  G4double W = ( (E+MP)*si*si + MT - co*std::sqrt(MT*MT-MP*MP*si*si) ) * E*(E+2*MP)
145  / ( std::pow((E+MP+MT),2) - E*co*co*(E+2*MP) );
146 
147  //G4double W2 = 2*MP/MT*(1-co)*E;
148  //G4cout << "WWWWWWWWW: " << W/E << " " << E/W << " " << W2/W << G4endl;
149  //G4cout << "Mm " << MT/MeV << " " << MP/MeV << G4endl;
150 
151  return W;
152 }
153 
G4ParticleChangeForGamma * fParticleChangeForGamma
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:593
G4double SampleAngle(const G4Material *aMaterial, G4double e, G4double el)
static constexpr double g
#define G4endl
Definition: G4ios.hh:61
const G4ThreeVector & GetMomentumDirection() const
static constexpr double mole
void SetProposedKineticEnergy(G4double proposedKinEnergy)
std::map< const G4Material *, G4double > theMassProjectile
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)
G4double GetMeanFreePath(const G4Material *mate, const G4ParticleDefinition *aParticle, G4double kineticEnergy)
void BuildPhysicsTable(const G4ParticleDefinition &aParticleType)
std::map< const G4Material *, G4double > theMassTarget
const G4String & GetName() const
Definition: G4Material.hh:179
double G4double
Definition: G4Types.hh:76
static constexpr double electron_mass_c2
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
static constexpr double MeV
G4double EnergyTransfer(G4double, G4double, G4double, G4double)
static constexpr double eV
std::vector< G4Material * > G4MaterialTable
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
static constexpr double c_light
G4LEPTSElasticModel(const G4String &modelName="G4LEPTSElasticModel")
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetProposedMomentumDirection() const
G4ThreeVector SampleNewDirection(const G4Material *aMaterial, G4ThreeVector Dir, G4double e, G4double el)
G4double theLowestEnergyLimit
const G4Material * GetMaterial() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
Definition: G4VEmModel.cc:131
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
#define DBL_MAX
Definition: templates.hh:83
void ProposeTrackStatus(G4TrackStatus status)
std::map< const G4Material *, G4double > theMolecularMass