98 if(arm<0 || station<0 || rp<0)
return(IndexNotValid);
99 if(arm>1 || station>=NStationMAX || rp>=NRPotsMAX)
return(IndexNotValid);
100 int rc = (arm*NStationMAX+
station)*NRPotsMAX + rp;
105 if(plane<0 || plane>=NplaneMAX)
return(IndexNotValid);
107 if(rc == IndexNotValid)
return(IndexNotValid);
108 return(rc*NplaneMAX + plane);
112 {
return((rp - RPn_first)*NplaneMAX + plane);}
116 {
return ((
id>>16)&0x7); }
131 verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
132 rpStatusWord(ps.getUntrackedParameter<unsigned
int>(
"RPStatusWord",0x8000))
158 for(
int stn=0; stn<3; stn++) {
161 rpSts = (rpSts >> 1);
RPstatus[stn][rp] = rpSts&1;
180 hBX = ibooker.
book1D(
"events per BX",
"ctpps_pixel;Event.BX", 4002, -1.5, 4000. +0.5);
181 hBXshort = ibooker.
book1D(
"events per BX(short)",
"ctpps_pixel;Event.BX", 102, -1.5, 100. + 0.5);
183 for(
int arm=0; arm<2; arm++) {
194 string stnd, stnTitle;
201 string st =
"planes activity";
202 string st2 =
": " + stnTitle;
209 h->SetOption(
"colz");
210 TAxis *yah = h->GetYaxis();
212 st =
"hit average multiplicity in planes";
213 int PlaneMultCut = 20;
217 h2->SetOption(
"textcolz");
218 TAxis *yah2 = h2->GetYaxis();
222 st =
"hit multiplicity in planes";
223 string st3 =
";PlaneIndex(=pixelPot*PlaneMAX + plane)";
228 st =
"cluster multiplicity in planes";
233 st =
"cluster size in planes";
240 for(
int rp=RPn_first; rp<
RPn_last; rp++) {
244 yah->SetBinLabel(rp - RPn_first +1, rpTitle.c_str());
245 yah2->SetBinLabel(rp - RPn_first +1, rpTitle.c_str());
257 ibooker.
book1D(
"number of fired planes per event", rpTitle+
";nPlanes",
260 ibooker.
book1D(
"5 fired planes per BX", rpTitle+
";Event.BX", 4002, -1.5, 4000.+0.5);
270 rpTitle+
";LumiSection;Plane#___ROC#", 1000,0.,1000.,
277 sprintf(s,
"plane%d_0",
p);
278 yahp2->SetBinLabel(
p*NplaneMAX+1,s);
280 sprintf(s,
" %d_%d",
p,
r);
281 yahp2->SetBinLabel(
p*NplaneMAX+
r+1,s);
286 rpTitle+
";ROC ID;number of fired ROCs", NROCsMAX,-0.5,NROCsMAX-0.5, 7,-0.5,6.5);
292 ibooker.
book1D(
"4 fired ROCs per BX", rpTitle+
";Event.BX", 4002, -1.5, 4000.+0.5);
295 ibooker.
book1D(
"hits per BX", rpTitle+
";Event.BX", 4002, -1.5, 4000.+0.5);
300 sprintf(s,
"plane_%d",
p);
301 string pd = rpd+
"/"+
string(s);
303 string st1 =
": "+rpTitle+
"_"+
string(s);
304 st =
"hits position";
309 st =
"adc average value";
314 st =
"hits multiplicity";
321 for(
int roc=0; roc<
NROCsMAX; roc++) {
322 sprintf(s,
"ROC_%d",roc);
323 string st2 = st1 +
"_" +
string(s);
330 string st =
"adc average value";
349 int lumiId =
event.getLuminosityBlock().id().luminosityBlock();
350 if(lumiId<0) lumiId=0;
353 for(
int arm = 0; arm <2; arm++) {
355 RPactivity[arm][rp] = digiSize[arm][rp] = 0;
358 for(
int ind=0; ind<2*3*
NRPotsMAX; ind++) {
363 for(
int ind=0; ind<2*3*NRPotsMAX*
NplaneMAX; ind++) {
381 for(
const auto &ds_digi : *pixDigi)
383 int idet =
getDet(ds_digi.id);
385 if(
verbosity>1)
LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_digi.id"<<ds_digi.id;
393 int arm = theId.
arm()&0x1;
395 int rpot = theId.
rp()&0x7;
396 RPactivity[arm][rpot] = 1;
397 ++digiSize[arm][rpot];
413 dit != ds_digi.end(); ++dit) {
414 int row = dit->row();
415 int col = dit->column();
416 int adc = dit->adc();
438 for(
int arm=0; arm<2; arm++) {
443 if(RPactivity[arm][rp]==0)
continue;
446 for(
int p=0; p<NplaneMAX; p++) if(HitsMultPlane[index][p]>0) np++;
455 for(
int r=0; r<NROCsMAX; r++) if(HitsMultROC[indp][r] > 0) ++rocf[
r];
463 if(max < rocf[
r]) { max = rocf[
r]; }
481 <<
"end of Run "<<run.
run()<<
": "<<
nEvents<<
" events\n" int adc(sample_type sample)
get the ADC sample (12 bits)
T getParameter(std::string const &) const
MonitorElement * hHitsMult[RPotsTotalNumber][NplaneMAX]
int HitsMultPlane[RPotsTotalNumber][NplaneMAX]
MonitorElement * hp2xyADC[RPotsTotalNumber][NplaneMAX]
MonitorElement * hp2HitsMultROC_LS[RPotsTotalNumber]
MonitorElement * h2CluSize[NArms][NStationMAX]
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenDigi
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
TProfile2D * getTProfile2D(void) const
MonitorElement * hp2HitsOcc[NArms][NStationMAX]
#define DEFINE_FWK_MODULE(type)
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
int bunchCrossing() const
int getDefaultRowDetSize() const
TH2D * getTH2D(void) const
CTPPSDetId getStationId() const
CTPPSPixelIndices thePixIndices
int prIndex(int rp, int plane)
int RPindexValid[RPotsTotalNumber]
virtual ~CTPPSPixelDQMSource()
int RPstatus[NStationMAX][NRPotsMAX]
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * h2ClusMultipl[NArms][NStationMAX]
CTPPSPixelDQMSource(const edm::ParameterSet &ps)
MonitorElement * bookProfile2D(Args &&...args)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * hRPotActivBX[RPotsTotalNumber]
static int RPotsTotalNumber
int getDefaultColDetSize() const
MonitorElement * h2xyROCadc[RPotsTotalNumber *NplaneMAX][NROCsMAX]
MonitorElement * book1D(Args &&...args)
CTPPSDetId getRPId() const
void armName(std::string &name, NameFlag flag=nFull) const
int getRPindex(int arm, int station, int rp)
MonitorElement * hRPotActivBXroc[RPotsTotalNumber]
MonitorElement * h2PlaneActive[NArms][NStationMAX]
MonitorElement * h2xyROCHits[RPotsTotalNumber *NplaneMAX][NROCsMAX]
void setStation(uint32_t station)
unsigned int rpStatusWord
MonitorElement * hRPotActivBXall[RPotsTotalNumber]
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
Base class for CTPPS detector IDs.
int transformToROC(const int col, const int row, int &rocId, int &colROC, int &rowROC) const
static const int kDetOffset
MonitorElement * hRPotActivROCs[RPotsTotalNumber]
MonitorElement * book2DD(Args &&...args)
int StationStatus[NStationMAX]
void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
int HitsMultROC[RPotsTotalNumber *NplaneMAX][NROCsMAX]
TH2F * getTH2F(void) const
int getPlaneIndex(int arm, int station, int rp, int plane)
MonitorElement * h2xyHits[RPotsTotalNumber][NplaneMAX]
MonitorElement * hRPotActivPlanes[RPotsTotalNumber]
MonitorElement * book1DD(Args &&...args)
MonitorElement * hBXshort
MonitorElement * h2HitsMultipl[NArms][NStationMAX]