Definition at line 130 of file HFShowerParam.cc.
References 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(), gflash, HFGflash::gfParameterization(), gpar, hzvem, hzvhad, i, cuy::ii, convertSQLiteXML::ok, onlyLong, parametrizeLast, getHLTPrescaleColumns::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().
132 G4StepPoint * preStepPoint = aStep->GetPreStepPoint();
133 G4Track * track = aStep->GetTrack();
134 G4ThreeVector hitPoint = preStepPoint->GetPosition();
135 G4int particleCode = track->GetDefinition()->GetPDGEncoding();
137 G4ThreeVector localPoint = G4ThreeVector(hitPoint.x(),hitPoint.y(),zv);
139 double pin = (preStepPoint->GetTotalEnergy())/GeV;
140 double zint = hitPoint.z();
145 << track->GetDefinition()->GetParticleName()
146 <<
" of energy " << pin <<
" GeV"
147 <<
" Pos x,y,z = " << hitPoint.x() <<
","
148 << hitPoint.y() <<
"," << zint <<
" (" << zz <<
","
149 << localPoint.z() <<
", "
150 << (localPoint.z()+0.5*
gpar[1]) <<
") Local "
153 std::vector<HFShowerParam::Hit> hits;
159 double pBeta = track->GetDynamicParticle()->GetTotalMomentum() / track->GetDynamicParticle()->GetTotalEnergy();
160 double dirz = (track->GetDynamicParticle()->GetMomentumDirection()).
z();
161 if (hitPoint.z() < 0) dirz *= -1.;
163 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits Momentum "
164 <<track->GetDynamicParticle()->GetMomentumDirection()
165 <<
" HitPoint " << hitPoint <<
" dirz " << dirz;
168 if (track->GetDefinition()->GetPDGCharge() != 0 && pBeta > (1/
ref_index) &&
169 aStep->GetTotalEnergyDeposit() > 0) other =
true;
173 if (particleCode ==
emPDG || particleCode ==
epPDG ||
174 particleCode ==
gammaPDG || other) {
181 }
else if ((track->GetDefinition()->GetPDGCharge() != 0) &&
183 edep = (aStep->GetTotalEnergyDeposit())/GeV;
187 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits edep = " << edep
189 <<
", Kill = " << kill <<
", pin = " << pin
190 <<
", edMin = " <<
edMin <<
" Other " << other;
197 for (
unsigned int i=0;
i<hitSL.size();
i++) {
204 if (npmt <= 0) ok =
false;
208 hit.
depth = hitSL[
i].depth;
209 hit.
time = hitSL[
i].time;
219 if (hit.
depth == 1) {
223 }
else if (hit.
depth == 2) {
231 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth "
232 << hit.
depth <<
" with edep " << hit.
edep
233 <<
" Time " << hit.
time;
239 for (
unsigned int i=0;
i<hitSL.size(); ++
i) {
241 G4ThreeVector pe_effect(hitSL[
i].
position.x(), hitSL[
i].position.y(),
242 hitSL[
i].position.z());
247 if (zv < 0. || zv >
gpar[1]) {
249 std::cout<<
"-#Zcut-HFShowerParam::getHits:z="<<zv<<
",m="<<gpar[1]<<std::endl;
256 edm::LogInfo(
"HFShower") <<
"HFShowerParam::getHits:#PMT= "
257 << npmt <<
",z = " << zv;
261 edm::LogInfo(
"HFShower") <<
"-#PMT=0 cut-HFShowerParam::"
262 <<
"getHits: npmt = " << npmt;
265 }
else if (npmt > 24) {
270 edm::LogInfo(
"HFShower") <<
"-SHORT cut-HFShowerParam::"
271 <<
"getHits:zMin=" << gpar[0];
277 edm::LogInfo(
"HFShower") <<
"HFShowerParam: npmt " << npmt
278 <<
" zv " <<
std::abs(pe_effect.z())
279 <<
":" << gpar[4] <<
":" << zv <<
":"
280 << gpar[0] <<
" ok " << ok <<
" depth "
284 if (G4UniformRand() > 0.5) depth = 2;
285 if (depth == 2 && zv < gpar[0]) ok =
false;
289 double r1 = G4UniformRand();
291 edm::LogInfo(
"HFShower") <<
"HFShowerParam:Distance to PMT (" <<npmt
292 <<
") " << dist <<
", exclusion flag "
297 double r2 = G4UniformRand();
299 edm::LogInfo(
"HFShower") <<
"HFShowerParam:Extra exclusion "
300 << r2 <<
">" <<
weight <<
" "
308 hit.
time = time + hitSL[
i].time;
317 if (hit.
depth == 1) {
321 }
else if (hit.
depth == 2) {
329 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth "
330 << hit.
depth <<
" with edep "
331 << hit.
edep <<
" Time " << hit.
time;
340 double tSlice = (aStep->GetPostStepPoint()->GetGlobalTime());
345 if (npmt <= 0) ok =
false;
348 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits hitPoint " << hitPoint <<
" flag " <<
ok;
356 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth 1 with edep "
357 << edep <<
" Time " << tSlice <<
":" << time
361 double zv =
std::abs(hitPoint.z()) - gpar[4];
372 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth 2 with edep "
373 << edep <<
" Time " << tSlice <<
":" << time
385 for (
unsigned int ii=0;
ii<hits.size(); ++
ii) {
387 if (zv > 12790)
edm::LogInfo(
"HFShower")<<
"HFShowerParam: Abnormal hit along "
389 << preStepPoint->GetPhysicalVolume()->GetLogicalVolume()->GetName()
390 <<
" at " << hits[
ii].position <<
" zz "
391 << zv <<
" Edep " << edep <<
" due to "
392 <<track->GetDefinition()->GetParticleName()
393 <<
" time " << hit.
time;
397 track->SetTrackStatus(fStopAndKill);
398 G4TrackVector tv = *(aStep->GetSecondary());
399 for (
unsigned int kk=0; kk<tv.size(); ++kk) {
400 if (tv[kk]->
GetVolume() == preStepPoint->GetPhysicalVolume())
401 tv[kk]->SetTrackStatus(fStopAndKill);
405 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits kill (" << kill
406 <<
") track " << track->GetTrackID()
407 <<
" at " << hitPoint
408 <<
" and deposit " << edep <<
" " << hits.size()
409 <<
" times" <<
" ZZ " << zz <<
" " << gpar[0];
std::vector< Hit > gfParameterization(G4Step *aStep, bool &ok, bool onlyLong=false)
static int PMTNumber(G4ThreeVector pe_effect)
std::vector< Hit > getHits(G4Step *aStep, bool &ok, double weight, bool onlyLong=false)
std::vector< double > gpar
HFShowerLibrary * showerLibrary
static int position[TOTALCHAMBERS][3]
double zShift(G4ThreeVector point, int depth, int fromEndAbs=0)
double tShift(G4ThreeVector point, int depth, int fromEndAbs=0)
static const G4LogicalVolume * GetVolume(const std::string &name)
Power< A, B >::type pow(const A &a, const B &b)