Definition at line 105 of file HFShowerParam.cc.
References funct::abs(), aperture_, applyFidCut_, attLMeanInv_, LEDCalibrationChannels::depth, 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_, equalizeTimeShift_, JetChargeProducer_cfi::exp, fibre_, fillHisto_, gflash_, gpar_, hfClusterShapes_cfi::hits, hzvem_, hzvhad_, mps_fire::i, cuy::ii, G4TrackToParticleID::isGammaElectronPositron(), convertSQLiteXML::ok, onlyLong_, trackingPlots::other, parametrizeLast_, castor_dqm_sourceclient_file_cfg::path, pePerGeV_, HFFibreFiducial::PMTNumber(), position, funct::pow(), diffTwoXMLs::r1, diffTwoXMLs::r2, ref_index_, alignCSCRings::s, showerLibrary_, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, protons_cff::time, HLT_2023v12_cff::track, trackEM_, HFFibre::tShift(), mps_merge::weight, hit::x, hit::y, z, hit::z, HFFibre::zShift(), gpuVertexFinder::zv, and geometryCSVtoXML::zz.
106 auto const preStepPoint = aStep->GetPreStepPoint();
107 auto const track = aStep->GetTrack();
109 const G4ThreeVector& hitPoint = preStepPoint->GetPosition();
111 G4ThreeVector localPoint = G4ThreeVector(hitPoint.x(), hitPoint.y(),
zv);
113 double pin = (preStepPoint->GetTotalEnergy()) / CLHEP::GeV;
114 double zint = hitPoint.z();
118 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: getHits " <<
track->GetDefinition()->GetParticleName()
119 <<
" of energy " << pin <<
" GeV Pos x,y,z = " << hitPoint.x() <<
"," << hitPoint.y()
120 <<
"," << zint <<
" (" <<
zz <<
"," << localPoint.z() <<
", " 121 << (localPoint.z() + 0.5 *
gpar_[1]) <<
") Local " << localPoint;
123 std::vector<HFShowerParam::Hit>
hits;
125 hit.position = hitPoint;
129 double pBeta =
track->GetDynamicParticle()->GetTotalMomentum() /
track->GetDynamicParticle()->GetTotalEnergy();
130 double dirz = (
track->GetDynamicParticle()->GetMomentumDirection()).
z();
131 if (hitPoint.z() < 0)
135 <<
track->GetDynamicParticle()->GetMomentumDirection() <<
" HitPoint " << hitPoint
138 if (!isEM &&
track->GetDefinition()->GetPDGCharge() != 0 && pBeta > (1 /
ref_index_) &&
139 aStep->GetTotalEnergyDeposit() > 0.) {
151 edep = (aStep->GetTotalEnergyDeposit()) / GeV;
155 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: getHits edep = " << edep <<
" weight " <<
weight <<
" final " 156 << edep *
weight <<
", Kill = " << isKilled <<
", pin = " << pin
164 for (
unsigned int i = 0;
i < hitSL.size();
i++) {
175 hit.position = hitSL[
i].position;
176 hit.depth = hitSL[
i].depth;
177 hit.time = hitSL[
i].time;
185 double sq =
sqrt(
pow(
hit.position.
x() / CLHEP::cm, 2) +
pow(
hit.position.
y() / CLHEP::cm, 2));
186 double zp =
hit.position.
z() / CLHEP::cm;
187 if (
hit.depth == 1) {
191 }
else if (
hit.depth == 2) {
200 <<
"HFShowerParam: Hit at depth " <<
hit.depth <<
" with edep " <<
hit.edep <<
" Time " <<
hit.time;
205 std::vector<HFGflash::Hit> hitSL =
gflash_->gfParameterization(aStep,
onlyLong_);
206 for (
unsigned int i = 0;
i < hitSL.size(); ++
i) {
208 G4ThreeVector pe_effect(hitSL[
i].
position.x(), hitSL[
i].position.y(), hitSL[
i].position.z());
213 if (zv < 0. || zv >
gpar_[1]) {
222 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam::getHits:#PMT= " << npmt <<
",z = " <<
zv;
226 edm::LogVerbatim(
"HFShower") <<
"-#PMT=0 cut-HFShowerParam::getHits: npmt = " << npmt;
229 }
else if (npmt > 24) {
241 <<
"HFShowerParam: npmt " << npmt <<
" zv " <<
std::abs(pe_effect.z()) <<
":" <<
gpar_[4] <<
":" <<
zv 242 <<
":" <<
gpar_[0] <<
" ok " <<
ok <<
" depth " <<
depth;
245 if (G4UniformRand() > 0.5)
252 double r1 = G4UniformRand();
254 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam:Distance to PMT (" << npmt <<
") " << dist
260 double r2 = G4UniformRand();
263 <<
"HFShowerParam:Extra exclusion " <<
r2 <<
">" <<
weight <<
" " << (
r2 >
weight);
269 hit.position = hitSL[
i].position;
278 double sq =
sqrt(
pow(
hit.position.
x() / CLHEP::cm, 2) +
pow(
hit.position.
y() / CLHEP::cm, 2));
279 double zp =
hit.position.
z() / CLHEP::cm;
280 if (
hit.depth == 1) {
284 }
else if (
hit.depth == 2) {
293 <<
"HFShowerParam: Hit at depth " <<
hit.depth <<
" with edep " <<
hit.edep <<
" Time " <<
hit.time;
302 double tSlice = (aStep->GetPostStepPoint()->GetGlobalTime());
312 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: getHits hitPoint " << hitPoint <<
" flag " <<
ok;
320 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: Hit at depth 1 with edep " << edep <<
" Time " << tSlice
321 <<
":" <<
time <<
":" <<
hit.time;
335 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: Hit at depth 2 with edep " << edep <<
" Time " << tSlice
347 for (
unsigned int ii = 0;
ii <
hits.size(); ++
ii) {
351 << preStepPoint->GetPhysicalVolume()->GetLogicalVolume()->GetName() <<
" at " 352 <<
hits[
ii].position <<
" zz " <<
zv <<
" Edep " << edep <<
" due to " 353 <<
track->GetDefinition()->GetParticleName() <<
" time " <<
hit.time;
355 edm::LogVerbatim(
"HFShower") <<
"HFShowerParam: getHits kill (" << isKilled <<
") track " <<
track->GetTrackID()
356 <<
" at " << hitPoint <<
" and deposit " << edep <<
" " <<
hits.size() <<
" times" 357 <<
" ZZ " <<
zz <<
" " <<
gpar_[0];
std::unique_ptr< HFGflash > gflash_
Log< level::Info, true > LogVerbatim
double zShift(const G4ThreeVector &point, int depth, int fromEndAbs=0) const
std::vector< double > gpar_
Abs< T >::type abs(const T &t)
double tShift(const G4ThreeVector &point, int depth, int fromEndAbs=0) const
int PMTNumber(const G4ThreeVector &pe_effect)
std::unique_ptr< HFShowerLibrary > showerLibrary_
static int position[264][3]
static bool isGammaElectronPositron(int pdgCode)
Power< A, B >::type pow(const A &a, const B &b)