Definition at line 109 of file HFShowerParam.cc.
References funct::abs(), aperture, applyFidCut, attLMeanInv, gather_cfg::cout, egammaForCoreTracking_cff::depth, HFShowerParam::Hit::depth, HFShowerParam::Hit::edep, edMin, em_2d_1, em_2d_2, em_lateral_1, em_lateral_2, em_long_1, em_long_2, em_long_gflash, em_long_sl, JetChargeProducer_cfi::exp, fibre, fillHisto, HFShowerLibrary::getHits(), GeV, gflash, HFGflash::gfParameterization(), gpar, hfClusterShapes_cfi::hits, hzvem, hzvhad, mps_fire::i, cuy::ii, G4TrackToParticleID::isGammaElectronPositron(), convertSQLiteXML::ok, onlyLong, trackingPlots::other, parametrizeLast, callgraph::path, pePerGeV, HFFibreFiducial::PMTNumber(), HFShowerParam::Hit::position, position, funct::pow(), diffTwoXMLs::r1, diffTwoXMLs::r2, ref_index, alignCSCRings::s, showerLibrary, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, protons_cff::time, HFShowerParam::Hit::time, HiIsolationCommonParameters_cff::track, trackEM, HFFibre::tShift(), mps_merge::weight, z, HFFibre::zShift(), and geometryCSVtoXML::zz.
110 auto const preStepPoint = aStep->GetPreStepPoint();
111 auto const track = aStep->GetTrack();
113 const G4ThreeVector& hitPoint = preStepPoint->GetPosition();
115 G4ThreeVector localPoint = G4ThreeVector(hitPoint.x(), hitPoint.y(), zv);
117 double pin = (preStepPoint->GetTotalEnergy()) /
GeV;
118 double zint = hitPoint.z();
122 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: getHits " <<
track->GetDefinition()->GetParticleName()
123 <<
" of energy " << pin <<
" GeV Pos x,y,z = " << hitPoint.x() <<
"," << hitPoint.y()
124 <<
"," << zint <<
" (" << zz <<
"," << localPoint.z() <<
", " 125 << (localPoint.z() + 0.5 *
gpar[1]) <<
") Local " << localPoint;
127 std::vector<HFShowerParam::Hit>
hits;
133 double pBeta =
track->GetDynamicParticle()->GetTotalMomentum() /
track->GetDynamicParticle()->GetTotalEnergy();
134 double dirz = (
track->GetDynamicParticle()->GetMomentumDirection()).
z();
135 if (hitPoint.z() < 0)
139 <<
track->GetDynamicParticle()->GetMomentumDirection() <<
" HitPoint " << hitPoint
142 if (!isEM &&
track->GetDefinition()->GetPDGCharge() != 0 && pBeta > (1 /
ref_index) &&
143 aStep->GetTotalEnergyDeposit() > 0.) {
154 }
else if ((
track->GetDefinition()->GetPDGCharge() != 0) && (pBeta > (1 /
ref_index)) && (dirz >
aperture)) {
155 edep = (aStep->GetTotalEnergyDeposit()) /
GeV;
159 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: getHits edep = " << edep <<
" weight " <<
weight <<
" final " 160 << edep *
weight <<
", Kill = " << isKilled <<
", pin = " << pin
161 <<
", edMin = " <<
edMin <<
" Other " <<
other;
168 for (
unsigned int i = 0;
i < hitSL.size();
i++) {
180 hit.
depth = hitSL[
i].depth;
181 hit.
time = hitSL[
i].time;
191 if (hit.
depth == 1) {
195 }
else if (hit.
depth == 2) {
204 <<
"HFShowerParam: Hit at depth " << hit.
depth <<
" with edep " << hit.
edep <<
" Time " << hit.
time;
210 for (
unsigned int i = 0;
i < hitSL.size(); ++
i) {
212 G4ThreeVector pe_effect(hitSL[
i].
position.x(), hitSL[
i].position.y(), hitSL[
i].position.z());
217 if (zv < 0. || zv >
gpar[1]) {
219 std::cout <<
"-#Zcut-HFShowerParam::getHits:z=" << zv <<
",m=" << gpar[1] << std::endl;
226 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam::getHits:#PMT= " << npmt <<
",z = " << zv;
230 edm::LogVerbatim(
"HFShower") <<
"-#PMT=0 cut-HFShowerParam::getHits: npmt = " << npmt;
233 }
else if (npmt > 24) {
238 edm::LogVerbatim(
"HFShower") <<
"-SHORT cut-HFShowerParam::getHits:zMin=" << gpar[0];
245 <<
"HFShowerParam: npmt " << npmt <<
" zv " <<
std::abs(pe_effect.z()) <<
":" << gpar[4] <<
":" << zv
246 <<
":" << gpar[0] <<
" ok " << ok <<
" depth " << depth;
249 if (G4UniformRand() > 0.5)
251 if (depth == 2 && zv < gpar[0])
256 double r1 = G4UniformRand();
258 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam:Distance to PMT (" << npmt <<
") " << dist
264 double r2 = G4UniformRand();
267 <<
"HFShowerParam:Extra exclusion " << r2 <<
">" <<
weight <<
" " << (r2 >
weight);
274 hit.
time = time + hitSL[
i].time;
283 if (hit.
depth == 1) {
287 }
else if (hit.
depth == 2) {
296 <<
"HFShowerParam: Hit at depth " << hit.
depth <<
" with edep " << hit.
edep <<
" Time " << hit.
time;
305 double tSlice = (aStep->GetPostStepPoint()->GetGlobalTime());
314 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: getHits hitPoint " << hitPoint <<
" flag " <<
ok;
322 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: Hit at depth 1 with edep " << edep <<
" Time " << tSlice
323 <<
":" << time <<
":" << hit.
time;
326 double zv =
std::abs(hitPoint.z()) - gpar[4];
337 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: Hit at depth 2 with edep " << edep <<
" Time " << tSlice
338 <<
":" << time << hit.
time;
349 for (
unsigned int ii = 0;
ii < hits.size(); ++
ii) {
352 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: Abnormal hit along " << path <<
" in " 353 << preStepPoint->GetPhysicalVolume()->GetLogicalVolume()->GetName() <<
" at " 354 << hits[
ii].position <<
" zz " << zv <<
" Edep " << edep <<
" due to " 355 <<
track->GetDefinition()->GetParticleName() <<
" time " << hit.
time;
357 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: getHits kill (" << isKilled <<
") track " <<
track->GetTrackID()
358 <<
" at " << hitPoint <<
" and deposit " << edep <<
" " << hits.size() <<
" times" 359 <<
" ZZ " << zz <<
" " << gpar[0];
double tShift(const G4ThreeVector &point, int depth, int fromEndAbs=0)
std::vector< Hit > gfParameterization(const G4Step *aStep, bool onlyLong=false)
std::vector< Hit > getHits(const G4Step *aStep, bool &ok, double weight, bool onlyLong=false)
std::vector< double > gpar
double zShift(const G4ThreeVector &point, int depth, int fromEndAbs=0)
HFShowerLibrary * showerLibrary
Abs< T >::type abs(const T &t)
int PMTNumber(const G4ThreeVector &pe_effect)
static int position[264][3]
static bool isGammaElectronPositron(int pdgCode)
Power< A, B >::type pow(const A &a, const B &b)