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 // 27 // ------------------------------------------- 28 // 29 // GEANT4 Class file 30 // 31 // 32 // File name: G4WentzelVIRelModel 33 // 34 // Author: V.Ivanchenko 35 // 36 // Creation date: 08.06.2012 from G4WentzelVIR 37 // 38 // Modifications: 39 // 40 // Class Description: 41 // 42 // Implementation of the model of multiple sca 43 // G.Wentzel, Z. Phys. 40 (1927) 590. 44 // H.W.Lewis, Phys Rev 78 (1950) 526. 45 // J.M. Fernandez-Varea et al., NIM B73 (1993) 46 // L.Urban, CERN-OPEN-2006-077. 47 48 // ------------------------------------------- 49 // 50 51 //....oooOO0OOooo........oooOO0OOooo........oo 52 //....oooOO0OOooo........oooOO0OOooo........oo 53 54 #include "G4WentzelVIRelModel.hh" 55 #include "G4WentzelVIRelXSection.hh" 56 #include "G4WentzelOKandVIxSection.hh" 57 #include "G4PhysicalConstants.hh" 58 #include "G4SystemOfUnits.hh" 59 #include "G4Material.hh" 60 #include "G4ElementVector.hh" 61 #include "G4ProductionCutsTable.hh" 62 #include "G4NistManager.hh" 63 #include "G4EmParameters.hh" 64 #include "G4AutoLock.hh" 65 66 //....oooOO0OOooo........oooOO0OOooo........oo 67 68 std::vector<G4double> G4WentzelVIRelModel::eff 69 70 namespace 71 { 72 G4Mutex theWVIRelMutex = G4MUTEX_INITIALIZER 73 } 74 75 G4WentzelVIRelModel::G4WentzelVIRelModel() : 76 G4WentzelVIModel(true, "WentzelVIRel") 77 { 78 fNistManager = G4NistManager::Instance(); 79 auto ptr = new G4WentzelVIRelXSection(); 80 SetWVICrossSection(static_cast<G4WentzelOKan 81 } 82 83 //....oooOO0OOooo........oooOO0OOooo........oo 84 85 G4WentzelVIRelModel::~G4WentzelVIRelModel() = 86 87 //....oooOO0OOooo........oooOO0OOooo........oo 88 89 void G4WentzelVIRelModel::Initialise(const G4P 90 const G4D 91 { 92 // Access to materials 93 const G4ProductionCutsTable* theCoupleTable 94 G4ProductionCutsTable::GetProductionCutsTa 95 if(theCoupleTable->GetTableSize() != effMass 96 ComputeEffectiveMass(); 97 } 98 99 G4WentzelVIModel::Initialise(p, cuts); 100 } 101 102 //....oooOO0OOooo........oooOO0OOooo........oo 103 104 void G4WentzelVIRelModel::DefineMaterial(const 105 { 106 if(cup != currentCouple) { 107 currentCouple = cup; 108 SetCurrentCouple(cup); 109 currentMaterial = cup->GetMaterial(); 110 currentMaterialIndex = currentCouple->GetI 111 GetWVICrossSection()->SetTargetMass(effMas 112 } 113 } 114 115 //....oooOO0OOooo........oooOO0OOooo........oo 116 117 G4double G4WentzelVIRelModel::ComputeCrossSect 118 const G4ParticleD 119 G4double kinEnerg 120 G4double Z, G4dou 121 G4double cutEnerg 122 { 123 G4double cross = 0.0; 124 if(p != particle) { SetupParticle(p); } 125 if(kinEnergy < lowEnergyLimit) { return cros 126 if(nullptr == CurrentCouple()) { 127 G4Exception("G4WentzelVIRelModel::ComputeC 128 FatalException, " G4MaterialCu 129 return cross; 130 } 131 DefineMaterial(CurrentCouple()); 132 G4int iz = G4lrint(Z); 133 G4double tmass = (1 == iz) ? CLHEP::proton_m 134 : fNistManager->GetAtomicMassAmu(iz)*amu_c 135 wokvi->SetTargetMass(tmass); 136 cosTetMaxNuc = wokvi->SetupKinematic(kinEner 137 if(cosTetMaxNuc < 1.0) { 138 G4double cost = wokvi->SetupTarget(iz, cut 139 cross = wokvi->ComputeTransportCrossSectio 140 /* 141 //if(p->GetParticleName() == "e-") 142 G4cout << "G4WentzelVIRelModel::CS: Z= " < 143 << " e(MeV)= " << kinEnergy 144 << " 1-cosN= " << 1 - cosTetMaxNuc 145 << " " << particle->GetParticleName 146 */ 147 } 148 return cross; 149 } 150 151 //....oooOO0OOooo........oooOO0OOooo........oo 152 153 void G4WentzelVIRelModel::ComputeEffectiveMass 154 { 155 const G4ProductionCutsTable* theCoupleTable 156 G4ProductionCutsTable::GetProductionCutsTa 157 std::size_t ncouples = (G4int)theCoupleTable 158 if(ncouples == effMass.size()) { return; } 159 160 G4AutoLock l(&theWVIRelMutex); 161 if(ncouples != effMass.size()) { 162 effMass.resize(ncouples, 0.0); 163 for(std::size_t i=0; i<ncouples; ++i) { 164 const G4Material* mat = 165 theCoupleTable->GetMaterialCutsCouple((G4int 166 const G4ElementVector* elmVector = mat-> 167 std::size_t nelm = mat->GetNumberOfEleme 168 G4double sum = 0.0; 169 G4double norm= 0.0; 170 for(std::size_t j=0; j<nelm; ++j) { 171 G4int Z = (*elmVector)[j]->GetZasInt(); 172 G4double mass = fNistManager->GetAtomicMassA 173 G4int Z2 = Z*Z; 174 sum += mass*Z2; 175 norm += Z2; 176 } 177 effMass[i] = (0.0 < norm) ? sum/norm : s 178 } 179 } 180 l.unlock(); 181 } 182 183 //....oooOO0OOooo........oooOO0OOooo........oo 184