102 if(arm<0 || station<0 || rp<0)
return(IndexNotValid);
103 if(arm>1 || station>=NStationMAX || rp>=NRPotsMAX)
return(IndexNotValid);
104 int rc = (arm*NStationMAX+
station)*NRPotsMAX + rp;
109 if(plane<0 || plane>=NplaneMAX)
return(IndexNotValid);
111 if(rc == IndexNotValid)
return(IndexNotValid);
112 return(rc*NplaneMAX + plane);
116 {
return((rp - RPn_first)*NplaneMAX + plane);}
120 {
return ((
id>>16)&0x7); }
135 verbosity(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
136 rpStatusWord(ps.getUntrackedParameter<unsigned
int>(
"RPStatusWord",0x8000))
162 for(
int stn=0; stn<3; stn++) {
165 rpSts = (rpSts >> 1);
RPstatus[stn][rp] = rpSts&1;
184 hBX = ibooker.
book1D(
"events per BX",
"ctpps_pixel;Event.BX", 4002, -1.5, 4000. +0.5);
185 hBXshort = ibooker.
book1D(
"events per BX(short)",
"ctpps_pixel;Event.BX", 102, -1.5, 100. + 0.5);
187 for(
int arm=0; arm<2; arm++) {
198 string stnd, stnTitle;
205 string st =
"planes activity";
206 string st2 =
": " + stnTitle;
211 h->SetOption(
"colz");
212 TAxis *yah = h->GetYaxis();
214 st =
"hit average multiplicity in planes";
215 int PlaneMultCut = 20;
219 h2->SetOption(
"textcolz");
220 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 span in planes";
234 const int nyClus = 9;
236 float yClus[nyClus+1];
239 double lnA =
log(2.);
241 for(
int j=0; j<nyClus; j++) yClus[j+1] = n0*
exp(j*lnA);
253 yah->SetBinLabel(rp -
RPn_first +1, rpTitle.c_str());
254 yah2->SetBinLabel(rp -
RPn_first +1, rpTitle.c_str());
266 ibooker.
bookProfile(
"number of fired planes per event", rpTitle+
";nPlanes;Probability",
269 ibooker.
book1D(
"5 fired planes per BX", rpTitle+
";Event.BX", 4002, -1.5, 4000.+0.5);
279 rpTitle+
";LumiSection;Plane#___ROC#", 1000,0.,1000.,
286 sprintf(s,
"plane%d_0",
p);
287 yahp2->SetBinLabel(
p*NplaneMAX+1,s);
289 sprintf(s,
" %d_%d",
p,
r);
290 yahp2->SetBinLabel(
p*NplaneMAX+
r+1,s);
295 rpTitle+
";ROC ID;number of fired aligned ROCs", NROCsMAX,-0.5,NROCsMAX-0.5,
296 7,-0.5,6.5, 0,NROCsMAX,
"");
302 ibooker.
book1D(
"4 fired ROCs per BX", rpTitle+
";Event.BX", 4002, -1.5, 4000.+0.5);
305 ibooker.
book1D(
"hits per BX", rpTitle+
";Event.BX", 4002, -1.5, 4000.+0.5);
310 sprintf(s,
"plane_%d",
p);
311 string pd = rpd+
"/"+
string(s);
313 string st1 =
": "+rpTitle+
"_"+
string(s);
314 st =
"hits position";
319 st =
"adc average value";
324 st =
"hits multiplicity";
331 for(
int roc=0; roc<
NROCsMAX; roc++) {
332 sprintf(s,
"ROC_%d",roc);
333 string st2 = st1 +
"_" +
string(s);
340 string st =
"adc average value";
359 int lumiId =
event.getLuminosityBlock().id().luminosityBlock();
360 if(lumiId<0) lumiId=0;
363 for(
int arm = 0; arm <2; arm++) {
365 RPactivity[arm][rp] = digiSize[arm][rp] = 0;
368 for(
int ind=0; ind<2*3*
NRPotsMAX; ind++) {
374 for(
int ind=0; ind<2*3*NRPotsMAX*
NplaneMAX; ind++) {
395 for(
const auto &ds_digi : *pixDigi)
397 int idet =
getDet(ds_digi.id);
399 if(
verbosity>1)
LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: ds_digi.id"<<ds_digi.id;
407 int arm = theId.
arm()&0x1;
409 int rpot = theId.
rp()&0x7;
410 RPactivity[arm][rpot] = 1;
411 ++digiSize[arm][rpot];
427 dit != ds_digi.end(); ++dit) {
428 int row = dit->row();
429 int col = dit->column();
430 int adc = dit->adc();
453 for(
const auto &ds : *pixClus)
457 if(
verbosity>1)
LogPrint(
"CTPPSPixelDQMSource") <<
"not CTPPS: cluster.id"<<ds.id;
465 int arm = theId.
arm()&0x1;
467 int rpot = theId.
rp()&0x7;
474 for (
const auto &
p : ds) {
475 unsigned int max=
p.minPixelRow() +
p.rowSpan()+1;
476 if(minRow >
p.minPixelRow()) minRow =
p.minPixelRow();
477 if(maxRow < max) maxRow =
max;
478 max=
p.minPixelCol() +
p.colSpan()+1;
479 if(minCol >
p.minPixelCol()) minCol =
p.minPixelCol();
480 if(maxCol < max) maxCol =
max;
483 int drow = maxRow - minRow;
484 int dcol = maxCol - minCol;
485 float clusize=
sqrt(drow*drow + dcol*dcol);
491 for(
int arm=0; arm<2; arm++) {
496 if(RPactivity[arm][rp]==0)
continue;
502 for(
int p=0; p<NplaneMAX; p++) if(HitsMultPlane[index][p]>0) np++;
514 for(
int r=0; r<NROCsMAX; r++) if(HitsMultROC[indp][r] > 0) ++rocf[
r];
522 if(max < rocf[
r]) { max = rocf[
r]; }
544 <<
"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 dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
TProfile2D * getTProfile2D(void) const
MonitorElement * bookProfile(Args &&...args)
MonitorElement * hp2HitsOcc[NArms][NStationMAX]
#define DEFINE_FWK_MODULE(type)
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
int bunchCrossing() const
int getDefaultRowDetSize() const
TH2D * getTH2D(void) 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]
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)
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 * book2DD(Args &&...args)
int StationStatus[NStationMAX]
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]