Definition at line 126 of file HFShowerParam.cc.
References abs, 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, hzv, i, GetRecoTauVFromDQM_MC_cff::kk, convertSQLiteXML::ok, onlyLong, parametrizeLast, scaleCards::path, pePerGeV, HFFibreFiducial::PMTNumber(), HFShowerParam::Hit::position, position, funct::pow(), diffTwoXMLs::r1, ref_index, alignCSCRings::s, showerLibrary, mathSSE::sqrt(), HFShowerParam::Hit::time, cond::rpcobgas::time, trackEM, HFFibre::tShift(), and HFFibre::zShift().
Referenced by HCalSD::getFromParam().
127 G4StepPoint * preStepPoint = aStep->GetPreStepPoint();
128 G4Track * track = aStep->GetTrack();
129 G4ThreeVector hitPoint = preStepPoint->GetPosition();
130 G4int particleCode = track->GetDefinition()->GetPDGEncoding();
132 G4ThreeVector localPoint = G4ThreeVector(hitPoint.x(),hitPoint.y(),zv);
134 double pin = (preStepPoint->GetTotalEnergy())/GeV;
135 double zint = hitPoint.z();
140 << track->GetDefinition()->GetParticleName()
141 <<
" of energy " << pin <<
" GeV"
142 <<
" Pos x,y,z = " << hitPoint.x() <<
","
143 << hitPoint.y() <<
"," << zint <<
" (" << zz <<
","
144 << localPoint.z() <<
", "
145 << (localPoint.z()+0.5*
gpar[1]) <<
") Local "
148 std::vector<HFShowerParam::Hit> hits;
154 double pBeta = track->GetDynamicParticle()->GetTotalMomentum() / track->GetDynamicParticle()->GetTotalEnergy();
156 if (track->GetDefinition()->GetPDGCharge() != 0 && pBeta > (1/
ref_index) &&
157 aStep->GetTotalEnergyDeposit() > 0) other =
true;
161 if (particleCode ==
emPDG || particleCode ==
epPDG ||
162 particleCode ==
gammaPDG || other) {
169 }
else if (track->GetDefinition()->GetPDGCharge() != 0 &&
171 edep = (aStep->GetTotalEnergyDeposit())/GeV;
173 std::string
path =
"ShowerLibrary";
175 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits edep = " << edep
176 <<
", Kill = " << kill <<
", pin = " << pin
177 <<
", edMin = " <<
edMin <<
" Other " << other;
183 for (
unsigned int i=0;
i<hitSL.size();
i++) {
190 if (npmt <= 0) ok =
false;
194 hit.
depth = hitSL[
i].depth;
195 hit.
time = hitSL[
i].time;
204 if (hit.
depth == 1) {
208 }
else if (hit.
depth == 2) {
214 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth "
215 << hit.
depth <<
" with edep " << hit.
edep
216 <<
" Time " << hit.
time;
222 for (
unsigned int i=0;
i<hitSL.size(); ++
i) {
224 G4ThreeVector pe_effect(hitSL[
i].
position.x(), hitSL[
i].position.y(),
225 hitSL[
i].position.z());
230 if (zv < 0. || zv >
gpar[1]) {
232 std::cout<<
"-#Zcut-HFShowerParam::getHits:z="<<zv<<
",m="<<gpar[1]<<std::endl;
239 edm::LogInfo(
"HFShower") <<
"HFShowerParam::getHits:#PMT= "
240 << npmt <<
",z = " << zv;
244 edm::LogInfo(
"HFShower") <<
"-#PMT=0 cut-HFShowerParam::"
245 <<
"getHits: npmt = " << npmt;
248 }
else if (npmt > 24) {
253 edm::LogInfo(
"HFShower") <<
"-SHORT cut-HFShowerParam::"
254 <<
"getHits:zMin=" << gpar[0];
260 edm::LogInfo(
"HFShower") <<
"HFShowerParam: npmt " << npmt
261 <<
" zv " <<
std::abs(pe_effect.z())
262 <<
":" << gpar[4] <<
":" << zv <<
":"
263 << gpar[0] <<
" ok " << ok <<
" depth "
267 if (G4UniformRand() > 0.5) depth = 2;
268 if (depth == 2 && zv < gpar[0]) ok =
false;
272 double r1 = G4UniformRand();
274 edm::LogInfo(
"HFShower") <<
"HFShowerParam:Distance to PMT (" <<npmt
275 <<
") " << dist <<
", exclusion flag "
284 hit.
time = time + hitSL[
i].time;
293 if (hit.
depth == 1) {
297 }
else if (hit.
depth == 2) {
303 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth "
304 << hit.
depth <<
" with edep "
305 << hit.
edep <<
" Time " << hit.
time;
313 double tSlice = (aStep->GetPostStepPoint()->GetGlobalTime());
320 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth 1 with edep "
321 << edep <<
" Time " << tSlice <<
":" << time
330 edm::LogInfo(
"HFShower") <<
"HFShowerParam: Hit at depth 2 with edep "
331 << edep <<
" Time " << tSlice <<
":" << time
337 for (
unsigned int ii=0; ii<hits.size(); ++ii) {
339 if (zv > 12790)
edm::LogInfo(
"HFShower")<<
"HFShowerParam: Abnormal hit along "
341 << preStepPoint->GetPhysicalVolume()->GetLogicalVolume()->GetName()
342 <<
" at " << hits[ii].position <<
" zz "
343 << zv <<
" Edep " << edep <<
" due to "
344 <<track->GetDefinition()->GetParticleName()
345 <<
" time " << hit.
time;
349 track->SetTrackStatus(fStopAndKill);
350 G4TrackVector tv = *(aStep->GetSecondary());
351 for (
unsigned int kk=0;
kk<tv.size(); ++
kk) {
352 if (tv[
kk]->
GetVolume() == preStepPoint->GetPhysicalVolume())
353 tv[
kk]->SetTrackStatus(fStopAndKill);
357 edm::LogInfo(
"HFShower") <<
"HFShowerParam: getHits kill (" << kill
358 <<
") track " << track->GetTrackID()
359 <<
" at " << hitPoint
360 <<
" and deposit " << edep <<
" " << hits.size()
361 <<
" times" <<
" ZZ " << zz <<
" " << gpar[0];
std::vector< Hit > gfParameterization(G4Step *aStep, bool &ok, bool onlyLong=false)
std::vector< Hit > getHits(G4Step *aStep, bool &ok, bool onlyLong=false)
static int PMTNumber(G4ThreeVector pe_effect)
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)