13 #include "G4VPhysicalVolume.hh"
16 #include "Randomize.hh"
17 #include "CLHEP/Units/GlobalSystemOfUnits.h"
30 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
31 const G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
32 const G4Track*
track = aStep->GetTrack();
34 const G4DynamicParticle* aParticle =
track->GetDynamicParticle();
35 const G4ThreeVector& momDir = aParticle->GetMomentumDirection();
36 double energy = preStepPoint->GetKineticEnergy();
37 G4ThreeVector hitPoint = preStepPoint->GetPosition();
38 const G4ThreeVector& hitPointOrig = preStepPoint->GetPosition();
39 G4int parCode =
track->GetDefinition()->GetPDGEncoding();
51 G4ThreeVector posLocal;
52 double tSlice = (postStepPoint->GetGlobalTime()) / nanosecond;
59 double xxlocal, yylocal, zzlocal;
62 side = (hitPointOrig.z() > 0.) ?
true :
false;
68 for (
int i = 0;
i <
npe;
i++) {
77 zz = (hitPointOrig.z() > 0.) ? zzlocal +
Z0 : zzlocal -
Z0;
79 posLocal = G4ThreeVector(xxlocal, yylocal, zzlocal);
90 zz = (hitPointOrig.z() > 0.) ? zzlocal +
Z0 : zzlocal -
Z0;
92 posLocal = G4ThreeVector(xxlocal, yylocal, zzlocal);
97 oneHit.
depth = channel;
102 hitPoint.setX(hitPointOrig.x() -
X0);
103 hitPoint.setY(hitPointOrig.y() -
Y0);
104 double setZ = (hitPointOrig.z() > 0.) ? hitPointOrig.z() -
Z0 : fabs(hitPointOrig.z()) -
Z0;
117 hits.push_back(oneHit);
119 LogDebug(
"ZdcShower") <<
"\nZdcShowerLibrary:Generated Hit " << nHit <<
" orig hit pos " << hitPointOrig
120 <<
" orig hit pos local coord" << hitPoint <<
" new position " << (
hits[nHit].position)
121 <<
" Channel " << (
hits[nHit].
depth) <<
" side " << side <<
" Time " << (
hits[nHit].time)
122 <<
" DetectorID " << (
hits[nHit].detID) <<
" Had Energy " << (
hits[nHit].DeHad)
123 <<
" EM Energy " << (
hits[nHit].DeEM) <<
"\n";
130 const G4ThreeVector& momDir,
140 LogDebug(
"ZdcShower") <<
"\n ZdcShowerLibrary::getEnergyFromLibrary input/output variables:"
141 <<
" phi: " << 59.2956 * momDir.phi() <<
" theta: " << 59.2956 * momDir.theta()
142 <<
" xin : " << hitPoint.x() <<
" yin : " << hitPoint.y() <<
" zin : " << hitPoint.z()
143 <<
" track en: " <<
energy <<
"(GeV)"
144 <<
" section: " <<
section <<
" side: " << side <<
" channel: " << channel
145 <<
" partID: " << parCode;
151 float xin = hitPoint.x();
152 float yin = hitPoint.y();
190 eav = ((((((-0.0002 * xin - 2.0e-13) * xin + 0.0022) * xin + 1.0e-11) * xin - 0.0217) * xin - 3.0e-10) * xin +
192 (((0.0001 * yin + 0.0056) * yin + 0.0508) * yin + 1.0) * 300.0 *
pow((
energy / 300.0), 0.99);
193 esig = ((((((0.0005 * xin - 1.0e-12) * xin - 0.0052) * xin + 5.0e-11) * xin + 0.032) * xin - 2.0e-10) * xin + 1.0) *
194 (((0.0006 * yin + 0.0071) * yin - 0.031) * yin + 1.0) * 30.0 *
pow((
energy / 300.0), 0.54);
197 eav = ((((((-0.0002 * xin - 2.0e-13) * xin + 0.0022) * xin + 1.0e-11) * xin - 0.0217) * xin - 3.0e-10) * xin +
199 (((0.0001 * yin + 0.0056) * yin + 0.0508) * yin + 1.0) * 300.0 *
pow((
energy / 300.0), 1.12);
200 esig = ((((((0.0005 * xin - 1.0e-12) * xin - 0.0052) * xin + 5.0e-11) * xin + 0.032) * xin - 2.0e-10) * xin + 1.0) *
201 (((0.0006 * yin + 0.0071) * yin - 0.031) * yin + 1.0) * 54.0 *
pow((
energy / 300.0), 0.93);
205 if (eav < 0. || esig < 0.) {
206 LogDebug(
"ZdcShower") <<
" Negative everage energy or esigma from parametrization \n"
207 <<
" xin: " << xin <<
"(cm)"
208 <<
" yin: " << yin <<
"(cm)"
209 <<
" track en: " <<
energy <<
"(GeV)"
210 <<
" eaverage: " << eav <<
" (GeV)"
211 <<
" esigma: " << esig <<
" (GeV)"
212 <<
" edist: " << edis <<
" (GeV)";
225 <<
" track en: " <<
energy <<
"(GeV)"
226 <<
" eaverage: " << eav /
GeV <<
" (GeV)"
227 <<
" esigma: " << esig /
GeV <<
" (GeV)"
228 <<
" edist: " << edis <<
" (GeV)"
238 efluct = eav + esig * CLHEP::RandGaussQ::shoot();
240 efluct = eav + esig * CLHEP::RandLandau::shoot();