Definition at line 117 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, emPDG, epPDG, JetChargeProducer_cfi::exp, fibre, fillHisto, gammaPDG, HFShowerLibrary::getHits(), GetVolume(), GeV, gflash, HFGflash::gfParameterization(), gpar, hfClusterShapes_cfi::hits, hzvem, hzvhad, mps_fire::i, cuy::ii, GetRecoTauVFromDQM_MC_cff::kk, 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, HFShowerParam::Hit::time, ntuplemaker::time, HiIsolationCommonParameters_cff::track, trackEM, HFFibre::tShift(), mps_merge::weight, z, HFFibre::zShift(), and geometryCSVtoXML::zz.
Referenced by HCalSD::getFromParam().
119 const G4StepPoint * preStepPoint = aStep->GetPreStepPoint();
120 G4Track *
track = aStep->GetTrack();
121 const G4ThreeVector& hitPoint = preStepPoint->GetPosition();
122 G4int particleCode = track->GetDefinition()->GetPDGEncoding();
124 G4ThreeVector localPoint = G4ThreeVector(hitPoint.x(),hitPoint.y(),zv);
126 double pin = (preStepPoint->GetTotalEnergy())/
GeV;
127 double zint = hitPoint.z();
132 << track->GetDefinition()->GetParticleName()
133 <<
" of energy " << pin <<
" GeV" 134 <<
" Pos x,y,z = " << hitPoint.x() <<
"," 135 << hitPoint.y() <<
"," << zint <<
" (" << zz <<
"," 136 << localPoint.z() <<
", " 137 << (localPoint.z()+0.5*
gpar[1]) <<
") Local " 140 std::vector<HFShowerParam::Hit>
hits;
146 double pBeta = track->GetDynamicParticle()->GetTotalMomentum() / track->GetDynamicParticle()->GetTotalEnergy();
147 double dirz = (track->GetDynamicParticle()->GetMomentumDirection()).
z();
148 if (hitPoint.z() < 0) dirz *= -1.;
150 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits Momentum " 151 <<track->GetDynamicParticle()->GetMomentumDirection()
152 <<
" HitPoint " << hitPoint <<
" dirz " << dirz;
155 if (track->GetDefinition()->GetPDGCharge() != 0 && pBeta > (1/
ref_index) &&
156 aStep->GetTotalEnergyDeposit() > 0) other =
true;
160 if (particleCode ==
emPDG || particleCode ==
epPDG ||
161 particleCode ==
gammaPDG || other) {
168 }
else if ((track->GetDefinition()->GetPDGCharge() != 0) &&
170 edep = (aStep->GetTotalEnergyDeposit())/
GeV;
174 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits edep = " << edep
176 <<
", Kill = " << kill <<
", pin = " << pin
177 <<
", edMin = " <<
edMin <<
" Other " <<
other;
184 for (
unsigned int i=0;
i<hitSL.size();
i++) {
191 if (npmt <= 0) ok =
false;
195 hit.
depth = hitSL[
i].depth;
196 hit.
time = hitSL[
i].time;
206 if (hit.
depth == 1) {
210 }
else if (hit.
depth == 2) {
218 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth " 219 << hit.
depth <<
" with edep " << hit.
edep 220 <<
" Time " << hit.
time;
226 for (
unsigned int i=0;
i<hitSL.size(); ++
i) {
228 G4ThreeVector pe_effect(hitSL[
i].
position.x(), hitSL[
i].position.y(),
229 hitSL[
i].position.z());
234 if (zv < 0. || zv >
gpar[1]) {
236 std::cout<<
"-#Zcut-HFShowerParam::getHits:z="<<zv<<
",m="<<gpar[1]<<std::endl;
243 edm::LogInfo(
"HFShower") <<
"HFShowerParam::getHits:#PMT= " 244 << npmt <<
",z = " << zv;
248 edm::LogInfo(
"HFShower") <<
"-#PMT=0 cut-HFShowerParam::" 249 <<
"getHits: npmt = " << npmt;
252 }
else if (npmt > 24) {
257 edm::LogInfo(
"HFShower") <<
"-SHORT cut-HFShowerParam::" 258 <<
"getHits:zMin=" << gpar[0];
264 edm::LogInfo(
"HFShower") <<
"HFShowerParam: npmt " << npmt
265 <<
" zv " <<
std::abs(pe_effect.z())
266 <<
":" << gpar[4] <<
":" << zv <<
":" 267 << gpar[0] <<
" ok " << ok <<
" depth " 271 if (G4UniformRand() > 0.5) depth = 2;
272 if (depth == 2 && zv < gpar[0]) ok =
false;
276 double r1 = G4UniformRand();
278 edm::LogInfo(
"HFShower") <<
"HFShowerParam:Distance to PMT (" <<npmt
279 <<
") " << dist <<
", exclusion flag " 284 double r2 = G4UniformRand();
286 edm::LogInfo(
"HFShower") <<
"HFShowerParam:Extra exclusion " 287 << r2 <<
">" <<
weight <<
" " 295 hit.
time = time + hitSL[
i].time;
304 if (hit.
depth == 1) {
308 }
else if (hit.
depth == 2) {
316 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth " 317 << hit.
depth <<
" with edep " 318 << hit.
edep <<
" Time " << hit.
time;
327 double tSlice = (aStep->GetPostStepPoint()->GetGlobalTime());
332 if (npmt <= 0) ok =
false;
335 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits hitPoint " << hitPoint <<
" flag " <<
ok;
343 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth 1 with edep " 344 << edep <<
" Time " << tSlice <<
":" << time
348 double zv =
std::abs(hitPoint.z()) - gpar[4];
359 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth 2 with edep " 360 << edep <<
" Time " << tSlice <<
":" << time
372 for (
unsigned int ii=0;
ii<hits.size(); ++
ii) {
374 if (zv > 12790)
edm::LogInfo(
"HFShower")<<
"HFShowerParam: Abnormal hit along " 376 << preStepPoint->GetPhysicalVolume()->GetLogicalVolume()->GetName()
377 <<
" at " << hits[
ii].position <<
" zz " 378 << zv <<
" Edep " << edep <<
" due to " 379 <<track->GetDefinition()->GetParticleName()
380 <<
" time " << hit.
time;
384 track->SetTrackStatus(fStopAndKill);
385 G4TrackVector tv = *(aStep->GetSecondary());
386 for (
unsigned int kk=0;
kk<tv.size(); ++
kk) {
387 if (tv[
kk]->
GetVolume() == preStepPoint->GetPhysicalVolume())
388 tv[
kk]->SetTrackStatus(fStopAndKill);
392 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits kill (" << kill
393 <<
") track " << track->GetTrackID()
394 <<
" at " << hitPoint
395 <<
" and deposit " << edep <<
" " << hits.size()
396 <<
" times" <<
" ZZ " << zz <<
" " << gpar[0];
double tShift(const G4ThreeVector &point, int depth, int fromEndAbs=0)
std::vector< Hit > gfParameterization(G4Step *aStep, bool &ok, bool onlyLong=false)
std::vector< Hit > getHits(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
static int PMTNumber(const G4ThreeVector &pe_effect)
Abs< T >::type abs(const T &t)
static const G4LogicalVolume * GetVolume(const std::string &name)
static int position[264][3]
Power< A, B >::type pow(const A &a, const B &b)