21 #include "G4LogicalVolumeStore.hh"
22 #include "G4LogicalVolume.hh"
25 #include "G4ParticleTable.hh"
26 #include "G4VProcess.hh"
28 #include "G4SystemOfUnits.hh"
29 #include "G4PhysicalConstants.hh"
41 CaloSD(name, cpv, clg, p, manager,
42 p.getParameter<edm::
ParameterSet>(
"HCalSD").getParameter<int>(
"TimeSliceUnit"),
43 p.getParameter<edm::
ParameterSet>(
"HCalSD").getParameter<bool>(
"IgnoreTrackID")),
45 showerParam(0), showerPMT(0), showerBundle(0), m_HEDarkening(0),
70 bool ageingFlagHE= m_HC.
getParameter<
bool>(
"HEDarkening");
71 bool ageingFlagHF= m_HC.
getParameter<
bool>(
"HFDarkening");
77 applyFidCut = m_HF.getParameter<
bool>(
"ApplyFiducialCut");
80 LogDebug(
"HcalSim") <<
"***************************************************"
84 <<
"* Constructing a HCalSD with name " << name <<
"\n"
87 <<
"***************************************************";
89 edm::LogInfo(
"HcalSim") <<
"HCalSD:: Use of HF code is set to " << useHF
90 <<
"\nUse of shower parametrization set to "
91 << useParam <<
"\nUse of shower library is set to "
92 << useShowerLibrary <<
"\nUse PMT Hit is set to "
93 << usePMTHit <<
" with beta Threshold "<< betaThr
94 <<
"\nUSe of FibreBundle Hit set to "<<useFibreBundle
95 <<
"\n Use of Birks law is set to "
96 << useBirk <<
" with three constants kB = "
97 << birk1 <<
", C1 = " << birk2 <<
", C2 = " <<
birk3;
101 <<
" ions below " <<
kmaxIon <<
" MeV\n"
102 <<
" Threshold for storing hits in HB: "
103 << eminHitHB <<
" HE: " << eminHitHE <<
" HO: "
104 << eminHitHO <<
" HF: " << eminHitHF <<
"\n"
105 <<
"Delivered luminosity for Darkening "
106 << deliveredLumi <<
" Flag (HE) " << ageingFlagHE
107 <<
" Flag (HF) " << ageingFlagHF <<
"\n"
112 if (testNumber || forTBH2)
118 const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance();
119 std::vector<G4LogicalVolume *>::const_iterator lvcite;
131 attribute =
"Volume";
134 DDValue ddv0(attribute, value, 0);
142 edm::LogInfo(
"HcalSim") <<
"HCalSD: Names to be tested for " << attribute
143 <<
" = " << value <<
" has " <<
hfNames.size()
145 for (
unsigned int i=0;
i <
hfNames.size(); ++
i) {
148 for(lvcite=lvs->begin(); lvcite!=lvs->end(); lvcite++)
149 if((*lvcite)->GetName()==namv) {
154 int level =
static_cast<int>(temp[
i]);
157 <<
" LV " <<
hfLV[
i] <<
" at level "
164 DDValue ddv1(attribute,value,0);
169 edm::LogInfo(
"HcalSim") <<
"HCalSD: Names to be tested for " << attribute
170 <<
" = " << value <<
":";
174 for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite) {
175 if ((*lvcite)->GetName() == namv) {
188 DDValue ddv3(attribute,value,0);
192 std::vector<G4String> pmtNames =
getNames(fv3);
193 edm::LogInfo(
"HcalSim") <<
"HCalSD: Names to be tested for " << attribute
194 <<
" = " << value <<
" have " << pmtNames.size()
196 for (
unsigned int i=0;
i<pmtNames.size(); ++
i) {
197 G4String namv = pmtNames[
i];
199 for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite)
200 if ((*lvcite)->GetName() == namv) {
205 edm::LogInfo(
"HcalSim") <<
"HCalSD: (" <<
i <<
") " << pmtNames[
i]
211 value =
"HFFibreBundleStraight";
213 DDValue ddv4(attribute,value,0);
218 edm::LogInfo(
"HcalSim") <<
"HCalSD: Names to be tested for " << attribute
219 <<
" = " << value <<
" have " << fibreNames.size()
221 for (
unsigned int i=0;
i<fibreNames.size(); ++
i) {
222 G4String namv = fibreNames[
i];
224 for (lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
225 if ((*lvcite)->GetName() == namv) {
230 edm::LogInfo(
"HcalSim") <<
"HCalSD: (" <<
i <<
") " << fibreNames[
i]
235 value =
"HFFibreBundleConical";
237 DDValue ddv5(attribute,value,0);
242 edm::LogInfo(
"HcalSim") <<
"HCalSD: Names to be tested for " << attribute
243 <<
" = " << value <<
" have " << fibreNames.size()
245 for (
unsigned int i=0;
i<fibreNames.size(); ++
i) {
246 G4String namv = fibreNames[
i];
248 for (lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite)
249 if ((*lvcite)->GetName() == namv) {
254 edm::LogInfo(
"HcalSim") <<
"HCalSD: (" <<
i <<
") " << fibreNames[
i]
260 attribute =
"ReadOutName";
263 DDValue ddv6(attribute,value,0);
271 edm::LogInfo(
"HFShower") <<
"HFShowerParam: " << gpar.size()
273 for (
unsigned int ig=0; ig<gpar.size(); ig++)
274 edm::LogInfo(
"HFShower") <<
"HFShowerParam: gpar[" << ig <<
"] = "
275 << gpar[ig]/cm <<
" cm";
278 <<
" view for " << attribute <<
" matching "
284 attribute =
"ReadOutName";
286 DDValue ddv2(attribute,name,0);
295 edm::LogInfo(
"HcalSim") <<
"HCalSD: " << layer0wt.size() <<
" Layer0Wt";
296 for (
unsigned int it=0; it<layer0wt.size(); ++it)
297 edm::LogInfo(
"HcalSim") <<
"HCalSD: [" << it <<
"] " << layer0wt[it];
299 const G4MaterialTable * matTab = G4Material::GetMaterialTable();
300 std::vector<G4Material*>::const_iterator matite;
316 for (matite = matTab->begin(); matite != matTab->end(); ++matite) {
317 if ((*matite)->GetName() == namx) {
328 edm::LogInfo(
"HcalSim") <<
"HCalSD: Material names for " << attribute
329 <<
" = " << name <<
":";
347 static const char *
const labels[] = {
"HB",
"HE",
"HO",
"HF Absorber",
"HF PMT",
348 "HF Absorber Long",
"HF Absorber Short",
349 "HF PMT Long",
"HF PMT Short"};
351 char name[20],
title[60];
352 for (
int i=0;
i<9; ++
i) {
353 sprintf (title,
"Hit energy in %s", labels[
i]);
354 sprintf (name,
"HCalSDHit%d", i);
356 sprintf (title,
"Energy (MeV)");
357 hit_[
i]->GetXaxis()->SetTitle(title);
358 hit_[
i]->GetYaxis()->SetTitle(
"Hits");
359 sprintf (title,
"Time of the hit in %s", labels[i]);
360 sprintf (name,
"HCalSDTime%d", i);
362 sprintf (title,
"Time (ns)");
363 time_[
i]->GetXaxis()->SetTitle(title);
364 time_[
i]->GetYaxis()->SetTitle(
"Hits");
365 sprintf (title,
"Longitudinal profile in %s", labels[i]);
366 sprintf (name,
"HCalSDDist%d", i);
368 sprintf (title,
"Distance (mm)");
369 dist_[
i]->GetXaxis()->SetTitle(title);
370 dist_[
i]->GetYaxis()->SetTitle(
"Hits");
372 if (useHF && (!useParam)) {
373 hzvem = hcDir.
make<TH1F>(
"hzvem",
"Longitudinal Profile (EM Part)",330,0.0,1650.0);
374 hzvem->GetXaxis()->SetTitle(
"Longitudinal Profile (EM Part)");
375 hzvhad = hcDir.
make<TH1F>(
"hzvhad",
"Longitudinal Profile (Had Part)",330,0.0,1650.0);
376 hzvhad->GetXaxis()->SetTitle(
"Longitudinal Profile (Hadronic Part)");
402 G4LogicalVolume* lv =
403 aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume();
404 G4String nameVolume = lv->GetName();
406 G4int parCode = aStep->GetTrack()->GetDefinition()->GetPDGEncoding();
409 G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
410 double r = hitPoint.perp()/CLHEP::cm;
411 double z =
std::abs(hitPoint.z())/CLHEP::cm;
412 float dose_acquired = 0.;
413 if (z>=1100 && z <= 1300) {
414 int hfZLayer = (int)((z - 1100)/20);
415 if (hfZLayer > 9) hfZLayer = 9;
417 for (
int i = hfZLayer;
i <= 9; ++
i) {
423 LogDebug(
"HcalSim") <<
"HCalSD: HFLumiDarkening at r = " << r
424 <<
", z = " << z <<
" Dose " << dose_acquired
431 <<
" hits from parametrization in " << nameVolume
432 <<
" for Track " << aStep->GetTrack()->GetTrackID()
433 <<
" (" << aStep->GetTrack()->GetDefinition()->GetParticleName()
439 <<
" hits afterParamS*";
442 bool notaMuon =
true;
443 if (parCode ==
mupPDG || parCode ==
mumPDG ) notaMuon =
false;
446 LogDebug(
"HcalSim") <<
"HCalSD: Starts shower library from "
447 << nameVolume <<
" for Track "
448 << aStep->GetTrack()->GetTrackID() <<
" ("
449 << aStep->GetTrack()->GetDefinition()->GetParticleName() <<
")";
454 LogDebug(
"HcalSim") <<
"HCalSD: Hit at Fibre in " << nameVolume
456 << aStep->GetTrack()->GetTrackID() <<
" ("
457 << aStep->GetTrack()->GetDefinition()->GetParticleName() <<
")";
464 LogDebug(
"HcalSim") <<
"HCalSD: Hit from PMT parametrization from "
465 << nameVolume <<
" for Track "
466 << aStep->GetTrack()->GetTrackID() <<
" ("
467 << aStep->GetTrack()->GetDefinition()->GetParticleName() <<
")";
472 LogDebug(
"HcalSim") <<
"HCalSD: Hit from FibreBundle from "
473 << nameVolume <<
" for Track "
474 << aStep->GetTrack()->GetTrackID() <<
" ("
475 << aStep->GetTrack()->GetDefinition()->GetParticleName() <<
")";
481 LogDebug(
"HcalSim") <<
"HCalSD: Hit from standard path from "
482 << nameVolume <<
" for Track "
483 << aStep->GetTrack()->GetTrackID() <<
" ("
484 << aStep->GetTrack()->GetDefinition()->GetParticleName() <<
")";
489 plotProfile(aStep, aStep->GetPreStepPoint()->GetPosition(),
500 double destep = aStep->GetTotalEnergyDeposit();
502 G4Track*
theTrack = aStep->GetTrack();
504 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
505 int depth = (touch->GetReplicaNumber(0))%10;
506 int det = ((touch->GetReplicaNumber(1))/1000)-3;
507 if (depth==0 && (det==0 || det==1)) weight =
layer0wt[det];
509 int lay = (touch->GetReplicaNumber(0)/10)%100 + 1;
510 G4ThreeVector hitPoint = aStep->GetPreStepPoint()->GetPosition();
515 int lay = (touch->GetReplicaNumber(0)/10)%100 + 1;
519 int det,
z, depth,
eta,
phi, lay;
525 edm::LogInfo(
"HcalSimDark") <<
"HCalSD:HE_Darkening >>> ieta: "<< ieta
526 <<
" lay: " << lay-2;
532 <<
" coefficient = " << dweight;
539 int pdg = theTrack->GetDefinition()->GetPDGEncoding();
541 double ke = theTrack->GetKineticEnergy()/MeV;
542 if ( pdg/1000000000 == 1 && (pdg/10000)%100 > 0 &&
543 (pdg/10)%100 > 0 && ke <
kmaxIon ) weight = 0;
544 if ((pdg == 2212) && (ke <
kmaxProton)) weight = 0;
545 if ((pdg == 2112) && (ke <
kmaxNeutron)) weight = 0;
549 << theTrack->GetTrackID() <<
" Type "
550 << theTrack->GetDefinition()->GetParticleName()
551 <<
" Kinetic Energy " << ke <<
" MeV";
560 G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
564 double wt2 = theTrack->GetWeight();
580 edm::LogInfo(
"HcalSim") <<
"HCalSD: Detector " << det+3 <<
" Depth " << depth
581 <<
" weight " << weight0 <<
" " << weight <<
" " << wt1
584 double edep = weight*wt1*destep;
585 if(wt2 > 0.0) { edep *= wt2; }
592 const G4VTouchable* touch = preStepPoint->GetTouchable();
593 G4ThreeVector hitPoint = preStepPoint->GetPosition();
595 int depth = (touch->GetReplicaNumber(0))%10 + 1;
596 int lay = (touch->GetReplicaNumber(0)/10)%100 + 1;
597 int det = (touch->GetReplicaNumber(1))/1000;
604 edm::LogInfo(
"HcalSim") <<
"HCalSD: updates numbering scheme for " << GetName();
611 G4ParticleTable * theParticleTable = G4ParticleTable::GetParticleTable();
612 G4String particleName;
613 mumPDG = theParticleTable->FindParticle(particleName=
"mu-")->GetPDGEncoding();
614 mupPDG = theParticleTable->FindParticle(particleName=
"mu+")->GetPDGEncoding();
616 LogDebug(
"HcalSim") <<
"HCalSD: Particle code for mu- = " <<
mumPDG
617 <<
" for mu+ = " <<
mupPDG;
627 switch (theId.subdetId()) {
657 LogDebug(
"HcalSim") <<
"HCalSD:getDDDArray called for " << str;
664 const std::vector<double> & fvec = value.
doubles();
665 int nval = fvec.size();
667 edm::LogError(
"HcalSim") <<
"HCalSD : # of " << str <<
" bins " << nval
668 <<
" < 2 ==> illegal";
669 throw cms::Exception(
"Unknown",
"HCalSD") <<
"nval < 2 for array " << str <<
"\n";
674 edm::LogError(
"HcalSim") <<
"HCalSD : cannot get array " << str;
675 throw cms::Exception(
"Unknown",
"HCalSD") <<
"cannot get array " << str <<
"\n";
681 std::vector<G4String>
tmp;
687 for (
unsigned int i=0;
i<tmp.size(); ++
i) {
688 if (!strcmp(tmp[
i].c_str(), log.
name().
name().c_str())) {
693 if (ok) tmp.push_back(log.
name().
name());
700 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
701 int levels = (touch->GetHistoryDepth()) + 1;
702 for (
unsigned int it=0; it <
hfNames.size(); ++it) {
704 G4LogicalVolume* lv = touch->GetVolume(levels-
hfLevels[it])->GetLogicalVolume();
705 if (lv ==
hfLV[it])
return true;
712 std::vector<G4String>::const_iterator it =
hfNames.begin();
713 for (; it !=
hfNames.end(); ++it)
if (name == *it)
return true;
718 std::vector<G4LogicalVolume*>::const_iterator ite =
fibreLV.begin();
719 for (; ite !=
fibreLV.end(); ++ite)
if (lv == *ite)
return true;
724 std::vector<G4String>::const_iterator it =
fibreNames.begin();
725 for (; it !=
fibreNames.end(); ++it)
if (name == *it)
return true;
730 std::vector<G4LogicalVolume*>::const_iterator ite =
pmtLV.begin();
731 for (; ite !=
pmtLV.end(); ++ite)
if (lv == *ite)
return true;
736 std::vector<G4LogicalVolume*>::const_iterator ite =
fibre1LV.begin();
737 for (; ite !=
fibre1LV.end(); ++ite)
if (lv == *ite)
return true;
742 std::vector<G4LogicalVolume*>::const_iterator ite =
fibre2LV.begin();
743 for (; ite !=
fibre2LV.end(); ++ite)
if (lv == *ite)
return true;
748 std::vector<G4Material*>::const_iterator ite =
materials.begin();
749 for (; ite !=
materials.end(); ++ite)
if (mat == *ite)
return true;
758 edm::LogInfo(
"HcalSim") <<
"HCalSD::isItinFidVolume:#PMT= " << npmt
759 <<
" for hit point " << hitPoint;
761 if (npmt <= 0) flag =
false;
764 edm::LogInfo(
"HcalSim") <<
"HCalSD::isItinFidVolume: point " << hitPoint
765 <<
" return flag " <<
flag;
785 G4int particleCode =
theTrack->GetDefinition()->GetPDGEncoding();
794 edm::LogInfo(
"HcalSim") <<
"HCalSD::getFromLibrary " <<hits.size()
795 <<
" hits for " << GetName() <<
" of " << primaryID
796 <<
" with " <<
theTrack->GetDefinition()->GetParticleName()
797 <<
" of " <<
preStepPoint->GetKineticEnergy()/GeV <<
" GeV";
799 for (
unsigned int i=0;
i<hits.size(); ++
i) {
800 G4ThreeVector hitPoint = hits[
i].position;
802 int depth = hits[
i].depth;
803 double time = hits[
i].time;
804 unsigned int unitID =
setDetUnitId(det, hitPoint, depth);
807 plotProfile(aStep, hitPoint, 1.0*GeV, time, depth);
825 theTrack->SetTrackStatus(fStopAndKill);
826 G4TrackVector tv = *(aStep->GetSecondary());
827 for (
unsigned int kk=0;
kk<tv.size(); ++
kk)
829 tv[
kk]->SetTrackStatus(fStopAndKill);
842 G4int particleCode =
theTrack->GetDefinition()->GetPDGEncoding();
852 edm::LogInfo(
"HcalSim") <<
"HCalSD::hitForFibre " << hits.size()
853 <<
" hits for " << GetName() <<
" of " << primaryID
854 <<
" with " <<
theTrack->GetDefinition()->GetParticleName()
856 <<
" GeV in detector type " << det;
858 if (hits.size() > 0) {
859 for (
unsigned int i=0;
i<hits.size(); ++
i) {
860 G4ThreeVector hitPoint = hits[
i].position;
862 int depth = hits[
i].depth;
863 double time = hits[
i].time;
864 unsigned int unitID =
setDetUnitId(det, hitPoint, depth);
887 int nHit =
static_cast<int>(hits.size());
895 edm::LogInfo(
"HcalSim") <<
"HCalSD::getFromParam " << nHit <<
" hits for "
896 << GetName() <<
" of " << primaryID <<
" with "
897 << aStep->GetTrack()->GetDefinition()->GetParticleName()
899 <<
" GeV in detector type " << det;
901 for (
int i = 0;
i<nHit; ++
i) {
902 G4ThreeVector hitPoint = hits[
i].position;
903 int depth = hits[
i].depth;
904 double time = hits[
i].time;
905 unsigned int unitID =
setDetUnitId(det, hitPoint, depth);
936 primaryID =
theTrack->GetParentID();
937 if (primaryID == 0) primaryID =
theTrack->GetTrackID();
946 double rr = (hitPoint.x()*hitPoint.x() + hitPoint.y()*hitPoint.y());
947 double phi = (rr == 0. ? 0. :atan2(hitPoint.y(),hitPoint.x()));
954 if (hitPoint.z() < 0) etaR =-etaR;
956 edm::LogInfo(
"HcalSim") <<
"HCalSD::Hit for Detector " << det <<
" etaR "
957 << etaR <<
" phi " << phi/deg <<
" depth " <<depth;
959 double time = (aStep->GetPostStepPoint()->GetGlobalTime());
971 plotProfile(aStep, hitPoint, edep*GeV, time, depth);
975 LogDebug(
"HcalSim") <<
"HCalSD::getHitPMT 1 hit for " << GetName()
976 <<
" of " << primaryID <<
" with "
977 <<
theTrack->GetDefinition()->GetParticleName()
979 <<
" GeV with velocity " << beta <<
" UnitID "
980 << std::hex << unitID << std::dec;
1000 primaryID =
theTrack->GetTrackID();
1002 primaryID =
theTrack->GetParentID();
1003 if (primaryID == 0) primaryID =
theTrack->GetTrackID();
1012 double rr = (hitPoint.x()*hitPoint.x() + hitPoint.y()*hitPoint.y());
1013 double phi = (rr == 0. ? 0. :atan2(hitPoint.y(),hitPoint.x()));
1020 if (hitPoint.z() < 0) etaR =-etaR;
1022 LogDebug(
"HcalSim") <<
"HCalSD::Hit for Detector " << det <<
" etaR "
1023 << etaR <<
" phi " << phi/deg <<
" depth " <<depth;
1025 double time = (aStep->GetPostStepPoint()->GetGlobalTime());
1026 uint32_t unitID = 0;
1037 plotProfile(aStep, hitPoint, edep*GeV, time, depth);
1041 LogDebug(
"HcalSim") <<
"HCalSD::getHitFibreBundle 1 hit for " << GetName()
1042 <<
" of " << primaryID <<
" with "
1043 <<
theTrack->GetDefinition()->GetParticleName()
1045 <<
" GeV with velocity " << beta <<
" UnitID "
1046 << std::hex << unitID << std::dec;
1060 if (primaryID == 0) {
1062 edm::LogInfo(
"HcalSim") <<
"HCalSD: Problem with primaryID **** set by "
1063 <<
"force to TkID **** " <<
theTrack->GetTrackID();
1065 primaryID =
theTrack->GetTrackID();
1082 while (infile >> det >> zside >> etaR >> phi >> lay >> wt) {
1084 layerWeights.insert(std::pair<uint32_t,double>(
id,wt));
1087 edm::LogInfo(
"HcalSim") <<
"HCalSD::readWeightFromFile:Entry " << entry
1088 <<
" ID " << std::hex <<
id << std::dec <<
" ("
1089 << det <<
"/" << zside <<
"/1/" << etaR <<
"/"
1090 << phi <<
"/" << lay <<
") Weight " << wt;
1095 edm::LogInfo(
"HcalSim") <<
"HCalSD::readWeightFromFile: reads " << entry
1096 <<
" weights from " <<
fName;
1109 std::map<uint32_t,double>::const_iterator ite =
layerWeights.find(
id);
1112 edm::LogInfo(
"HcalSim") <<
"HCalSD::layerWeight: ID " << std::hex <<
id
1113 << std::dec <<
" (" << tmp.
subdet <<
"/"
1114 << tmp.
zside <<
"/1/" << tmp.
etaR <<
"/"
1115 << tmp.
phis <<
"/" << tmp.
lay <<
") Weight " <<wt;
1122 double time,
int id) {
1124 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
1125 static G4String modName[8] = {
"HEModule",
"HVQF" ,
"HBModule",
"MBAT",
1126 "MBBT" ,
"MBBTC",
"MBBT_R1P",
"MBBT_R1M"};
1127 G4ThreeVector local;
1131 for (
int n=0;
n<touch->GetHistoryDepth(); ++
n) {
1132 G4String
name = touch->GetVolume(
n)->GetName();
1134 LogDebug(
"HcalSim") <<
"plotProfile Depth " <<
n <<
" Name " <<
name;
1136 for (
unsigned int ii=0;
ii<8; ++
ii) {
1137 if (name == modName[
ii]) {
1139 int dn = touch->GetHistoryDepth() -
n;
1140 local = touch->GetHistory()->GetTransform(dn).TransformPoint(global);
1141 if (ii == 0) {depth = local.z() - 4006.5; idx = 1;}
1142 else if (ii == 1) {depth = local.z() + 825.0; idx = 3;}
1143 else if (ii == 2) {depth = local.x() - 1775.; idx = 0;}
1144 else {depth = local.y() + 15.; idx = 2;}
1150 if (!found) depth =
std::abs(global.z()) - 11500;
1152 LogDebug(
"HcalSim") <<
"plotProfile Found " << found <<
" Global " << global
1153 <<
" Local " << local <<
" depth " << depth <<
" ID "
1154 <<
id <<
" EDEP " << edep <<
" Time " <<
time;
1159 int jd = 2*idx +
id - 7;
1160 if (jd >= 0 && jd < 4) {
1162 if (
hit_[jd] != 0)
hit_[jd]->Fill(edep);
1163 if (
time_[jd] != 0)
time_[jd]->Fill(time,edep);
1164 if (
dist_[jd] != 0)
dist_[jd]->Fill(depth,edep);
T getParameter(std::string const &) const
std::vector< double > layer0wt
T getUntrackedParameter(std::string const &, T const &) const
HFShowerParam * showerParam
float int_lumi(float intlumi)
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 addFilter(const DDFilter &, log_op op=AND)
void updateHit(CaloG4Hit *)
void hitForFibre(G4Step *step, double weight)
void getFromParam(G4Step *step, double weight)
void initRun(G4ParticleTable *)
bool isItStraightBundle(G4LogicalVolume *)
virtual bool ProcessHits(G4Step *, G4TouchableHistory *)
std::vector< double > gpar
bool isItinFidVolume(G4ThreeVector &)
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< G4LogicalVolume * > fibre1LV
std::vector< G4LogicalVolume * > fibreLV
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
double getHits(G4Step *aStep, bool type)
virtual uint32_t setDetUnitId(G4Step *step)
int setTrackID(G4Step *step)
void getFromLibrary(G4Step *step, double weight)
void setNumberingScheme(HcalNumberingScheme *)
type of data representation of DDCompactView
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
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)
bool isItConicalBundle(G4LogicalVolume *)
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
void resetForNewPrimary(const G4ThreeVector &, double)
std::vector< G4LogicalVolume * > pmtLV
std::vector< G4LogicalVolume * > hfLV
bool isItScintillator(G4Material *)
bool next()
set current node to the next node in the filtered tree
virtual double getEnergyDeposit(G4Step *)
void plotHF(G4ThreeVector &pos, bool emType)
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::...
float degradation(float mrad)
std::vector< Hit > getHits(G4Step *aStep, double weight)
Abs< T >::type abs(const T &t)
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
void getHitPMT(G4Step *step)
T * make(const Args &...args) const
make new ROOT object
HFDarkening * m_HFDarkening
double getAttenuation(G4Step *aStep, double birk1, double birk2, double birk3)
std::vector< int > hfLevels
virtual std::vector< std::string > getNames()
void plotProfile(G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
HEDarkening * m_HEDarkening
void NaNTrap(G4Step *step)
virtual G4bool getStepInfo(G4Step *aStep)
bool isItPMT(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
static const G4LogicalVolume * GetVolume(const std::string &name)
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
std::vector< Hit > getHits(G4Step *aStep, double weight)
void readWeightFromFile(std::string)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
void getHitFibreBundle(G4Step *step, bool type)
DDsvalues_type mergedSpecifics() const
double getHits(G4Step *aStep)
void initRun(G4ParticleTable *theParticleTable)
HcalNumberingFromDDD * numberingFromDDD
double layerWeight(int, const G4ThreeVector &, int, int)
std::vector< std::vector< double > > tmp
float dose(int layer, float radius)
double getResponseWt(G4Track *)
void initRun(G4ParticleTable *)
std::vector< G4String > fibreNames
bool firstChild()
set the current node to the first child ...
std::vector< G4Material * > materials
virtual bool filterHit(CaloG4Hit *, double)
void setCriteria(const DDValue &nameVal, comp_op, log_op l=AND, bool asString=true, bool merged=true)
std::vector< G4String > hfNames
std::map< uint32_t, double > layerWeights
uint32_t getUnitID() const
HcalID unitID(int det, const CLHEP::Hep3Vector &pos, int depth, int lay=-1) const
float degradation(float intlumi, int ieta, int lay)
HCalSD(G4String, const DDCompactView &, SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
HFShowerLibrary * showerLibrary
std::vector< G4LogicalVolume * > fibre2LV
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
bool isItFibre(G4LogicalVolume *)
double getEnergyDeposit() const
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.