13 edm::LogInfo(
"OutputInfo") <<
" Hcal RecHit Task histograms will NOT be saved";
41 if (eventype_ ==
"multi")
etype_ = 2;
44 if(sign_ ==
"-")
iz = -1;
45 if(sign_ ==
"*")
iz = 0;
126 if(
depth == 0){ sprintf (histo,
"N_HB" );}
127 else{ sprintf (histo,
"N_HB_depth%d",
depth );}
129 Nhb.push_back( ibooker.
book1D(histo, histo, NBins, 0., (
float)NBins) );
132 if(
depth == 0){ sprintf (histo,
"N_HE" );}
133 else{ sprintf (histo,
"N_HE_depth%d",
depth );}
135 Nhe.push_back( ibooker.
book1D(histo, histo, NBins,0., (
float)NBins) );
138 if(
depth == 0){ sprintf (histo,
"N_HO" );}
139 else{ sprintf (histo,
"N_HO_depth%d",
depth );}
141 Nho.push_back( ibooker.
book1D(histo, histo, NBins,0., (
float)NBins) );
144 if(
depth == 0){ sprintf (histo,
"N_HF" );}
145 else{ sprintf (histo,
"N_HF_depth%d",
depth );}
147 Nhf.push_back( ibooker.
book1D(histo, histo, NBins,0., (
float)NBins) );
158 sprintf (histo,
"emap_depth%d",
depth );
159 emap.push_back( ibooker.
book2D(histo, histo, 84, -42., 42., 72, 0., 72.) );
165 sprintf (histo,
"emean_vs_ieta_HB%d",
depth );
168 sprintf (histo,
"emean_vs_ieta_M0_HB%d",
depth );
171 sprintf (histo,
"emean_vs_ieta_M3_HB%d",
depth );
175 sprintf (histo,
"emean_vs_ieta_HE%d",
depth );
178 sprintf (histo,
"emean_vs_ieta_M0_HE%d",
depth );
181 sprintf (histo,
"emean_vs_ieta_M3_HE%d",
depth );
185 sprintf (histo,
"emean_vs_ieta_HF%d",
depth );
188 sprintf (histo,
"emean_vs_ieta_HO" );
195 sprintf (histo,
"occupancy_map_HB%d",
depth );
200 sprintf (histo,
"occupancy_map_HE%d",
depth );
204 sprintf (histo,
"occupancy_map_HO" );
208 sprintf (histo,
"occupancy_map_HF%d",
depth );
215 sprintf (histo,
"occupancy_vs_ieta_HB%d",
depth );
220 sprintf (histo,
"occupancy_vs_ieta_HE%d",
depth );
224 sprintf (histo,
"occupancy_vs_ieta_HO" );
228 sprintf (histo,
"occupancy_vs_ieta_HF%d",
depth );
234 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HB" ) ;
237 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HE" ) ;
240 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HF" ) ;
243 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWord_HO" ) ;
247 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HB" ) ;
250 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HE" ) ;
253 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HF" ) ;
256 sprintf (histo,
"HcalRecHitTask_RecHit_Aux_StatusWord_HO" ) ;
262 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWordCorr_HB");
265 sprintf (histo,
"HcalRecHitTask_RecHit_StatusWordCorr_HE");
273 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths");
276 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_E");
279 sprintf (histo,
"HcalRecHitTask_En_rechits_cone_profile_vs_ieta_all_depths_EH");
288 sprintf(histo,
"HcalRecHitTask_severityLevel_HB");
291 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HB" ) ;
294 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_M0_HB" ) ;
297 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_M3_HB" ) ;
300 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_M2vM0_HB" ) ;
303 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_M3vM0_HB" ) ;
306 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_M3vM2_HB" ) ;
309 sprintf (histo,
"HcalRecHitTask_M2Log10Chi2_of_rechits_HB" ) ;
312 sprintf (histo,
"HcalRecHitTask_timing_HB" ) ;
316 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HB" ) ;
319 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HB" ) ;
320 meTE_HB = ibooker.
book2D(histo, histo, 150, -5., 295., 70, -48., 92.);
322 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_High_HB" ) ;
325 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HB" ) ;
328 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HB" ) ;
331 sprintf (histo,
"HcalRecHitTask_Log10Chi2_vs_energy_profile_HB" ) ;
334 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HB" ) ;
344 sprintf(histo,
"HcalRecHitTask_severityLevel_HE");
347 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HE" ) ;
350 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_M0_HE" ) ;
353 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_M3_HE" ) ;
356 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_M2vM0_HE" ) ;
359 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_M3vM0_HE" ) ;
362 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_M2vM0_HE" ) ;
365 sprintf (histo,
"HcalRecHitTask_M2Log10Chi2_of_rechits_HE" ) ;
368 sprintf (histo,
"HcalRecHitTask_timing_HE" ) ;
371 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HE" ) ;
374 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HE" ) ;
375 meTE_HE = ibooker.
book2D(histo, histo, 200, -5., 395., 70, -48., 92.);
377 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HE" ) ;
380 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HE" ) ;
383 sprintf (histo,
"HcalRecHitTask_Log10Chi2_vs_energy_profile_HE" ) ;
394 sprintf(histo,
"HcalRecHitTask_severityLevel_HO");
397 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HO" ) ;
400 sprintf (histo,
"HcalRecHitTask_timing_HO" ) ;
403 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HO" ) ;
404 meTE_HO= ibooker.
book2D(histo, histo, 60, -5., 55., 70, -48., 92.);
406 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_High_HO" ) ;
409 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HO" ) ;
412 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_High_HO" ) ;
422 sprintf(histo,
"HcalRecHitTask_severityLevel_HF");
425 sprintf (histo,
"HcalRecHitTask_energy_of_rechits_HF" ) ;
428 sprintf (histo,
"HcalRecHitTask_timing_HF" ) ;
431 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_Low_HF" ) ;
434 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_HF" ) ;
435 meTE_HF = ibooker.
book2D(histo, histo, 200, -5., 995., 70, -48., 92.);
437 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_Low_HF" ) ;
440 sprintf (histo,
"HcalRecHitTask_timing_vs_energy_profile_HF" ) ;
459 int nrechitsThresh = 0;
465 double eEcalCone = 0.;
472 double etaHot = 99999.;
473 double phiHot = 99999.;
530 for (; RecHit != RecHitEnd ; ++RecHit) {
532 double en = RecHit->energy();
544 RecHit = rhitEE.
product()->begin();
545 RecHitEnd = rhitEE.
product()->end();
547 for (; RecHit != RecHitEnd ; ++RecHit) {
549 double en = RecHit->energy();
567 for (
unsigned int i = 0;
i <
cen.size();
i++) {
583 if( depth < 1 )
continue;
589 if( sub ==1 ){ nhb_v[
depth]++; nhb_v[0]++;}
590 if( sub ==2 ){ nhe_v[
depth]++; nhe_v[0]++;}
591 if( sub ==3 ){ nho_v[
depth]++; nho_v[0]++;}
592 if( sub ==4 ){ nhf_v[
depth]++; nhf_v[0]++;}
601 if (ieta2 < 0) ieta2--;
605 emap[depth2-1]->Fill(
double(ieta2),
double(iphi),en);
608 if( depth == 1 || depth == 2 ) {
611 if (ieta1 < 0) ieta1--;
642 unsigned int isw67 = 0;
645 unsigned int sw27 = 27;
646 unsigned int sw13 = 13;
648 uint32_t statadd27 = 0x1<<sw27;
649 uint32_t statadd13 = 0x1<<sw13;
654 if(stwd & statadd27) status27 = 1;
655 if(stwd & statadd13) status13 = 1;
659 }
else if (sub == 2){
664 for (
unsigned int isw = 0; isw < 32; isw++){
665 statadd = 0x1<<(isw);
672 if (isw == 6) isw67 += 1;
673 if (isw == 7) isw67 += 2;
678 for (
unsigned int isw =0; isw < 32; isw++){
679 statadd = 0x1<<(isw);
680 if( auxstwd & statadd ){
692 for(
int depth = 0; depth <=
maxDepthHE_; depth++)
Nhe[depth]->
Fill(
double(nhe_v[depth]));
693 for(
int depth = 0; depth <=
maxDepthHO_; depth++)
Nho[depth]->
Fill(
double(nho_v[depth]));
694 for(
int depth = 0; depth <=
maxDepthHF_; depth++)
Nhf[depth]->
Fill(
double(nhf_v[depth]));
702 double clusEta = 999.;
703 double clusPhi = 999.;
706 double HcalCone = 0.;
718 for (
unsigned int i = 0;
i <
cen.size();
i++) {
729 double rhot =
dR(etaHot, phiHot, eta, phi);
730 if(rhot < partR && en > 1.) {
731 clusEta = (clusEta * clusEn + eta * en)/(clusEn + en);
732 clusPhi =
phi12(clusPhi, clusEn, phi, en);
739 if(en > 1. ) nrechitsThresh++;
844 if( subdet_ == 1 || subdet_ == 2 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
853 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
854 double eta = cellGeometry->getPosition().eta () ;
855 double phi = cellGeometry->getPosition().phi () ;
856 double zc = cellGeometry->getPosition().z ();
857 int sub = cell.subdet();
858 int depth = cell.depth();
859 int inteta = cell.ieta();
860 int intphi = cell.iphi();
861 double en =
j->energy();
862 double enM0 =
j->eraw();
863 double enM3 =
j->eaux();
864 double chi2 =
j->chi2();
865 double t =
j->time();
866 int stwd =
j->flags();
867 int auxstwd =
j->aux();
876 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
880 cenM0.push_back(enM0);
881 cenM3.push_back(enM3);
882 cchi2.push_back(chi2);
886 cieta.push_back(inteta);
887 ciphi.push_back(intphi);
890 cstwd.push_back(stwd);
897 if( subdet_ == 4 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
906 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
907 double eta = cellGeometry->getPosition().eta () ;
908 double phi = cellGeometry->getPosition().phi () ;
909 double zc = cellGeometry->getPosition().z ();
910 int sub = cell.subdet();
911 int depth = cell.depth();
912 int inteta = cell.ieta();
913 int intphi = cell.iphi();
914 double en =
j->energy();
918 double t =
j->time();
919 int stwd =
j->flags();
920 int auxstwd =
j->aux();
927 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
931 cenM0.push_back(enM0);
932 cenM3.push_back(enM3);
933 cchi2.push_back(chi2);
937 cieta.push_back(inteta);
938 ciphi.push_back(intphi);
941 cstwd.push_back(stwd);
948 if( subdet_ == 3 || subdet_ == 5 || subdet_ == 6 || subdet_ == 0) {
956 geometry->getSubdetectorGeometry (cell)->getGeometry (cell) ;
957 double eta = cellGeometry->getPosition().eta () ;
958 double phi = cellGeometry->getPosition().phi () ;
959 double zc = cellGeometry->getPosition().z ();
960 int sub = cell.subdet();
961 int depth = cell.depth();
962 int inteta = cell.ieta();
963 int intphi = cell.iphi();
964 double t =
j->time();
965 double en =
j->energy();
969 int stwd =
j->flags();
970 int auxstwd =
j->aux();
977 if((
iz > 0 && eta > 0.) || (
iz < 0 && eta <0.) ||
iz == 0) {
980 cenM0.push_back(enM0);
981 cenM3.push_back(enM3);
982 cchi2.push_back(chi2);
986 cieta.push_back(inteta);
987 ciphi.push_back(intphi);
990 cstwd.push_back(stwd);
998 double PI = 3.1415926535898;
999 double deltaphi= phi1 - phi2;
1000 if( phi2 > phi1 ) { deltaphi= phi2 - phi1;}
1001 if(deltaphi > PI) { deltaphi = 2.*PI - deltaphi;}
1002 double deltaeta = eta2 - eta1;
1003 double tmp =
sqrt(deltaeta* deltaeta + deltaphi*deltaphi);
1011 double PI = 3.1415926535898;
1012 double a1 = phi1;
double a2 = phi2;
1014 if( a1 > 0.5*PI && a2 < 0.) a2 += 2*
PI;
1015 if( a2 > 0.5*PI && a1 < 0.) a1 += 2*
PI;
1016 tmp = (a1 * en1 + a2 * en2)/(en1 + en2);
1017 if(tmp > PI) tmp -= 2.*
PI;
1027 double PI = 3.1415926535898;
1028 double a1 = phi1;
double a2 = phi2;
1029 double tmp = a2 - a1;
1031 if(a1 > 0.5 * PI) tmp += 2.*
PI;
1032 if(a2 > 0.5 * PI) tmp -= 2.*
PI;
1042 const uint32_t recHitFlag = hit->
flags();
1047 return severityLevel;
int getNPhi(const int type) const
std::string hcalselector_
MonitorElement * sevLvl_HF
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
MonitorElement * sevLvl_HE
MonitorElement * RecHit_Aux_StatusWord_HO
MonitorElement * bookProfile(Args &&...args)
unsigned int getHxSize(const int type) const
double dPhiWsign(double phi1, double phi2)
const DetId & detid() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * meTE_Low_HE
#define DEFINE_FWK_MODULE(type)
std::vector< MonitorElement * > Nhb
MonitorElement * meRecHitsEnergyHEM3
std::vector< int > cdepth
int hcalSevLvl(const CaloRecHit *hit)
std::vector< EcalRecHit >::const_iterator const_iterator
std::vector< int > hcalHBSevLvlVec
std::vector< MonitorElement * > emap
MonitorElement * occupancy_map_HO
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< MonitorElement * > emean_vs_ieta_HBM3
std::vector< double > ceta
edm::EDGetTokenT< EBRecHitCollection > tok_EB_
MonitorElement * meEnConeEtaProfile_EH
std::vector< MonitorElement * > emean_vs_ieta_HBM0
std::vector< MonitorElement * > emean_vs_ieta_HF
std::vector< int > hcalHESevLvlVec
double phi12(double phi1, double en1, double phi2, double en2)
MonitorElement * meRecHitsEnergyM3vM0HE
MonitorElement * meTE_Low_HB
MonitorElement * meTEprofileHF_Low
const HcalSeverityLevelComputer * theHcalSevLvlComputer
MonitorElement * meRecHitsEnergyM2vM0HB
MonitorElement * sevLvl_HO
virtual void fillRecHitsTmp(int subdet_, edm::Event const &ev)
int getMaxDepth(const int type) const
std::vector< MonitorElement * > Nhe
std::vector< MonitorElement * > emean_vs_ieta_HEM0
MonitorElement * meRecHitsEnergyM2vM0HE
std::vector< MonitorElement * > occupancy_vs_ieta_HF
const HcalChannelQuality * theHcalChStatus
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * meEnConeEtaProfile_E
MonitorElement * meTEprofileHO
std::string ecalselector_
MonitorElement * meTEprofileHB
edm::EDGetTokenT< HORecHitCollection > tok_ho_
std::vector< double > cchi2
MonitorElement * meLog10Chi2profileHE
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
MonitorElement * emean_vs_ieta_HO
MonitorElement * sevLvl_HB
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< MonitorElement * > occupancy_vs_ieta_HB
MonitorElement * meTimeHE
MonitorElement * meTimeHO
MonitorElement * meRecHitsEnergyHF
std::vector< MonitorElement * > emean_vs_ieta_HB
std::vector< double > cenM3
HcalRecHitsAnalyzer(edm::ParameterSet const &conf)
MonitorElement * meEnConeEtaProfile
MonitorElement * meTEprofileHE
void setCurrentFolder(const std::string &fullpath)
std::vector< uint32_t > cstwd
std::vector< MonitorElement * > Nho
std::vector< MonitorElement * > occupancy_map_HE
T const * product() const
MonitorElement * book2D(Args &&...args)
MonitorElement * RecHit_Aux_StatusWord_HB
virtual void analyze(edm::Event const &ev, edm::EventSetup const &c) override
virtual void dqmBeginRun(const edm::Run &run, const edm::EventSetup &c) override
T const * product() const
MonitorElement * meRecHitsEnergyM3vM2HB
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
MonitorElement * meLog10Chi2profileHB
std::pair< int, int > getEtaRange(const int i) const
virtual 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
std::vector< MonitorElement * > emean_vs_ieta_HEM3
const HcalDDDRecConstants * hcons
MonitorElement * meTEprofileHB_Low
edm::EDGetTokenT< EERecHitCollection > tok_EE_
std::vector< double > ctime
std::vector< double > cen
MonitorElement * meRecHitsEnergyM3vM0HB
MonitorElement * meRecHitsEnergyHBM3
std::vector< double > cenM0
MonitorElement * RecHit_StatusWordCorr_HE
std::vector< MonitorElement * > occupancy_map_HF
MonitorElement * meTimeHB
std::vector< MonitorElement * > occupancy_map_HB
MonitorElement * meTEprofileHF
MonitorElement * RecHit_Aux_StatusWord_HF
MonitorElement * RecHit_Aux_StatusWord_HE
uint32_t getValue() const
MonitorElement * RecHit_StatusWordCorr_HB
std::vector< MonitorElement * > Nhf
std::vector< MonitorElement * > occupancy_vs_ieta_HE
edm::ESHandle< CaloGeometry > geometry
std::vector< MonitorElement * > emean_vs_ieta_HE
MonitorElement * meRecHitsEnergyHE
MonitorElement * meTE_Low_HF