Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 #include "G4LEPTSElasticModel.hh" 27 28 //....oooOO0OOooo........oooOO0OOooo........oo 29 G4LEPTSElasticModel::G4LEPTSElasticModel(const 30 : G4VLEPTSModel( modelName ) 31 { 32 theXSType = XSElastic; 33 fParticleChangeForGamma = nullptr; 34 } // constructor 35 36 37 //....oooOO0OOooo........oooOO0OOooo........oo 38 G4LEPTSElasticModel::~G4LEPTSElasticModel() = 39 40 41 //....oooOO0OOooo........oooOO0OOooo........oo 42 void G4LEPTSElasticModel::Initialise(const G4P 43 const G4DataVector&) 44 { 45 Init(); 46 BuildPhysicsTable( *aParticle ); 47 48 fParticleChangeForGamma = GetParticleChangeF 49 50 // static const G4double proton_mass_c2 = 51 // static const G4double neutron_mass_c2 = 52 // static const G4double h2o_mass_c2 = 8*neu 53 // G4cout << "mme " << h2o_mass_c2/MeV << " 54 55 const G4MaterialTable * materialTable = G4Ma 56 std::vector<G4Material*>::const_iterator mat 57 for( matite = materialTable->begin(); matite 58 const G4Material * aMaterial = (*matite); 59 theMassTarget[aMaterial] = theMolecularMa 60 theMassProjectile[aMaterial] = CLHEP::elec 61 62 if( verboseLevel >= 1) G4cout << "Material 63 << " MTarget: " << theMassTarget[aMater 64 } 65 66 67 } 68 69 //....oooOO0OOooo........oooOO0OOooo........oo 70 G4double G4LEPTSElasticModel::CrossSectionPerV 71 const 72 G4dou 73 G4dou 74 G4dou 75 { 76 if( kineticEnergy < theLowestEnergyLimit ) r 77 return 1./GetMeanFreePath( mate, aParticle, 78 79 } 80 81 82 //....oooOO0OOooo........oooOO0OOooo........oo 83 void G4LEPTSElasticModel::SampleSecondaries(st 84 const G4Mater 85 const G4Dynam 86 G4double, 87 G4double) 88 { 89 G4double P0KinEn = aDynamicParticle->GetKine 90 G4ThreeVector P0Dir = aDynamicParticle->GetM 91 92 if( P0KinEn < theLowestEnergyLimit ) { 93 fParticleChangeForGamma->ProposeMomentumDi 94 fParticleChangeForGamma->SetProposedKineti 95 fParticleChangeForGamma->ProposeLocalEnerg 96 fParticleChangeForGamma->ProposeTrackStatu 97 if( verboseLevel > 2 ) G4cout << " ENERGY 98 return; 99 } 100 101 //- G4ParticleDefinition * particleDefDef = 102 //- G4String partName = particleDefDef->Get 103 104 // G4ThreeVector pos, pos0, dpos; 105 106 //- G4StepPoG4int * PostPoG4int = aStep.Get 107 //- G4ThreeVector r = PostPoG4int->GetPosit 108 109 //TypeOfInteraction=-10; 110 111 const G4Material* aMaterial = mateCuts->GetM 112 G4double ang = SampleAngle(aMaterial, P0KinE 113 G4ThreeVector P1Dir = SampleNewDirection(P0D 114 #ifdef DEBUG_LEPTS 115 if( verboseLevel >= 2 ) G4cout << " G4LEPTSE 116 #endif 117 118 //G4ThreeVector P1Dir = SampleNewDirection(P 119 //G4double Energylost1= ElasticEnergyTransf 120 G4double Energylost = EnergyTransfer(P0KinE 121 if( verboseLevel >= 3 ) G4cout << " ELASTIC 122 123 G4double P1KinEn = P0KinEn - Energylost; 124 if( verboseLevel >= 3 ) G4cout << " ELASTIC 125 #ifdef DEBUG_LEPTS 126 if( verboseLevel >= 2 ) G4cout << " G4LEPTS 127 #endif 128 fParticleChangeForGamma->ProposeMomentumDire 129 fParticleChangeForGamma->SetProposedKineticE 130 fParticleChangeForGamma->ProposeLocalEnergyD 131 //G4cout << "elasticEnergyLost: " << Energyl 132 133 #ifdef DEBUG_LEPTS 134 if( verboseLevel >= 2 ) G4cout << " G4LEPTS 135 #endif 136 } 137 138 //....oooOO0OOooo........oooOO0OOooo........oo 139 G4double G4LEPTSElasticModel::EnergyTransfer(G 140 { 141 G4double co = std::cos(ang); 142 G4double si = std::sin(ang); 143 144 G4double W = ( (E+MP)*si*si + MT - co*std::s 145 / ( std::pow((E+MP+MT),2) - E*co*co*(E+2*M 146 147 //G4double W2 = 2*MP/MT*(1-co)*E; 148 //G4cout << "WWWWWWWWW: " << W/E << " " << E 149 //G4cout << "Mm " << MT/MeV << " " << MP/MeV 150 151 return W; 152 } 153 154