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: G4RDeIonisationCrossSectionH 33 // 34 // Author: V.Ivanchenko (Vladimir.Ivanc 35 // 36 // Creation date: 25 Sept 2001 37 // 38 // Modifications: 39 // 10 Oct 2001 M.G. Pia Revision to impro 40 // 19 Jul 2002 VI Create composite 41 // 21 Jan 2003 V.Ivanchenko Cut per region 42 // 43 // ------------------------------------------- 44 45 #include "G4RDeIonisationCrossSectionHandler.h 46 #include "G4PhysicalConstants.hh" 47 #include "G4SystemOfUnits.hh" 48 #include "G4RDVEnergySpectrum.hh" 49 #include "G4DataVector.hh" 50 #include "G4RDCompositeEMDataSet.hh" 51 #include "G4RDVDataSetAlgorithm.hh" 52 #include "G4RDLinLogLogInterpolation.hh" 53 #include "G4RDSemiLogInterpolation.hh" 54 #include "G4RDVEMDataSet.hh" 55 #include "G4RDEMDataSet.hh" 56 #include "G4Material.hh" 57 #include "G4ProductionCutsTable.hh" 58 59 60 G4RDeIonisationCrossSectionHandler::G4RDeIonis 61 const G4RDVEnergySpectrum* spec, G4RDVData 62 G4double emin, G4double emax, G4int nbin) 63 : G4RDVCrossSectionHandler(), 64 theParam(spec) 65 { 66 G4RDVCrossSectionHandler::Initialise(alg, em 67 interp = new G4RDLinLogLogInterpolation(); 68 } 69 70 71 G4RDeIonisationCrossSectionHandler::~G4RDeIoni 72 { 73 delete interp; 74 } 75 76 77 std::vector<G4RDVEMDataSet*>* G4RDeIonisationC 78 const G4DataVector& en 79 const G4DataVector* en 80 { 81 G4int verbose = 0; 82 std::vector<G4RDVEMDataSet*>* set = new std: 83 84 G4DataVector* energies; 85 G4DataVector* cs; 86 G4int nOfBins = energyVector.size(); 87 88 const G4ProductionCutsTable* theCoupleTable= 89 G4ProductionCutsTable::GetProductionCu 90 size_t numOfCouples = theCoupleTable->GetTab 91 92 for (size_t m=0; m<numOfCouples; m++) { 93 94 const G4MaterialCutsCouple* couple = theCo 95 const G4Material* material= couple->GetMat 96 const G4ElementVector* elementVector = mat 97 const G4double* nAtomsPerVolume = material 98 G4int nElements = material->GetNumberOfEle 99 100 if(verbose > 0) { 101 G4cout << "eIonisation CS for " << m << 102 << material->GetName() 103 << " eEl= " << nElements << G4en 104 } 105 106 G4double tcut = (*energyCuts)[m]; 107 108 G4RDVDataSetAlgorithm* algo = interp->Clon 109 G4RDVEMDataSet* setForMat = new G4RDCompos 110 111 for (G4int i=0; i<nElements; i++) { 112 113 G4int Z = (G4int) (*elementVector)[i]->G 114 G4int nShells = NumberOfComponents(Z); 115 energies = new G4DataVector; 116 cs = new G4DataVector; 117 G4double density = nAtomsPerVolume[i]; 118 119 for (G4int bin=0; bin<nOfBins; bin++) { 120 121 G4double e = energyVector[bin]; 122 energies->push_back(e); 123 G4double value = 0.0; 124 125 if(e > tcut) { 126 for (G4int n=0; n<nShells; n++) { 127 G4double cross = FindValue(Z, e, n 128 G4double p = theParam->Probability 129 value += cross * p * density; 130 131 if(verbose>0 && m == 0 && e>=1. && 132 G4cout << "G4eIonCrossSH: e(MeV) 133 << " n= " << n 134 << " cross= " << cross 135 << " p= " << p 136 << " value= " << value 137 << " tcut(MeV)= " << tcut 138 << " rho= " << density 139 << " Z= " << Z 140 << G4endl; 141 } 142 143 } 144 } 145 cs->push_back(value); 146 } 147 G4RDVDataSetAlgorithm* algo = interp->Cl 148 G4RDVEMDataSet* elSet = new G4RDEMDataSe 149 setForMat->AddComponent(elSet); 150 } 151 set->push_back(setForMat); 152 } 153 154 return set; 155 } 156 157 158