14 #include "G4VPhysicalVolume.hh"
17 #include "Randomize.hh"
18 #include "CLHEP/Units/GlobalSystemOfUnits.h"
31 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
32 const G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
33 const G4Track*
track = aStep->GetTrack();
35 const G4DynamicParticle* aParticle =
track->GetDynamicParticle();
36 const G4ThreeVector& momDir = aParticle->GetMomentumDirection();
37 double energy = preStepPoint->GetKineticEnergy();
38 G4ThreeVector hitPoint = preStepPoint->GetPosition();
39 const G4ThreeVector& hitPointOrig = preStepPoint->GetPosition();
40 G4int parCode =
track->GetDefinition()->GetPDGEncoding();
52 G4ThreeVector posLocal;
53 double tSlice = (postStepPoint->GetGlobalTime()) / nanosecond;
60 double xxlocal, yylocal, zzlocal;
63 side = (hitPointOrig.z() > 0.) ?
true :
false;
69 for (
int i = 0;
i <
npe;
i++) {
78 zz = (hitPointOrig.z() > 0.) ? zzlocal +
Z0 : zzlocal -
Z0;
80 posLocal = G4ThreeVector(xxlocal, yylocal, zzlocal);
91 zz = (hitPointOrig.z() > 0.) ? zzlocal +
Z0 : zzlocal -
Z0;
93 posLocal = G4ThreeVector(xxlocal, yylocal, zzlocal);
98 oneHit.
depth = channel;
103 hitPoint.setX(hitPointOrig.x() -
X0);
104 hitPoint.setY(hitPointOrig.y() -
Y0);
105 double setZ = (hitPointOrig.z() > 0.) ? hitPointOrig.z() -
Z0 : fabs(hitPointOrig.z()) -
Z0;
118 hits.push_back(oneHit);
120 LogDebug(
"ZdcShower") <<
"\nZdcShowerLibrary:Generated Hit " << nHit <<
" orig hit pos " << hitPointOrig
121 <<
" orig hit pos local coord" << hitPoint <<
" new position " << (
hits[nHit].position)
122 <<
" Channel " << (
hits[nHit].
depth) <<
" side " << side <<
" Time " << (
hits[nHit].time)
123 <<
" DetectorID " << (
hits[nHit].detID) <<
" Had Energy " << (
hits[nHit].DeHad)
124 <<
" EM Energy " << (
hits[nHit].DeEM) <<
"\n";
131 const G4ThreeVector& momDir,
141 LogDebug(
"ZdcShower") <<
"\n ZdcShowerLibrary::getEnergyFromLibrary input/output variables:"
142 <<
" phi: " << 59.2956 * momDir.phi() <<
" theta: " << 59.2956 * momDir.theta()
143 <<
" xin : " << hitPoint.x() <<
" yin : " << hitPoint.y() <<
" zin : " << hitPoint.z()
144 <<
" track en: " <<
energy <<
"(GeV)"
145 <<
" section: " <<
section <<
" side: " << side <<
" channel: " << channel
146 <<
" partID: " << parCode;
152 float xin = hitPoint.x();
153 float yin = hitPoint.y();
191 eav = ((((((-0.0002 * xin - 2.0e-13) * xin + 0.0022) * xin + 1.0e-11) * xin - 0.0217) * xin - 3.0e-10) * xin +
193 (((0.0001 * yin + 0.0056) * yin + 0.0508) * yin + 1.0) * 300.0 *
pow((
energy / 300.0), 0.99);
194 esig = ((((((0.0005 * xin - 1.0e-12) * xin - 0.0052) * xin + 5.0e-11) * xin + 0.032) * xin - 2.0e-10) * xin + 1.0) *
195 (((0.0006 * yin + 0.0071) * yin - 0.031) * yin + 1.0) * 30.0 *
pow((
energy / 300.0), 0.54);
198 eav = ((((((-0.0002 * xin - 2.0e-13) * xin + 0.0022) * xin + 1.0e-11) * xin - 0.0217) * xin - 3.0e-10) * xin +
200 (((0.0001 * yin + 0.0056) * yin + 0.0508) * yin + 1.0) * 300.0 *
pow((
energy / 300.0), 1.12);
201 esig = ((((((0.0005 * xin - 1.0e-12) * xin - 0.0052) * xin + 5.0e-11) * xin + 0.032) * xin - 2.0e-10) * xin + 1.0) *
202 (((0.0006 * yin + 0.0071) * yin - 0.031) * yin + 1.0) * 54.0 *
pow((
energy / 300.0), 0.93);
206 if (eav < 0. || edis < 0.) {
207 LogDebug(
"ZdcShower") <<
" Negative everage energy from parametrization \n"
208 <<
" xin: " << xin <<
"(cm)"
209 <<
" yin: " << yin <<
"(cm)"
210 <<
" track en: " <<
energy <<
"(GeV)"
211 <<
" eaverage: " << eav /
GeV <<
" (GeV)"
212 <<
" esigma: " << esig /
GeV <<
" (GeV)"
213 <<
" edist: " << edis <<
" (GeV)"
227 <<
" track en: " <<
energy <<
"(GeV)"
228 <<
" eaverage: " << eav /
GeV <<
" (GeV)"
229 <<
" esigma: " << esig /
GeV <<
" (GeV)"
230 <<
" edist: " << edis <<
" (GeV)"
240 efluct = eav + esig * CLHEP::RandGaussQ::shoot();
242 efluct = eav + esig * CLHEP::RandLandau::shoot();