12 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
13 prefixME_.append(
"/");
78 std::cout <<
"<HcalDeadCellMonitor::setup> Setting up histograms"<<std::endl;
87 Nevents =
dbe_->
book1D(
"NumberOfDeadCellEvents",
"Number of Events Seen by DeadCellMonitor",2,0,2);
92 "Total Number of Dead Hcal Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
96 "Total Number of Dead HB Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
100 "Total Number of Dead HE Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
103 "Total Number of Dead HO Cells Ring 0,1 |ieta|<=10 (excluding known problems) vs LS;Lumi Section;Dead Cells",
106 "Total Number of Dead HO Cells Ring 2 |ieta|>10 (excluding known problems) vs LS;Lumi Section;Dead Cells",
109 "Total Number of Dead HF Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
112 "Total Number of Dead HBHEHF Cells (excluding known problems) vs LS;Lumi Section;Dead Cells",
124 "RBX loss vs LS; Lumi Section; Index of lost RBX",
128 "Total Number of Dead HBHEHF Cells in last 10 LS. Last bin contains OverFlow",
131 "Total Number of Dead Cells Ring 0,1 (abs(ieta)<=10) in last 10 LS. Last bin contains OverFlow",
138 me=
dbe_->
bookInt(
"Test_DigiMissing_Periodic_Lumi_Check");
143 me=
dbe_->
bookInt(
"Min_Events_Required_Periodic_Lumi_Check");
155 me=
dbe_->
bookInt(
"Test_RecHitsMissing_Periodic_Lumi_Check");
161 std::stringstream
units;
162 std::stringstream
name;
168 "Digi Present At Least Once",
"");
171 "Total Number of Never-Present Hcal Cells vs LS;Lumi Section;Dead Cells",
175 "Total Number of Never-Present HB Cells vs LS;Lumi Section;Dead Cells",
179 "Total Number of Never-Present HE Cells vs LS;Lumi Section;Dead Cells",
183 "Total Number of Never-Present HO Cells vs LS;Lumi Section;Dead Cells",
187 "Total Number of Never-Present HF Cells vs LS;Lumi Section;Dead Cells",
201 name<<
"Dead Cells with No Digis";
206 name<<
"HB HE HF Depth 1 Dead Cells with No Digis for at least 1 Full Luminosity Block";
210 name<<
"HB HE HF Depth 2 Dead Cells with No Digis for at least 1 Full Luminosity Block";
214 name<<
"HE Depth 3 Dead Cells with No Digis for at least 1 Full Luminosity Block";
218 name<<
"HO Depth 4 Dead Cells with No Digis for at least 1 Full Luminosity Block";
223 name<<
"Total Number of Hcal Digis Unoccupied for at least 1 Full Luminosity Block";
228 name<<
"Total Number of HB Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
233 name<<
"Total Number of HE Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
238 name<<
"Total Number of HO Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
243 name<<
"Total Number of HF Digis Unoccupied for at least 1 Full LS vs LS;Lumi Section; Dead Cells";
268 units<<
"Cells Above Energy Threshold At Least Once: Depth 3 -- HE >="<<
HEenergyThreshold_<<
" GeV";
271 units<<
"Cells Above Energy Threshold At Least Once: Depth 4 -- HO >="<<
HOenergyThreshold_<<
" GeV";
277 "Total Number of Hcal Rechits with Low Energy;Lumi Section;Dead Cells",
280 name<<
"Total Number of HB RecHits with Energy Never >= "<<
HBenergyThreshold_<<
" GeV;Lumi Section;Dead Cells";
285 name<<
"Total Number of HE RecHits with Energy Never >= "<<HEenergyThreshold_<<
" GeV;Lumi Section;Dead Cells";
290 name<<
"Total Number of HO RecHits with Energy Never >= "<<HOenergyThreshold_<<
" GeV;Lumi Section;Dead Cells";
295 name<<
"Total Number of HF RecHits with Energy Never >= "<<HFenergyThreshold_<<
" GeV;Lumi Section;Dead Cells";
309 units<<
"RecHits with Consistent Low Energy Depth 1 -- HB <"<<HBenergyThreshold_<<
" GeV, HE < "<<HEenergyThreshold_<<
", HF <"<<HFenergyThreshold_<<
" GeV";
312 units<<
"RecHits with Consistent Low Energy Depth 2 -- HB <"<<HBenergyThreshold_<<
" GeV, HE < "<<HEenergyThreshold_<<
", HF <"<<HFenergyThreshold_<<
" GeV";
315 units<<
"RecHits with Consistent Low Energy Depth 3 -- HE <"<<HEenergyThreshold_<<
" GeV";
318 units<<
"RecHits with Consistent Low Energy Depth 4 -- HO <"<<HOenergyThreshold_<<
" GeV";
325 name<<
"Total Number of Hcal RecHits with Consistent Low Energy;Lumi Section;Dead Cells";
330 name<<
"Total Number of HB RecHits with Consistent Low Energy < "<<HBenergyThreshold_<<
" GeV;Lumi Section;Dead Cells";
335 name<<
"Total Number of HE RecHits with Consistent Low Energy < "<<HEenergyThreshold_<<
" GeV;Lumi Section;Dead Cells";
340 name<<
"Total Number of HO RecHits with Consistent Low Energy < "<<HOenergyThreshold_<<
" GeV;Lumi Section;Dead Cells";
345 name<<
"Total Number of HF RecHits with Consistent Low Energy < "<<HFenergyThreshold_<<
" GeV;Lumi Section;Dead Cells";
391 for (std::vector<DetId>::const_iterator
i = mydetids.begin();
432 for (
int ieta=11;ieta<=15;++ieta)
433 for (
int iphi=1;iphi<=72;++iphi)
436 if (
isSiPM(ieta,iphi,4)==
false)
468 for (
int ieta=11;ieta<=15;++ieta)
469 for (
int iphi=1;iphi<=72;++iphi)
552 for (
unsigned int i=0;
i<156;++
i)
637 if (dcsStatus.
isValid() && dcsStatus->size() != 0)
696 if (!(e.
getByLabel(
"gtEvmDigis", gtEvm_handle)))
698 edm::LogWarning(
"HcalDeadCellMonitor")<<
"gtEvmDigis"<<
" gtEvmDigis not available";
703 if (
debug_>1)
std::cout <<
"\t<HcalDeadCellMonitor::analyze> Processing good event! event # = "<<
ievt_<<std::endl;
710 processEvent(*hbhe_rechit, *ho_rechit, *hf_rechit, *hbhe_digi, *ho_digi, *hf_digi);
715 for(
int i=71;
i<132;
i++)
721 if(
i >= 72 &&
i < 95 &&
i%2==0)
723 if(
i >=108 &&
i <= 131 &&
i%2==0)
733 for (
unsigned int i=0;
i<132;++
i)
745 for (
unsigned int i=132;
i<156;++
i)
747 if(intensity1_>100 && intensity2_>100)
755 for (
unsigned int i=0;
i<156;++
i)
761 for (
unsigned int i=0;
i<156;++
i)
776 if (
debug_>1)
std::cout <<
"<HcalDeadCellMonitor::processEvent> Processing event..."<<std::endl;
804 j!=hbhedigi.
end(); ++
j)
811 j!=hodigi.
end(); ++
j)
817 j!=hfdigi.
end(); ++
j)
838 j!=hbHits.
end(); ++
j)
842 k!=hoHits.
end(); ++
k)
846 j!=hfHits.
end(); ++
j)
859 for (
int d=0;d<4;++d)
866 if (d==3) ++hopresent;
867 else if (d==2) ++hepresent;
872 if (
abs(ieta)>29) ++hfpresent;
873 else if (
abs(ieta)<17) ++hbpresent;
879 if (
abs(ieta)>29) ++hfpresent;
880 else if (
abs(ieta)<17) ++hbpresent;
910 int ieta=digi.id().ieta();
911 int iphi=digi.id().iphi();
912 int depth=digi.id().depth();
931 template<
class RECHIT>
934 float en = rechit->energy();
936 int ieta =
id.ieta();
937 int iphi =
id.iphi();
938 int depth =
id.depth();
1013 std::cout <<
"<HcalDeadCellMonitor::fillNevents_recentdigis> CHECKING FOR RECENT MISSING DIGIS evtcount = "<<
deadevt_<<std::endl;
1033 for (
int subdet=1;subdet<=4;++subdet)
1036 if (ieta==-9999)
continue;
1064 for (
int subdet=1;subdet<=4;++subdet)
1067 if (ieta==-9999)
continue;
1084 ieta<0 ? zside=-1 : zside=+1;
1090 std::cout <<
"DEAD CELL; NO RECENT OCCUPANCY: subdet = "<<subdet<<
", ieta = "<<ieta<<
", iphi = "<<iphi<<
" depth = "<<depth+1<<std::endl;
1091 std::cout <<
"\t RAW COORDINATES: eta = "<<
eta<<
" phi = "<<
phi<<
" depth = "<<depth<<std::endl;
1130 std::cout <<
"<HcalDeadCellMonitor::fillNevents_energy> BELOW-ENERGY-THRESHOLD PLOTS"<<std::endl;
1150 for (
int subdet=1;subdet<=4;++subdet)
1153 if (ieta==-9999)
continue;
1181 for (
int subdet=1;subdet<=4;++subdet)
1184 if (ieta==-9999)
continue;
1204 ieta<0 ? zside=-1 : zside=+1;
1208 std::cout <<
"DEAD CELL; BELOW ENERGY THRESHOLD; subdet = "<<subdet<<
" ieta = "<<ieta<<
", phi = "<<iphi<<
" depth = "<<depth+1<<std::endl;
1229 std::cout <<
"<HcalDeadCellMonitor::fillNevents_problemCells> FILLING PROBLEM CELL PLOTS"<<std::endl;
1250 int knownBadHFLUMI=0;
1256 unsigned int neverpresentHB=0;
1257 unsigned int neverpresentHE=0;
1258 unsigned int neverpresentHO=0;
1259 unsigned int neverpresentHF=0;
1261 unsigned int unoccupiedHB=0;
1262 unsigned int unoccupiedHE=0;
1263 unsigned int unoccupiedHO=0;
1264 unsigned int unoccupiedHF=0;
1266 unsigned int belowenergyHB=0;
1267 unsigned int belowenergyHE=0;
1268 unsigned int belowenergyHO=0;
1269 unsigned int belowenergyHF=0;
1271 unsigned int energyneverpresentHB=0;
1272 unsigned int energyneverpresentHE=0;
1273 unsigned int energyneverpresentHO=0;
1274 unsigned int energyneverpresentHF=0;
1288 unsigned int RBX_loss_HB=0;
1289 unsigned int RBX_loss_HE=0;
1290 unsigned int RBX_loss_HO01=0;
1291 unsigned int RBX_loss_HO2=0;
1292 unsigned int RBX_loss_HF=0;
1294 unsigned int counter_HB = 0;
1295 unsigned int counter_HE = 0;
1296 unsigned int counter_HO01 = 0;
1297 unsigned int counter_HO2 = 0;
1298 unsigned int counter_HF = 0;
1300 for(
int i=0;
i<156;
i++)
1305 { counter_HB ++ ; RBX_loss_HB = 72*(counter_HB); }
1307 { counter_HE ++ ; RBX_loss_HE = 72*(counter_HE); }
1309 { counter_HO01 ++ ; RBX_loss_HO01 = 72*(counter_HO01); }
1311 { counter_HO2 ++ ; RBX_loss_HO2 = 72*(counter_HO2); }
1312 if(
i>=132 &&
i<=155)
1313 { counter_HF ++ ; RBX_loss_HF = 72*(counter_HF); }
1328 NumBadHO+=RBX_loss_HO01+RBX_loss_HO2;
1333 belowenergyHB+=RBX_loss_HB;
1334 belowenergyHE+=RBX_loss_HE;
1335 belowenergyHO+=RBX_loss_HO01+RBX_loss_HO2;
1336 belowenergyHF+=RBX_loss_HF;
1338 unoccupiedHB+=RBX_loss_HB;
1339 unoccupiedHE+=RBX_loss_HE;
1340 unoccupiedHO+=RBX_loss_HO01+RBX_loss_HO2;
1341 unoccupiedHF+=RBX_loss_HF;
1355 for (
int subdet=1;subdet<=4;++subdet)
1358 if (ieta==-9999)
continue;
1409 if (
excludeHO1P02_==
true && ( (ieta>4 && ieta<10) && (iphi<=10 || iphi>70) ) )
1415 if (
abs(ieta)<=10) ++knownBadHO01;
1428 if (depth==1 && (
abs(ieta)==33 ||
abs(ieta)==34))
1430 else if (depth==2 && (
abs(ieta)==35 ||
abs(ieta)==36))
1435 if (depth==1 && (
abs(ieta)==33 ||
abs(ieta)==34))
1437 else if (depth==2 && (
abs(ieta)==35 ||
abs(ieta)==36))
1445 else if (subdet==
HcalEndcap) ++neverpresentHE;
1475 if (subdet==
HcalBarrel) ++energyneverpresentHB;
1476 else if (subdet==
HcalEndcap) ++energyneverpresentHE;
1479 ++energyneverpresentHO;
1481 --energyneverpresentHO;
1483 else if (subdet==
HcalForward) ++energyneverpresentHF;
1489 else if (subdet==
HcalEndcap) ++belowenergyHE;
1526 if( belowenergyHB<RBX_loss_HB )
1527 belowenergyHB+=RBX_loss_HB;
1528 if( belowenergyHE<RBX_loss_HE )
1529 belowenergyHE+=RBX_loss_HE;
1530 if( belowenergyHO<RBX_loss_HO01+RBX_loss_HO2)
1531 belowenergyHO+=RBX_loss_HO01+RBX_loss_HO2;
1532 if( belowenergyHF<RBX_loss_HF )
1533 belowenergyHF+=RBX_loss_HF;
1535 if( unoccupiedHB<RBX_loss_HB )
1536 unoccupiedHB+=RBX_loss_HB;
1537 if( unoccupiedHE<RBX_loss_HE )
1538 unoccupiedHE+=RBX_loss_HE;
1539 if( unoccupiedHO<RBX_loss_HO01+RBX_loss_HO2 )
1540 unoccupiedHO+=RBX_loss_HO01+RBX_loss_HO2;
1541 if( unoccupiedHF<RBX_loss_HF )
1542 unoccupiedHF+=RBX_loss_HF;
1605 for (
unsigned int i=0;
i<85;++
i)
1607 for (
unsigned int j=0;
j<72;++
j)
1609 for (
unsigned int k=0;
k<4;++
k)
1619 for (
unsigned int i=0;
i<156;++
i)
edm::InputTag hfRechitLabel_
void beginRun(const edm::Run &run, const edm::EventSetup &c)
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * NumberOfNeverPresentRecHitsHO
bool LumiInOrder(int lumisec)
void fillNevents_problemCells()
MonitorElement * NumberOfRecentMissingRecHitsHF
MonitorElement * NumberOfNeverPresentRecHits
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * ProblemsCurrentLB
MonitorElement * NumberOfNeverPresentDigisHB
void analyze(edm::Event const &e, edm::EventSetup const &s)
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * HEDeadVsEvent
MonitorElement * NumberOfRecentMissingRecHits
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void zeroCounters(bool resetpresent=false)
bool present_digi[85][72][4]
edm::InputTag hbheRechitLabel_
#define DEFINE_FWK_MODULE(type)
std::map< unsigned int, int > KnownBadCells_
MonitorElement * NumberOfNeverPresentDigisHE
std::vector< int > AllowedCalibTypes_
void endRun(const edm::Run &run, const edm::EventSetup &c)
std::vector< T >::const_iterator const_iterator
HcalDeadCellMonitor(const edm::ParameterSet &ps)
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
edm::LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * NumberOfRecentMissingDigisHB
void update(void)
Mark the object updated.
void process_RecHit(T &rechit)
void fillNevents_recentrechits()
MonitorElement * ProblemsInLastNLB_HO01_alarm
MonitorElement * NumberOfRecentMissingDigisHE
bool present_rechit[85][72][4]
MonitorElement * bookFloat(const char *name)
Book float.
LuminosityBlockNumber_t luminosityBlock() const
uint32_t rawId() const
get the raw id
double HFenergyThreshold_
bool isSiPM(int ieta, int iphi, int depth)
EtaPhiHists RecHitPresentByDepth
MonitorElement * RBX_loss_VS_LB
std::vector< MonitorElement * > depth
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
int CalcIeta(int subdet, int eta, int depth)
MonitorElement * ProblemsVsLB
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
bool IsAllowedCalibType()
MonitorElement * NumberOfNeverPresentDigisHF
MonitorElement * ProblemsVsLB_HBHEHF
edm::InputTag hoRechitLabel_
double HEenergyThreshold_
std::vector< DetId > getAllChannels() const
unsigned int occupancy_RBX[156]
MonitorElement * NumberOfNeverPresentDigisHO
void processEvent_HBHEdigi(const HBHEDataFrame digi)
MonitorElement * NumberOfNeverPresentRecHitsHB
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
unsigned int recentoccupancy_rechit[85][72][4]
MonitorElement * NumberOfRecentMissingRecHitsHE
MonitorElement * ProblemsVsLB_HF
MonitorElement * NumberOfRecentMissingDigisHO
MonitorElement * NumberOfNeverPresentRecHitsHF
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * ProblemsVsLB_HB
const cms_uint32_t totalIntensityBeam2() const
const_iterator end() const
const HcalFrontEndId getHcalFrontEndId(const DetId &)
const cms_uint32_t totalIntensityBeam1() const
unsigned int recentoccupancy_digi[85][72][4]
void processEvent(const HBHERecHitCollection &hbHits, const HORecHitCollection &hoHits, const HFRecHitCollection &hfHits, const HBHEDigiCollection &hbhedigi, const HODigiCollection &hodigi, const HFDigiCollection &hfdigi)
int badChannelStatusMask_
EtaPhiHists RecentMissingDigisByDepth
MonitorElement * NumberOfRecentMissingRecHitsHO
T const * product() const
EtaPhiHists DigiPresentByDepth
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
T const * product() const
EtaPhiHists RecentMissingRecHitsByDepth
int CalcEtaBin(int subdet, int ieta, int depth)
void SetupEtaPhiHists(EtaPhiHists &hh, std::string Name, std::string Units)
double HOenergyThreshold_
MonitorElement * HBDeadVsEvent
MonitorElement * NumberOfNeverPresentRecHitsHE
MonitorElement * ProblemsVsLB_HE
TProfile * getTProfile(void) const
MonitorElement * NumberOfNeverPresentDigis
unsigned int NumBadHFLUMI
double HBenergyThreshold_
MonitorElement * NumberOfRecentMissingDigis
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
MonitorElement * NumberOfRecentMissingDigisHF
void process_Digi(T &digi)
void fillNevents_recentdigis()
bool deadmon_test_rechits_
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * ProblemsInLastNLB_HBHEHF_alarm
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
const Item * getValues(DetId fId) const
MonitorElement * HFDeadVsEvent
HcalLogicalMap * logicalMap_
void Reset(void)
reset ME (ie. contents, errors, etc)
const cms_uint16_t beamMode() const
MonitorElement * ProblemsVsLB_HO2
void setCurrentFolder(const std::string &fullpath)
MonitorElement * HODeadVsEvent
const_iterator begin() const
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
MonitorElement * NumberOfRecentMissingRecHitsHB
MonitorElement * ProblemsVsLB_HO