Definition at line 131 of file HFShowerParam.cc.
References funct::abs(), aperture, applyFidCut, attLMeanInv, gather_cfg::cout, 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, create_public_lumi_plots::exp, fibre, fillHisto, gammaPDG, HFShowerLibrary::getHits(), GetVolume(), GeV, gflash, HFGflash::gfParameterization(), gpar, hzvem, hzvhad, i, cuy::ii, GetRecoTauVFromDQM_MC_cff::kk, convertSQLiteXML::ok, onlyLong, parametrizeLast, cmsHarvester::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, cond::rpcobgas::time, trackEM, HFFibre::tShift(), histoStyle::weight, detailsBasic3DVector::z, and HFFibre::zShift().
Referenced by HCalSD::getFromParam().
133 G4StepPoint * preStepPoint = aStep->GetPreStepPoint();
134 G4Track * track = aStep->GetTrack();
135 G4ThreeVector hitPoint = preStepPoint->GetPosition();
136 G4int particleCode = track->GetDefinition()->GetPDGEncoding();
138 G4ThreeVector localPoint = G4ThreeVector(hitPoint.x(),hitPoint.y(),zv);
140 double pin = (preStepPoint->GetTotalEnergy())/
GeV;
141 double zint = hitPoint.z();
146 << track->GetDefinition()->GetParticleName()
147 <<
" of energy " << pin <<
" GeV"
148 <<
" Pos x,y,z = " << hitPoint.x() <<
","
149 << hitPoint.y() <<
"," << zint <<
" (" << zz <<
","
150 << localPoint.z() <<
", "
151 << (localPoint.z()+0.5*
gpar[1]) <<
") Local "
154 std::vector<HFShowerParam::Hit> hits;
160 double pBeta = track->GetDynamicParticle()->GetTotalMomentum() / track->GetDynamicParticle()->GetTotalEnergy();
161 double dirz = (track->GetDynamicParticle()->GetMomentumDirection()).
z();
162 if (hitPoint.z() < 0) dirz *= -1.;
164 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits Momentum "
165 <<track->GetDynamicParticle()->GetMomentumDirection()
166 <<
" HitPoint " << hitPoint <<
" dirz " << dirz;
169 if (track->GetDefinition()->GetPDGCharge() != 0 && pBeta > (1/
ref_index) &&
170 aStep->GetTotalEnergyDeposit() > 0) other =
true;
174 if (particleCode ==
emPDG || particleCode ==
epPDG ||
175 particleCode ==
gammaPDG || other) {
182 }
else if ((track->GetDefinition()->GetPDGCharge() != 0) &&
184 edep = (aStep->GetTotalEnergyDeposit())/
GeV;
188 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits edep = " << edep
190 <<
", Kill = " << kill <<
", pin = " << pin
191 <<
", edMin = " <<
edMin <<
" Other " << other;
198 for (
unsigned int i=0;
i<hitSL.size();
i++) {
205 if (npmt <= 0) ok =
false;
209 hit.
depth = hitSL[
i].depth;
210 hit.
time = hitSL[
i].time;
220 if (hit.
depth == 1) {
224 }
else if (hit.
depth == 2) {
232 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth "
233 << hit.
depth <<
" with edep " << hit.
edep
234 <<
" Time " << hit.
time;
240 for (
unsigned int i=0;
i<hitSL.size(); ++
i) {
242 G4ThreeVector pe_effect(hitSL[
i].
position.x(), hitSL[
i].position.y(),
243 hitSL[
i].position.z());
248 if (zv < 0. || zv >
gpar[1]) {
250 std::cout<<
"-#Zcut-HFShowerParam::getHits:z="<<zv<<
",m="<<gpar[1]<<std::endl;
257 edm::LogInfo(
"HFShower") <<
"HFShowerParam::getHits:#PMT= "
258 << npmt <<
",z = " << zv;
262 edm::LogInfo(
"HFShower") <<
"-#PMT=0 cut-HFShowerParam::"
263 <<
"getHits: npmt = " << npmt;
266 }
else if (npmt > 24) {
271 edm::LogInfo(
"HFShower") <<
"-SHORT cut-HFShowerParam::"
272 <<
"getHits:zMin=" << gpar[0];
278 edm::LogInfo(
"HFShower") <<
"HFShowerParam: npmt " << npmt
279 <<
" zv " <<
std::abs(pe_effect.z())
280 <<
":" << gpar[4] <<
":" << zv <<
":"
281 << gpar[0] <<
" ok " << ok <<
" depth "
285 if (G4UniformRand() > 0.5) depth = 2;
286 if (depth == 2 && zv < gpar[0]) ok =
false;
290 double r1 = G4UniformRand();
292 edm::LogInfo(
"HFShower") <<
"HFShowerParam:Distance to PMT (" <<npmt
293 <<
") " << dist <<
", exclusion flag "
298 double r2 = G4UniformRand();
300 edm::LogInfo(
"HFShower") <<
"HFShowerParam:Extra exclusion "
301 << r2 <<
">" <<
weight <<
" "
309 hit.
time = time + hitSL[
i].time;
318 if (hit.
depth == 1) {
322 }
else if (hit.
depth == 2) {
330 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth "
331 << hit.
depth <<
" with edep "
332 << hit.
edep <<
" Time " << hit.
time;
341 double tSlice = (aStep->GetPostStepPoint()->GetGlobalTime());
346 if (npmt <= 0) ok =
false;
349 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits hitPoint " << hitPoint <<
" flag " <<
ok;
357 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth 1 with edep "
358 << edep <<
" Time " << tSlice <<
":" << time
362 double zv =
std::abs(hitPoint.z()) - gpar[4];
373 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth 2 with edep "
374 << edep <<
" Time " << tSlice <<
":" << time
386 for (
unsigned int ii=0;
ii<hits.size(); ++
ii) {
388 if (zv > 12790)
edm::LogInfo(
"HFShower")<<
"HFShowerParam: Abnormal hit along "
390 << preStepPoint->GetPhysicalVolume()->GetLogicalVolume()->GetName()
391 <<
" at " << hits[
ii].position <<
" zz "
392 << zv <<
" Edep " << edep <<
" due to "
393 <<track->GetDefinition()->GetParticleName()
394 <<
" time " << hit.
time;
398 track->SetTrackStatus(fStopAndKill);
399 G4TrackVector tv = *(aStep->GetSecondary());
400 for (
unsigned int kk=0;
kk<tv.size(); ++
kk) {
401 if (tv[
kk]->
GetVolume() == preStepPoint->GetPhysicalVolume())
402 tv[
kk]->SetTrackStatus(fStopAndKill);
406 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits kill (" << kill
407 <<
") track " << track->GetTrackID()
408 <<
" at " << hitPoint
409 <<
" and deposit " << edep <<
" " << hits.size()
410 <<
" 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)
tuple path
else: Piece not in the list, fine.
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)