54 #include "G4SDManager.hh" 57 #include "G4ThreeVector.hh" 58 #include "G4VProcess.hh" 59 #include "G4HCofThisEvent.hh" 60 #include "CLHEP/Random/RandGaussQ.h" 61 #include "CLHEP/Units/GlobalSystemOfUnits.h" 62 #include "CLHEP/Units/GlobalPhysicalConstants.h" 63 #include "Randomize.hh" 67 class HepRandomEngine;
72 public Observer<const BeginOfEvent*>,
95 void qieAnalysis(CLHEP::HepRandomEngine*);
96 void xtalAnalysis(CLHEP::HepRandomEngine*);
101 int unitID(uint32_t
id);
102 double scale(
int det,
int layer);
114 double scaleHB0, scaleHB16,
scaleHO, scaleHE0;
129 std::vector<double>
esimh, eqie, esime, enois;
130 std::vector<double> eseta, eqeta,
esphi, eqphi, eslay, eqlay;
131 double etots, eecals, ehcals, etotq, eecalq, ehcalq;
135 G4ThreeVector pvPosition, pvMomentum,
pvUVW;
162 double beamEta = (fMaxEta + fMinEta) / 2.;
163 double beamPhi = (fMaxPhi + fMinPhi) / 2.;
164 double beamThet = 2 * atan(
exp(-beamEta));
168 icphi = (
int)(fabs(beamPhi) / 0.087) + 5;
172 produces<PHcalTB04Info>();
175 beamline_RM->rotateZ(-beamPhi);
176 beamline_RM->rotateY(-beamThet);
178 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04:: Initialised as observer of BeginOf" 179 <<
"Job/BeginOfRun/BeginOfEvent/G4Step/EndOfEvent" 180 <<
" with Parameter values:\n \thcalOnly = " << hcalOnly <<
"\tecalNoise = " << ecalNoise
181 <<
"\n\tMode = " << mode <<
" (0: HB2 Standard; " 182 <<
"1:HB2 Segmented)" 183 <<
"\tType = " << type <<
" (0: HB; 1 HE; 2 HB+HE)\n\tbeamOffset = " << beamOffset
193 edm::LogInfo(
"HcalTBSim") <<
"\n --------> Total number of selected entries" 194 <<
" : " <<
count <<
"\nPointers:: QIE " <<
myQie <<
" Histo " <<
histo;
218 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis:: Save information from " <<
nTower <<
" HCal towers";
231 for (
int lay = 1; lay < 8; lay++) {
232 for (
int icr = 1; icr < 8; icr++) {
240 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis:: Save information from " <<
nCrystal <<
" ECal Crystals";
242 LogDebug(
"HcalTBSim") <<
"\tCrystal[" <<
i <<
"] Original " << std::hex <<
idEcal[
i] <<
" Stored " <<
idXtal[
i]
253 for (
int i = 0;
i < 5;
i++) {
257 for (
int i = 0;
i < 3;
i++) {
261 for (
int i = 0;
i < 20;
i++) {
273 int irun = (*run)()->GetRunID();
274 edm::LogInfo(
"HcalTBSim") <<
" =====> Begin of Run = " << irun;
276 G4SDManager*
sd = G4SDManager::GetSDMpointerIfExist();
279 G4VSensitiveDetector* aSD = sd->FindSensitiveDetector(sdname);
280 if (aSD ==
nullptr) {
282 <<
" with name " << sdname <<
" in this " 286 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis::beginOfRun: Finds SD " 287 <<
"with name " << theCaloSD->GetName() <<
" in this Setup";
290 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis::beginOfRun: set a " 291 <<
"new numbering scheme";
295 aSD = sd->FindSensitiveDetector(sdname);
296 if (aSD ==
nullptr) {
298 <<
" with name " << sdname <<
" in this " 302 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis::beginOfRun: Finds SD " 303 <<
"with name " << theCaloSD->GetName() <<
" in this Setup";
306 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis::beginOfRun: set a " 307 <<
"new numbering scheme";
312 <<
"not get SD Manager!";
317 evNum = (*evt)()->GetEventID();
319 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis: =====> Begin of event = " <<
evNum;
323 if (aStep !=
nullptr) {
325 G4ThreeVector thePreStepPoint = aStep->GetPreStepPoint()->GetPosition();
326 G4ThreeVector thePostStepPoint;
329 G4Track* aTrack = aStep->GetTrack();
330 int trackID = aTrack->GetTrackID();
331 int parentID = aTrack->GetParentID();
332 const G4ThreeVector&
position = aTrack->GetPosition();
333 G4ThreeVector momentum = aTrack->GetMomentum();
334 G4String partType = aTrack->GetDefinition()->GetParticleType();
335 G4String partSubType = aTrack->GetDefinition()->GetParticleSubType();
336 int partPDGEncoding = aTrack->GetDefinition()->GetPDGEncoding();
338 bool isPDGStable = aTrack->GetDefinition()->GetPDGStable();
340 double pDGlifetime = aTrack->GetDefinition()->GetPDGLifeTime();
341 double gammaFactor = aStep->GetPreStepPoint()->GetGamma();
344 double stepDeltaEnergy = aStep->GetDeltaEnergy();
345 double kinEnergy = aTrack->GetKineticEnergy();
348 if (trackID == 1 && parentID == 0 && ((kinEnergy == 0.) || (fabs(stepDeltaEnergy / kinEnergy) > 0.1))) {
350 if (kinEnergy == 0.) {
353 if (fabs(stepDeltaEnergy / kinEnergy) > 0.1)
363 G4String thePostPVname =
"NoName";
364 G4StepPoint* thePostPoint = aStep->GetPostStepPoint();
366 thePostStepPoint = thePostPoint->GetPosition();
367 G4VPhysicalVolume* thePostPV = thePostPoint->GetPhysicalVolume();
369 thePostPVname = thePostPV->GetName();
372 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: V1 found at: " << thePostStepPoint
373 <<
" G4VPhysicalVolume: " << thePostPVname;
375 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis::fill_v1Pos: Primary Track " 380 if ((trackID != 1 && parentID == 1 && (aTrack->GetCurrentStepNumber() == 1) && (thePreStepPoint ==
pvPosition)) ||
381 (trackID == 1 && thePreStepPoint ==
pvPosition)) {
383 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis::A secondary... PDG:" << partPDGEncoding <<
" TrackID:" << trackID
384 <<
" ParentID:" << parentID <<
" stable: " << isPDGStable <<
" Tau: " << pDGlifetime
385 <<
" cTauGamma=" << c_light * pDGlifetime * gammaFactor * 1000. <<
"um" 386 <<
" GammaFactor: " << gammaFactor;
391 secEkin.push_back(aTrack->GetKineticEnergy());
394 double ctaugamma_um = c_light * pDGlifetime * gammaFactor * 1000.;
395 if ((ctaugamma_um > 0.) && (ctaugamma_um < 100.)) {
403 if (aTrack->GetCurrentStepNumber() == 1) {
408 std::vector<int>::iterator
pos;
409 for (pos = pos1; pos != pos2; pos++) {
413 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: A tertiary... PDG:" << partPDGEncoding
414 <<
" TrackID:" << trackID <<
" ParentID:" << parentID <<
" stable: " << isPDGStable
415 <<
" Tau: " << pDGlifetime
416 <<
" cTauGamma=" << c_light * pDGlifetime * gammaFactor * 1000.
417 <<
"um GammaFactor: " << gammaFactor;
431 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis::Fill event " << (*evt)()->GetEventID();
435 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis::Do QIE analysis with " <<
hcalHitCache.size() <<
" hits";
436 CLHEP::HepRandomEngine* engine = G4Random::getTheEngine();
441 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis::Do Xtal analysis with " <<
ecalHitCache.size() <<
" hits";
446 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis::Final analysis";
449 int iEvt = (*evt)()->GetEventID();
451 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis:: Event " << iEvt;
452 else if ((iEvt < 100) && (iEvt % 10 == 0))
453 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis:: Event " << iEvt;
454 else if ((iEvt < 1000) && (iEvt % 100 == 0))
455 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis:: Event " << iEvt;
456 else if ((iEvt < 10000) && (iEvt % 1000 == 0))
457 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis:: Event " << iEvt;
461 std::vector<CaloHit> hhits, hhitl;
464 std::map<int, float, std::less<int> > primaries;
465 double etot1 = 0, etot2 = 0;
468 G4HCofThisEvent* allHC = (*evt)()->GetHCofThisEvent();
470 idHC = G4SDManager::GetSDMpointer()->GetCollectionID(sdName);
472 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Hit Collection for " << sdName <<
" of ID " << idHC <<
" is obtained at " 475 if (idHC >= 0 && theHC !=
nullptr) {
476 hhits.reserve(theHC->entries());
477 hhitl.reserve(theHC->entries());
478 for (j = 0; j < theHC->entries(); j++) {
484 double theta = pos.theta();
486 double phi = pos.phi();
494 double escl = e *
scale(det, layer);
496 CaloHit hit(det, layer, escl, eta, phi, jitter, idx);
497 hhits.push_back(hit);
498 CaloHit hitl(det, layer, escl, eta, phi, jitter,
id);
499 hhitl.push_back(hitl);
503 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Hcal Hit i/p " << j <<
" ID 0x" << std::hex <<
id <<
" 0x" << idx
504 <<
std::dec <<
" time " << std::setw(6) << time <<
" " << std::setw(6) << jitter
505 <<
" theta " << std::setw(8) << theta <<
" eta " << std::setw(8) << eta <<
" phi " 506 << std::setw(8) << phi <<
" e " << std::setw(8) << e <<
" " << std::setw(8) << escl;
512 std::vector<CaloHit>::iterator itr;
513 int nHit = hhits.size();
514 std::vector<CaloHit*>
hits(nHit);
515 for (j = 0, itr = hhits.begin(); itr != hhits.end(); j++, itr++) {
519 std::vector<CaloHit*>::iterator k1, k2;
521 for (k1 = hits.begin(); k1 != hits.end(); k1++) {
522 int det = (**k1).det();
523 int layer = (**k1).layer();
524 double ehit = (**k1).e();
525 double eta = (**k1).eta();
526 double phi = (**k1).phi();
527 double jitter = (**k1).t();
528 uint32_t
unitID = (**k1).id();
530 for (k2 = k1 + 1; k2 != hits.end() && fabs(jitter - (**k2).t()) < 1 && unitID == (**k2).id(); k2++) {
535 CaloHit hit(det, layer, ehit, eta, phi, jitter, unitID);
540 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Hcal Hit store " << nhit <<
" ID 0x" << std::hex << unitID <<
std::dec 541 <<
" time " << std::setw(6) << jitter <<
" eta " << std::setw(8) << eta <<
" phi " 542 << std::setw(8) << phi <<
" e " << std::setw(8) << ehit;
545 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Stores " << nhit <<
" HCal hits" 546 <<
" from " << nHit <<
" input hits E(Hcal) " << etot1 <<
" " << etot2;
549 for (j = 0, itr = hhitl.begin(); itr != hhitl.end(); j++, itr++) {
555 for (k1 = hits.begin(); k1 != hits.end(); k1++) {
556 int det = (**k1).det();
557 int layer = (**k1).layer();
558 double ehit = (**k1).e();
559 double eta = (**k1).eta();
560 double phi = (**k1).phi();
561 double jitter = (**k1).t();
562 uint32_t
unitID = (**k1).id();
564 for (k2 = k1 + 1; k2 != hits.end() && fabs(jitter - (**k2).t()) < 1 && unitID == (**k2).id(); k2++) {
569 CaloHit hit(det, layer, ehit, eta, phi, jitter, unitID);
574 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Hcal Hit store " << nhitl <<
" ID 0x" << std::hex << unitID
575 <<
std::dec <<
" time " << std::setw(6) << jitter <<
" eta " << std::setw(8) << eta <<
" phi " 576 << std::setw(8) << phi <<
" e " << std::setw(8) << ehit;
579 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Stores " << nhitl <<
" HCal " 580 <<
"hits from " << nHit <<
" input hits E(Hcal) " << etot1 <<
" " << etotl;
583 std::vector<CaloHit> ehits;
585 idHC = G4SDManager::GetSDMpointer()->GetCollectionID(sdName);
588 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Hit Collection for " << sdName <<
" of ID " << idHC <<
" is obtained at " 590 if (idHC >= 0 && theHC !=
nullptr) {
591 ehits.reserve(theHC->entries());
592 for (j = 0; j < theHC->entries(); j++) {
598 double theta = pos.theta();
600 double phi = pos.phi();
601 if (e < 0 || e > 100000.)
606 ehits.push_back(hit);
610 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Ecal Hit i/p " << j <<
" ID 0x" << std::hex <<
id <<
std::dec 611 <<
" time " << std::setw(6) << time <<
" theta " << std::setw(8) << theta <<
" eta " 612 << std::setw(8) << eta <<
" phi " << std::setw(8) << phi <<
" e " << std::setw(8) <<
e;
619 std::vector<CaloHit*> hite(nHit);
620 for (j = 0, itr = ehits.begin(); itr != ehits.end(); j++, itr++) {
625 for (k1 = hite.begin(); k1 != hite.end(); k1++) {
626 int det = (**k1).det();
627 int layer = (**k1).layer();
628 double ehit = (**k1).e();
629 double eta = (**k1).eta();
630 double phi = (**k1).phi();
631 double jitter = (**k1).t();
632 uint32_t
unitID = (**k1).id();
634 for (k2 = k1 + 1; k2 != hite.end() && fabs(jitter - (**k2).t()) < 1 && unitID == (**k2).id(); k2++) {
639 CaloHit hit(det, layer, ehit, eta, phi, jitter, unitID);
644 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Ecal Hit store " << nhit <<
" ID 0x" << std::hex << unitID <<
std::dec 645 <<
" time " << std::setw(6) << jitter <<
" eta " << std::setw(8) << eta <<
" phi " 646 << std::setw(8) << phi <<
" e " << std::setw(8) << ehit;
649 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Stores " << nhit <<
" ECal hits" 650 <<
" from " << nHit <<
" input hits E(Ecal) " << etot1 <<
" " << etot2;
655 G4PrimaryParticle* thePrim =
nullptr;
656 int nvertex = (*evt)()->GetNumberOfPrimaryVertex();
657 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Event has " << nvertex <<
" verteices";
659 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis::EndOfEvent ERROR: no " 660 <<
"vertex found for event " <<
evNum;
662 for (
int i = 0;
i < nvertex;
i++) {
663 G4PrimaryVertex* avertex = (*evt)()->GetPrimaryVertex(
i);
664 if (avertex ==
nullptr) {
665 edm::LogInfo(
"HcalTBSim") <<
"HcalTB04Analysis::EndOfEvent ERR: pointer " 666 <<
"to vertex = 0 for event " <<
evNum;
668 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis::Vertex number :" <<
i <<
" " << avertex->GetPosition();
669 int npart = avertex->GetNumberOfParticle();
673 if (thePrim ==
nullptr)
674 thePrim = avertex->GetPrimary(trackID);
678 if (thePrim !=
nullptr) {
679 double px = thePrim->GetPx();
680 double py = thePrim->GetPy();
681 double pz = thePrim->GetPz();
686 <<
"primary has p=0 ";
688 double costheta = pz /
p;
691 if (px != 0 || py != 0)
696 edm::LogWarning(
"HcalTBSim") <<
"HcalTB04Analysis::EndOfEvent ERR: could " 697 <<
"not find primary";
704 std::vector<CaloHit>
hits(hittot);
707 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis::qieAnalysis: Size " << hits.size() <<
" " << todo.size() <<
" " 710 for (
unsigned int k1 = 0; k1 <
hcalHitCache.size(); k1++) {
712 uint32_t
id = hit.
id();
714 double esim = hit.
e();
716 for (
unsigned int k2 = k1 + 1; k2 <
hcalHitCache.size(); k2++) {
718 if (hit.
id() ==
id) {
728 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: ID 0x" << std::hex <<
id <<
std::dec <<
" registers " << esim
730 <<
"from " << nhit <<
" hits starting with hit # " << k1 <<
" energy with noise " <<
eq;
731 for (
int k2 = 0; k2 <
nTower; k2++) {
741 for (
int k2 = 0; k2 <
nTower; k2++) {
749 <<
esimh[k2] <<
" energy from hits and energy " 750 <<
"after QIE analysis " <<
eqie[k2];
757 CLHEP::RandGaussQ randGauss(*engine);
761 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis::xtalAnalysis: Size " << iok.size() <<
" " <<
idEcal.size() <<
" " 763 for (
unsigned int k1 = 0; k1 <
ecalHitCache.size(); k1++) {
767 for (
unsigned int k2 = k1 + 1; k2 <
ecalHitCache.size(); k2++) {
777 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: ID 0x" << std::hex <<
id <<
std::dec <<
" registers " << esim
779 <<
"from " << nhit <<
" hits starting with hit # " << k1 <<
" energy with noise " <<
eq;
781 for (
int k2 = 0; k2 <
nCrystal; k2++) {
791 for (
int k2 = 0; k2 <
nCrystal; k2++) {
796 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: ID 0x" << std::hex <<
idEcal[k2] <<
std::dec <<
" registers " 797 <<
esime[k2] <<
" energy from hits and energy from" 798 <<
" noise " <<
enois[k2];
820 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Energy deposit at Sim Level " 821 <<
"(Total) " <<
etots <<
" (ECal) " <<
eecals <<
" (HCal) " << ehcals
822 <<
"\nHcalTB04Analysis:: " 823 <<
"Energy deposit at Qie Level (Total) " <<
etotq <<
" (ECal) " <<
eecalq <<
" (HCal) " 828 for (
int i = 0;
i < 5;
i++) {
832 for (
int i = 0;
i < 3;
i++) {
836 double e1 = 0, e2 = 0;
849 ieta = ieta -
iceta + 2;
851 if (iphi >= 0 && iphi < 3 && ieta >= 0 && ieta < 5) {
860 for (
int i = 0;
i < 3;
i++) {
866 for (
int i = 0;
i < 5;
i++) {
872 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Energy fraction along Eta and" 874 for (
int i = 0;
i < 5;
i++)
875 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: [" <<
i <<
"] Eta Sim = " <<
eseta[
i] <<
" Qie = " <<
eqeta[
i]
880 for (
int i = 0;
i < 20;
i++) {
892 if (iphi >= 0 && iphi < 3 && layer >= 0 && layer < 20) {
899 for (
int i = 0;
i < 20;
i++) {
905 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Energy fraction along Layer";
906 for (
int i = 0;
i < 20;
i++)
907 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: [" <<
i <<
"] Sim = " <<
eslay[
i] <<
" Qie = " <<
eqlay[
i];
933 std::vector<CaloHit>::iterator itr;
935 uint32_t
id = itr->id();
938 product.
saveHit(det, lay, ieta, iphi, itr->e(), itr->t());
941 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Save Hit " << std::setw(3) << i + 1 <<
" ID 0x" << std::hex << group
942 <<
std::dec <<
" " << std::setw(2) << det <<
" " << std::setw(2) << lay <<
" " << std::setw(1)
943 << z <<
" " << std::setw(3) << ieta <<
" " << std::setw(3) << iphi <<
" T " << std::setw(6)
944 << itr->t() <<
" E " << std::setw(6) << itr->e();
947 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Saves " << nhit <<
" hits from Crystals";
952 uint32_t
id = itr->
id();
955 product.
saveHit(det, lay, ieta, iphi, itr->e(), itr->t());
958 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Save Hit " << std::setw(3) << i + 1 <<
" ID 0x" << std::hex << group
959 <<
std::dec <<
" " << std::setw(2) << det <<
" " << std::setw(2) << lay <<
" " << std::setw(1)
960 << z <<
" " << std::setw(3) << ieta <<
" " << std::setw(3) << iphi <<
" T " << std::setw(6)
961 << itr->t() <<
" E " << std::setw(6) << itr->e();
964 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis:: Saves " << nhit <<
" hits from HCal";
978 for (
unsigned int i = 0; i <
secTrackID.size(); i++) {
989 pvUVW = G4ThreeVector();
1007 esimh.push_back(0.);
1015 esime.push_back(0.);
1016 enois.push_back(0.);
1023 group = (det & 15) << 20;
1024 group += ((lay - 1) & 31) << 15;
1025 group += (z & 1) << 14;
1026 group += (ieta & 127) << 7;
1027 group += (iphi & 127);
1036 else if (layer == 17)
1038 else if (layer > 17)
1048 double theta = 2.0 * atan(
exp(-eta));
1051 const double rLay[19] = {1836.0,
1070 if (layer > 0 && layer <= 19)
1071 dist += rLay[layer - 1] * mm /
sin(theta);
1073 const double zLay[19] = {4034.0,
1092 if (layer > 0 && layer <= 19)
1093 dist += zLay[layer - 1] * mm /
cos(theta);
1096 double tmp = dist / c_light / ns;
1098 LogDebug(
"HcalTBSim") <<
"HcalTB04Analysis::timeOfFlight " << tmp <<
" for det/lay " << det <<
" " << layer
1099 <<
" eta/theta " << eta <<
" " << theta / deg <<
" dist " << dist;
T getParameter(std::string const &) const
#define DEFINE_SIMWATCHER(type)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< double > secEkin
void setLongProf(const std::vector< double > &es, const std::vector< double > &eq)
std::vector< int > idHcal
def fillEvent(tree, event)
void fillPrimary(double energy, double eta, double phi)
std::vector< CaloHit > hcalHitLayer
std::vector< double > eqeta
std::vector< double > eqie
void fillTrnsProf(const std::vector< double > &es1, const std::vector< double > &eq1, const std::vector< double > &es2, const std::vector< double > &eq2)
Sin< T >::type sin(const T &t)
void fillBuffer(const EndOfEvent *evt)
std::vector< int > shortLivedSecondaries
Geom::Theta< T > theta() const
std::vector< int > secTrackID
std::vector< double > eqphi
void setPrimary(int primary, int id, double energy, double eta, double phi)
void setNumberingScheme(HcalNumberingScheme *)
void update(const BeginOfRun *run) override
This routine will be called when the appropriate signal arrives.
void setEdep(double simtot, double sime, double simh, double digtot, double dige, double digh)
void setTrnsProf(const std::vector< double > &es1, const std::vector< double > &eq1, const std::vector< double > &es2, const std::vector< double > &eq2)
void saveHit(int det, int lay, int eta, int phi, double e, double t)
std::vector< int > secPartID
static uint32_t packHcalIndex(int det, int z, int depth, int eta, int phi, int lay)
std::vector< uint32_t > idEcal
std::vector< double > eseta
void setIDs(const std::vector< int > &, const std::vector< int > &)
void setVtxSec(int id, int pdg, double px, double py, double pz, double ek)
void setEdepHcal(const std::vector< double > &esim, const std::vector< double > &edig)
double getEnergy(const std::vector< int > &)
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
G4RotationMatrix * beamline_RM
std::vector< double > esime
static std::vector< uint32_t > getUnitIDs(const int type, const int mode)
double scale(int det, int layer)
std::vector< double > esphi
double timeOfFlight(int det, int layer, double eta)
std::vector< CaloHit > hcalHitCache
void xtalAnalysis(CLHEP::HepRandomEngine *)
static uint32_t getUnitID(const uint32_t id, const int mode)
HcalTB04Analysis(const edm::ParameterSet &p)
~HcalTB04Analysis() override
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< int > idXtal
std::vector< CaloHit > ecalHitCache
std::vector< double > enois
void setVtxPrim(int evNum, int type, double x, double y, double z, double u, double v, double w, double px, double py, double pz)
std::vector< G4ThreeVector > secMomentum
std::vector< int > getCode(int, const std::vector< CaloHit > &, CLHEP::HepRandomEngine *)
G4THitsCollection< CaloG4Hit > CaloG4HitCollection
static int position[264][3]
double getTimeSlice() const
std::vector< uint32_t > idTower
void qieAnalysis(CLHEP::HepRandomEngine *)
std::vector< double > eslay
math::XYZPoint getEntry() const
std::vector< double > eqlay
uint32_t getUnitID() const
void setNumberingScheme(EcalNumberingScheme *)
std::vector< std::string > names
Power< A, B >::type pow(const A &a, const B &b)
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)
void fillEdep(double etots, double eecals, double ehcals, double etotq, double eecalq, double ehcalq)
void fillEvent(PHcalTB04Info &)
double getEnergyDeposit() const
std::vector< double > esimh
void fillLongProf(const std::vector< double > &es, const std::vector< double > &eq)
void produce(edm::Event &, const edm::EventSetup &) override