19 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
20 prefixME_.append(
"/");
45 std::cout <<
"<HcalDigiMonitor> Digi shape ADC threshold set to: >" << shapeThresh_ <<
" counts above nominal pedestal (3*10)"<< std::endl;
66 std::cout <<
"<HcalDigiMonitor> Checking for the following problems:"<<std::endl;
67 if (digi_checkcapid_)
std::cout <<
"\tChecking that cap ID rotation is correct;"<<std::endl;
68 if (digi_checkdigisize_)
70 std::cout <<
"\tChecking that HBHE digi size is between ["<<mindigisizeHBHE_<<
" - "<<maxdigisizeHBHE_<<
"];"<<std::endl;
71 std::cout <<
"\tChecking that HO digi size is between ["<<mindigisizeHO_<<
" - "<<maxdigisizeHO_<<
"];"<<std::endl;
72 std::cout <<
"\tChecking that HF digi size is between ["<<mindigisizeHF_<<
" - "<<maxdigisizeHF_<<
"];"<<std::endl;
74 if (digi_checkadcsum_)
std::cout <<
"\tChecking that ADC sum of digi is greater than 0;"<<std::endl;
75 if (digi_checkdverr_)
std::cout <<
"\tChecking that data valid bit is true and digi error bit is false;\n"<<std::endl;
107 if(last ==-1)
return false;
110 if(v==now)
return false;
171 std::cout <<
"<HcalDigiMonitor::setup> Setting up histograms"<<std::endl;
173 std::ostringstream
name;
213 "Total Number of ProblemDigis HBHEHF in last 10 LS. Last bin contains OverFlow",
231 HFP_shape=ib.
book1D(
"HFP_signal_shape",
"HFP signal shape",10,-0.5,9.5);
232 HFM_shape=ib.
book1D(
"HFM_signal_shape",
"HFM signal shape",10,-0.5,9.5);
246 h_valid_digis=ib.
book1D(
"ValidEvents",
"Events with minimum number of valid digis",2,-0.5,1.5);
251 h_invalid_bcn=ib.
book1D(
"InvalidDigiEvents_BCN",
"Bunch Crossing Number fo Events with Many Unpacker Errors",3464,-0.5,3563.5);
253 DigiSize = ib.
book2D(
"Digi Size",
"Digi Size",4,0,4,20,-0.5,19.5);
272 HBocc_vs_LB=ib.
bookProfile(
"HBoccVsLB",
"HB digi occupancy vs Luminosity Block;Lumi block;# of Good digis",
275 HEocc_vs_LB=ib.
bookProfile(
"HEoccVsLB",
"HE digi occupancy vs Luminosity Block;Lumi block;# of Good digis",
278 HOocc_vs_LB=ib.
bookProfile(
"HOoccVsLB",
"HO digi occupancy vs Luminosity Block;Lumi block;# of Good digis",
281 HFocc_vs_LB=ib.
bookProfile(
"HFoccVsLB",
"HF digi occupancy vs Luminosity Block;Lumi block;# of Good digis",
288 "Digi Phi Occupancy Map;i#phi;# of Events",
291 "Digi Eta Occupancy Map;i#eta;# of Events",
294 "Digi VME Occupancy Map;HTR Slot;VME Crate Id",
295 40,-0.25,19.75,36,-0.5,35.5);
298 "Digi Spigot Occupancy Map;Spigot;DCC Id",
304 "Digi VME Error Map;HTR Slot;VME Crate Id",
305 40,-0.25,19.75,18,-0.5,17.5);
308 "Digi Spigot Error Map;Spigot;DCC Id",
319 DigiBQFrac = ib.
book1D(
"Bad Digi Fraction",
"Bad Digi Fraction;Bad Quality Digi Fraction for digis in collection; # of Events",
327 "Bad Digis From Unpacker/ (Bad Digis From Unpacker + Good Digis); Bad Unpacker Fraction; # of Events",
347 if (
debug_>1)
std::cout <<
"\t<HcalDigiMonitor::bookHistograms> Getting conditions from DB!"<<std::endl;
357 for (std::vector<DetId>::const_iterator chan = mydetids.begin();chan!=mydetids.end();++chan)
360 std::vector <double> peds;
366 for (
int capid=0;capid<4;++capid)
369 double temp_ADC=channelCoder->
adc(*shape,(
float)calibs.
pedestal(capid),capid);
370 peds.push_back(temp_ADC);
388 for (std::vector<DetId>::const_iterator
i = mydetids.begin();
407 std::stringstream
name;
409 if (subdet==
"HB" || subdet==
"HE") nChan=2592;
410 else if (subdet ==
"HO") nChan=2160;
411 else if (subdet ==
"HF") nChan=1728;
414 hist.
shape = ib.
book1D(subdet+
" Digi Shape",subdet+
" Digi Shape;Time Slice",10,-0.5,9.5);
416 subdet+
" Digi Shape - over thresh passing trigger and HF HT cuts;Time slice",
419 subdet+
" Total Digis Over Threshold",
422 for (
int ts=0;ts<9;++ts)
424 name<<subdet<<
" Plus Time Slices "<<ts<<
" and "<<ts+1;
425 hist.
TS_sum_plus.push_back(ib.
book1D(name.str().c_str(),name.str().c_str(),50, 0., 50.));
427 name<<subdet<<
" Minus Time Slices "<<ts<<
" and "<<ts+1;
428 hist.
TS_sum_minus.push_back(ib.
book1D(name.str().c_str(),name.str().c_str(),50, 0., 50.));
431 hist.
presample= ib.
book1D(subdet+
" Digi Presamples",subdet+
" Digi Presamples",50,-0.5,49.5);
432 hist.
BQ = ib.
book1D(subdet+
" Bad Quality Digis",subdet+
" Bad Quality Digis",nChan+1,-0.5,nChan+0.5);
435 hist.
DigiFirstCapID = ib.
book1D(subdet+
" Capid 1st Time Slice",subdet+
" Capid for 1st Time Slice;CapId (T0)- 1st CapId (T0);# of Events",7,-3.5,3.5);
437 hist.
DVerr = ib.
book1D(subdet+
" Data Valid Err Bits",subdet+
" QIE Data Valid Err Bits",4,-0.5,3.5);
442 hist.
CapID = ib.
book1D(subdet+
" CapID",subdet+
" CapID",4,-0.5,3.5);
443 hist.
ADC = ib.
book1D(subdet+
" ADC count per time slice",subdet+
" ADC count per time slice",200,-0.5,199.5);
444 hist.
ADCsum = ib.
book1D(subdet+
" ADC sum", subdet+
" ADC sum",200,-0.5,199.5);
445 hist.
fibBCNOff = ib.
book1D(subdet+
" Fiber Orbit Message Idle BCN Offset", subdet+
" Fiber Orbit Message Idle BCN Offset;Offset from Expected",
464 if (dcsStatus.
isValid() && dcsStatus->size() != 0)
492 const unsigned int nTrig(triggerNames.
size());
493 for (
unsigned int i=0;
i<nTrig;++
i){
517 float en=
HF->energy();
518 int ieta=
HF->id().ieta();
574 if (fed.
size()<12)
continue;
577 if(!dccHeader)
return;
579 std::cout <<
"### Processing FED: " <<
i << std::endl;
591 std::cout <<
"### Number of TS=" << NTS << std::endl;
592 if (NTS==0)
continue;
595 if(dccid==720 && (spigot==12 || spigot==13))
continue;
596 if(dccid==722 && (spigot==12 || spigot==13))
continue;
601 if((dccid >= 1118 && dccid<=1122) ||
602 (dccid>=718 && dccid<=723))
611 if (
debug_>1)
std::cout <<
"\t<HcalDigiMonitor::analyze> Processing good event! event # = "<<
ievt_<<std::endl;
633 unsigned int allgooddigis= hbhe.
size()+ho.
size()+hf.
size();
638 if(bcN>=3446 && bcN<=3564)
644 if ((allgooddigis==0) ||
673 typedef std::vector<DetId> DetIdVector;
680 int rDepth =
id.
depth();
681 int rPhi =
id.iphi();
682 int rEta =
id.ieta();
683 int binEta =
CalcEtaBin(
id.subdet(), rEta, rDepth);
685 if (binEta < 85 && binEta >= 0
686 && (rPhi-1) >= 0 && (rPhi-1)<72
687 && (rDepth-1) >= 0 && (rDepth-1)<4)
702 if (
abs(rEta)>=11 &&
abs(rEta)<=15 && !
isSiPM(rEta,rPhi,rDepth))
continue;
705 if( (rEta>4 && rEta<10) && (rPhi<=10 || rPhi>70) )
continue;
718 ++
baddigis[binEta][rPhi-1][rDepth-1];
721 bool HEM15A =
true ? (
id.subdet()==
HcalEndcap && (rPhi>56 && rPhi<59 && rEta<0)) :
false;
722 bool HEM15B =
true ? (
id.subdet()==
HcalEndcap && (rPhi>54 && rPhi<57 && rEta<0)) :
false;
723 bool HBP14A =
true ? (
id.subdet()==
HcalBarrel && (rPhi>50 && rPhi<53 && rEta>0)) :
false;
726 if( HEM15A || HEM15B || HBP14A )
794 && (digi.
id().
iphi()<=10 || digi.
id().
iphi()>70) )
continue;
843 if (count_bad>0 || count_good>0)
912 template <
class DIGI>
948 int iEta = digi.id().ieta();
949 int iPhi = digi.id().iphi();
950 int iDepth = digi.id().depth();
951 int calcEta =
CalcEtaBin(digi.id().subdet(),iEta,iDepth);
954 if (digi.size()<mindigisize || digi.size()>maxdigisize)
961 ++
digisize[static_cast<int>(digi.size())][digi.id().subdet()-1];
963 ++
digisize[19][digi.id().subdet()-1];
969 if (firstcap==-1) firstcap = digi.sample(0).capid();
970 int capdif = digi.sample(0).capid() - firstcap;
973 if (capdif >-4 && capdif<4)
980 int offset = digi.fiberIdleOffset();
998 bool digi_error=
false;
1004 std::map<HcalDetId, std::vector<double> >::iterator foundID =
PedestalsByCapId_.find(digi.id());
1007 int thisCapid = digi.sample(
i).capid();
1008 if (thisCapid>=0 && thisCapid<4) ++h.
capid[thisCapid];
1012 if(
bitUpset(last,thisCapid)) bitUp=
true;
1017 if(digi.sample(
i).er()) err=(err|0x2);
1018 if(!digi.sample(
i).dv()) err=(err|0x2);
1020 if ((digi_error==
false) && (digi.sample(
i).er() || !digi.sample(
i).dv()))
1025 ++h.
dverr[
static_cast<int>(2*digi.sample(
i).er()+digi.sample(
i).dv())];
1031 if (
i==digi.size()-1)
continue;
1032 tssum= digi.sample(
i).adc()+digi.sample(
i+1).adc();
1033 if (tssum<50 && tssum>=0)
1041 if (digi.sample(
i).adc()<0) ++h.
adc[0];
1042 else if (digi.sample(
i).adc()<200) ++h.
adc[digi.sample(
i).adc()];
1045 if (
i>=pedSubADCsize)
continue;
1050 ADCcount+=(int)(digi.sample(
i).adc()-(foundID->second)[thisCapid]);
1055 ADCcount+=digi.sample(
i).adc()-3;
1063 ++
badcapID[calcEta][iPhi-1][iDepth-1];
1073 ++
baddigis[calcEta][iPhi-1][iDepth-1];
1074 ++
errorVME[
static_cast<int>(2*(digi.elecId().htrSlot()+0.5*digi.elecId().htrTopBottom()))][
static_cast<int>(digi.elecId().readoutVMECrateId())];
1075 ++
errorSpigot[
static_cast<int>(digi.elecId().spigot())][static_cast<int>(digi.elecId().dccid())];
1082 if (ADCcount<0) ADCcount=0;
1093 if (digi.id().subdet()!=
HcalOuter ||
isSiPM(iEta,iPhi, iDepth)==
false)
1095 for (
int i=0;
i<pedSubADCsize;++
i)
1106 ++
occupancyVME[
static_cast<int>(2*(digi.elecId().htrSlot()+0.5*digi.elecId().htrTopBottom()))][
static_cast<int>(digi.elecId().readoutVMECrateId())];
1107 ++
occupancySpigot[
static_cast<int>(digi.elecId().spigot())][static_cast<int>(digi.elecId().dccid())];
1117 double maxenergy=-1, fullenergy=0;
1121 fullenergy+=digi.sample(
ff).nominal_fC()-2.5;
1122 if (digi.sample(
ff).nominal_fC()-2.5>maxenergy)
1124 maxenergy=digi.sample(
ff).nominal_fC()-2.5;
1129 if (maxtime>=2 && maxtime<=5 && maxenergy>20 && maxenergy<100)
1133 if(digi.id().ieta()>0)
HFP_shape->
Fill(
ff,(digi.sample(
ff).nominal_fC()-2.5)/fullenergy);
1134 if(digi.id().ieta()<0)
HFM_shape->
Fill(
ff,(digi.sample(
ff).nominal_fC()-2.5)/fullenergy);
1138 double time_den=0, time_num=0;
1140 int startslice=
std::max(0,maxtime-1);
1141 int endslice=
std::min(digisize-1,maxtime+1);
1142 for (
int ss=startslice;
ss<=endslice;++
ss)
1145 time_num+=
ss*(digi.sample(
ss).nominal_fC()-2.5);
1146 time_den+=digi.sample(
ss).nominal_fC()-2.5;
1150 if (iDepth==2) ++myiphi;
1197 std::cout <<
"<HcalDigiMonitor> Calling fill_Nevents for event "<<
tevt_<<
" (processed events = "<<
ievt_<<
")"<<std::endl;
1198 int iPhi, iEta, iDepth;
1229 for (
int i=0;
i<10;++
i)
1231 for (
int j=0;
j<50;++
j)
1257 for (
int i=0;
i<4;++
i)
1270 for (
int i=0;
i<200;++
i)
1284 for (
int i = 0;
i < 15; ++
i)
1299 if (DIGI_BQ_FRAC_NBINS==1)
break;
1310 for (
int i=0;
i<50;++
i)
1319 for (
int i=0;
i<10;++
i)
1332 for (
int i=0;
i<8;++
i)
1341 for (
int i=0;
i<40;++
i)
1343 for (
int j=0;
j<18;++
j)
1353 for (
int j=0;
j<36;++
j)
1361 for (
int sub=0;sub<4;++sub)
1363 for (
int dsize=0;dsize<20;++dsize)
1371 for (
int d=0;d<4;++d)
1558 for (
int i=0;
i<85;++
i)
1563 for (
int j=0;
j<72;++
j)
1565 for (
int k=0;
k<4;++
k)
1578 for (
int i=0;
i<40;++
i)
1580 for (
int j=0;
j<18;++
j)
1589 for (
int j=0;
j<36;++
j)
1597 for (
int i=0;
i<20;++
i)
1599 for (
int j=0;
j<4;++
j)
1645 for (
int j=0;
j<10;++
j)
MonitorElement * h_invalid_bcn
bool passedMinBiasHLT_
Methods, variables accessible only within class code.
T getUntrackedParameter(std::string const &, T const &) const
bool LumiInOrder(int lumisec)
MonitorElement * DigiBQFrac
edm::EDGetTokenT< DcsStatusCollection > dcsStatusToken_
int getNDD() const
Get the number of daq data samples per channel when not zero-suppressed.
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
MonitorElement * ProblemsCurrentLB
MonitorElement * HFtiming_occupancy2D
std::vector< std::string > MinBiasHLTBits_
EtaPhiHists DigiErrorsDVErr
int occupancySpigot[40][36]
HcalSubdetector subdet() const
get the subdetector
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * DigiSize
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
MonitorElement * HFP_shape
MonitorElement * bookProfile(Args &&...args)
void bookHistograms(DQMStore::IBooker &ib, const edm::Run &run, const edm::EventSetup &c)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * ProblemsVsLB_HF
#define DEFINE_FWK_MODULE(type)
std::map< unsigned int, int > KnownBadCells_
MonitorElement * HFtiming_totaltime2D
std::vector< int > AllowedCalibTypes_
MonitorElement * shapeThresh
MonitorElement * HFM_shape
EtaPhiHists DigiErrorOccupancyByDepth
#define DIGI_BQ_FRAC_NBINS
virtual void cleanup(void)
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
MonitorElement * bookInt(Args &&...args)
std::vector< HFRecHit >::const_iterator const_iterator
int bunchCrossing() const
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
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
HcalDigiMonitor(const edm::ParameterSet &ps)
double pedestal(int fCapId) const
get pedestal for capid=0..3
const Item * getValues(DetId fId, bool throwOnFail=true) const
Strings::size_type size() const
void update(void)
Mark the object updated.
int badFibBCNOff[85][72][4]
MonitorElement * DigiOccupancyEta
MonitorElement * DigiErrorVME
MonitorElement * DigiOccupancyVME
MonitorElement * HOocc_vs_LB
size_t size() const
Lenght of the data buffer in bytes.
const HcalDetId & id() const
MonitorElement * ThreshCount
LuminosityBlockNumber_t luminosityBlock() const
std::map< HcalDetId, std::vector< double > > PedestalsByCapId_
MonitorElement * DigiErrorSpigot
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
EtaPhiHists DigiErrorsBadFibBCNOff
void SetupEtaPhiHists(DQMStore::IBooker &ib, EtaPhiHists &hh, std::string Name, std::string Units)
void UpdateHists(DigiHists &h)
bool isSiPM(int ieta, int iphi, int depth)
int depth() const
get the tower depth
std::vector< MonitorElement * > depth
int DigiMonitor_ExpectedOrbitMessageTime_
MonitorElement * HBocc_vs_LB
int baddigisize[85][72][4]
bool IsAllowedCalibType()
MonitorElement * ProblemsVsLB_HBHEHF
MonitorElement * ProblemsVsLB_HB
int digierrorsdverr[85][72][4]
uint64_t uniqcounter[85][72][4]
std::vector< DetId > getAllChannels() const
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)
DetIdVector::const_iterator bad_quality_begin() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
const float bins_cellcount_new[]
std::vector< MonitorElement * > TS_sum_minus
MonitorElement * HFocc_vs_LB
edm::EDGetTokenT< HcalUnpackerReport > tok_unpack_
std::vector< MonitorElement * > TS_sum_plus
int process_Digi(T &digi, DigiHists &hist, int &firstcap)
uint64_t uniqcounter2[85][72][4]
const_iterator end() const
MonitorElement * DigiUnpackerErrorCount
MonitorElement * HEocc_vs_LB
int iphi() const
get the cell iphi
EtaPhiHists DigiErrorsBadDigiSize
bool digi_checkoccupancy_
int badChannelStatusMask_
MonitorElement * fibBCNOff
void setCurrentFolder(const std::string &fullpath)
static const double theHFEtaBounds[]
static bool bitUpset(int last, int now)
MonitorElement * book2D(Args &&...args)
MonitorElement * DigiOccupancySpigot
std::string const & triggerName(unsigned int index) const
EtaPhiHists DigiErrorsBadADCSum
edm::InputTag hltresultsLabel_
MonitorElement * HFtiming_etaProfile
T const * product() const
MonitorElement * ProblemsVsLB_HE
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
int CalcEtaBin(int subdet, int ieta, int depth)
void analyze(const edm::Event &e, const edm::EventSetup &c)
edm::EDGetTokenT< HODigiCollection > tok_ho_
edm::InputTag FEDRawDataCollection_
MonitorElement * h_invalid_orbitnumMod103
int badQualityDigis() const
int occupancyEtaPhi[85][72][4]
void setup(DQMStore::IBooker &)
edm::EDGetTokenT< HFDigiCollection > tok_hf_
edm::EDGetTokenT< FEDRawDataCollection > FEDRawDataCollectionToken_
MonitorElement * h_valid_digis
static std::atomic< unsigned int > counter
double count_shapeThresh[10]
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
edm::EDGetTokenT< edm::TriggerResults > tok_trigger_
void setupSubdetHists(DQMStore::IBooker &ib, DigiHists &hist, std::string subdet)
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
const HcalDetId & id() const
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
MonitorElement * DigiUnpackerErrorFrac
MonitorElement * DigiFirstCapID
EtaPhiHists DigiErrorsBadCapID
MonitorElement * ProblemsVsLB_HO
EtaPhiHists DigiOccupancyByDepth
MonitorElement * ProblemsVsLB
if(conf.exists("allCellsPositionCalc"))
int badunpackerreport[85][72][4]
MonitorElement * presample
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * DigiExpectedSize
void processEvent(const HBHEDigiCollection &hbhe, const HODigiCollection &ho, const HFDigiCollection &hf, const HcalDbService &cond, const HcalUnpackerReport &report, int orN, int bcN)
void Reset(void)
reset ME (ie. contents, errors, etc)
virtual void setup(DQMStore::IBooker &)
edm::EDGetTokenT< HFRecHitCollection > tok_hfrec_
EtaPhiHists DigiErrorsByDepth
EtaPhiHists DigiErrorsUnpacker
edm::ESHandle< HcalDbService > conditions_
const float bins_fraccount_new[]
const_iterator begin() const
DetIdVector::const_iterator bad_quality_end() const
MonitorElement * DigiOccupancyPhi
MonitorElement * ProblemDigisInLastNLB_HBHEHF_alarm
double pedSubtractedADC_[10]
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
void endRun(const edm::Run &run, const edm::EventSetup &c)
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_