13 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
14 prefixME_.append(
"/");
121 std::cout <<
"<HcalHotCellMonitor::setup> Setting up histograms"<<std::endl;
126 me=ib.
bookFloat(
"minErrorFractionPerLumiSection");
132 "Total Number of Hot Hcal Cells vs lumi section",
136 "Total Number of Hot HB Cells vs lumi section",
139 "Total Number of Hot HE Cells vs lumi section",
142 "Total Number of Hot HO Cells vs lumi section",
145 "Total Number of Hot HF Cells vs lumi section",
148 "Total Number of Hot HBHEHF Cells vs lumi section",
159 std::stringstream
units;
162 me=ib.
bookInt(
"HotCellAboveThresholdTestEnabled");
169 "Hot Cells Above Energy Threshold",
"");
191 "Hot Cells Above ET Threshold",
"");
199 units<<
"Hot Cells: Depth 2 -- HB > "<<
HBETThreshold_<<
" GeV (ET), HE > "<<
HEETThreshold_<<
" GeV (ET), HF > "<<HFETThreshold_<<
" GeV (ET)";
202 units<<
"Hot Cells: Depth 3 -- HE > "<<
HEETThreshold_<<
" GeV (ET)";
211 me=ib.
bookInt(
"PersistentHotCellTestEnabled");
216 me=ib.
bookInt(
"minEventsPerLS");
221 "Hot Cells Persistently Above Energy Threshold",
"");
242 "Hot Cells Persistently Above ET Threshold",
"");
263 me=ib.
bookInt(
"NeighborTestEnabled");
272 d_HBenergyVsNeighbor=ib.
book1D(
"NeighborSumOverEnergyHB",
"HB Neighbor Sum Energy/Cell Energy;sum(neighbors)/E_cell",500,0,10);
273 d_HEenergyVsNeighbor=ib.
book1D(
"NeighborSumOverEnergyHE",
"HE Neighbor Sum Energy/Cell Energy;sum(neighbors)/E_cell",500,0,10);
274 d_HOenergyVsNeighbor=ib.
book1D(
"NeighborSumOverEnergyHO",
"HO Neighbor Sum Energy/Cell Energy;sum(neighbors)/E_cell",500,0,10);
275 d_HFenergyVsNeighbor=ib.
book1D(
"NeighborSumOverEnergyHF",
"HF Neighbor Sum Energy/Cell Energy;sum(neighbors)/E_cell",500,0,10);
284 if (
debug_>1)
std::cout <<
"HcalHotCellMonitor::bookHistograms"<<std::endl;
407 if (
debug_>1)
std::cout <<
"\t<HcalHotCellMonitor::analyze> Processing good event! event # = "<<
ievt_<<std::endl;
409 processEvent(*hbhe_rechit, *ho_rechit, *hf_rechit, *topo);
424 if (
debug_>1)
std::cout <<
"<HcalHotCellMonitor::processEvent> Processing event..."<<std::endl;
446 if (
debug_>1)
std::cout <<
"<HcalHotCellMonitor::processEvent_rechitenergy> Processing rechits..."<<std::endl;
450 float en = HBHEiter->energy();
454 int ieta =
id.
ieta();
455 int iphi =
id.iphi();
456 int depth =
id.depth();
457 std::pair<double,double>
etas = topology.
etaRange(
id.subdet(),
abs(ieta));
458 double fEta=fabs(0.5*(etas.first+etas.second));
459 float et = en/cosh(fEta);
489 float en = HOiter->energy();
492 int ieta =
id.
ieta();
493 int iphi =
id.iphi();
494 int depth =
id.depth();
495 std::pair<double,double>
etas = topology.
etaRange(
id.subdet(),
abs(ieta));
496 double fEta=fabs(0.5*(etas.first+etas.second));
497 float et = en/cosh(fEta);
502 if (
isSiPM(ieta,iphi,depth)) {
533 float en = HFiter->energy();
538 int ieta =
id.
ieta();
539 int iphi =
id.iphi();
540 int depth =
id.depth();
541 std::pair<double,double>
etas = topology.
etaRange(
id.subdet(),
abs(ieta));
542 double fEta=fabs(0.5*(etas.first+etas.second));
543 float et = en/cosh(fEta);
558 if (en>=threshold_pers)
584 template <
class RECHIT,
class RECHITCOLLECTION>
586 RECHITCOLLECTION&
coll,
594 int ieta, iphi,
depth;
597 int neighborsfound=0;
600 en = rechit->energy();
606 std::pair<double,double>
etas = topology.
etaRange(
id.subdet(),
abs(ieta));
607 double fEta=fabs(0.5*(etas.first+etas.second));
609 float et = en/cosh(fEta);
633 if (
abs(ieta)>39) mydeltaphi*=4;
634 else if (
abs(ieta)>20) mydeltaphi*=2;
637 for (
int nP =-1*mydeltaphi;nP<=mydeltaphi;++nP) {
639 if (nD==0 && nE==0 && nP==0)
641 int myphi=(nP+iphi)%72;
644 if (part==coll.end())
649 enNeighbor+=part->energy();
660 int myval=(int)(enNeighbor/en*50);
661 if (myval<0) myval=0;
662 if (myval>499) myval=499;
663 if (enNeighbor/en<0 || enNeighbor/en>=10)
return;
669 if ((1.*enNeighbor/en)>params.
HotEnergyFrac && en>0 && enNeighbor>0)
688 std::cout <<
"<HcalHotCellMonitor::fillNevents_persistentenergy> FILLING PERSISTENT ENERGY PLOTS"<<std::endl;
706 for (
int subdet=1;subdet<=4;++subdet) {
708 if (ieta==-9999)
continue;
712 ieta<0 ? ieta-- : ieta++;
719 if (
debug_>0)
std::cout <<
"HOT CELL; PERSISTENT ENERGY at subdet = "<<subdet<<
", eta = "<<ieta<<
", phi = "<<iphi<<
" depth = "<<
depth<<std::endl;
746 for (
int subdet=1;subdet<=4;++subdet) {
748 if (ieta==-9999)
continue;
752 ieta<0 ? ieta-- : ieta++;
759 if (
debug_>0)
std::cout <<
"HOT CELL; PERSISTENT ENERGY at subdet = "<<subdet<<
", eta = "<<ieta<<
", phi = "<<iphi<<
" depth = "<<
depth<<std::endl;
783 std::cout <<
"<HcalHotCellMonitor::fillNevents_energy> ABOVE-ENERGY-THRESHOLD PLOTS"<<std::endl;
798 unsigned int maxdepth=0;
816 for (
int subdet=1;subdet<=4;++subdet) {
818 if (ieta==-9999)
continue;
822 ieta<0 ? ieta-- : ieta++;
827 std::cout <<
"HOT CELL; ABOVE ENERGY THRESHOLD at subdet = "<<subdet<<
", eta = "<<ieta<<
", phi = "<<iphi<<
" depth = "<<
depth+1<<
" ABOVE THRESHOLD IN "<<
aboveenergy[
eta][
phi][
depth]<<
" EVENTS"<<std::endl;
835 std::cout <<
"HOT CELL; ABOVE ET THRESHOLD at subdet = "<<subdet<<
", eta = "<<ieta<<
", phi = "<<iphi<<
" depth = "<<
depth+1<<
" ABOVE THRESHOLD IN "<<
aboveet[
eta][
phi][
depth]<<
" EVENTS"<<std::endl;
864 std::cout <<
"<HcalHotCellMonitor::fillNevents_neighbor> FILLING ABOVE-NEIGHBOR-ENERGY PLOTS"<<std::endl;
881 for (
int subdet=1;subdet<=4;++subdet) {
883 if (ieta==-9999)
continue;
887 ieta<0 ? ieta-- : ieta++;
902 for (
int i=0;
i<500;++
i) {
924 std::cout <<
"<HcalHotCellMonitor::fillNevents_problemCells> FILLING PROBLEM CELL PLOTS"<<std::endl;
926 if (
ievt_==0)
return;
931 bool problemvalue=
false;
942 unsigned int DEPTH = 0;
955 if (DEPTH==0)
return;
985 if (
test_et_ && (etabins==0 || phibins==0))
994 if (ieta==-9999)
continue;
997 if (
abs(ieta)>20 &&
phi%2==1)
continue;
998 else if (
abs(ieta)>39 && (
phi+1)%4!=3)
continue;
1011 if (problemvalue==
false)
continue;
1018 if (
abs(ieta)<5) ++NumBadHO0;
1024 if (
depth+1==1 && (
abs(ieta)==33 ||
abs(ieta)==34)) ++NumBadHFLUMI;
1025 else if (
depth+1==2 && (
abs(ieta)==35 ||
abs(ieta)==36)) ++NumBadHFLUMI;
1031 if (
debug_>2)
std::cout <<
"<HcalHotCellMonitor::fillNevents_problemCells> Num Bad HB = "<<NumBadHB<<
" Num Bad HE = "<<NumBadHE<<
" Num Bad HO = "<<NumBadHO<<
" Num Bad HF = "<<NumBadHF<<
" CURRENT LS = "<<
currentLS<<std::endl;
1056 for (
int i=0;
i<85;++
i)
1058 for (
int j=0;
j<72;++
j)
1060 for (
int k=0;
k<4;++
k)
1072 for (
int i=0;
i<500;++
i)
bool isHO(int etabin, int depth)
void processEvent(const HBHERecHitCollection &hbHits, const HORecHitCollection &hoHits, const HFRecHitCollection &hfHits, const HcalTopology &topology)
int abovepersistent[85][72][4]
T getUntrackedParameter(std::string const &, T const &) const
EtaPhiHists AboveEnergyThresholdCellsByDepth
bool LumiInOrder(int lumisec)
void bookHistograms(DQMStore::IBooker &ib, const edm::Run &run, const edm::EventSetup &c)
MonitorElement * ProblemsCurrentLB
int aboveneighbors[85][72][4]
edm::InputTag hoRechitLabel_
hotNeighborParams HONeighborParams_
double HFpersistentETThreshold_
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
CaloTopology const * topology(0)
MonitorElement * bookProfile(Args &&...args)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * ProblemsVsLB_HF
#define DEFINE_FWK_MODULE(type)
double HEpersistentThreshold_
bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const
std::vector< int > AllowedCalibTypes_
int abovepersistentET[85][72][4]
int rechit_occupancy_sum[85][72][4]
virtual void cleanup(void)
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
MonitorElement * bookInt(Args &&...args)
std::vector< HBHERecHit >::const_iterator const_iterator
void fillNevents_problemCells(const HcalTopology &)
edm::LuminosityBlockNumber_t luminosityBlock() const
EtaPhiHists AbovePersistentThresholdCellsByDepth
edm::EDGetTokenT< HORecHitCollection > tok_ho_
int aboveenergy[85][72][4]
void fillNevents_energy(const HcalTopology &)
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
EtaPhiHists AbovePersistentETThresholdCellsByDepth
bool isHE(int etabin, int depth)
void processEvent_rechitenergy(const HBHERecHitCollection &hbheHits, const HORecHitCollection &hoHits, const HFRecHitCollection &hfHits, const HcalTopology &topology)
LuminosityBlockNumber_t luminosityBlock() const
HcalHotCellMonitor(const edm::ParameterSet &ps)
void SetupEtaPhiHists(DQMStore::IBooker &ib, EtaPhiHists &hh, std::string Name, std::string Units)
bool isSiPM(int ieta, int iphi, int depth)
std::vector< MonitorElement * > depth
MonitorElement * d_HFenergyVsNeighbor
int CalcIeta(int subdet, int eta, int depth)
bool IsAllowedCalibType()
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
MonitorElement * ProblemsVsLB_HBHEHF
double persistentThreshold_
double HOpersistentThreshold_
MonitorElement * ProblemsVsLB_HB
double HBenergyThreshold_
double HOpersistentETThreshold_
void analyze(edm::Event const &e, edm::EventSetup const &s)
EtaPhiHists AboveETThresholdCellsByDepth
int ieta() const
get the cell ieta
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
hotNeighborParams HBHENeighborParams_
double persistentETThreshold_
bool isHB(int etabin, int depth)
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void fillNevents_neighbor(const HcalTopology &)
MonitorElement * d_HBenergyVsNeighbor
const_iterator end() const
void endRun(const edm::Run &run, const edm::EventSetup &c)
void setup(DQMStore::IBooker &)
edm::InputTag hbheRechitLabel_
bool isHF(int etabin, int depth)
void processHit_rechitNeighbors(R &rechititer, C &collection, hotNeighborParams ¶ms, const HcalTopology &topology)
void setCurrentFolder(const std::string &fullpath)
double HFenergyThreshold_
double HBpersistentThreshold_
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
double HFpersistentThreshold_
void fillNevents_persistentenergy(const HcalTopology &)
MonitorElement * ProblemsVsLB_HE
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
int CalcEtaBin(int subdet, int ieta, int depth)
edm::InputTag hfRechitLabel_
MonitorElement * d_HOenergyVsNeighbor
EtaPhiHists AboveNeighborsHotCellsByDepth
std::pair< double, double > etaRange(HcalSubdetector subdet, int ieta) const
TString units(TString variable, Char_t axis)
TProfile * getTProfile(void) const
MonitorElement * ProblemsVsLB_HO
MonitorElement * bookFloat(Args &&...args)
double HOenergyThreshold_
MonitorElement * ProblemsVsLB
double HEpersistentETThreshold_
double HBpersistentETThreshold_
hotNeighborParams HFNeighborParams_
void Reset(void)
reset ME (ie. contents, errors, etc)
double HEenergyThreshold_
virtual void setup(DQMStore::IBooker &)
const_iterator begin() const
MonitorElement * d_HEenergyVsNeighbor