10 if (prefixME_.substr(prefixME_.size()-1, prefixME_.size())!=
"/")
11 prefixME_.append(
"/");
212 ZDC_TotalChannelErrors =
dbe_->
book2D(
"ZDC_TotalChannelErrors",
"Total Number of Errors(Digi Error, Hot Cell or Dead Cell) Per Channel in the ZDC" ,2,0,2,9,0,9);
300 for (
int i = 0;
i < 5; ++
i) {
302 sprintf(title,
"h_ZDCP_EMChan_%i_Pulse",
i + 1);
303 sprintf(name,
"ZDC Plus EM Section Pulse for channel %i",
i + 1);
308 sprintf(title,
"h_ZDCM_EMChan_%i_Pulse",
i + 1);
309 sprintf(name,
"ZDC Minus EM Section Pulse for channel %i",
i + 1);
314 sprintf(title,
"h_ZDCP_EMChan_%i_Charge",
i + 1);
315 sprintf(name,
"ZDC Plus EM Section Charge for channel %i",
i + 1);
320 sprintf(title,
"h_ZDCM_EMChan_%i_Charge",
i + 1);
321 sprintf(name,
"ZDC Minus EM Section Charge for channel %i",
i + 1);
326 sprintf(title,
"h_ZDCP_EMChan_%i_TSMean",
i + 1);
327 sprintf(name,
"ZDC Plus EM Section TSMean for channel %i",
i + 1);
332 sprintf(title,
"h_ZDCM_EMChan_%i_TSMean",
i + 1);
333 sprintf(name,
"ZDC Minus EM Section TSMean for channel %i",
i + 1);
339 for (
int i = 0;
i < 4; ++
i) {
341 sprintf(title,
"h_ZDCP_HADChan_%i_Pulse",
i + 1);
342 sprintf(name,
"ZDC Plus HAD Section Pulse for channel %i",
i + 1);
347 sprintf(title,
"h_ZDCM_HADChan_%i_Pulse",
i + 1);
348 sprintf(name,
"ZDC Minus HAD Section Pulse for channel %i",
i + 1);
353 sprintf(title,
"h_ZDCP_HADChan_%i_Charge",
i + 1);
354 sprintf(name,
"ZDC Plus HAD Section Charge for channel %i",
i + 1);
359 sprintf(title,
"h_ZDCM_HADChan_%i_Charge",
i + 1);
360 sprintf(name,
"ZDC Minus HAD Section Charge for channel %i",
i + 1);
365 sprintf(title,
"h_ZDCP_HADChan_%i_TSMean",
i + 1);
366 sprintf(name,
"ZDC Plus HAD Section TSMean for channel %i",
i + 1);
371 sprintf(title,
"h_ZDCM_HADChan_%i_TSMean",
i + 1);
372 sprintf(name,
"ZDC Minus HAD Section TSMean for channel %i",
i + 1);
379 for (
int i = 0;
i < 5; ++
i) {
381 sprintf(title,
"h_ZDCP_EMChan_%i_RecHit_Energy",
i+1);
382 sprintf(name,
"ZDC EM Section Rechit Energy for channel %i",
i+1);
387 sprintf(title,
"h_ZDCM_EMChan_%i_RecHit_Energy",
i+1);
388 sprintf(name,
"ZDC EM Section Rechit Energy for channel %i",
i+1);
393 sprintf(title,
"h_ZDCP_EMChan_%i_RecHit_Timing",
i+1);
394 sprintf(name,
"ZDC EM Section Rechit Timing for channel %i",
i+1);
399 sprintf(title,
"h_ZDCM_EMChan_%i_RecHit_Timing",
i+1);
400 sprintf(name,
"ZDC EM Section Rechit Timing for channel %i",
i+1);
406 for (
int i = 0;
i < 4; ++
i) {
408 sprintf(title,
"h_ZDCP_HADChan_%i_RecHit_Energy",
i+1);
409 sprintf(name,
"ZDC HAD Section Rechit Energy for channel %i",
i+1);
414 sprintf(title,
"h_ZDCM_HADChan_%i_RecHit_Energy",
i+1);
415 sprintf(name,
"ZDC HAD Section Rechit Energy for channel %i",
i+1);
420 sprintf(title,
"h_ZDCP_HADChan_%i_RecHit_Timing",
i+1);
421 sprintf(name,
"ZDC HAD Section Rechit Timing for channel %i",
i+1);
426 sprintf(title,
"h_ZDCM_HADChan_%i_RecHit_Timing",
i+1);
427 sprintf(name,
"ZDC HAD Section Rechit Timing for channel %i",
i+1);
442 for (
int i=0;
i<18;++
i)
454 for(
int i=0;
i<18;++
i)
487 for (
int i=0;
i<18;++
i)
505 std::vector<double> fData;
506 double digiThresh = 99.5;
508 int digiSaturation = 127;
521 for (
int i=0;
i<18;++
i)
531 typedef std::vector<DetId> DetIdVector;
537 DetId id(baddigi_iter->rawId());
544 int iSide =
id.zside();
545 int iSection =
id.section();
546 int iChannel =
id.channel();
547 if(iSection==1 || iSection==2){
549 DeadChannelError[(9*((1-iSide)/2))+(iChannel-1)+(5*((iSection-1)%2))]=
false;
565 digi_iter != digi.
end(); ++digi_iter)
569 int iSide = digi_iter->id().zside();
570 int iSection = digi_iter->id().section();
571 int iChannel = digi_iter->id().channel();
573 unsigned int fTS = digi_iter->
size();
574 while (fData.size()<fTS)
575 fData.push_back(-999);
576 while (fData.size()>fTS)
579 if (iSection==1 || iSection==2)
586 DeadChannelError[(9*((1-iSide)/2))+(iChannel-1)+(5*((iSection-1)%2))]=
false;
590 int iCapIDPrevious=27;
594 for (
int iTS=0; iTS<digi.
size(); ++iTS)
597 if (digi[iTS].
adc()==127) HotCounter+=1;
599 if (HotCounter >= 3)
HotChannelError[(9*((1-iSide)/2))+(iChannel-1)+(5*((iSection-1)%2))]=
true;
604 if (digi[iTS].
adc()<=10) ColdCounter+=1;
617 if (iTS>0) iCapIDPrevious=digi.
sample(iTS-1).
capid();
622 DigiErrorDVER[(9*((1-iSide)/2))+(iChannel-1)+(5*((iSection-1)%2))]=
true;
627 if (iTS==0)
continue;
630 if ((iCapID-iCapIDPrevious+4)%4!=1)
633 DigiErrorCAPID[(9*((1-iSide)/2))+(iChannel-1)+(5*((iSection-1)%2))]=
true;
647 bool saturated =
false;
648 for (
unsigned int i = 0;
i < fTS; ++
i)
651 fData[
i]=digi[
i].nominal_fC();
652 if (digi[
i].
adc()==digiSaturation){
659 fTSMean =
getTime(fData, 4, 6, fSum);
661 if (saturated==
true){
668 for (
unsigned int i = 0;
i < fTS; ++
i) {
671 if (fSum > digiThresh) {
678 for (
unsigned int i = 0;
i < fTS; ++
i) {
681 if (fSum > digiThresh) {
688 else if (iSection == 2)
691 for (
unsigned int i = 0;
i < fTS; ++
i) {
694 if (fSum > digiThresh) {
700 for (
unsigned int i = 0;
i < fTS; ++
i) {
703 if (fSum > digiThresh) {
720 for (
int i = 0;
i<18;
i++){
764 rechit_iter != rechit.
end(); ++rechit_iter)
767 int Side = (rechit_iter->id()).zside();
768 int Section = (rechit_iter->id()).section();
769 int Channel = (rechit_iter->id()).channel();
831 double weightedTime = 0.;
834 double digiThreshf = 99.5;
836 for (
unsigned int ts=ts_min; ts<=ts_max; ++ts) {
837 if (fData[ts] > digiThreshf){
838 weightedTime += ts * fData[ts];
844 Time = weightedTime / SumT;
857 bool HadLumiError[18]={
false};
863 for (
int i=0;
i<18;++
i)
882 HadLumiError[
i]=
true;
890 HadLumiError[
i]=
true;
892 if (HadLumiError[i]==
true)
926 for (
int i=0;
i<18;++
i)
945 HadLumiError[
i]=
true;
953 HadLumiError[
i]=
true;
955 if (HadLumiError[i]==
true)
996 for (
int i = 0;
i < 5; ++
i) {
1008 for (
int i = 0;
i < 4; ++
i) {
int adc(sample_type sample)
get the ADC sample (12 bits)
virtual void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
MonitorElement * h_ZDCP_HAD_TSMean[4]
T getParameter(std::string const &) const
bool ChannelHasDigiError[18]
T getUntrackedParameter(std::string const &, T const &) const
bool LumiInOrder(int lumisec)
void setBinContent(int binx, double content)
set content of bin (1-D)
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
MonitorElement * ZDC_DigiErrorsVsLS
MonitorElement * h_ZDCP_HAD_RecHitTiming[4]
MonitorElement * h_ZDCM_EM_Pulse[5]
MonitorElement * h_ZDCM_HAD_TSMean[4]
int ColdChannelCounter[18]
MonitorElement * ZDC_Hot_Channel_Errors
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * h_ZDCM_EM_TSMean[5]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * h_ZDCM_EM_RecHitTiming[5]
MonitorElement * NZDC_QualityIndexVsLB_
MonitorElement * ZDC_Dead_Channel_Errors
double getTime(std::vector< double > fData, unsigned int ts_min, unsigned int ts_max, double &fSum)
MonitorElement * h_2D_TSMean
MonitorElement * h_ZDCM_HAD_RecHitTiming[4]
#define DEFINE_FWK_MODULE(type)
int OfflineColdThreshold_
MonitorElement * h_ZDCP_EM_RecHitEnergy[5]
std::vector< int > AllowedCalibTypes_
edm::InputTag rechitLabel_
std::vector< T >::const_iterator const_iterator
MonitorElement * h_ZDCP_EM_Pulse[5]
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)
bool dv() const
is the Data Valid bit set?
edm::LuminosityBlockNumber_t luminosityBlock() const
std::vector< double > ChannelWeighting_
MonitorElement * h_ZDCP_EM_TSMean[5]
MonitorElement * h_ZDCM_EM_Charge[5]
std::vector< double > MaxErrorRates_
MonitorElement * ZDC_DeadChannelErrorsVsLS
MonitorElement * ZDC_HotChannelErrorsVsLS
MonitorElement * h_ZDCP_HAD_Charge[4]
MonitorElement * ZDC_ColdChannelErrorsVsLS
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
void analyze(const edm::Event &e, const edm::EventSetup &c)
bool IsAllowedCalibType()
void processEvent(const ZDCDigiCollection &digi, const ZDCRecHitCollection &rechit, const HcalUnpackerReport &report)
const HcalQIESample & sample(int i) const
access a sample
MonitorElement * ZDC_DigiErrors_CAPID
MonitorElement * ZDC_DigiErrors_DVER
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
DetIdVector::const_iterator bad_quality_begin() const
MonitorElement * h_2D_saturation
MonitorElement * h_2D_charge
MonitorElement * h_2D_RecHitTime
MonitorElement * h_ZDCM_HAD_Charge[4]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * h_ZDCM_HAD_RecHitEnergy[4]
MonitorElement * ZDC_Cold_Channel_Errors
const_iterator end() const
int OfflineDeadThreshold_
MonitorElement * PZDC_QualityIndexVsLB_
MonitorElement * h_2D_RecHitEnergy
static const int SubdetectorId
int capid() const
get the Capacitor id
HcalZDCMonitor(const edm::ParameterSet &ps)
bool DeadChannelError[18]
void endRun(const edm::Run &run, const edm::EventSetup &c)
MonitorElement * EventsVsLS
MonitorElement * h_ZDCP_HAD_Pulse[4]
int size() const
total number of samples in the digi
MonitorElement * h_ZDCM_EM_RecHitEnergy[5]
virtual void endRun(const edm::Run &run, const edm::EventSetup &c)
MonitorElement * ZDC_Digi_Errors
MonitorElement * ZDC_TotalChannelErrors
MonitorElement * h_ZDCP_HAD_RecHitEnergy[4]
int TotalChannelErrors[18]
int DeadChannelCounter[18]
TH2F * getTH2F(void) const
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.
MonitorElement * h_ZDCP_EM_Charge[5]
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
bool er() const
is the error bit set?
void setCurrentFolder(const std::string &fullpath)
void beginRun(const edm::Run &run, const edm::EventSetup &c)
const_iterator begin() const
DetIdVector::const_iterator bad_quality_end() const
MonitorElement * h_ZDCP_EM_RecHitTiming[5]
MonitorElement * h_ZDCM_HAD_Pulse[4]