27 #include "G4LogicalVolumeStore.hh" 28 #include "G4LogicalVolume.hh" 31 #include "G4ParticleTable.hh" 32 #include "G4VProcess.hh" 34 #include "G4SystemOfUnits.hh" 35 #include "G4PhysicalConstants.hh" 47 CaloSD(name, cpv, clg, p, manager,
79 bool agingFlagHF = m_HC.
getParameter<
bool>(
"HFDarkening");
86 applyFidCut = m_HF.getParameter<
bool>(
"ApplyFiducialCut");
89 LogDebug(
"HcalSim") <<
"***************************************************" 93 <<
"* Constructing a HCalSD with name " << name <<
"\n" 96 <<
"***************************************************";
98 edm::LogInfo(
"HcalSim") <<
"HCalSD:: Use of HF code is set to " << useHF
99 <<
"\nUse of shower parametrization set to " 100 << useParam <<
"\nUse of shower library is set to " 101 << useShowerLibrary <<
"\nUse PMT Hit is set to " 102 << usePMTHit <<
" with beta Threshold "<< betaThr
103 <<
"\nUSe of FibreBundle Hit set to "<<useFibreBundle
104 <<
"\n Use of Birks law is set to " 105 << useBirk <<
" with three constants kB = " 106 << birk1 <<
", C1 = " << birk2 <<
", C2 = " <<
birk3;
110 <<
" ions below " <<
kmaxIon <<
" MeV\n" 111 <<
" Threshold for storing hits in HB: " 112 << eminHitHB <<
" HE: " << eminHitHE <<
" HO: " 113 << eminHitHO <<
" HF: " << eminHitHF <<
"\n" 114 <<
"Delivered luminosity for Darkening " 115 << deliveredLumi <<
" Flag (HE) " << agingFlagHE
116 <<
" Flag (HB) " << agingFlagHB
117 <<
" Flag (HF) " << agingFlagHF <<
"\n" 118 <<
"Application of Fiducial Cut " << applyFidCut
119 <<
"Flag for test number|neutral density filter " 123 if (testNumber || forTBH2)
129 const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance();
130 std::vector<G4LogicalVolume *>::const_iterator lvcite;
131 const G4LogicalVolume* lv;
142 attribute =
"Volume";
150 edm::LogInfo(
"HcalSim") <<
"HCalSD: Names to be tested for " << attribute
151 <<
" = " << value <<
" has " <<
hfNames.size()
153 for (
unsigned int i=0;
i <
hfNames.size(); ++
i) {
156 for(lvcite=lvs->begin(); lvcite!=lvs->end(); lvcite++)
157 if((*lvcite)->GetName()==namv) {
162 int level =
static_cast<int>(temp[
i]);
165 <<
" LV " <<
hfLV[
i] <<
" at level " 174 edm::LogInfo(
"HcalSim") <<
"HCalSD: Names to be tested for " << attribute
175 <<
" = " << value <<
":";
179 for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite) {
180 if ((*lvcite)->GetName() == namv) {
194 std::vector<G4String> pmtNames =
getNames(fv3);
195 edm::LogInfo(
"HcalSim") <<
"HCalSD: Names to be tested for " << attribute
196 <<
" = " << value <<
" have " << pmtNames.size()
198 for (
unsigned int i=0;
i<pmtNames.size(); ++
i) {
199 G4String namv = pmtNames[
i];
201 for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite)
202 if ((*lvcite)->GetName() == namv) {
207 edm::LogInfo(
"HcalSim") <<
"HCalSD: (" <<
i <<
") " << pmtNames[
i]
213 value =
"HFFibreBundleStraight";
217 edm::LogInfo(
"HcalSim") <<
"HCalSD: Names to be tested for " << attribute
218 <<
" = " << value <<
" have " << fibreNames.size()
220 for (
unsigned int i=0;
i<fibreNames.size(); ++
i) {
221 G4String namv = fibreNames[
i];
223 for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
224 if ((*lvcite)->GetName() == namv) {
229 edm::LogInfo(
"HcalSim") <<
"HCalSD: (" <<
i <<
") " << fibreNames[
i]
234 value =
"HFFibreBundleConical";
238 edm::LogInfo(
"HcalSim") <<
"HCalSD: Names to be tested for " << attribute
239 <<
" = " << value <<
" have " << fibreNames.size()
241 for (
unsigned int i=0;
i<fibreNames.size(); ++
i) {
242 G4String namv = fibreNames[
i];
244 for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite)
245 if ((*lvcite)->GetName() == namv) {
250 edm::LogInfo(
"HcalSim") <<
"HCalSD: (" <<
i <<
") " << fibreNames[
i]
258 const G4MaterialTable * matTab = G4Material::GetMaterialTable();
259 std::vector<G4Material*>::const_iterator matite;
260 attribute =
"OnlyForHcalSimNumbering";
280 const G4Material* mat =
nullptr;
281 for (matite = matTab->begin(); matite != matTab->end(); ++matite) {
282 if ((*matite)->GetName() == namx) {
293 edm::LogInfo(
"HcalSim") <<
"HCalSD: Material names for " << attribute
294 <<
" = " << name <<
":";
311 static const char *
const labels[] = {
"HB",
"HE",
"HO",
"HF Absorber",
"HF PMT",
312 "HF Absorber Long",
"HF Absorber Short",
313 "HF PMT Long",
"HF PMT Short"};
315 char name[20],
title[60];
316 for (
int i=0;
i<9; ++
i) {
317 sprintf (title,
"Hit energy in %s", labels[
i]);
318 sprintf (name,
"HCalSDHit%d", i);
320 sprintf (title,
"Energy (MeV)");
321 hit_[
i]->GetXaxis()->SetTitle(title);
322 hit_[
i]->GetYaxis()->SetTitle(
"Hits");
323 sprintf (title,
"Time of the hit in %s", labels[i]);
324 sprintf (name,
"HCalSDTime%d", i);
326 sprintf (title,
"Time (ns)");
327 time_[
i]->GetXaxis()->SetTitle(title);
328 time_[
i]->GetYaxis()->SetTitle(
"Hits");
329 sprintf (title,
"Longitudinal profile in %s", labels[i]);
330 sprintf (name,
"HCalSDDist%d", i);
332 sprintf (title,
"Distance (mm)");
333 dist_[
i]->GetXaxis()->SetTitle(title);
334 dist_[
i]->GetYaxis()->SetTitle(
"Hits");
336 if (useHF && (!useParam)) {
337 hzvem = hcDir.
make<TH1F>(
"hzvem",
"Longitudinal Profile (EM Part)",330,0.0,1650.0);
338 hzvem->GetXaxis()->SetTitle(
"Longitudinal Profile (EM Part)");
339 hzvhad = hcDir.
make<TH1F>(
"hzvhad",
"Longitudinal Profile (Had Part)",330,0.0,1650.0);
340 hzvhad->GetXaxis()->SetTitle(
"Longitudinal Profile (Hadronic Part)");
362 if (aStep ==
nullptr) {
365 depth_ = (aStep->GetPreStepPoint()->GetTouchable()->GetReplicaNumber(0))%10;
366 const G4LogicalVolume* lv =
367 aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
368 G4String nameVolume = lv->GetName();
370 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
373 G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
374 double r = hitPoint.perp()/CLHEP::cm;
375 double z =
std::abs(hitPoint.z())/CLHEP::cm;
376 double dose_acquired = 0.;
383 weight *=
m_HFDarkening->degradation(normalized_lumi*dose_acquired);
387 LogDebug(
"HcalSim") <<
"HCalSD: HFLumiDarkening at r = " << r
388 <<
", z = " << z <<
" Dose " << dose_acquired
395 <<
" hits from parametrization in " << nameVolume
396 <<
" for Track " << aStep->GetTrack()->GetTrackID()
397 <<
" (" << aStep->GetTrack()->GetDefinition()->GetParticleName()
403 <<
" hits afterParamS*";
406 bool notaMuon =
true;
407 if (parCode ==
mupPDG || parCode ==
mumPDG ) notaMuon =
false;
410 LogDebug(
"HcalSim") <<
"HCalSD: Starts shower library from " 411 << nameVolume <<
" for Track " 412 << aStep->GetTrack()->GetTrackID() <<
" (" 413 << aStep->GetTrack()->GetDefinition()->GetParticleName() <<
")";
418 LogDebug(
"HcalSim") <<
"HCalSD: Hit at Fibre in " << nameVolume
420 << aStep->GetTrack()->GetTrackID() <<
" (" 421 << aStep->GetTrack()->GetDefinition()->GetParticleName() <<
")";
428 LogDebug(
"HcalSim") <<
"HCalSD: Hit from PMT parametrization from " 429 << nameVolume <<
" for Track " 430 << aStep->GetTrack()->GetTrackID() <<
" (" 431 << aStep->GetTrack()->GetDefinition()->GetParticleName() <<
")";
436 LogDebug(
"HcalSim") <<
"HCalSD: Hit from FibreBundle from " 437 << nameVolume <<
" for Track " 438 << aStep->GetTrack()->GetTrackID() <<
" (" 439 << aStep->GetTrack()->GetDefinition()->GetParticleName() <<
")";
445 LogDebug(
"HcalSim") <<
"HCalSD: Hit from standard path from " 446 << nameVolume <<
" for Track " 447 << aStep->GetTrack()->GetTrackID() <<
" (" 448 << aStep->GetTrack()->GetDefinition()->GetParticleName() <<
")";
453 plotProfile(aStep, aStep->GetPreStepPoint()->GetPosition(),
464 double destep = aStep->GetTotalEnergyDeposit();
468 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
470 int det(0), ieta(0),
phi(0),
z(0), lay,
depth(-1);
481 lay = (touch->GetReplicaNumber(0)/10)%100 + 1;
483 edm::LogInfo(
"HcalSim") <<
"HCalSD: det: " << det <<
" ieta: "<< ieta
484 <<
" iphi: " <<
phi <<
" zside " <<
z <<
" lay: " 490 G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
499 <<
" coefficient = " << dweight;
508 <<
" coefficient = " << dweight;
515 int pdg =
theTrack->GetDefinition()->GetPDGEncoding();
518 if ( pdg/1000000000 == 1 && (pdg/10000)%100 > 0 &&
519 (pdg/10)%100 > 0 && ke <
kmaxIon ) weight = 0;
520 if ((pdg == 2212) && (ke <
kmaxProton)) weight = 0;
521 if ((pdg == 2112) && (ke <
kmaxNeutron)) weight = 0;
525 <<
theTrack->GetTrackID() <<
" Type " 526 <<
theTrack->GetDefinition()->GetParticleName()
527 <<
" Kinetic Energy " << ke <<
" MeV";
536 const G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
543 <<
" weight " << weight0 <<
" " << weight <<
" " << wt1
546 double edep = weight*wt1*destep;
547 if (wt2 > 0.0) { edep *= wt2; }
553 const G4StepPoint* prePoint = aStep->GetPreStepPoint();
554 const G4VTouchable* touch = prePoint->GetTouchable();
555 const G4ThreeVector& hitPoint = prePoint->GetPosition();
557 int depth = (touch->GetReplicaNumber(0))%10 + 1;
558 int lay = (touch->GetReplicaNumber(0)/10)%100 + 1;
559 int det = (touch->GetReplicaNumber(1))/1000;
565 if (scheme !=
nullptr) {
566 edm::LogInfo(
"HcalSim") <<
"HCalSD: updates numbering scheme for " << GetName();
580 edm::LogError(
"HcalSim") <<
"HCalSD : Cannot find HcalDDDSimConstant";
581 throw cms::Exception(
"Unknown",
"HCalSD") <<
"Cannot find HcalDDDSimConstant" <<
"\n";
591 for (
unsigned int ig=0; ig<
gpar.size(); ig++)
592 edm::LogInfo(
"HcalSim") <<
"HCalSD: gpar[" << ig <<
"] = " 593 <<
gpar[ig]/cm <<
" cm";
610 G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable();
612 mumPDG = theParticleTable->FindParticle(particleName=
"mu-")->GetPDGEncoding();
613 mupPDG = theParticleTable->FindParticle(particleName=
"mu+")->GetPDGEncoding();
615 LogDebug(
"HcalSim") <<
"HCalSD: Particle code for mu- = " <<
mumPDG 616 <<
" for mu+ = " <<
mupPDG;
628 switch (theId.subdetId()) {
660 <<
" " << std::hex <<
id <<
std::dec 661 <<
" does not match one from relabller for " 663 << tmp.
phi <<
":" << tmp.
phis <<
":" 664 << tmp.
depth <<
":" << tmp.
lay << std::endl;
672 LogDebug(
"HcalSim") <<
"HCalSD:getDDDArray called for " <<
str;
679 const std::vector<double> & fvec = value.
doubles();
680 int nval = fvec.size();
682 edm::LogError(
"HcalSim") <<
"HCalSD : # of " << str <<
" bins " << nval
683 <<
" < 2 ==> illegal";
684 throw cms::Exception(
"Unknown",
"HCalSD") <<
"nval < 2 for array " << str <<
"\n";
690 throw cms::Exception(
"Unknown",
"HCalSD") <<
"cannot get array " << str <<
"\n";
696 std::vector<G4String>
tmp;
702 for (
unsigned int i=0;
i<tmp.size(); ++
i) {
703 if (!strcmp(tmp[
i].c_str(), log.
name().
name().c_str())) {
708 if (ok) tmp.push_back(log.
name().
name());
715 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
716 int levels = (touch->GetHistoryDepth()) + 1;
717 for (
unsigned int it=0; it <
hfNames.size(); ++it) {
719 const G4LogicalVolume* lv = touch->GetVolume(levels-
hfLevels[it])->GetLogicalVolume();
720 if (lv ==
hfLV[it])
return true;
727 std::vector<G4String>::const_iterator it =
hfNames.begin();
728 for (; it !=
hfNames.end(); ++it)
if (name == *it)
return true;
733 std::vector<const G4LogicalVolume*>::const_iterator ite =
fibreLV.begin();
734 for (; ite !=
fibreLV.end(); ++ite)
if (lv == *ite)
return true;
739 std::vector<G4String>::const_iterator it =
fibreNames.begin();
740 for (; it !=
fibreNames.end(); ++it)
if (name == *it)
return true;
745 std::vector<const G4LogicalVolume*>::const_iterator ite =
pmtLV.begin();
746 for (; ite !=
pmtLV.end(); ++ite)
if (lv == *ite)
return true;
751 std::vector<const G4LogicalVolume*>::const_iterator ite =
fibre1LV.begin();
752 for (; ite !=
fibre1LV.end(); ++ite)
if (lv == *ite)
return true;
757 std::vector<const G4LogicalVolume*>::const_iterator ite =
fibre2LV.begin();
758 for (; ite !=
fibre2LV.end(); ++ite)
if (lv == *ite)
return true;
763 std::vector<const G4Material*>::const_iterator ite =
materials.begin();
764 for (; ite !=
materials.end(); ++ite)
if (mat == *ite)
return true;
773 edm::LogInfo(
"HcalSim") <<
"HCalSD::isItinFidVolume:#PMT= " << npmt
774 <<
" for hit point " << hitPoint;
776 if (npmt <= 0) flag =
false;
779 edm::LogInfo(
"HcalSim") <<
"HCalSD::isItinFidVolume: point " << hitPoint
780 <<
" return flag " <<
flag;
800 G4int particleCode =
theTrack->GetDefinition()->GetPDGEncoding();
809 edm::LogInfo(
"HcalSim") <<
"HCalSD::getFromLibrary " <<hits.size()
810 <<
" hits for " << GetName() <<
" of " << primaryID
811 <<
" with " <<
theTrack->GetDefinition()->GetParticleName()
814 for (
unsigned int i=0;
i<hits.size(); ++
i) {
815 G4ThreeVector hitPoint = hits[
i].position;
817 int depth = hits[
i].depth;
818 double time = hits[
i].time;
819 unsigned int unitID =
setDetUnitId(det, hitPoint, depth);
840 theTrack->SetTrackStatus(fStopAndKill);
841 G4TrackVector tv = *(aStep->GetSecondary());
842 for (
unsigned int kk=0;
kk<tv.size(); ++
kk)
844 tv[
kk]->SetTrackStatus(fStopAndKill);
850 const G4StepPoint*
preStepPoint = aStep->GetPreStepPoint();
851 const G4Track*
theTrack = aStep->GetTrack();
857 G4int particleCode = theTrack->GetDefinition()->GetPDGEncoding();
867 edm::LogInfo(
"HcalSim") <<
"HCalSD::hitForFibre " << hits.size()
868 <<
" hits for " << GetName() <<
" of " << primaryID
869 <<
" with " << theTrack->GetDefinition()->GetParticleName()
870 <<
" of " << preStepPoint->GetKineticEnergy()/
GeV 871 <<
" GeV in detector type " << det;
874 for (
unsigned int i=0;
i<hits.size(); ++
i) {
875 G4ThreeVector hitPoint = hits[
i].position;
877 int depth = hits[
i].depth;
878 double time = hits[
i].time;
879 unsigned int unitID =
setDetUnitId(det, hitPoint, depth);
902 int nHit =
static_cast<int>(hits.size());
905 const G4StepPoint*
preStepPoint = aStep->GetPreStepPoint();
910 edm::LogInfo(
"HcalSim") <<
"HCalSD::getFromParam " << nHit <<
" hits for " 911 << GetName() <<
" of " << primaryID <<
" with " 912 << aStep->GetTrack()->GetDefinition()->GetParticleName()
913 <<
" of " << preStepPoint->GetKineticEnergy()/
GeV 914 <<
" GeV in detector type " << det;
916 for (
int i = 0;
i<nHit; ++
i) {
917 G4ThreeVector hitPoint = hits[
i].position;
918 int depth = hits[
i].depth;
919 double time = hits[
i].time;
920 unsigned int unitID =
setDetUnitId(det, hitPoint, depth);
941 const G4StepPoint*
preStepPoint = aStep->GetPreStepPoint();
942 const G4Track*
theTrack = aStep->GetTrack();
946 double etrack = preStepPoint->GetKineticEnergy();
949 primaryID = theTrack->GetTrackID();
951 primaryID = theTrack->GetParentID();
952 if (primaryID == 0) primaryID = theTrack->GetTrackID();
960 const G4ThreeVector& hitPoint = preStepPoint->GetPosition();
961 double rr = (hitPoint.x()*hitPoint.x() + hitPoint.y()*hitPoint.y());
962 double phi = (rr == 0. ? 0. :atan2(hitPoint.y(),hitPoint.x()));
969 if (hitPoint.z() < 0) etaR =-etaR;
971 edm::LogInfo(
"HcalSim") <<
"HCalSD::Hit for Detector " << det <<
" etaR " 972 << etaR <<
" phi " << phi/deg <<
" depth " <<
depth;
974 double time = (aStep->GetPostStepPoint()->GetGlobalTime());
989 double beta = preStepPoint->GetBeta();
990 LogDebug(
"HcalSim") <<
"HCalSD::getHitPMT 1 hit for " << GetName()
991 <<
" of " << primaryID <<
" with " 992 << theTrack->GetDefinition()->GetParticleName()
993 <<
" of " << preStepPoint->GetKineticEnergy()/GeV
994 <<
" GeV with velocity " << beta <<
" UnitID " 1007 const G4StepPoint*
preStepPoint = aStep->GetPreStepPoint();
1008 const G4Track*
theTrack = aStep->GetTrack();
1012 double etrack = preStepPoint->GetKineticEnergy();
1015 primaryID = theTrack->GetTrackID();
1017 primaryID = theTrack->GetParentID();
1018 if (primaryID == 0) primaryID = theTrack->GetTrackID();
1021 posGlobal = preStepPoint->GetPosition();
1026 const G4ThreeVector& hitPoint = preStepPoint->GetPosition();
1027 double rr = (hitPoint.x()*hitPoint.x() + hitPoint.y()*hitPoint.y());
1028 double phi = (rr == 0. ? 0. :atan2(hitPoint.y(),hitPoint.x()));
1035 if (hitPoint.z() < 0) etaR =-etaR;
1037 LogDebug(
"HcalSim") <<
"HCalSD::Hit for Detector " << det <<
" etaR " 1038 << etaR <<
" phi " << phi/deg <<
" depth " <<
depth;
1040 double time = (aStep->GetPostStepPoint()->GetGlobalTime());
1041 uint32_t unitID = 0;
1055 double beta = preStepPoint->GetBeta();
1056 LogDebug(
"HcalSim") <<
"HCalSD::getHitFibreBundle 1 hit for " << GetName()
1057 <<
" of " << primaryID <<
" with " 1058 << theTrack->GetDefinition()->GetParticleName()
1059 <<
" of " << preStepPoint->GetKineticEnergy()/GeV
1060 <<
" GeV with velocity " << beta <<
" UnitID " 1070 const G4StepPoint*
preStepPoint = aStep->GetPreStepPoint();
1071 const G4Track*
theTrack = aStep->GetTrack();
1073 double etrack = preStepPoint->GetKineticEnergy();
1076 if (primaryID == 0) {
1078 edm::LogInfo(
"HcalSim") <<
"HCalSD: Problem with primaryID **** set by " 1079 <<
"force to TkID **** " <<theTrack->GetTrackID();
1081 primaryID = theTrack->GetTrackID();
1092 std::ifstream infile;
1098 while (infile >> det >> zside >> etaR >> phi >> lay >> wt) {
1100 layerWeights.insert(std::pair<uint32_t,double>(
id,wt));
1103 edm::LogInfo(
"HcalSim") <<
"HCalSD::readWeightFromFile:Entry " << entry
1104 <<
" ID " << std::hex <<
id <<
std::dec <<
" (" 1105 << det <<
"/" << zside <<
"/1/" << etaR <<
"/" 1106 << phi <<
"/" << lay <<
") Weight " << wt;
1111 edm::LogInfo(
"HcalSim") <<
"HCalSD::readWeightFromFile: reads " << entry
1112 <<
" weights from " << fName;
1126 std::map<uint32_t,double>::const_iterator ite =
layerWeights.find(
id);
1129 edm::LogInfo(
"HcalSim") <<
"HCalSD::layerWeight: ID " << std::hex <<
id 1131 << tmp.
zside <<
"/1/" << tmp.
etaR <<
"/" 1132 << tmp.
phis <<
"/" << tmp.
lay <<
") Weight " <<wt;
1139 double time,
int id) {
1141 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
1142 static const G4String modName[8] = {
"HEModule",
"HVQF" ,
"HBModule",
"MBAT",
1143 "MBBT" ,
"MBBTC",
"MBBT_R1P",
"MBBT_R1M"};
1144 G4ThreeVector
local;
1148 for (
int n=0;
n<touch->GetHistoryDepth(); ++
n) {
1149 G4String
name = touch->GetVolume(
n)->GetName();
1151 LogDebug(
"HcalSim") <<
"plotProfile Depth " <<
n <<
" Name " <<
name;
1153 for (
unsigned int ii=0;
ii<8; ++
ii) {
1154 if (name == modName[
ii]) {
1156 int dn = touch->GetHistoryDepth() -
n;
1157 local = touch->GetHistory()->GetTransform(dn).TransformPoint(global);
1158 if (ii == 0) {depth = local.z() - 4006.5; idx = 1;}
1159 else if (ii == 1) {depth = local.z() + 825.0; idx = 3;}
1160 else if (ii == 2) {depth = local.x() - 1775.; idx = 0;}
1161 else {depth = local.y() + 15.; idx = 2;}
1167 if (!found) depth =
std::abs(global.z()) - 11500;
1169 LogDebug(
"HcalSim") <<
"plotProfile Found " << found <<
" Global " << global
1170 <<
" Local " << local <<
" depth " << depth <<
" ID " 1171 <<
id <<
" EDEP " << edep <<
" Time " <<
time;
1176 int jd = 2*idx +
id - 7;
1177 if (jd >= 0 && jd < 4) {
1179 if (
hit_[jd] !=
nullptr)
hit_[jd]->Fill(edep);
1180 if (
time_[jd] !=
nullptr)
time_[jd]->Fill(time,edep);
1181 if (
dist_[jd] !=
nullptr)
dist_[jd]->Fill(depth,edep);
1195 if (
id.subdet == 4) {
1196 int ieta = (
id.zside == 0) ? -
id.etaR :
id.etaR;
1198 if (
id.
depth <= 2) {
1199 if (G4UniformRand() > 0.5)
id.depth += 2;
1202 }
else if ((
id.subdet == 1 ||
id.subdet ==2) &&
testNumber) {
1203 if (
depth_ == 0)
id.depth = 1;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3)
void readWeightFromFile(const std::string &)
std::vector< const G4LogicalVolume * > hfLV
HFShowerParam * showerParam
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
void updateHit(CaloG4Hit *)
void getFromParam(G4Step *step, double weight)
std::vector< double > gpar
int zside() const
get the z-side of the cell (1/-1)
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
std::vector< Hit > getHits(G4Step *aStep, bool &ok, double weight, bool onlyLong=false)
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID &id)
HFShowerFibreBundle * showerBundle
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
void plotProfile(const G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
void getFromLibrary(G4Step *step, double weight)
std::vector< const G4LogicalVolume * > fibre2LV
static const unsigned int numberOfZLayers
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
void setNumberingScheme(HcalNumberingScheme *)
type of data representation of DDCompactView
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
bool compare(HcalNumberingFromDDD::HcalID const &, uint32_t const &)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
static int PMTNumber(const G4ThreeVector &pe_effect)
static TrackerG4SimHitNumberingScheme & numberingScheme(const DDCompactView &cpv, const GeometricDet &det)
std::vector< Hit > getHits(const G4Step *aStep, double weight)
int setTrackID(const G4Step *step)
bool isItConicalBundle(const G4LogicalVolume *)
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
bool ProcessHits(G4Step *, G4TouchableHistory *) override
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
double getHits(const G4Step *aStep)
void resetForNewPrimary(const G4ThreeVector &, double)
int getMaxDepth(const int &type) const
HCalSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
bool next()
set current node to the next node in the filtered tree
const std::vector< std::string > & getNames() const
std::unique_ptr< HFDarkening > m_HFDarkening
const HBHEDarkening * m_HEDarkening
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Abs< T >::type abs(const T &t)
void plotHF(const G4ThreeVector &pos, bool emType)
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
HcalNumberingScheme * numberingScheme
T * make(const Args &...args) const
make new ROOT object
double getHits(const G4Step *aStep, bool type)
std::vector< int > hfLevels
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
uint32_t setDetUnitId(const G4Step *step) override
double getLayer0Wt(const int &det, const int &phi, const int &zside) const
virtual G4bool getStepInfo(G4Step *aStep)
bool isItStraightBundle(const G4LogicalVolume *)
int ietaAbs() const
get the absolute value of the cell ieta
void setID(uint32_t unitID, double timeSlice, int trackID, uint16_t depth=0)
G4StepPoint * preStepPoint
int iphi() const
get the cell iphi
const std::vector< double > & getGparHF() const
std::vector< const G4LogicalVolume * > pmtLV
static const unsigned int lowZLimit
static const G4LogicalVolume * GetVolume(const std::string &name)
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
bool filterHit(CaloG4Hit *, double) override
std::vector< Hit > getHits(G4Step *aStep, double weight)
static const unsigned int upperZLimit
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
void getHitFibreBundle(const G4Step *step, bool type)
void hitForFibre(const G4Step *step, double weight)
bool isItPMT(const G4LogicalVolume *)
DDsvalues_type mergedSpecifics() const
bool isItinFidVolume(const G4ThreeVector &)
void getHitPMT(const G4Step *step)
HcalNumberingFromDDD * numberingFromDDD
double layerWeight(int, const G4ThreeVector &, int, int)
std::vector< std::vector< double > > tmp
bool isItHF(const G4Step *)
std::vector< G4String > fibreNames
bool firstChild()
set the current node to the first child ...
bool isItScintillator(const G4Material *)
std::vector< G4String > hfNames
std::vector< const G4LogicalVolume * > fibreLV
std::map< uint32_t, double > layerWeights
uint32_t getUnitID() const
double getResponseWt(const G4Track *)
std::vector< const G4LogicalVolume * > fibre1LV
HcalID unitID(int det, const CLHEP::Hep3Vector &pos, int depth, int lay=-1) const
HFShowerLibrary * showerLibrary
int maxHFDepth(const int &ieta, const int &iphi) const
std::vector< const G4Material * > materials
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
const HBHEDarkening * m_HBDarkening
double getEnergyDeposit(G4Step *) override
const std::string & name() const
Returns the name.
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
CaloG4Hit * createNewHit()
std::vector< G4String > matNames
float degradation(float intlumi, int ieta, int lay) const
double getEnergyDeposit() const
bool isItFibre(const G4LogicalVolume *)
void NaNTrap(const G4Step *step) const
HcalDDDSimConstants * hcalConstants