65 constexpr float adc2fC[128]={-0.5,0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5, 10.5,11.5,12.5,
66 13.5,15.,17.,19.,21.,23.,25.,27.,29.5,32.5,35.5,38.5,42.,46.,50.,54.5,59.5,
67 64.5,59.5,64.5,69.5,74.5,79.5,84.5,89.5,94.5,99.5,104.5,109.5,114.5,119.5,
68 124.5,129.5,137.,147.,157.,167.,177.,187.,197.,209.5,224.5,239.5,254.5,272.,
69 292.,312.,334.5,359.5,384.5,359.5,384.5,409.5,434.5,459.5,484.5,509.5,534.5,
70 559.5,584.5,609.5,634.5,659.5,684.5,709.5,747.,797.,847.,897.,947.,997.,
71 1047.,1109.5,1184.5,1259.5,1334.5,1422.,1522.,1622.,1734.5,1859.5,1984.5,
72 1859.5,1984.5,2109.5,2234.5,2359.5,2484.5,2609.5,2734.5,2859.5,2984.5,
73 3109.5,3234.5,3359.5,3484.5,3609.5,3797.,4047.,4297.,4547.,4797.,5047.,
74 5297.,5609.5,5984.5,6359.5,6734.5,7172.,7672.,8172.,8734.5,9359.5,9984.5};
76 constexpr char const *
subdets[11]={
"HBM",
"HBP",
"HEM",
"HEP",
"HO1M",
"HO0",
"HO1P",
"HO2M",
"HO2P",
"HFM",
"HFP"};
78 "HBM01",
"HBM02",
"HBM03",
"HBM04",
"HBM05",
"HBM06",
"HBM07",
"HBM08",
"HBM09",
"HBM10",
"HBM11",
"HBM12",
"HBM13",
"HBM14",
"HBM15",
"HBM16",
"HBM17",
"HBM18",
79 "HBP01",
"HBP02",
"HBP03",
"HBP04",
"HBP05",
"HBP06",
"HBP07",
"HBP08",
"HBP09",
"HBP10",
"HBP11",
"HBP12",
"HBP13",
"HBP14",
"HBP15",
"HBP16",
"HBP17",
"HBP18"};
81 "HEM01",
"HEM02",
"HEM03",
"HEM04",
"HEM05",
"HEM06",
"HEM07",
"HEM08",
"HEM09",
"HEM10",
"HEM11",
"HEM12",
"HEM13",
"HEM14",
"HEM15",
"HEM16",
"HEM17",
"HEM18",
82 "HEP01",
"HEP02",
"HEP03",
"HEP04",
"HEP05",
"HEP06",
"HEP07",
"HEP08",
"HEP09",
"HEP10",
"HEP11",
"HEP12",
"HEP13",
"HEP14",
"HEP15",
"HEP16",
"HEP17",
"HEP18"};
84 "HO2M02",
"HO2M04",
"HO2M06",
"HO2M08",
"HO2M10",
"HO2M12",
"HO1M02",
"HO1M04",
"HO1M06",
"HO1M08",
"HO1M10",
"HO1M12",
85 "HO001",
"HO002",
"HO003",
"HO004",
"HO005",
"HO006",
"HO007",
"HO008",
"HO009",
"HO010",
"HO011",
"HO012",
86 "HO1P02",
"HO1P04",
"HO1P06",
"HO1P08",
"HO1P10",
"HO1P12",
"HO2P02",
"HO2P04",
"HO2P06",
"HO2P08",
"HO2P10",
"HO2P12",
97 n_th_hi=n_th_300=n_pix_1=n_pix_8=pix=n_pix=0;
100 n_th_hi_LS=n_th_300_LS=0;
117 n_pix_hi=n_pix_lo=
energy=n_zero=0;
137 if(rbx.substr(0,3)==
"HO0"){
138 int sect=atoi(rbx.substr(3,2).c_str());
139 if(sect>12)
return -1;
140 if(rm==1 && (sect==2 || sect==3 || sect==6 || sect==7 || sect==10 || sect==11))
return -1;
141 if(rm==4 && (sect==12 || sect==1 || sect==4 || sect==5 || sect==8 || sect==9 ))
return -1;
143 if(rbx.substr(0,3)==
"HO1" || rbx.substr(0,3)==
"HO2"){
144 int sect=atoi(rbx.substr(4,2).c_str());
145 if(sect>12)
return -1;
146 if(sect==1 || sect==3 || sect==5 || sect==7 || sect==9 || sect==11)
return -1;
149 if(
id.rawId()==0)
return -1;
174 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
175 prefixME_.append(
"/");
210 if (
debug_>1)
std::cout <<
"HcalDetDiagNoiseMonitor::bookHistograms"<<std::endl;
234 name=
"RBX Pixel multiplicity";
PixelMult = ib.
book1D(name,name,73,0,73);
237 name=
"Number of zero TS per RBX";
NZeroes = ib.
book1D(name,name,100,0,100);
242 name=
"HBP HPD Noise Rate Pixel above 50fC";
HBP_Rate50 = ib.
book1D(name,name,73,0,73);
243 name=
"HBM HPD Noise Rate Pixel above 50fC";
HBM_Rate50 = ib.
book1D(name,name,73,0,73);
244 name=
"HEP HPD Noise Rate Pixel above 50fC";
HEP_Rate50 = ib.
book1D(name,name,73,0,73);
245 name=
"HEM HPD Noise Rate Pixel above 50fC";
HEM_Rate50 = ib.
book1D(name,name,73,0,73);
246 name=
"HBP HPD Noise Rate HPD above 300fC";
HBP_Rate300 = ib.
book1D(name,name,73,0,73);
247 name=
"HBM HPD Noise Rate HPD above 300fC";
HBM_Rate300 = ib.
book1D(name,name,73,0,73);
248 name=
"HEP HPD Noise Rate HPD above 300fC";
HEP_Rate300 = ib.
book1D(name,name,73,0,73);
249 name=
"HEM HPD Noise Rate HPD above 300fC";
HEM_Rate300 = ib.
book1D(name,name,73,0,73);
252 name=
"HO0 HPD Noise Rate Pixel above 50fC";
HO0_Rate50 = ib.
book1D(name,name,49,0,49);
253 name=
"HO1P HPD Noise Rate Pixel above 50fC";
HO1P_Rate50 = ib.
book1D(name,name,48,0,48);
254 name=
"HO1M HPD Noise Rate Pixel above 50fC";
HO1M_Rate50 = ib.
book1D(name,name,48,0,48);
255 name=
"HO0 HPD Noise Rate HPD above 300fC";
HO0_Rate300 = ib.
book1D(name,name,48,0,48);
256 name=
"HO1P HPD Noise Rate HPD abGetRMindexove 300fC";
HO1P_Rate300 = ib.
book1D(name,name,48,0,48);
257 name=
"HO1M HPD Noise Rate HPD above 300fC";
HO1M_Rate300 = ib.
book1D(name,name,48,0,48);
271 for(
int i=0;
i<36;
i++){
287 bool isNoiseEvent=
false;
295 if(trigger_data->triggerWord()>1000) isNoiseEvent=
true;
310 if ( fedData.
size() < 24 )
continue ;
321 if(tWord.at(11) || tWord.at(12)) isNoiseEvent=
true;
326 if(!isNoiseEvent)
return;
357 for(
int i=0;
i<digi->size();
i++){
359 if(max<
adc2fC[digi->sample(
i).adc()&0xff]) max=
adc2fC[digi->sample(
i).adc()&0xff];
360 if(
adc2fC[digi->sample(
i).adc()&0xff]==0) n_zero++;
366 for(
int i=0;
i<digi->size();
i++)
energy+=
adc2fC[digi->sample(
i).adc()&0xff]-2.5;
376 double max=-100,
energy=0;
int Eta=digi->id().ieta();
int Phi=digi->id().iphi();
int n_zero=0;
377 for(
int i=0;
i<digi->size()-1;
i++){
378 if(max<
adc2fC[digi->sample(
i).adc()&0xff]) max=
adc2fC[digi->sample(
i).adc()&0xff];
379 if(
adc2fC[digi->sample(
i).adc()&0xff]==0) n_zero++;
381 if((Eta>=11 && Eta<=15 && Phi>=59 && Phi<=70) || (Eta>=5 && Eta<=10 && Phi>=47 && Phi<=58)){
388 for(
int i=0;
i<digi->size();
i++)
energy+=
adc2fC[digi->sample(
i).adc()&0xff]-2.5;
400 if(RMs[
i].n_pix_hi>0){
414 for(
int sd=0;
sd<7;
sd++)
for(
int sect=1;sect<=18;sect++){
415 std::stringstream tempss;
416 tempss << std::setw(2) << std::setfill(
'0') << sect;
419 double rbx_energy=0;
int pix_mult=0;
int n_zero=0;
bool isValidRBX=
false;
422 if(index>0 && index<HcalFrontEndId::maxRmIndex){
442 int first_rbx=0,last_rbx=0;
449 if(
sd==0){ first_rbx=0; last_rbx=18;}
450 if(
sd==1){ first_rbx=18; last_rbx=36;}
452 for(
int rbx=first_rbx;rbx<last_rbx;rbx++)
for(
int rm=1;
rm<=4;
rm++){
463 if(
sd==2){ first_rbx=0; last_rbx=18;}
464 if(
sd==3){ first_rbx=18; last_rbx=36;}
466 for(
int rbx=first_rbx;rbx<last_rbx;rbx++)
for(
int rm=1;
rm<=4;
rm++){
477 if(
sd==4){ first_rbx=6; last_rbx=12;}
478 if(
sd==5){ first_rbx=12; last_rbx=24;}
479 if(
sd==6){ first_rbx=24; last_rbx=30;}
481 for(
int rbx=first_rbx;rbx<last_rbx;rbx++)
for(
int rm=1;
rm<=4;
rm++){
500 if(
sd==0){ first_rbx=0; }
501 if(
sd==1){ first_rbx=18;}
503 for(
int rbx=0;rbx<18;rbx++)
for(
int rm=1;
rm<=4;
rm++){
516 if(
sd==2){ first_rbx=0;}
517 if(
sd==3){ first_rbx=18;}
519 for(
int rbx=0;rbx<18;rbx++)
for(
int rm=1;
rm<=4;
rm++){
533 if(
sd==4){ first_rbx=6; n=6;}
534 if(
sd==5){ first_rbx=12;n=12;}
535 if(
sd==6){ first_rbx=24;n=6;}
537 for(
int rbx=0;rbx<
n;rbx++)
for(
int rm=1;
rm<=4;
rm++){
560 float VAL1,VAL2,VAL3,VAL4,VAL5;
568 sprintf(str,
"%sHcalDetDiagNoiseData.root",
OutputFilePath.c_str());
570 TFile *
theFile =
new TFile(str,
"RECREATE");
571 if(!theFile->IsOpen())
return;
573 sprintf(str,
"%d",
run_number); TObjString
run(str); run.Write(
"run number");
574 sprintf(str,
"%d",
ievt_); TObjString
events(str); events.Write(
"Total events processed");
575 sprintf(str,
"%d",
dataset_seq_number); TObjString dsnum(str); dsnum.Write(
"Dataset number");
576 Long_t
t; t=
time(0); strftime(str,30,
"%F %T",localtime(&t)); TObjString tm(str); tm.Write(
"Dataset creation time");
578 TTree *
tree =
new TTree(
"HCAL Noise data",
"HCAL Noise data");
580 tree->Branch(
"RBX", &RBX,
"RBX/C");
581 tree->Branch(
"rm", &RM,
"rm/I");
582 tree->Branch(
"RATE_50", &VAL1,
"RATE_50");
583 tree->Branch(
"RATE_300", &VAL2,
"RATE_300");
584 tree->Branch(
"RATE_PIX1", &VAL3,
"RATE_PIX1");
585 tree->Branch(
"RATE_PIX8", &VAL4,
"RATE_PIX8");
586 tree->Branch(
"RATE_PIXMEAN", &VAL5,
"RATE_PIXMEAN");
587 for(
int rbx=0;rbx<36;rbx++)
for(
int rm=1;
rm<=4;
rm++){
590 sprintf(RBX,
"%s",
HB_RBX[rbx]);
599 for(
int rbx=0;rbx<36;rbx++)
for(
int rm=1;
rm<=4;
rm++){
602 sprintf(RBX,
"%s",
HE_RBX[rbx]);
611 for(
int rbx=0;rbx<36;rbx++)
for(
int rm=1;
rm<=4;
rm++){
614 sprintf(RBX,
"%s",
HO_RBX[rbx]);
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool LumiInOrder(int lumisec)
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * HO1M_Rate50
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
HcalDetDiagNoiseRMEvent()
#define DEFINE_FWK_MODULE(type)
MonitorElement * TriggerBx12
std::vector< int > AllowedCalibTypes_
HcalDetDiagNoiseRMData rm[HcalFrontEndId::maxRmIndex]
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
MonitorElement * bookInt(Args &&...args)
std::vector< HBHEDataFrame >::const_iterator const_iterator
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)
MonitorElement * HO1P_Rate50
edm::LuminosityBlockNumber_t luminosityBlock() const
void getLogicalMap(const edm::EventSetup &c)
HcalDetDiagNoiseRMSummary * RMSummary
size_t size() const
Lenght of the data buffer in bytes.
MonitorElement * HEM_Rate50
void analyze(edm::Event const &e, edm::EventSetup const &s)
MonitorElement * HO0_Rate50
int GetRMindex(const std::string &rbx, int rm)
bool IsAllowedCalibType()
MonitorElement * HEP_Rate300
MonitorElement * HBM_Rate50
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > tok_l1_
MonitorElement * TriggerBx11
HcalLogicalMap * logicalMap_
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
std::string OutputFilePath
static const int maxRmIndex
MonitorElement * book1D(Args &&...args)
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
edm::EDGetTokenT< HODigiCollection > tok_ho_
MonitorElement * PixelMult
const HcalFrontEndId getHcalFrontEndId(const DetId &)
MonitorElement * HPDEnergy
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
MonitorElement * HO1P_Rate300
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
MonitorElement * HEP_Rate50
MonitorElement * HE_RBXmapSpikeCnt
MonitorElement * HO_RBXmapSpikeCnt
HcalDetDiagNoiseRMSummary()
MonitorElement * HBP_Rate300
~HcalDetDiagNoiseMonitor()
MonitorElement * HO1M_Rate300
MonitorElement * HBP_Rate50
MonitorElement * HBM_Rate300
MonitorElement * HO0_Rate300
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
edm::EDGetTokenT< FEDRawDataCollection > tok_raw_
void setup(DQMStore::IBooker &)
MonitorElement * RBXEnergy
HcalDetDiagNoiseMonitor(const edm::ParameterSet &ps)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void reset(double vett[256])
void bookHistograms(DQMStore::IBooker &ib, const edm::Run &run, const edm::EventSetup &c)
virtual void setup(DQMStore::IBooker &)
MonitorElement * HB_RBXmapSpikeCnt
MonitorElement * HEM_Rate300
edm::EDGetTokenT< HcalTBTriggerData > tok_tb_