Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // >> 23 // $Id: G4eeToHadronsMultiModel.cc,v 1.2 2005/11/23 19:17:26 vnivanch Exp $ >> 24 // GEANT4 tag $Name: geant4-08-00 $ 26 // 25 // 27 // ------------------------------------------- 26 // ------------------------------------------------------------------- 28 // 27 // 29 // GEANT4 Class file 28 // GEANT4 Class file 30 // 29 // 31 // 30 // 32 // File name: G4eeToHadronsMultiModel 31 // File name: G4eeToHadronsMultiModel 33 // 32 // 34 // Author: Vladimir Ivanchenko << 33 // Author: Vladimir Ivanchenko on base of Michel Maire code 35 // 34 // 36 // Creation date: 02.08.2004 35 // Creation date: 02.08.2004 37 // 36 // 38 // Modifications: 37 // Modifications: 39 // 08-11-04 Migration to new interface of Stor 38 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko) 40 // 08-04-05 Major optimisation of internal int 39 // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko) 41 // 40 // 42 41 43 // 42 // 44 // ------------------------------------------- 43 // ------------------------------------------------------------------- 45 // 44 // 46 //....oooOO0OOooo........oooOO0OOooo........oo 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 47 //....oooOO0OOooo........oooOO0OOooo........oo 46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 48 47 49 #include "G4eeToHadronsMultiModel.hh" 48 #include "G4eeToHadronsMultiModel.hh" 50 #include "G4PhysicalConstants.hh" << 51 #include "G4SystemOfUnits.hh" << 52 #include "G4eeToTwoPiModel.hh" 49 #include "G4eeToTwoPiModel.hh" 53 #include "G4eeTo3PiModel.hh" << 54 #include "G4eeToPGammaModel.hh" << 55 #include "G4ee2KNeutralModel.hh" << 56 #include "G4ee2KChargedModel.hh" << 57 #include "G4eeCrossSections.hh" 50 #include "G4eeCrossSections.hh" 58 #include "G4Vee2hadrons.hh" << 59 #include "G4Positron.hh" << 60 51 61 //....oooOO0OOooo........oooOO0OOooo........oo 52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 62 53 63 using namespace std; 54 using namespace std; 64 55 65 G4eeToHadronsMultiModel::G4eeToHadronsMultiMod << 56 G4eeToHadronsMultiModel::G4eeToHadronsMultiModel(G4int ver, const G4String& name) 66 const G4String& mname) : G4VEmModel(mname), << 57 : G4VEmModel(name), 67 { << 58 csFactor(1.0), 68 maxKineticEnergy = 4.521*CLHEP::GeV; //crre << 59 nModels(0), 69 delta = 1.0*CLHEP::MeV; //for bin width << 60 verbose(ver), 70 } << 61 isInitialised(false) >> 62 {} 71 63 72 //....oooOO0OOooo........oooOO0OOooo........oo 64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 73 65 74 G4eeToHadronsMultiModel::~G4eeToHadronsMultiMo 66 G4eeToHadronsMultiModel::~G4eeToHadronsMultiModel() 75 { 67 { >> 68 G4int n = models.size(); >> 69 if(n>0) { >> 70 for(G4int i=0; i<n; i++) { >> 71 delete models[i]; >> 72 } >> 73 } 76 delete cross; 74 delete cross; 77 } 75 } 78 76 79 //....oooOO0OOooo........oooOO0OOooo........oo 77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 80 78 81 void G4eeToHadronsMultiModel::Initialise(const << 79 void G4eeToHadronsMultiModel::Initialise(const G4ParticleDefinition* p, const G4DataVector& v) 82 const G4DataVector& cuts) << 83 { 80 { 84 if(!isInitialised) { 81 if(!isInitialised) { 85 isInitialised = true; 82 isInitialised = true; 86 83 87 //G4cout<<"###Initialise in HadronMultiMod << 84 thKineticEnergy = DBL_MAX; >> 85 maxKineticEnergy = HighEnergyLimit(); 88 86 89 cross = new G4eeCrossSections(); 87 cross = new G4eeCrossSections(); 90 << 88 G4eeToHadronsModel* model = new G4eeToHadronsModel(new G4eeToTwoPiModel(cross), verbose); 91 G4eeToTwoPiModel* m2pi = << 89 models.push_back(model); 92 new G4eeToTwoPiModel(cross,maxKineticEne << 90 model->SetHighEnergyLimit(maxKineticEnergy); 93 AddEEModel(m2pi,cuts); << 91 model->Initialise(p, v); 94 << 92 G4double emin = model->LowEnergyLimit(); 95 G4eeTo3PiModel* m3pi = << 93 if(emin < thKineticEnergy) thKineticEnergy = emin; 96 new G4eeTo3PiModel(cross,maxKineticEnerg << 94 ekinMin.push_back(emin); 97 AddEEModel(m3pi,cuts); << 95 ekinMax.push_back(model->HighEnergyLimit()); 98 << 96 ekinPeak.push_back(model->PeakEnergy()); 99 G4ee2KChargedModel* m2kc = << 97 cumSum.push_back(0.0); 100 new G4ee2KChargedModel(cross,maxKineticE << 98 nModels = 1; 101 AddEEModel(m2kc,cuts); << 102 << 103 G4ee2KNeutralModel* m2kn = << 104 new G4ee2KNeutralModel(cross,maxKineticE << 105 AddEEModel(m2kn,cuts); << 106 << 107 G4eeToPGammaModel* mpg1 = << 108 new G4eeToPGammaModel(cross,"pi0",maxKin << 109 AddEEModel(mpg1,cuts); << 110 << 111 G4eeToPGammaModel* mpg2 = << 112 new G4eeToPGammaModel(cross,"eta",maxKin << 113 AddEEModel(mpg2,cuts); << 114 << 115 nModels = (G4int)models.size(); << 116 << 117 fParticleChange = GetParticleChangeForGamm << 118 } 99 } 119 } 100 } 120 101 121 //....oooOO0OOooo........oooOO0OOooo........oo 102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 122 103 123 void G4eeToHadronsMultiModel::AddEEModel(G4Vee << 104 void G4eeToHadronsMultiModel::PrintInfo() 124 const G4DataVector& cuts) << 125 { << 126 G4eeToHadronsModel* model = new G4eeToHadron << 127 models.push_back(model); << 128 G4double elow = mod->LowEnergy(); << 129 ekinMin.push_back(elow); << 130 if(thKineticEnergy > elow) { thKineticEnergy << 131 ekinMax.push_back(mod->HighEnergy()); << 132 ekinPeak.push_back(mod->PeakEnergy()); << 133 cumSum.push_back(0.0); << 134 << 135 const G4ParticleDefinition* positron = G4Pos << 136 model->Initialise(positron,cuts); << 137 } << 138 << 139 //....oooOO0OOooo........oooOO0OOooo........oo << 140 << 141 G4double G4eeToHadronsMultiModel::CrossSection << 142 const G4Material* mat, << 143 const G4ParticleDefinition* p, << 144 G4double kineticEnergy, << 145 G4double, G4double) << 146 { << 147 return mat->GetElectronDensity()* << 148 ComputeCrossSectionPerElectron(p, kineticE << 149 } << 150 << 151 //....oooOO0OOooo........oooOO0OOooo........oo << 152 << 153 G4double G4eeToHadronsMultiModel::ComputeCross << 154 const G4 << 155 G4double kineticEnergy, << 156 G4double Z, G4double, << 157 G4double, G4double) << 158 { << 159 return Z*ComputeCrossSectionPerElectron(p, k << 160 } << 161 << 162 //....oooOO0OOooo........oooOO0OOooo........oo << 163 << 164 G4double G4eeToHadronsMultiModel::ComputeCross << 165 G4double kineticEnergy, << 166 G4double, G4double) << 167 { << 168 G4double res = 0.0; << 169 << 170 G4double energy = LabToCM(kineticEnergy); << 171 << 172 if (energy > thKineticEnergy) { << 173 for(G4int i=0; i<nModels; i++) { << 174 if(energy >= ekinMin[i] && energy <= eki << 175 res += (models[i])->ComputeCrossSectio << 176 } << 177 cumSum[i] = res; << 178 } << 179 } << 180 return res*csFactor; << 181 } << 182 << 183 //....oooOO0OOooo........oooOO0OOooo........oo << 184 << 185 void G4eeToHadronsMultiModel::SampleSecondarie << 186 std::vector<G4DynamicParticle*>* ne << 187 const G4MaterialCutsCouple* couple, << 188 const G4DynamicParticle* dp, << 189 G4double, G4double) << 190 { << 191 G4double kinEnergy = dp->GetKineticEnergy(); << 192 G4double energy = LabToCM(kinEnergy); << 193 if (energy > thKineticEnergy) { << 194 G4double q = cumSum[nModels-1]*G4UniformRa << 195 for(G4int i=0; i<nModels; ++i) { << 196 if(q <= cumSum[i]) { << 197 (models[i])->SampleSecondaries(newp, c << 198 if(newp->size() > 0) { << 199 fParticleChange->ProposeTrackStatus(fStopA << 200 } << 201 break; << 202 } << 203 } << 204 } << 205 } << 206 << 207 //....oooOO0OOooo........oooOO0OOooo........oo << 208 << 209 void G4eeToHadronsMultiModel::ModelDescription << 210 { 105 { 211 if(verbose > 0) { 106 if(verbose > 0) { 212 G4double e1 = 0.5*thKineticEnergy*thKineti << 107 G4cout << " e+ annihilation into hadrons active above " 213 - 2.0*electron_mass_c2; << 108 << thKineticEnergy/GeV << " GeV" 214 G4double e2 = 0.5*maxKineticEnergy*maxKine << 109 << G4endl; 215 - 2.0*electron_mass_c2; << 216 outFile << " e+ annihilation into had << 217 << e1/GeV << " GeV to " << e2/GeV << " G << 218 } 110 } 219 } 111 } 220 112 221 //....oooOO0OOooo........oooOO0OOooo........oo 113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 222 114 223 void G4eeToHadronsMultiModel::SetCrossSecFacto 115 void G4eeToHadronsMultiModel::SetCrossSecFactor(G4double fac) 224 { 116 { 225 if(fac > 1.0) { 117 if(fac > 1.0) { 226 csFactor = fac; 118 csFactor = fac; 227 if(verbose > 0) { << 119 if(verbose > 0) 228 G4cout << "### G4eeToHadronsMultiModel: << 120 G4cout << "### G4eeToHadronsMultiModel: The cross section for G4eeToHadronsMultiModel is " 229 << "G4eeToHadronsMultiModel is increase << 121 << "increased by the Factor= " << csFactor << G4endl; 230 << csFactor << " times" << G4endl; << 231 } << 232 } 122 } 233 } 123 } 234 124 235 //....oooOO0OOooo........oooOO0OOooo........oo 125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 236 126