21 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
22 prefixME_.append(
"/");
45 std::cout <<
"<HcalDigiMonitor> Digi shape ADC threshold set to: >" << shapeThresh_ <<
" counts above nominal pedestal (3*10)"<< std::endl;
58 std::cout <<
"<HcalDigiMonitor> Checking for the following problems:"<<std::endl;
59 if (digi_checkcapid_)
std::cout <<
"\tChecking that cap ID rotation is correct;"<<std::endl;
60 if (digi_checkdigisize_)
std::cout <<
"\tChecking that digi size is between ["<<mindigisize_<<
" - "<<maxdigisize_<<
"];"<<std::endl;
61 if (digi_checkadcsum_)
std::cout <<
"\tChecking that ADC sum of digi is greater than 0;"<<std::endl;
62 if (digi_checkdverr_)
std::cout <<
"\tChecking that data valid bit is true and digi error bit is false;\n"<<std::endl;
80 if(last ==-1)
return false;
83 if(v==now)
return false;
142 std::cout <<
"<HcalDigiMonitor::beginRun> Setting up histograms"<<std::endl;
144 std::ostringstream
name;
217 h_invalid_bcn=
dbe_->
book1D(
"InvalidDigiEvents_BCN",
"Bunch Crossing Number fo Events with Many Unpacker Errors",3464,-0.5,3563.5);
247 "Digi Phi Occupancy Map;i#phi;# of Events",
250 "Digi Eta Occupancy Map;i#eta;# of Events",
253 "Digi VME Occupancy Map;HTR Slot;VME Crate Id",
254 40,-0.25,19.75,18,-0.5,17.5);
257 "Digi Spigot Occupancy Map;Spigot;DCC Id",
263 "Digi VME Error Map;HTR Slot;VME Crate Id",
264 40,-0.25,19.75,18,-0.5,17.5);
267 "Digi Spigot Error Map;Spigot;DCC Id",
278 DigiBQFrac =
dbe_->
book1D(
"Bad Digi Fraction",
"Bad Digi Fraction;Bad Quality Digi Fraction for digis in collection; # of Events",
286 "Bad Digis From Unpacker/ (Bad Digis From Unpacker + Good Digis); Bad Unpacker Fraction; # of Events",
306 if (
debug_>1)
std::cout <<
"\t<HcalDigiMonitor::setup> Getting conditions from DB!"<<std::endl;
317 for (std::vector<DetId>::const_iterator chan = mydetids.begin();chan!=mydetids.end();++chan)
320 std::vector <double> peds;
325 for (
int capid=0;capid<4;++capid)
328 double temp_ADC=channelCoder->
adc(*shape,(
float)calibs.
pedestal(capid),capid);
329 peds.push_back(temp_ADC);
344 std::stringstream
name;
346 if (subdet==
"HB" || subdet==
"HE") nChan=2592;
347 else if (subdet ==
"HO") nChan=2160;
348 else if (subdet ==
"HF") nChan=1728;
351 hist.
shape =
dbe_->
book1D(subdet+
" Digi Shape",subdet+
" Digi Shape;Time Slice",10,-0.5,9.5);
353 subdet+
" Digi Shape - over thresh passing trigger and HF HT cuts;Time slice",
356 subdet+
" Total Digis Over Threshold",
359 for (
int ts=0;ts<9;++ts)
361 name<<subdet<<
" Plus Time Slices "<<ts<<
" and "<<ts+1;
364 name<<subdet<<
" Minus Time Slices "<<ts<<
" and "<<ts+1;
368 hist.
presample=
dbe_->
book1D(subdet+
" Digi Presamples",subdet+
" Digi Presamples",50,-0.5,49.5);
369 hist.
BQ =
dbe_->
book1D(subdet+
" Bad Quality Digis",subdet+
" Bad Quality Digis",nChan+1,-0.5,nChan+0.5);
372 hist.
DigiFirstCapID =
dbe_->
book1D(subdet+
" Capid 1st Time Slice",subdet+
" Capid for 1st Time Slice;CapId (T0)- 1st CapId (T0);# of Events",7,-3.5,3.5);
374 hist.
DVerr =
dbe_->
book1D(subdet+
" Data Valid Err Bits",subdet+
" QIE Data Valid Err Bits",4,-0.5,3.5);
380 hist.
ADC =
dbe_->
book1D(subdet+
" ADC count per time slice",subdet+
" ADC count per time slice",200,-0.5,199.5);
381 hist.
ADCsum =
dbe_->
book1D(subdet+
" ADC sum", subdet+
" ADC sum",200,-0.5,199.5);
382 hist.
fibBCNOff =
dbe_->
book1D(subdet+
" Fiber Orbit Message Idle BCN Offset", subdet+
" Fiber Orbit Message Idle BCN Offset;Offset from Expected",
402 const unsigned int nTrig(triggerNames.
size());
403 for (
unsigned int i=0;
i<nTrig;++
i){
419 bool rechitsFound=
false;
426 float en=HF->energy();
427 int ieta=HF->
id().ieta();
469 if (
debug_>1)
std::cout <<
"\t<HcalDigiMonitor::analyze> Processing good event! event # = "<<
ievt_<<std::endl;
489 std::cout <<
"HcalDigiMonitor::processEvent DQMStore not instantiated!!!"<<std::endl;
497 unsigned int allgooddigis= hbhe.
size()+ho.
size()+hf.
size();
500 if ((allgooddigis==0) ||
528 typedef std::vector<DetId> DetIdVector;
538 int rDepth =
id.depth();
539 int rPhi =
id.iphi();
540 int rEta =
id.ieta();
541 int binEta =
CalcEtaBin(
id.subdet(), rEta, rDepth);
547 if (rDepth==1 && (
abs(rEta)==33 ||
abs(rEta)==34)) ++HFlumibad;
548 else if (rDepth==2 && (
abs(rEta)==35 ||
abs(rEta)==36)) ++HFlumibad;
554 if (
abs(rEta)>=11 &&
abs(rEta)<=15 && !
isSiPM(rEta,rPhi,rDepth))
continue;
557 if (
abs(rEta)<5) ++HO0bad;
563 if (binEta < 85 && binEta >= 0
564 && (rPhi-1) >= 0 && (rPhi-1)<72
565 && (rDepth-1) >= 0 && (rDepth-1)<4)
568 ++
baddigis[binEta][rPhi-1][rDepth-1];
671 if (count_bad>0 || count_good>0)
739 template <
class DIGI>
756 int iEta = digi.id().ieta();
757 int iPhi = digi.id().iphi();
758 int iDepth = digi.id().depth();
759 int calcEta =
CalcEtaBin(digi.id().subdet(),iEta,iDepth);
769 ++
digisize[static_cast<int>(digi.size())][digi.id().subdet()-1];
771 ++
digisize[19][digi.id().subdet()-1];
777 if (firstcap==-1) firstcap = digi.sample(0).capid();
778 int capdif = digi.sample(0).capid() - firstcap;
781 if (capdif >-4 && capdif<4)
788 int offset = digi.fiberIdleOffset();
806 bool digi_error=
false;
812 std::map<HcalDetId, std::vector<double> >::iterator foundID =
PedestalsByCapId_.find(digi.id());
815 int thisCapid = digi.sample(
i).capid();
816 if (thisCapid>=0 && thisCapid<4) ++h.
capid[thisCapid];
820 if(
bitUpset(last,thisCapid)) bitUp=
true;
825 if(digi.sample(
i).er()) err=(err|0x2);
826 if(!digi.sample(
i).dv()) err=(err|0x2);
828 if ((digi_error==
false) && (digi.sample(
i).er() || !digi.sample(
i).dv()))
833 ++h.
dverr[
static_cast<int>(2*digi.sample(
i).er()+digi.sample(
i).dv())];
839 if (
i==digi.size()-1)
continue;
840 tssum= digi.sample(
i).adc()+digi.sample(
i+1).adc();
841 if (tssum<45 && tssum>=-5)
849 if (digi.sample(
i).adc()<0) ++h.
adc[0];
850 else if (digi.sample(
i).adc()<200) ++h.
adc[digi.sample(
i).adc()];
853 if (
i>=pedSubADCsize)
continue;
858 ADCcount+=(int)(digi.sample(
i).adc()-(foundID->second)[thisCapid]);
863 ADCcount+=digi.sample(
i).adc()-3;
871 ++
badcapID[calcEta][iPhi-1][iDepth-1];
878 ++
baddigis[calcEta][iPhi-1][iDepth-1];
879 ++
errorVME[
static_cast<int>(2*(digi.elecId().htrSlot()+0.5*digi.elecId().htrTopBottom()))][
static_cast<int>(digi.elecId().readoutVMECrateId())];
880 ++
errorSpigot[
static_cast<int>(digi.elecId().spigot())][static_cast<int>(digi.elecId().dccid())];
884 if (ADCcount<0) ADCcount=0;
897 for (
int i=0;
i<pedSubADCsize;++
i)
908 ++
occupancyVME[
static_cast<int>(2*(digi.elecId().htrSlot()+0.5*digi.elecId().htrTopBottom()))][
static_cast<int>(digi.elecId().readoutVMECrateId())];
909 ++
occupancySpigot[
static_cast<int>(digi.elecId().spigot())][static_cast<int>(digi.elecId().dccid())];
919 double maxenergy=-1, fullenergy=0;
923 fullenergy+=digi.sample(
ff).nominal_fC()-2.5;
924 if (digi.sample(
ff).nominal_fC()-2.5>maxenergy)
926 maxenergy=digi.sample(
ff).nominal_fC()-2.5;
931 if (maxtime>=2 && maxtime<=5 && maxenergy>20 && maxenergy<100)
935 if(digi.id().ieta()>0)
HFP_shape->
Fill(
ff,(digi.sample(
ff).nominal_fC()-2.5)/fullenergy);
936 if(digi.id().ieta()<0)
HFM_shape->
Fill(
ff,(digi.sample(
ff).nominal_fC()-2.5)/fullenergy);
940 double time_den=0, time_num=0;
942 int startslice=
std::max(0,maxtime-1);
943 int endslice=
std::min(digisize-1,maxtime+1);
944 for (
int ss=startslice;ss<=endslice;++ss)
947 time_num+=ss*(digi.sample(ss).nominal_fC()-2.5);
948 time_den+=digi.sample(ss).nominal_fC()-2.5;
952 if (iDepth==2) ++myiphi;
983 std::cout <<
"<HcalDigiMonitor> Calling fill_Nevents for event "<<
tevt_<<
" (processed events = "<<
ievt_<<
")"<<std::endl;
984 int iPhi, iEta, iDepth;
988 for (
int i=0;
i<10;++
i)
990 for (
int j=0;
j<50;++
j)
1016 for (
int i=0;
i<4;++
i)
1029 for (
int i=0;
i<200;++
i)
1043 for (
int i = 0;
i < 15; ++
i)
1058 if (DIGI_BQ_FRAC_NBINS==1)
break;
1069 for (
int i=0;
i<50;++
i)
1078 for (
int i=0;
i<10;++
i)
1091 for (
int i=0;
i<8;++
i)
1100 for (
int i=0;
i<40;++
i)
1102 for (
int j=0;
j<18;++
j)
1112 for (
int j=0;
j<36;++
j)
1120 for (
int sub=0;sub<4;++sub)
1122 for (
int dsize=0;dsize<20;++dsize)
1130 for (
int d=0;d<4;++d)
1243 int zside = iEta/
abs(iEta);
1293 for (
int i=0;
i<85;++
i)
1298 for (
int j=0;
j<72;++
j)
1300 for (
int k=0;
k<4;++
k)
1313 for (
int i=0;
i<40;++
i)
1315 for (
int j=0;
j<18;++
j)
1324 for (
int j=0;
j<36;++
j)
1332 for (
int i=0;
i<20;++
i)
1334 for (
int j=0;
j<4;++
j)
1380 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
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 * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * DigiSize
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
MonitorElement * HFP_shape
MonitorElement * ProblemsVsLB_HF
#define DEFINE_FWK_MODULE(type)
MonitorElement * HFtiming_totaltime2D
std::vector< int > AllowedCalibTypes_
MonitorElement * shapeThresh
void beginRun(const edm::Run &run, const edm::EventSetup &c)
MonitorElement * HFM_shape
EtaPhiHists DigiErrorOccupancyByDepth
#define DIGI_BQ_FRAC_NBINS
std::vector< T >::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
HcalDigiMonitor(const edm::ParameterSet &ps)
double pedestal(int fCapId) const
get pedestal for capid=0..3
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
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)
edm::InputTag hfRechitLabel_
EtaPhiHists DigiErrorsBadFibBCNOff
void UpdateHists(DigiHists &h)
bool isSiPM(int ieta, int iphi, int depth)
std::vector< MonitorElement * > depth
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
int DigiMonitor_ExpectedOrbitMessageTime_
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
MonitorElement * HBocc_vs_LB
int baddigisize[85][72][4]
bool IsAllowedCalibType()
const T & max(const T &a, const T &b)
MonitorElement * ProblemsVsLB_HBHEHF
MonitorElement * ProblemsVsLB_HB
int digierrorsdverr[85][72][4]
std::vector< DetId > getAllChannels() const
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
float bins_cellcount_new[]
DetIdVector::const_iterator bad_quality_begin() const
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
std::vector< MonitorElement * > TS_sum_minus
MonitorElement * HFocc_vs_LB
unsigned int offset(bool)
std::vector< MonitorElement * > TS_sum_plus
int process_Digi(T &digi, DigiHists &hist, int &firstcap)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const_iterator end() const
MonitorElement * DigiUnpackerErrorCount
MonitorElement * HEocc_vs_LB
EtaPhiHists DigiErrorsBadDigiSize
bool digi_checkoccupancy_
MonitorElement * fibBCNOff
static const double theHFEtaBounds[]
int count_BQFrac[DIGI_BQ_FRAC_NBINS]
static bool bitUpset(int last, int now)
MonitorElement * DigiOccupancySpigot
std::string const & triggerName(unsigned int index) const
EtaPhiHists DigiErrorsBadADCSum
edm::InputTag hltresultsLabel_
int count_BQ[DIGI_SUBDET_NUM]
MonitorElement * HFtiming_etaProfile
T const * product() const
void FillUnphysicalHEHFBins(EtaPhiHists &hh)
MonitorElement * ProblemsVsLB_HE
int CalcEtaBin(int subdet, int ieta, int depth)
void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * h_invalid_orbitnumMod103
void SetupEtaPhiHists(EtaPhiHists &hh, std::string Name, std::string Units)
int badQualityDigis() const
int occupancyEtaPhi[85][72][4]
float bins_fraccount_new[]
MonitorElement * h_valid_digis
double count_shapeThresh[10]
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
perl if(1 lt scalar(@::datatypes))
const HcalDetId & id() const
MonitorElement * DigiUnpackerErrorFrac
MonitorElement * DigiFirstCapID
EtaPhiHists DigiErrorsBadCapID
MonitorElement * ProblemsVsLB_HO
void setupSubdetHists(DigiHists &hist, std::string subdet)
EtaPhiHists DigiOccupancyByDepth
MonitorElement * ProblemsVsLB
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
int badunpackerreport[85][72][4]
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
MonitorElement * presample
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
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)
EtaPhiHists DigiErrorsByDepth
EtaPhiHists DigiErrorsUnpacker
edm::ESHandle< HcalDbService > conditions_
void setCurrentFolder(const std::string &fullpath)
const_iterator begin() const
DetIdVector::const_iterator bad_quality_end() const
MonitorElement * DigiOccupancyPhi
double pedSubtractedADC_[10]
bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
void endRun(const edm::Run &run, const edm::EventSetup &c)