7 : topFolderName_(conf.getParameter<
std::
string>(
"TopFolderName")) {
14 edm::LogInfo(
"OutputInfo") <<
" Hcal RecHit Task histograms will NOT be saved";
54 if (eventype_ ==
"multi")
149 sprintf(histo,
"N_HB");
151 sprintf(histo,
"N_HB_depth%d",
depth);
154 Nhb.push_back(ibooker.
book1D(histo, histo, NBins, 0., (
float)NBins));
158 sprintf(histo,
"N_HE");
160 sprintf(histo,
"N_HE_depth%d",
depth);
163 Nhe.push_back(ibooker.
book1D(histo, histo, NBins, 0., (
float)NBins));
167 sprintf(histo,
"N_HO");
169 sprintf(histo,
"N_HO_depth%d",
depth);
172 Nho.push_back(ibooker.
book1D(histo, histo, NBins, 0., (
float)NBins));
176 sprintf(histo,
"N_HF");
178 sprintf(histo,
"N_HF_depth%d",
depth);
181 Nhf.push_back(ibooker.
book1D(histo, histo, NBins, 0., (
float)NBins));
191 sprintf(histo,
"emap_depth%d",
depth);
194 sprintf(histo,
"emap_HO");
200 sprintf(histo,
"emean_vs_ieta_HB%d",
depth);
203 sprintf(histo,
"emean_vs_ieta_M0_HB%d",
depth);
207 sprintf(histo,
"emean_vs_ieta_M3_HB%d",
depth);
212 sprintf(histo,
"emean_vs_ieta_HE%d",
depth);
215 sprintf(histo,
"emean_vs_ieta_M0_HE%d",
depth);
219 sprintf(histo,
"emean_vs_ieta_M3_HE%d",
depth);
226 sprintf(histo,
"emean_vs_ieta_HEP17_depth%d",
depth);
230 sprintf(histo,
"emean_vs_ieta_M0_HEP17_depth%d",
depth);
234 sprintf(histo,
"emean_vs_ieta_M3_HEP17_depth%d",
depth);
241 sprintf(histo,
"emean_vs_ieta_HF%d",
depth);
244 sprintf(histo,
"emean_vs_ieta_HO");
251 sprintf(histo,
"occupancy_map_HB%d",
depth);
257 sprintf(histo,
"occupancy_map_HE%d",
depth);
262 sprintf(histo,
"occupancy_map_HO");
266 sprintf(histo,
"occupancy_map_HF%d",
depth);
273 sprintf(histo,
"occupancy_vs_ieta_HB%d",
depth);
275 sprintf(histo,
"nrechits_vs_iphi_HBP_d%d",
depth);
277 sprintf(histo,
"nrechits_vs_iphi_HBM_d%d",
depth);
282 sprintf(histo,
"occupancy_vs_ieta_HE%d",
depth);
284 sprintf(histo,
"nrechits_vs_iphi_HEP_d%d",
depth);
286 sprintf(histo,
"nrechits_vs_iphi_HEM_d%d",
depth);
290 sprintf(histo,
"occupancy_vs_ieta_HO");
292 sprintf(histo,
"nrechits_vs_iphi_HOP");
294 sprintf(histo,
"nrechits_vs_iphi_HOM");
298 sprintf(histo,
"occupancy_vs_ieta_HF%d",
depth);
300 sprintf(histo,
"nrechits_vs_iphi_HFP_d%d",
depth);
302 sprintf(histo,
"nrechits_vs_iphi_HFM_d%d",
depth);
307 sprintf(histo,
"HcalRecHitTask_RecHit_StatusWord_HB");
310 sprintf(histo,
"HcalRecHitTask_RecHit_StatusWord_HE");
313 sprintf(histo,
"HcalRecHitTask_RecHit_StatusWord_HF");
316 sprintf(histo,
"HcalRecHitTask_RecHit_StatusWord_HO");
320 sprintf(histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HB");
323 sprintf(histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HE");
326 sprintf(histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HF");
329 sprintf(histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HO");
335 sprintf(histo,
"HcalRecHitTask_RecHit_StatusWordCorr_HB");
338 sprintf(histo,
"HcalRecHitTask_RecHit_StatusWordCorr_HE");
345 sprintf(histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths");
348 sprintf(histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_E");
351 sprintf(histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_EH");
360 sprintf(histo,
"HcalRecHitTask_severityLevel_HB");
363 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_HB");
366 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M0_HB");
369 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M3_HB");
372 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M2vM0_HB");
375 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M3vM0_HB");
378 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M3vM2_HB");
381 sprintf(histo,
"HcalRecHitTask_M2Log10Chi2_of_rechits_HB");
384 sprintf(histo,
"HcalRecHitTask_timing_HB");
388 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_Low_HB");
391 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_HB");
392 meTE_HB = ibooker.
book2D(histo, histo, 150, -5., 295., 70, -48., 92.);
394 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_High_HB");
397 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HB");
400 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_profile_HB");
403 sprintf(histo,
"HcalRecHitTask_Log10Chi2_vs_energy_profile_HB");
406 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HB");
414 sprintf(histo,
"HcalRecHitTask_severityLevel_HE");
417 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_HE");
420 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M0_HE");
423 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M3_HE");
427 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_HEP17");
430 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M0_HEP17");
433 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M3_HEP17");
436 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_HEP17_depth%d",
depth);
439 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M0_HEP17_depth%d",
depth);
442 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M3_HEP17_depth%d",
depth);
447 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M2vM0_HE");
450 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M3vM0_HE");
453 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_M3vM2_HE");
456 sprintf(histo,
"HcalRecHitTask_M2Log10Chi2_of_rechits_HE");
459 sprintf(histo,
"HcalRecHitTask_timing_HE");
462 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_Low_HE");
465 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_HE");
466 meTE_HE = ibooker.
book2D(histo, histo, 200, -5., 395., 70, -48., 92.);
468 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HE");
471 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_profile_HE");
474 sprintf(histo,
"HcalRecHitTask_Log10Chi2_vs_energy_profile_HE");
483 sprintf(histo,
"HcalRecHitTask_severityLevel_HO");
486 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_HO");
489 sprintf(histo,
"HcalRecHitTask_timing_HO");
492 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_HO");
493 meTE_HO = ibooker.
book2D(histo, histo, 60, -5., 55., 70, -48., 92.);
495 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_High_HO");
498 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_profile_HO");
501 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HO");
510 sprintf(histo,
"HcalRecHitTask_severityLevel_HF");
513 sprintf(histo,
"HcalRecHitTask_energy_of_rechits_HF");
516 sprintf(histo,
"HcalRecHitTask_timing_HF");
519 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_Low_HF");
522 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_HF");
523 meTE_HF = ibooker.
book2D(histo, histo, 200, -5., 995., 70, -48., 92.);
525 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HF");
528 sprintf(histo,
"HcalRecHitTask_timing_vs_energy_profile_HF");
543 int nrechitsThresh = 0;
549 double eEcalCone = 0.;
556 double etaHot = 99999.;
557 double phiHot = 99999.;
614 double en =
recHit.energy();
623 double en =
recHit.energy();
640 for (
unsigned int i = 0;
i <
cen.size();
i++) {
655 bool isHEP17 = (sub == 2) && (iphi >= 63) && (iphi <= 66) && (ieta > 0) && (
hep17_);
702 emap[depth2 - 1]->Fill(
double(ieta2),
double(iphi), en);
705 if (depth == 1 || depth == 2) {
761 unsigned int isw67 = 0;
764 unsigned int sw27 = 27;
765 unsigned int sw13 = 13;
767 uint32_t statadd27 = 0x1 << sw27;
768 uint32_t statadd13 = 0x1 << sw13;
773 if (stwd & statadd27)
775 if (stwd & statadd13)
780 }
else if (sub == 2) {
784 for (
unsigned int isw = 0; isw < 32; isw++) {
785 statadd = 0x1 << (isw);
786 if (stwd & statadd) {
803 for (
unsigned int isw = 0; isw < 32; isw++) {
804 statadd = 0x1 << (isw);
805 if (auxstwd & statadd) {
821 Nhe[depth]->
Fill(
double(nhe_v[depth]));
823 Nho[depth]->
Fill(
double(nho_v[depth]));
825 Nhf[depth]->
Fill(
double(nhf_v[depth]));
832 double clusEta = 999.;
833 double clusPhi = 999.;
836 double HcalCone = 0.;
848 for (
unsigned int i = 0;
i <
cen.size();
i++) {
858 double chi2_log10 = 9.99;
860 chi2_log10 = log10(chi2);
864 bool isHEP17 = (sub == 2) && (iphi >= 63) && (iphi <= 66) && (ieta > 0) && (
hep17_);
868 double rhot =
dR(etaHot, phiHot, eta, phi);
869 if (rhot < partR && en > 1.) {
870 clusEta = (clusEta * clusEn + eta * en) / (clusEn + en);
871 clusPhi =
phi12(clusPhi, clusEn, phi, en);
989 if (subdet_ == 1 || subdet_ == 2 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
996 double eta = cellGeometry->getPosition(cell).eta();
997 double phi = cellGeometry->getPosition(cell).phi();
998 double zc = cellGeometry->getPosition(cell).z();
999 int sub = cell.subdet();
1000 int depth = cell.depth();
1001 int inteta = cell.ieta();
1002 int intphi = cell.iphi();
1003 double en = j->energy();
1004 double enM0 = j->eraw();
1005 double enM3 = j->eaux();
1006 double chi2 = j->chi2();
1007 double t = j->time();
1008 int stwd = j->flags();
1009 int auxstwd = j->aux();
1018 if ((
iz > 0 && eta > 0.) || (
iz < 0 && eta < 0.) ||
iz == 0) {
1019 csub.push_back(sub);
1021 cenM0.push_back(enM0);
1022 cenM3.push_back(enM3);
1023 cchi2.push_back(chi2);
1024 ceta.push_back(eta);
1025 cphi.push_back(phi);
1027 cieta.push_back(inteta);
1028 ciphi.push_back(intphi);
1031 cstwd.push_back(stwd);
1038 if (subdet_ == 4 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
1045 double eta = cellGeometry->getPosition().eta();
1046 double phi = cellGeometry->getPosition().phi();
1047 double zc = cellGeometry->getPosition().z();
1048 int sub = cell.subdet();
1049 int depth = cell.depth();
1050 int inteta = cell.ieta();
1051 int intphi = cell.iphi();
1052 double en = j->energy();
1056 double t = j->time();
1057 int stwd = j->flags();
1058 int auxstwd = j->aux();
1065 if ((
iz > 0 && eta > 0.) || (
iz < 0 && eta < 0.) ||
iz == 0) {
1066 csub.push_back(sub);
1068 cenM0.push_back(enM0);
1069 cenM3.push_back(enM3);
1070 cchi2.push_back(chi2);
1071 ceta.push_back(eta);
1072 cphi.push_back(phi);
1074 cieta.push_back(inteta);
1075 ciphi.push_back(intphi);
1078 cstwd.push_back(stwd);
1086 if (subdet_ == 3 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
1092 double eta = cellGeometry->getPosition().eta();
1093 double phi = cellGeometry->getPosition().phi();
1094 double zc = cellGeometry->getPosition().z();
1095 int sub = cell.subdet();
1096 int depth = cell.depth();
1097 int inteta = cell.ieta();
1098 int intphi = cell.iphi();
1099 double t = j->time();
1100 double en = j->energy();
1104 int stwd = j->flags();
1105 int auxstwd = j->aux();
1112 if ((
iz > 0 && eta > 0.) || (
iz < 0 && eta < 0.) ||
iz == 0) {
1113 csub.push_back(sub);
1115 cenM0.push_back(enM0);
1116 cenM3.push_back(enM3);
1117 cchi2.push_back(chi2);
1118 ceta.push_back(eta);
1119 cphi.push_back(phi);
1121 cieta.push_back(inteta);
1122 ciphi.push_back(intphi);
1125 cstwd.push_back(stwd);
1134 double PI = 3.1415926535898;
1135 double deltaphi = phi1 - phi2;
1137 deltaphi = phi2 - phi1;
1139 if (deltaphi > PI) {
1140 deltaphi = 2. * PI - deltaphi;
1142 double deltaeta = eta2 - eta1;
1143 double tmp =
sqrt(deltaeta * deltaeta + deltaphi * deltaphi);
1151 double PI = 3.1415926535898;
1155 if (a1 > 0.5 * PI && a2 < 0.)
1157 if (a2 > 0.5 * PI && a1 < 0.)
1159 tmp = (a1 * en1 + a2 * en2) / (en1 + en2);
1170 double PI = 3.1415926535898;
1173 double tmp = a2 - a1;
1189 const uint32_t recHitFlag = hit->
flags();
std::string hcalselector_
MonitorElement * nrechits_vs_iphi_HOP
MonitorElement * sevLvl_HF
std::vector< MonitorElement * > emean_vs_ieta_HEP17M3
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meTEprofileHB_High
MonitorElement * RecHit_StatusWord_HE
MonitorElement * meRecHitsM2Chi2HB
MonitorElement * meTimeHF
std::vector< double > cphi
std::vector< int > hcalHOSevLvlVec
double dR(double eta1, double phi1, double eta2, double phi2)
MonitorElement * RecHit_StatusWord_HF
MonitorElement * meRecHitsEnergyM3vM2HE
std::vector< MonitorElement * > Nho
std::vector< MonitorElement * > emean_vs_ieta_HBM3
MonitorElement * sevLvl_HE
std::vector< MonitorElement * > occupancy_vs_ieta_HB
MonitorElement * RecHit_Aux_StatusWord_HO
MonitorElement * bookProfile(Args &&...args)
unsigned int getHxSize(const int type) const
double dPhiWsign(double phi1, double phi2)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * meTE_Low_HE
constexpr const DetId & detid() const
MonitorElement * meRecHitsEnergyHEM3
std::vector< int > cdepth
std::vector< MonitorElement * > occupancy_map_HE
const HcalTopology * theHcalTopology
int hcalSevLvl(const CaloRecHit *hit)
std::vector< T >::const_iterator const_iterator
std::vector< int > hcalHBSevLvlVec
MonitorElement * occupancy_map_HO
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< MonitorElement * > occupancy_map_HF
std::vector< double > ceta
edm::EDGetTokenT< EBRecHitCollection > tok_EB_
MonitorElement * meEnConeEtaProfile_EH
CaloGeometry const * getGeometry()
std::vector< int > hcalHESevLvlVec
double phi12(double phi1, double en1, double phi2, double en2)
bool getMergePositionFlag() const
MonitorElement * meRecHitsEnergyM3vM0HE
std::vector< MonitorElement * > Nhe
MonitorElement * meTE_Low_HB
std::pair< int, int > getEtaRange(const int &i) const
MonitorElement * meTEprofileHF_Low
const HcalSeverityLevelComputer * theHcalSevLvlComputer
std::vector< MonitorElement * > Nhf
MonitorElement * meRecHitsEnergyM2vM0HB
std::vector< MonitorElement * > nrechits_vs_iphi_HEP
MonitorElement * sevLvl_HO
virtual void fillRecHitsTmp(int subdet_, edm::Event const &ev)
std::vector< MonitorElement * > emean_vs_ieta_HEP17
std::vector< MonitorElement * > emean_vs_ieta_HBM0
MonitorElement * meRecHitsEnergyM2vM0HE
std::vector< MonitorElement * > occupancy_vs_ieta_HF
std::vector< MonitorElement * > occupancy_vs_ieta_HE
#define DEFINE_FWK_MODULE(type)
std::vector< MonitorElement * > emean_vs_ieta_HB
void setCurrentFolder(std::string const &fullpath)
const HcalChannelQuality * theHcalChStatus
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::vector< MonitorElement * > occupancy_map_HB
MonitorElement * meEnConeEtaProfile_E
std::vector< MonitorElement * > emap
std::vector< MonitorElement * > nrechits_vs_iphi_HFP
MonitorElement * meTEprofileHO
std::string ecalselector_
MonitorElement * meTEprofileHB
edm::EDGetTokenT< HORecHitCollection > tok_ho_
std::vector< double > cchi2
MonitorElement * meLog10Chi2profileHE
std::vector< MonitorElement * > nrechits_vs_iphi_HFM
MonitorElement * book1D(Args &&...args)
MonitorElement * meRecHitsEnergyHBM0
MonitorElement * meTE_High_HO
MonitorElement * meRecHitsEnergyHO
MonitorElement * meRecHitsM2Chi2HE
std::vector< uint32_t > cauxstwd
MonitorElement * meRecHitsEnergyHEM0
MonitorElement * occupancy_vs_ieta_HO
MonitorElement * meTEprofileHE_Low
MonitorElement * RecHit_StatusWord_HO
MonitorElement * meRecHitsEnergyHB
std::vector< MonitorElement * > emean_vs_ieta_HE
MonitorElement * nrechits_vs_iphi_HOM
MonitorElement * emean_vs_ieta_HO
MonitorElement * sevLvl_HB
std::vector< MonitorElement * > emean_vs_ieta_HEP17M0
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< MonitorElement * > nrechits_vs_iphi_HBP
const_iterator end() const
MonitorElement * meTimeHE
std::vector< MonitorElement * > nrechits_vs_iphi_HEM
MonitorElement * meTimeHO
MonitorElement * meRecHitsEnergyHF
std::vector< double > cenM3
HcalRecHitsAnalyzer(edm::ParameterSet const &conf)
MonitorElement * meEnConeEtaProfile
std::vector< MonitorElement * > emean_vs_ieta_HEM3
std::string topFolderName_
MonitorElement * meTEprofileHE
std::vector< uint32_t > cstwd
T const * product() const
MonitorElement * book2D(Args &&...args)
std::vector< MonitorElement * > meRecHitsEnergyHEP17
MonitorElement * RecHit_Aux_StatusWord_HB
void analyze(edm::Event const &ev, edm::EventSetup const &c) override
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &c) override
int getMaxDepth(const int &type) const
std::vector< MonitorElement * > emean_vs_ieta_HF
MonitorElement * meRecHitsEnergyM3vM2HB
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
std::vector< MonitorElement * > meRecHitsEnergyHEP17M0
MonitorElement * meLog10Chi2profileHB
std::vector< MonitorElement * > nrechits_vs_iphi_HBM
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< std::vector< double > > tmp
MonitorElement * meTE_High_HB
std::vector< int > hcalHFSevLvlVec
MonitorElement * RecHit_StatusWord_HB
MonitorElement * meTEprofileHO_High
const HcalDDDRecConstants * hcons
MonitorElement * meTEprofileHB_Low
edm::EDGetTokenT< EERecHitCollection > tok_EE_
std::vector< MonitorElement * > Nhb
std::vector< double > ctime
std::vector< double > cen
MonitorElement * meRecHitsEnergyM3vM0HB
HcalDetId idFront(const HcalDetId &id) const
MonitorElement * meRecHitsEnergyHBM3
std::vector< double > cenM0
MonitorElement * RecHit_StatusWordCorr_HE
MonitorElement * meTimeHB
MonitorElement * meTEprofileHF
MonitorElement * RecHit_Aux_StatusWord_HF
MonitorElement * RecHit_Aux_StatusWord_HE
uint32_t getValue() const
MonitorElement * book1DD(Args &&...args)
T const * product() const
constexpr uint32_t flags() const
MonitorElement * RecHit_StatusWordCorr_HB
std::vector< MonitorElement * > meRecHitsEnergyHEP17M3
edm::ESHandle< CaloGeometry > geometry
const_iterator begin() const
int getNPhi(const int &type) const
std::vector< MonitorElement * > emean_vs_ieta_HEM0
MonitorElement * meRecHitsEnergyHE
MonitorElement * meTE_Low_HF