105 if(arm<0 || station<0 || rp<0)
return(IndexNotValid);
106 if(arm>1 || station>=NStationMAX || rp>=NRPotsMAX)
return(IndexNotValid);
107 int rc = (arm*NStationMAX+
station)*NRPotsMAX + rp;
112 if(plane<0 || plane>=NplaneMAX)
return(IndexNotValid);
114 if(rc == IndexNotValid)
return(IndexNotValid);
115 return(rc*NplaneMAX + plane);
124 return( arm*2 + stationBinOrder[stn] +1 );
128 {
return((rp - RPn_first)*NplaneMAX + plane);}
132 {
return ((
id>>16)&0x7); }
147 verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
148 rpStatusWord(ps.getUntrackedParameter<unsigned
int>(
"RPStatusWord",0x8008))
182 rpSts = (rpSts >> 1);
RPstatus[stn][rp] = rpSts&1;
201 string armTitleShort, stnTitleShort;
202 hBX = ibooker.
book1D(
"events per BX",
"ctpps_pixel;Event.BX", 4002, -1.5, 4000. +0.5);
203 hBXshort = ibooker.
book1D(
"events per BX(short)",
"ctpps_pixel;Event.BX", 102, -1.5, 100. + 0.5);
205 string str1st =
"Pixel planes activity";
209 h1st->SetOption(
"colz");
210 TAxis *yah1st = h1st->GetYaxis();
212 for(
int arm=0; arm<2; arm++) {
224 string stnd, stnTitle;
232 string st =
"planes activity";
233 string st2 =
": " + stnTitle;
238 h->SetOption(
"colz");
239 TAxis *yah = h->GetYaxis();
241 st =
"hit average multiplicity in planes";
242 int PlaneMultCut = 20;
246 h2->SetOption(
"textcolz");
247 TAxis *yah2 = h2->GetYaxis();
249 st =
"hit multiplicity in planes";
250 string st3 =
";PlaneIndex(=pixelPot*PlaneMAX + plane)";
255 st =
"cluster multiplicity in planes";
260 st =
"cluster span in planes";
261 const int nyClus = 9;
263 float yClus[nyClus+1];
266 double lnA =
log(2.);
268 for(
int j=0; j<nyClus; j++) yClus[j+1] = n0*
exp(j*lnA);
282 string rpBinName = armTitleShort +
"_" + stnTitleShort+
"_"+rpTitle;
295 ibooker.
bookProfile(
"number of fired planes per event", rpTitle+
";nPlanes;Probability",
298 ibooker.
book1D(
"5 fired planes per BX", rpTitle+
";Event.BX", 4002, -1.5, 4000.+0.5);
308 rpTitle+
";LumiSection;Plane#___ROC#", 1000,0.,1000.,
315 sprintf(s,
"plane%d_0",
p);
316 yahp2->SetBinLabel(
p*NplaneMAX+1,s);
318 sprintf(s,
" %d_%d",
p,
r);
319 yahp2->SetBinLabel(
p*NplaneMAX+
r+1,s);
324 rpTitle+
";ROC ID;number of fired aligned ROCs", NROCsMAX,-0.5,NROCsMAX-0.5,
325 7,-0.5,6.5, 0,NROCsMAX,
"");
331 ibooker.
book1D(
"4 fired ROCs per BX", rpTitle+
";Event.BX", 4002, -1.5, 4000.+0.5);
334 ibooker.
book1D(
"hits per BX", rpTitle+
";Event.BX", 4002, -1.5, 4000.+0.5);
339 sprintf(s,
"plane_%d",
p);
340 string pd = rpd+
"/"+
string(s);
342 string st1 =
": "+rpTitle+
"_"+
string(s);
343 st =
"hits position";
348 st =
"adc average value";
353 st =
"hits multiplicity";
360 for(
int roc=0; roc<
NROCsMAX; roc++) {
361 sprintf(s,
"ROC_%d",roc);
362 string st2 = st1 +
"_" +
string(s);
385 int lumiId =
event.getLuminosityBlock().id().luminosityBlock();
386 if(lumiId<0) lumiId=0;
391 { RPactivity[rp] = RPdigiSize[rp] = 0;}
399 for(
int ind=0; ind<RPotsTotalNumber*
NplaneMAX; ind++) {
400 for(
int roc=0; roc<
NROCsMAX; roc++) {
420 for(
const auto &ds_digi : *pixDigi)
422 int idet =
getDet(ds_digi.id);
424 if(
verbosity>1)
LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_digi.id"<<ds_digi.id;
432 int arm = theId.
arm()&0x1;
434 int rpot = theId.
rp()&0x7;
436 RPactivity[rpInd] = 1;
454 dit != ds_digi.end(); ++dit) {
455 int row = dit->row();
456 int col = dit->column();
457 int adc = dit->adc();
480 for(
const auto &ds : *pixClus)
484 if(
verbosity>1)
LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: cluster.id"<<ds.id;
492 int arm = theId.
arm()&0x1;
494 int rpot = theId.
rp()&0x7;
503 for (
const auto &
p : ds) {
504 unsigned int max=
p.minPixelRow() +
p.rowSpan()+1;
505 if(minRow >
p.minPixelRow()) minRow =
p.minPixelRow();
506 if(maxRow < max) maxRow =
max;
507 max=
p.minPixelCol() +
p.colSpan()+1;
508 if(minCol >
p.minPixelCol()) minCol =
p.minPixelCol();
509 if(maxCol < max) maxCol =
max;
512 int drow = maxRow - minRow;
513 int dcol = maxCol - minCol;
514 float clusize=
sqrt(drow*drow + dcol*dcol);
520 for(
int arm=0; arm<2; arm++) {
525 if(RPactivity[index]==0)
continue;
531 for(
int p=0; p<NplaneMAX; p++) if(HitsMultPlane[index][p]>0) np++;
543 for(
int r=0; r<NROCsMAX; r++) if(HitsMultROC[indp][r] > 0) ++rocf[
r];
551 if(max < rocf[
r]) { max = rocf[
r]; }
573 <<
"end of Run "<<run.
run()<<
": "<<
nEvents<<
" events\n" int adc(sample_type sample)
get the ADC sample (12 bits)
int StationStatus[StationIDMAX]
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
TProfile2D * getTProfile2D() const
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
MonitorElement * bookProfile(Args &&...args)
MonitorElement * hp2HitsOcc[NArms][NStationMAX]
#define DEFINE_FWK_MODULE(type)
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
int bunchCrossing() const
int getDefaultRowDetSize() const
static int NRPotBinsInStation
CTPPSDetId getStationId() const
CTPPSPixelIndices thePixIndices
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCluster
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)
int RPindexValid[RPotsTotalNumber]
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * hROCadc[RPotsTotalNumber *NplaneMAX][NROCsMAX]
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 * 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)
int ClusMultPlane[RPotsTotalNumber][NplaneMAX]
unsigned int rpStatusWord
MonitorElement * hRPotActivBXall[RPotsTotalNumber]
void setCurrentFolder(const std::string &fullpath)
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 * hRPotActivROCs[RPotsTotalNumber]
MonitorElement * h2AllPlanesActive
MonitorElement * book2DD(Args &&...args)
int getRPglobalBin(int arm, int stn)
int HitsMultROC[RPotsTotalNumber *NplaneMAX][NROCsMAX]
int getRPInStationBin(int rp)
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]