111 if(arm<0 || station<0 || rp<0)
return(IndexNotValid);
112 if(arm>1 || station>=NStationMAX || rp>=NRPotsMAX)
return(IndexNotValid);
113 int rc = (arm*NStationMAX+
station)*NRPotsMAX + rp;
118 if(plane<0 || plane>=NplaneMAX)
return(IndexNotValid);
120 if(rc == IndexNotValid)
return(IndexNotValid);
121 return(rc*NplaneMAX + plane);
130 return( arm*2 + stationBinOrder[stn] +1 );
134 {
return((rp - RPn_first)*NplaneMAX + plane);}
138 {
return ((
id>>16)&0x7); }
153 verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
154 rpStatusWord(ps.getUntrackedParameter<unsigned
int>(
"RPStatusWord",0x8008))
191 rpSts = (rpSts >> 1);
RPstatus[stn][rp] = rpSts&1;
212 string armTitleShort, stnTitleShort;
213 hBX = ibooker.
book1D(
"events per BX",
"ctpps_pixel;Event.BX", 4002, -1.5, 4000. +0.5);
214 hBXshort = ibooker.
book1D(
"events per BX(short)",
"ctpps_pixel;Event.BX", 102, -1.5, 100. + 0.5);
216 string str1st =
"Pixel planes activity";
220 h1st->SetOption(
"colz");
221 TAxis *yah1st = h1st->GetYaxis();
223 string str2 =
"Pixel RP active";
231 str2 =
"Pixel Local Tracks";
239 for(
int arm=0; arm<2; arm++) {
251 string stnd, stnTitle;
264 string rpBinName = armTitleShort +
"_" + stnTitleShort+
"_"+rpTitle;
278 string st2 =
": " + stnTitle;
280 string st =
"hit multiplicity in planes";
281 string st3 =
";PlaneIndex(=pixelPot*PlaneMAX + plane)";
286 st =
"cluster size in planes";
291 const float x0Maximum = 70.;
292 const float y0Maximum = 15.;
293 st =
"track intercept point";
295 int(x0Maximum)*2, 0.,x0Maximum,
int(y0Maximum)*4,-y0Maximum,y0Maximum);
298 st =
"number of tracks per event";
303 st =
"number of hits per track";
305 5,1.5,6.5, -0.1,1.1,
"");
309 ibooker.
bookProfile(
"number of fired planes per event", rpTitle+
";nPlanes;Probability",
321 rpTitle+
";LumiSection;Plane#___ROC#", 1000,0.,1000.,
328 sprintf(s,
"plane%d_0",
p);
329 yahp2->SetBinLabel(
p*NplaneMAX+1,s);
331 sprintf(s,
" %d_%d",
p,
r);
332 yahp2->SetBinLabel(
p*NplaneMAX+
r+1,s);
338 ibooker.
book1D(
"5 fired planes per BX", rpTitle+
";Event.BX",4002,-1.5, 4000.+0.5);
341 ibooker.
book1D(
"4 fired ROCs per BX", rpTitle+
";Event.BX", 4002, -1.5, 4000.+0.5);
344 ibooker.
book1D(
"hits per BX", rpTitle+
";Event.BX", 4002, -1.5, 4000.+0.5);
349 sprintf(s,
"plane_%d",
p);
350 string pd = rpd+
"/"+
string(s);
352 string st1 =
": "+rpTitle+
"_"+
string(s);
354 st =
"hits position";
359 st =
"adc average value";
364 st =
"hits multiplicity";
381 int lumiId =
event.getLuminosityBlock().id().luminosityBlock();
382 if(lumiId<0) lumiId=0;
388 { RPactivity[rp] = RPdigiSize[rp] = pixRPTracks[rp] = 0;}
396 for(
int ind=0; ind<RPotsTotalNumber*
NplaneMAX; ind++) {
397 for(
int roc=0; roc<
NROCsMAX; roc++) {
414 for(
const auto &ds_tr : *pixTrack)
416 int idet =
getDet(ds_tr.id);
418 if(
verbosity>1)
LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_tr.id"<<ds_tr.id;
422 int arm = theId.
arm()&0x1;
424 int rpot = theId.
rp()&0x7;
428 dit != ds_tr.end(); ++dit) {
429 ++pixRPTracks[rpInd];
435 float x0 = dit->getX0();
436 float y0 = dit->getY0();
454 for(
const auto &ds_digi : *pixDigi)
456 int idet =
getDet(ds_digi.id);
458 if(
verbosity>1)
LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_digi.id"<<ds_digi.id;
466 int arm = theId.
arm()&0x1;
468 int rpot = theId.
rp()&0x7;
470 RPactivity[rpInd] = 1;
481 int nh = ds_digi.data.size();
488 dit != ds_digi.end(); ++dit) {
489 int row = dit->row();
490 int col = dit->column();
491 int adc = dit->adc();
512 for(
const auto &ds : *pixClus)
516 if(
verbosity>1)
LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: cluster.id"<<ds.id;
524 int arm = theId.
arm()&0x1;
526 int rpot = theId.
rp()&0x7;
533 for (
const auto &
p : ds) {
534 int clusize =
p.size();
541 bool allRPactivity =
false;
542 for(
int rp=0; rp<RPotsTotalNumber; rp++) if(RPactivity[rp]>0) allRPactivity=
true;
543 for(
int arm=0; arm<2; arm++) {
550 if(!allRPactivity)
continue;
552 int ntr = pixRPTracks[
index];
560 for(
int p=0; p<NplaneMAX; p++) if(HitsMultPlane[index][p]>0) np++;
572 for(
int r=0; r<NROCsMAX; r++) if(HitsMultROC[indp][r] > 0) ++rocf[
r];
580 if(max < rocf[
r]) { max = rocf[
r]; }
595 <<
"end of Run "<<run.
run()<<
": "<<
nEvents<<
" events\n"
TProfile * getTProfile() const
int StationStatus[StationIDMAX]
T getParameter(std::string const &) const
MonitorElement * hHitsMult[RPotsTotalNumber][NplaneMAX]
int HitsMultPlane[RPotsTotalNumber][NplaneMAX]
MonitorElement * hp2xyADC[RPotsTotalNumber][NplaneMAX]
MonitorElement * hpRPactive
MonitorElement * hp2HitsMultROC_LS[RPotsTotalNumber]
MonitorElement * h2CluSize[NArms][NStationMAX]
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenDigi
TProfile2D * getTProfile2D() const
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
MonitorElement * bookProfile(Args &&...args)
MonitorElement * htrackMult[RPotsTotalNumber]
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
MonitorElement * h2trackXY0[RPotsTotalNumber]
MonitorElement * hpixLTrack
int bunchCrossing() const
int getDefaultRowDetSize() const
static int NRPotBinsInStation
CTPPSDetId getStationId() const
static int NLocalTracksMAX
CTPPSPixelIndices thePixIndices
static int ClusterSizeMax
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCluster
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > tokenTrack
MonitorElement * htrackHits[RPotsTotalNumber]
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
int prIndex(int rp, int plane)
#define DEFINE_FWK_MODULE(type)
int RPindexValid[RPotsTotalNumber]
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * hROCadc[RPotsTotalNumber *NplaneMAX][NROCsMAX]
void setCurrentFolder(std::string const &fullpath)
CTPPSPixelDQMSource(const edm::ParameterSet &ps)
MonitorElement * bookProfile2D(Args &&...args)
MonitorElement * hRPotActivBX[RPotsTotalNumber]
static int RPotsTotalNumber
int getDefaultColDetSize() const
MonitorElement * book1D(Args &&...args)
CTPPSDetId getRPId() const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
void armName(std::string &name, NameFlag flag=nFull) const
int getRPindex(int arm, int station, int rp)
MonitorElement * hRPotActivBXroc[RPotsTotalNumber]
MonitorElement * h2xyROCHits[RPotsTotalNumber *NplaneMAX][NROCsMAX]
void setStation(uint32_t station)
int ClusMultPlane[RPotsTotalNumber][NplaneMAX]
unsigned int rpStatusWord
MonitorElement * hRPotActivBXall[RPotsTotalNumber]
MonitorElement * book2D(Args &&...args)
~CTPPSPixelDQMSource() override
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 * h2AllPlanesActive
MonitorElement * book2DD(Args &&...args)
int getRPglobalBin(int arm, int stn)
int HitsMultROC[RPotsTotalNumber *NplaneMAX][NROCsMAX]
int getRPInStationBin(int rp)
collection_type::const_iterator const_iterator
int getPlaneIndex(int arm, int station, int rp, int plane)
MonitorElement * h2xyHits[RPotsTotalNumber][NplaneMAX]
MonitorElement * hRPotActivPlanes[RPotsTotalNumber]
MonitorElement * book1DD(Args &&...args)
int RPstatus[StationIDMAX][RPotsIDMAX]
MonitorElement * hBXshort
MonitorElement * h2HitsMultipl[NArms][NStationMAX]