14 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
15 prefixME_.append(
"/");
124 std::cout <<
"<HcalHotCellMonitor::setup> Setting up histograms"<<std::endl;
135 "Total Number of Hot Hcal Cells vs lumi section",
139 "Total Number of Hot HB Cells vs lumi section",
142 "Total Number of Hot HE Cells vs lumi section",
145 "Total Number of Hot HO Cells vs lumi section",
148 "Total Number of Hot HF Cells vs lumi section",
151 "Total Number of Hot HBHEHF Cells vs lumi section",
162 std::stringstream
units;
165 me=
dbe_->
bookInt(
"HotCellAboveThresholdTestEnabled");
172 "Hot Cells Above Energy Threshold",
"");
194 "Hot Cells Above ET Threshold",
"");
202 units<<
"Hot Cells: Depth 2 -- HB > "<<
HBETThreshold_<<
" GeV (ET), HE > "<<
HEETThreshold_<<
" GeV (ET), HF > "<<HFETThreshold_<<
" GeV (ET)";
205 units<<
"Hot Cells: Depth 3 -- HE > "<<
HEETThreshold_<<
" GeV (ET)";
224 "Hot Cells Persistently Above Energy Threshold",
"");
245 "Hot Cells Persistently Above ET Threshold",
"");
407 if (
debug_>1)
std::cout <<
"\t<HcalHotCellMonitor::analyze> Processing good event! event # = "<<
ievt_<<std::endl;
425 if (
debug_>1)
std::cout <<
"<HcalHotCellMonitor::processEvent> Processing event..."<<std::endl;
448 if (
debug_>1)
std::cout <<
"<HcalHotCellMonitor::processEvent_rechitenergy> Processing rechits..."<<std::endl;
453 float en = HBHEiter->energy();
457 int ieta =
id.
ieta();
458 int iphi =
id.iphi();
459 int depth =
id.depth();
461 float et = en/cosh(fEta);
496 float en = HOiter->energy();
499 int ieta =
id.
ieta();
500 int iphi =
id.iphi();
501 int depth =
id.depth();
503 float et = en/cosh(fEta);
508 if (
isSiPM(ieta,iphi,depth))
543 float en = HFiter->energy();
548 int ieta =
id.
ieta();
549 int iphi =
id.iphi();
550 int depth =
id.depth();
552 float et = en/cosh(fEta);
568 if (en>=threshold_pers)
594 template <
class RECHIT,
class RECHITCOLLECTION>
596 RECHITCOLLECTION&
coll,
605 int ieta, iphi, depth;
608 int neighborsfound=0;
611 en = rechit->energy();
623 float et = en/cosh(fEta);
649 if (
abs(ieta)>39) mydeltaphi*=4;
650 else if (
abs(ieta)>20) mydeltaphi*=2;
654 for (
int nP =-1*mydeltaphi;nP<=mydeltaphi;++nP)
658 if (nD==0 && nE==0 && nP==0)
660 int myphi=(nP+iphi)%72;
663 if (part==coll.end())
668 enNeighbor+=part->energy();
680 int myval=(int)(enNeighbor/en*50);
681 if (myval<0) myval=0;
682 if (myval>499) myval=499;
683 if (enNeighbor/en<0 || enNeighbor/en>=10)
return;
689 if ((1.*enNeighbor/en)>params.
HotEnergyFrac && en>0 && enNeighbor>0)
709 std::cout <<
"<HcalHotCellMonitor::fillNevents_persistentenergy> FILLING PERSISTENT ENERGY PLOTS"<<std::endl;
731 for (
int subdet=1;subdet<=4;++subdet)
734 if (ieta==-9999)
continue;
738 ieta<0 ? ieta-- : ieta++;
746 if (
debug_>0)
std::cout <<
"HOT CELL; PERSISTENT ENERGY at subdet = "<<subdet<<
", eta = "<<ieta<<
", phi = "<<iphi<<
" depth = "<<depth<<std::endl;
777 for (
int subdet=1;subdet<=4;++subdet)
780 if (ieta==-9999)
continue;
784 ieta<0 ? ieta-- : ieta++;
792 if (
debug_>0)
std::cout <<
"HOT CELL; PERSISTENT ENERGY at subdet = "<<subdet<<
", eta = "<<ieta<<
", phi = "<<iphi<<
" depth = "<<depth<<std::endl;
817 std::cout <<
"<HcalHotCellMonitor::fillNevents_energy> ABOVE-ENERGY-THRESHOLD PLOTS"<<std::endl;
834 unsigned int maxdepth=0;
840 for (
unsigned int depth=0;depth<maxdepth;++depth)
857 for (
int subdet=1;subdet<=4;++subdet)
860 if (ieta==-9999)
continue;
864 ieta<0 ? ieta-- : ieta++;
871 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;
881 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;
911 std::cout <<
"<HcalHotCellMonitor::fillNevents_neighbor> FILLING ABOVE-NEIGHBOR-ENERGY PLOTS"<<std::endl;
931 for (
int subdet=1;subdet<=4;++subdet)
934 if (ieta==-9999)
continue;
938 ieta<0 ? ieta-- : ieta++;
942 if (
debug_>2)
std::cout <<
"HOT CELL; ABOVE NEIGHBORS at eta = "<<ieta<<
", phi = "<<iphi<<
" depth = "<<(depth>4 ? depth+1 : depth-3)<<std::endl;
954 for (
int i=0;
i<500;++
i)
978 std::cout <<
"<HcalHotCellMonitor::fillNevents_problemCells> FILLING PROBLEM CELL PLOTS"<<std::endl;
980 if (
ievt_==0)
return;
985 bool problemvalue=
false;
996 unsigned int DEPTH = 0;
1009 if (DEPTH==0)
return;
1011 for (
unsigned int depth=0;depth<DEPTH;++depth)
1039 if (
test_et_ && (etabins==0 || phibins==0))
1048 if (ieta==-9999)
continue;
1051 if (
abs(ieta)>20 &&
phi%2==1)
continue;
1052 else if (
abs(ieta)>39 && (
phi+1)%4!=3)
continue;
1065 if (problemvalue==
false)
continue;
1066 if (
isHB(
eta,depth+1)) ++NumBadHB;
1072 if (
abs(ieta)<5) ++NumBadHO0;
1078 if (depth+1==1 && (
abs(ieta)==33 ||
abs(ieta)==34)) ++NumBadHFLUMI;
1079 else if (depth+1==2 && (
abs(ieta)==35 ||
abs(ieta)==36)) ++NumBadHFLUMI;
1085 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;
1110 for (
int i=0;
i<85;++
i)
1112 for (
int j=0;
j<72;++
j)
1114 for (
int k=0;
k<4;++
k)
1126 for (
int i=0;
i<500;++
i)
bool isHO(int etabin, int depth)
int abovepersistent[85][72][4]
T getUntrackedParameter(std::string const &, T const &) const
EtaPhiHists AboveEnergyThresholdCellsByDepth
bool LumiInOrder(int lumisec)
void beginRun(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)
void processEvent(const HBHERecHitCollection &hbHits, const HORecHitCollection &hoHits, const HFRecHitCollection &hfHits)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void processHit_rechitNeighbors(R &rechititer, C &collection, hotNeighborParams ¶ms)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * ProblemsVsLB_HF
#define DEFINE_FWK_MODULE(type)
double HEpersistentThreshold_
std::vector< int > AllowedCalibTypes_
int abovepersistentET[85][72][4]
int rechit_occupancy_sum[85][72][4]
std::vector< HBHERecHit >::const_iterator const_iterator
edm::LuminosityBlockNumber_t luminosityBlock() const
EtaPhiHists AbovePersistentThresholdCellsByDepth
edm::EDGetTokenT< HORecHitCollection > tok_ho_
int aboveenergy[85][72][4]
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
EtaPhiHists AbovePersistentETThresholdCellsByDepth
bool isHE(int etabin, int depth)
void fillNevents_problemCells()
MonitorElement * bookFloat(const char *name)
Book float.
LuminosityBlockNumber_t luminosityBlock() const
HcalHotCellMonitor(const edm::ParameterSet &ps)
bool isSiPM(int ieta, int iphi, int depth)
std::vector< MonitorElement * > depth
MonitorElement * d_HFenergyVsNeighbor
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
int CalcIeta(int subdet, int eta, int depth)
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
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)
Abs< T >::type abs(const T &t)
hotNeighborParams HBHENeighborParams_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
void fillNevents_neighbor()
double persistentETThreshold_
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
void fillNevents_energy()
bool isHB(int etabin, int depth)
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void processEvent_rechitenergy(const HBHERecHitCollection &hbheHits, const HORecHitCollection &hoHits, const HFRecHitCollection &hfHits)
MonitorElement * d_HBenergyVsNeighbor
const_iterator end() const
void endRun(const edm::Run &run, const edm::EventSetup &c)
edm::InputTag hbheRechitLabel_
bool isHF(int etabin, int depth)
double HFenergyThreshold_
static const double theHFEtaBounds[]
double HBpersistentThreshold_
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void fillNevents_persistentenergy()
double HFpersistentThreshold_
MonitorElement * ProblemsVsLB_HE
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
int CalcEtaBin(int subdet, int ieta, int depth)
void SetupEtaPhiHists(EtaPhiHists &hh, std::string Name, std::string Units)
edm::InputTag hfRechitLabel_
MonitorElement * d_HOenergyVsNeighbor
EtaPhiHists AboveNeighborsHotCellsByDepth
TString units(TString variable, Char_t axis)
TProfile * getTProfile(void) const
MonitorElement * ProblemsVsLB_HO
double HOenergyThreshold_
MonitorElement * ProblemsVsLB
MonitorElement * bookInt(const char *name)
Book int.
double HEpersistentETThreshold_
double HBpersistentETThreshold_
static const double theHBHEEtaBounds[]
hotNeighborParams HFNeighborParams_
void Reset(void)
reset ME (ie. contents, errors, etc)
double HEenergyThreshold_
void setCurrentFolder(const std::string &fullpath)
const_iterator begin() const
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
MonitorElement * d_HEenergyVsNeighbor