55 G4cout <<
"*******************************************************************************" <<
G4endl;
56 G4cout <<
"*******************************************************************************" <<
G4endl;
57 G4cout <<
" The name of the class G4MuElecElasticModel is changed to G4MicroElecElasticModel. " <<
G4endl;
58 G4cout <<
" The obsolete class will be REMOVED with the next release of Geant4. " <<
G4endl;
59 G4cout <<
"*******************************************************************************" <<
G4endl;
60 G4cout <<
"*******************************************************************************" <<
G4endl;
82 G4cout <<
"MuElec Elastic model is constructed " << G4endl
97 std::map< G4String,G4MuElecCrossSectionDataSet*,std::less<G4String> >::iterator
pos;
117 G4cout <<
"Calling G4MuElecElasticModel::Initialise()" <<
G4endl;
123 G4cout <<
"G4MuElecElasticModel: low energy limit increased from " <<
130 G4cout <<
"G4MuElecElasticModel: high energy limit decreased from " <<
139 G4String fileElectron(
"microelec/sigma_elastic_e_Si");
156 char *path = std::getenv(
"G4LEDATA");
164 std::ostringstream eFullFileName;
165 eFullFileName << path <<
"/microelec/sigmadiff_elastic_e_Si.dat";
166 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
168 if (!eDiffCrossSection)
169 G4Exception(
"G4MuElecElasticModel::Initialise",
"em0003",
FatalException,
"Missing data file: /microelec/sigmadiff_elastic_e_Si.dat");
173 while(!eDiffCrossSection.eof())
177 eDiffCrossSection>>tDummy>>eDummy;
183 eVecm[tDummy].push_back(0.);
189 if (!eDiffCrossSection.eof()) eDiffCrossSectionData[tDummy][eDummy]*=scaleFactor;
191 if (eDummy !=
eVecm[tDummy].back())
eVecm[tDummy].push_back(eDummy);
198 G4cout <<
"Loaded cross section files for MuElec Elastic model" <<
G4endl;
202 G4cout <<
"MuElec Elastic model is initialized " << G4endl
225 G4cout <<
"Calling CrossSectionPerVolume() of G4MuElecElasticModel" <<
G4endl;
243 std::map< G4String,G4MuElecCrossSectionDataSet*,std::less<G4String> >::iterator
pos;
256 G4Exception(
"G4MuElecElasticModel::ComputeCrossSectionPerVolume",
"em0002",
FatalException,
"Model not applicable to particle type.");
264 G4cout <<
" - Cross section per Si atom (cm^-1)=" << sigma*density/(1./
cm) << G4endl;
269 return sigma*density;
282 G4cout <<
"Calling SampleSecondaries() of G4MuElecElasticModel" <<
G4endl;
303 G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
305 xDir *= std::cos(phi);
306 yDir *= std::sin(phi);
308 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
338 std::vector<double>::iterator
t2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(),
k);
339 std::vector<double>::iterator
t1 = t2-1;
341 std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(), integrDiff);
342 std::vector<double>::iterator e11 = e12-1;
344 std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(), integrDiff);
345 std::vector<double>::iterator e21 = e22-1;
354 xs11 = eDiffCrossSectionData[valueT1][valueE11];
355 xs12 = eDiffCrossSectionData[valueT1][valueE12];
356 xs21 = eDiffCrossSectionData[valueT2][valueE21];
357 xs22 = eDiffCrossSectionData[valueT2][valueE22];
361 if (xs11==0 || xs12==0 ||xs21==0 ||xs22==0)
return (0.);
363 theta = QuadInterpolator( valueE11, valueE12,
395 G4double a = (std::log10(xs2)-std::log10(xs1)) / (std::log10(e2)-std::log10(e1));
396 G4double b = std::log10(xs2) - a*std::log10(e2);
424 integrdiff = uniformRand;
430 cosTheta= std::cos(theta*
pi/180);