CMS 3D CMS Logo

CTPPSPixelDQMSource.cc
Go to the documentation of this file.
1 /******************************************
2 *
3 * This is a part of CTPPSDQM software.
4 * Authors:
5 * F.Ferro INFN Genova
6 * Vladimir Popov (vladimir.popov@cern.ch)
7 *
8 *******************************************/
9 
16 
20 
22 
28 
29 #include <string>
30 
31 //-----------------------------------------------------------------------------
32 
34 {
35  public:
37  ~CTPPSPixelDQMSource() override;
38 
39  protected:
40  void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override;
41  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
42  void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
43  void endRun(edm::Run const& run, edm::EventSetup const& eSetup) override;
44 
45  private:
46  unsigned int verbosity;
47  long int nEvents = 0;
51 
52  static constexpr int NArms=2;
53  static constexpr int NStationMAX=3; // in an arm
54  static constexpr int NRPotsMAX=6; // per station
55  static constexpr int NplaneMAX=6; // per RPot
56  static constexpr int NROCsMAX = 6; // per plane
57  static constexpr int RPn_first = 3, RPn_last = 4;
58  static constexpr int ADCMax = 256;
59  static constexpr int StationIDMAX=4; // possible range of ID
60  static constexpr int RPotsIDMAX=8; // possible range of ID
61  static constexpr int NLocalTracksMAX=20;
62  static constexpr int hitMultMAX = 50; // tuned
63  static constexpr int ClusMultMAX = 10; // tuned
64  static constexpr int ClusterSizeMax = 9;
65 
67  int pixRowMAX = 160; // defaultDetSizeInX, CMS Y-axis
68  int pixColMAX = 156; // defaultDetSizeInY, CMS X-axis
69  int ROCSizeInX = pixRowMAX/2; // ROC row size in pixels = 80
70  int ROCSizeInY = pixColMAX/3; // ROC col size in pixels = 52
71 
73 
75  static constexpr int NPlaneBins = NplaneMAX*NRPotBinsInStation;
76 
79 
82 
83  static constexpr int RPotsTotalNumber=NArms*NStationMAX*NRPotsMAX;
84 
100  int HitsMultROC[RPotsTotalNumber*NplaneMAX][NROCsMAX];
103 
104 
105  unsigned int rpStatusWord = 0x8008; //220_fr_hr(stn2rp3)+ 210_fr_hr
106  int RPstatus[StationIDMAX][RPotsIDMAX]; // symmetric in both arms
107  int StationStatus[StationIDMAX]; // symmetric in both arms
108  const int IndexNotValid = 0;
109 
110  int getRPindex(int arm, int station, int rp) {
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;
114  return(rc);
115  }
116 
117  int getPlaneIndex(int arm, int station, int rp, int plane) {
118  if(plane<0 || plane>=NplaneMAX) return(IndexNotValid);
119  int rc = getRPindex(arm, station, rp);
120  if(rc == IndexNotValid) return(IndexNotValid);
121  return(rc*NplaneMAX + plane);
122  }
123 
124  int getRPInStationBin(int rp) { return(rp - RPn_first +1); }
125 
126 
127  static constexpr int NRPglobalBins = 4; //2 arms w. 2 stations w. 1 RP
128  int getRPglobalBin(int arm, int stn) {
129  static constexpr int stationBinOrder[NStationMAX] = {0, 4, 1};
130  return( arm*2 + stationBinOrder[stn] +1 );
131  }
132 
133  int prIndex(int rp, int plane) // plane index in station
134  {return((rp - RPn_first)*NplaneMAX + plane);}
135  int getDet(int id)
136  { return (id>>DetId::kDetOffset)&0xF; }
137  int getPixPlane(int id)
138  { return ((id>>16)&0x7); }
139 // int getSubdet(int id) { return ((id>>kSubdetOffset)&0x7); }
140 
141  int multHitsMax, cluSizeMax; // for tuning
143 };
144 
145 //----------------------------------------------------------------------------------
146 
147 using namespace std;
148 using namespace edm;
149 
150 //-------------------------------------------------------------------------------
151 
153  verbosity(ps.getUntrackedParameter<unsigned int>("verbosity", 0)),
154  rpStatusWord(ps.getUntrackedParameter<unsigned int>("RPStatusWord",0x8008))
155 {
156  tokenDigi = consumes<DetSetVector<CTPPSPixelDigi> >(ps.getParameter<edm::InputTag>("tagRPixDigi"));
157  tokenCluster=consumes<DetSetVector<CTPPSPixelCluster>>(ps.getParameter<edm::InputTag>("tagRPixCluster"));
158 tokenTrack=consumes<DetSetVector<CTPPSPixelLocalTrack>>(ps.getParameter<edm::InputTag>("tagRPixLTrack"));
159 }
160 
161 //----------------------------------------------------------------------------------
162 
164 {
165 }
166 
167 //--------------------------------------------------------------------------
168 
170 {
171  if(verbosity) LogPrint("CTPPSPixelDQMSource") <<"RPstatusWord= "<<rpStatusWord;
172  nEvents = 0;
173 
174  CTPPSPixelLocalTrack thePixelLocalTrack;
175  TrackFitDimension = thePixelLocalTrack.dimension;
176 
179  ROCSizeInX = pixRowMAX/2; // ROC row size in pixels = 80
180  ROCSizeInY = pixColMAX/3;
181 
182  for(int stn=0; stn<StationIDMAX; stn++) {
183  StationStatus[stn]=0;
184  for(int rp=0; rp<RPotsIDMAX; rp++) RPstatus[stn][rp]=0;
185  }
186 
187  unsigned int rpSts = rpStatusWord<<1;
188  for(int stn=0; stn<NStationMAX; stn++) {
189  int stns = 0;
190  for(int rp=0; rp<NRPotsMAX; rp++) {
191  rpSts = (rpSts >> 1); RPstatus[stn][rp] = rpSts&1;
192  if(RPstatus[stn][rp] > 0) stns = 1;
193  }
194  StationStatus[stn]=stns;
195  }
196 
197  for(int ind=0; ind<2*3*NRPotsMAX; ind++) RPindexValid[ind] = 0;
198 
199  multHitsMax = cluSizeMax = -1;
200  x0_MIN = y0_MIN = 1.0e06;
201  x0_MAX = y0_MAX = -1.0e06;
202 }
203 
204 //-------------------------------------------------------------------------------------
205 
207 edm::EventSetup const &)
208 {
209  ibooker.cd();
210  ibooker.setCurrentFolder("CTPPS/TrackingPixel");
211  char s[50];
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);
215 
216  string str1st = "Pixel planes activity";
217  h2AllPlanesActive = ibooker.book2DD(str1st,str1st+"(digi task);Plane #",
219  TH2D *h1st = h2AllPlanesActive->getTH2D();
220  h1st->SetOption("colz");
221  TAxis *yah1st = h1st->GetYaxis();
222 
223  string str2 = "Pixel RP active";
224  hpRPactive = ibooker.bookProfile(str2,str2+" per event(digi task)",
225  NRPglobalBins, 0.5,NRPglobalBins+0.5, -0.1, 1.1,"" );
226  TAxis *xaRPact = hpRPactive->getTProfile()->GetXaxis();
227  hpRPactive->getTProfile()->SetOption("hist");
228  hpRPactive->getTProfile()->SetMinimum(0.);
229  hpRPactive->getTProfile()->SetMaximum(1.1);
230 
231  str2 = "Pixel Local Tracks";
232  hpixLTrack = ibooker.bookProfile(str2,str2+" per event",
233  NRPglobalBins, 0.5, NRPglobalBins+0.5,-0.1,NLocalTracksMAX,"");
234 
235  TAxis *xah1trk = hpixLTrack->getTProfile()->GetXaxis();
236  hpixLTrack->getTProfile()->GetYaxis()->SetTitle("average number of tracks per event");
237  hpixLTrack->getTProfile()->SetOption("hist");
238 
239  for(int arm=0; arm<2; arm++) {
241  string sd, armTitle;
242  ID.armName(sd, CTPPSDetId::nPath);
243  ID.armName(armTitle, CTPPSDetId::nFull);
244  ID.armName(armTitleShort, CTPPSDetId::nShort);
245 
246  ibooker.setCurrentFolder(sd);
247 
248  for(int stn=0; stn<NStationMAX; stn++) {
249  if(StationStatus[stn]==0) continue;
250  ID.setStation(stn);
251  string stnd, stnTitle;
252 
253  CTPPSDetId(ID.getStationId()).stationName(stnd, CTPPSDetId::nPath);
254  CTPPSDetId(ID.getStationId()).stationName(stnTitle, CTPPSDetId::nFull);
255  CTPPSDetId(ID.getStationId()).stationName(stnTitleShort, CTPPSDetId::nShort);
256 
257  ibooker.setCurrentFolder(stnd);
258 //--------- RPots ---
259  int pixBinW = 4;
260  for(int rp=RPn_first; rp<RPn_last; rp++) { // only installed pixel pots
261  ID.setRP(rp);
262  string rpd, rpTitle;
263  CTPPSDetId(ID.getRPId()).rpName(rpTitle, CTPPSDetId::nShort);
264  string rpBinName = armTitleShort + "_" + stnTitleShort+"_"+rpTitle;
265  yah1st->SetBinLabel(getRPglobalBin(arm,stn), rpBinName.c_str());
266  xah1trk->SetBinLabel(getRPglobalBin(arm,stn), rpBinName.c_str());
267  xaRPact->SetBinLabel(getRPglobalBin(arm,stn), rpBinName.c_str());
268 
269  if(RPstatus[stn][rp]==0) continue;
270  int indexP = getRPindex(arm,stn,rp);
271  RPindexValid[indexP] = 1;
272 
273  CTPPSDetId(ID.getRPId()).rpName(rpTitle, CTPPSDetId::nFull);
274  CTPPSDetId(ID.getRPId()).rpName(rpd, CTPPSDetId::nPath);
275 
276  ibooker.setCurrentFolder(rpd);
277 
278  string st2 = ": " + stnTitle;
279 
280  string st = "hit multiplicity in planes";
281  string st3 = ";PlaneIndex(=pixelPot*PlaneMAX + plane)";
282  h2HitsMultipl[arm][stn]= ibooker.book2DD(st,st+st2+st3+";multiplicity",
284  h2HitsMultipl[arm][stn]->getTH2D()->SetOption("colz");
285 
286  st = "cluster size in planes";
287  h2CluSize[arm][stn] = ibooker.book2D(st,st+st2+st3+";Cluster size",
289  h2CluSize[arm][stn]->getTH2F()->SetOption("colz");
290 
291  const float x0Maximum = 70.;
292  const float y0Maximum = 15.;
293  st = "track intercept point";
294  h2trackXY0[indexP] = ibooker.book2D(st,st+st2+";x0;y0",
295  int(x0Maximum)*2, 0.,x0Maximum,int(y0Maximum)*4,-y0Maximum,y0Maximum);
296  h2trackXY0[indexP]->getTH2F()->SetOption("colz");
297 
298  st = "number of tracks per event";
299  htrackMult[indexP] = ibooker.bookProfile(st,rpTitle+";number of tracks",
300  NLocalTracksMAX+1, -0.5,NLocalTracksMAX+0.5, -0.5,NLocalTracksMAX+0.5,"");
301  htrackMult[indexP]->getTProfile()->SetOption("hist");
302 
303  st = "number of hits per track";
304  htrackHits[indexP] = ibooker.bookProfile(st,rpTitle+";number of hits",
305  5,1.5,6.5, -0.1,1.1, "");
306  htrackHits[indexP]->getTProfile()->SetOption("hist");
307 
308  hRPotActivPlanes[indexP] =
309  ibooker.bookProfile("number of fired planes per event", rpTitle+";nPlanes;Probability",
310  NplaneMAX+1, -0.5, NplaneMAX+0.5, -0.5,NplaneMAX+0.5,"");
311  hRPotActivPlanes[indexP]->getTProfile()->SetOption("hist");
312 
313  h2HitsMultROC[indexP] = ibooker.bookProfile2D("ROCs hits multiplicity per event",
314  rpTitle+";plane # ;ROC #", NplaneMAX,-0.5,NplaneMAX-0.5, NROCsMAX,-0.5,NROCsMAX-0.5,
315  0.,ROCSizeInX*ROCSizeInY,"");
316  h2HitsMultROC[indexP]->getTProfile2D()->SetOption("colztext");
317  h2HitsMultROC[indexP]->getTProfile2D()->SetMinimum(1.e-10);
318 
319 
320  hp2HitsMultROC_LS[indexP]=ibooker.bookProfile2D("ROCs_hits_multiplicity_per_event vs LS",
321  rpTitle+";LumiSection;Plane#___ROC#", 1000,0.,1000.,
322  NplaneMAX*NROCsMAX,0.,double(NplaneMAX*NROCsMAX),0.,ROCSizeInX*ROCSizeInY,"");
323  hp2HitsMultROC_LS[indexP]->getTProfile2D()->SetOption("colz");
324  hp2HitsMultROC_LS[indexP]->getTProfile2D()->SetMinimum(1.0e-10);
325  hp2HitsMultROC_LS[indexP]->getTProfile2D()->SetCanExtend(TProfile2D::kXaxis);
326  TAxis *yahp2 = hp2HitsMultROC_LS[indexP]->getTProfile2D()->GetYaxis();
327  for(int p=0; p<NplaneMAX; p++) {
328  sprintf(s,"plane%d_0",p);
329  yahp2->SetBinLabel(p*NplaneMAX+1,s);
330  for(int r=1; r<NROCsMAX; r++) {
331  sprintf(s," %d_%d",p,r);
332  yahp2->SetBinLabel(p*NplaneMAX+r+1,s);
333  }
334  }
335 
336  ibooker.setCurrentFolder(rpd+"/latency");
337  hRPotActivBX[indexP] =
338  ibooker.book1D("5 fired planes per BX", rpTitle+";Event.BX",4002,-1.5, 4000.+0.5);
339 
340  hRPotActivBXroc[indexP] =
341  ibooker.book1D("4 fired ROCs per BX", rpTitle+";Event.BX", 4002, -1.5, 4000.+0.5);
342 
343  hRPotActivBXall[indexP] =
344  ibooker.book1D("hits per BX", rpTitle+";Event.BX", 4002, -1.5, 4000.+0.5);
345 
346  int nbins = pixRowMAX/pixBinW;
347 
348  for(int p=0; p<NplaneMAX; p++) {
349  sprintf(s,"plane_%d",p);
350  string pd = rpd+"/"+string(s);
351  ibooker.setCurrentFolder(pd);
352  string st1 = ": "+rpTitle+"_"+string(s);
353 
354  st = "hits position";
355  h2xyHits[indexP][p]=ibooker.book2DD(st,st1+";pix col;pix row",
357  h2xyHits[indexP][p]->getTH2D()->SetOption("colz");
358 
359  st = "adc average value";
360  hp2xyADC[indexP][p]=ibooker.bookProfile2D(st,st1+";pix col;pix row",
361  nbins,0,pixRowMAX,nbins,0,pixRowMAX, 0.,512.,"");
362  hp2xyADC[indexP][p]->getTProfile2D()->SetOption("colz");
363 
364  st = "hits multiplicity";
365  hHitsMult[indexP][p]=ibooker.book1DD(st,st1+";number of hits;N / 1 hit",
366  hitMultMAX+1,-0.5,hitMultMAX+0.5);
367  } // end of for(int p=0; p<NplaneMAX;..
368 
369  } // end for(int rp=0; rp<NRPotsMAX;...
370  } // end of for(int stn=0; stn<
371  } //end of for(int arm=0; arm<2;...
372 
373  return;
374 }
375 
376 //-------------------------------------------------------------------------------
377 
379 {
380  ++nEvents;
381  int lumiId = event.getLuminosityBlock().id().luminosityBlock();
382  if(lumiId<0) lumiId=0;
383 
384  int RPactivity[RPotsTotalNumber], RPdigiSize[RPotsTotalNumber];
385  int pixRPTracks[RPotsTotalNumber];
386 
387  for(int rp=0; rp<RPotsTotalNumber; rp++)
388  { RPactivity[rp] = RPdigiSize[rp] = pixRPTracks[rp] = 0;}
389 
390  for(int ind=0; ind<RPotsTotalNumber; ind++) {
391  for(int p=0; p<NplaneMAX; p++) {
392  HitsMultPlane[ind][p] = 0;
393  ClusMultPlane[ind][p] = 0;
394  }
395  }
396  for(int ind=0; ind<RPotsTotalNumber*NplaneMAX; ind++) {
397  for(int roc=0; roc<NROCsMAX; roc++) {
398  HitsMultROC[ind][roc] = 0;
399  }
400  }
402  event.getByToken(tokenDigi, pixDigi);
403 
405  event.getByToken(tokenCluster, pixClus);
406 
408  event.getByToken(tokenTrack, pixTrack);
409 
410  hBX->Fill(event.bunchCrossing());
411  hBXshort->Fill(event.bunchCrossing());
412 
413  if(pixTrack.isValid()) {
414  for(const auto &ds_tr : *pixTrack)
415  {
416  int idet = getDet(ds_tr.id);
417  if(idet != DetId::VeryForward) {
418  if(verbosity>1) LogPrint("CTPPSPixelDQMSource") <<"not CTPPS: ds_tr.id"<<ds_tr.id;
419  continue;
420  }
421  CTPPSDetId theId(ds_tr.id);
422  int arm = theId.arm()&0x1;
423  int station = theId.station()&0x3;
424  int rpot = theId.rp()&0x7;
425  int rpInd = getRPindex(arm,station,rpot);
426 
428  dit != ds_tr.end(); ++dit) {
429  ++pixRPTracks[rpInd];
430  int nh_tr = (dit->getNDF() + TrackFitDimension)/2;
431  for(int i=0; i<=NplaneMAX; i++) {
432  if(i==nh_tr) htrackHits[rpInd]->Fill(nh_tr,1.);
433  else htrackHits[rpInd]->Fill(i,0.);
434  }
435  float x0 = dit->getX0();
436  float y0 = dit->getY0();
437  h2trackXY0[rpInd]->Fill(x0,y0);
438  if(x0_MAX < x0) x0_MAX = x0;
439  if(y0_MAX < y0) y0_MAX = y0;
440  if(x0_MIN > x0) x0_MIN = x0;
441  if(y0_MIN > y0) y0_MIN = y0;
442  }
443  }
444  } // end if(pixTrack.isValid())
445 
446 
447  bool valid = false;
448  valid |= pixDigi.isValid();
449 // valid |= Clus.isValid();
450 
451  if(!valid && verbosity) LogPrint("CTPPSPixelDQMSource") <<"No valid data in Event "<<nEvents;
452 
453  if(pixDigi.isValid()) {
454  for(const auto &ds_digi : *pixDigi)
455  {
456  int idet = getDet(ds_digi.id);
457  if(idet != DetId::VeryForward) {
458  if(verbosity>1) LogPrint("CTPPSPixelDQMSource") <<"not CTPPS: ds_digi.id"<<ds_digi.id;
459  continue;
460  }
461  // int subdet = getSubdet(ds_digi.id);
462 
463  int plane = getPixPlane(ds_digi.id);
464 
465  CTPPSDetId theId(ds_digi.id);
466  int arm = theId.arm()&0x1;
467  int station = theId.station()&0x3;
468  int rpot = theId.rp()&0x7;
469  int rpInd = getRPindex(arm,station,rpot);
470  RPactivity[rpInd] = 1;
471  ++RPdigiSize[rpInd];
472 
473  if(StationStatus[station] && RPstatus[station][rpot]) {
474 
475  h2HitsMultipl[arm][station]->Fill(prIndex(rpot,plane),ds_digi.data.size());
476  h2AllPlanesActive->Fill(plane,getRPglobalBin(arm,station));
477 
478  int index = getRPindex(arm,station,rpot);
479  HitsMultPlane[index][plane] += ds_digi.data.size();
480  if(RPindexValid[index]) {
481  int nh = ds_digi.data.size();
482  if(nh > hitMultMAX) nh = hitMultMAX;
483  hHitsMult[index][plane]->Fill(nh);
484  }
485  int rocHistIndex = getPlaneIndex(arm,station,rpot,plane);
486 
487  for(DetSet<CTPPSPixelDigi>::const_iterator dit = ds_digi.begin();
488  dit != ds_digi.end(); ++dit) {
489  int row = dit->row();
490  int col = dit->column();
491  int adc = dit->adc();
492 
493  if(RPindexValid[index]) {
494  h2xyHits[index][plane]->Fill(col,row);
495  hp2xyADC[index][plane]->Fill(col,row,adc);
496  int colROC, rowROC;
497  int trocId;
498  if(!thePixIndices.transformToROC(col,row, trocId, colROC, rowROC)) {
499  if(trocId>=0 && trocId<NROCsMAX) {
500  ++HitsMultROC[rocHistIndex][trocId];
501  }
502  }
503  } //end if(RPindexValid[index]) {
504  }
505  if(int(ds_digi.data.size()) > multHitsMax) multHitsMax = ds_digi.data.size();
506 
507  } // end if(StationStatus[station]) {
508  } // end for(const auto &ds_digi : *pixDigi)
509  } //if(pixDigi.isValid()) {
510 
511  if(pixClus.isValid())
512  for(const auto &ds : *pixClus)
513  {
514  int idet = getDet(ds.id);
515  if(idet != DetId::VeryForward) {
516  if(verbosity>1) LogPrint("CTPPSPixelDQMSource") <<"not CTPPS: cluster.id"<<ds.id;
517  continue;
518  }
519  // int subdet = getSubdet(ds.id);
520 
521  int plane = getPixPlane(ds.id);
522 
523  CTPPSDetId theId(ds.id);
524  int arm = theId.arm()&0x1;
525  int station = theId.station()&0x3;
526  int rpot = theId.rp()&0x7;
527 
528  if((StationStatus[station]==0) || (RPstatus[station][rpot]==0)) continue;
529 
530  int index = getRPindex(arm,station,rpot);
531  ++ClusMultPlane[index][plane];
532 
533  for (const auto &p : ds) {
534  int clusize = p.size();
535  h2CluSize[arm][station]->Fill(prIndex(rpot,plane),clusize);
536  if(cluSizeMax < clusize) cluSizeMax = clusize;
537  if(clusize > ClusterSizeMax) clusize = ClusterSizeMax;
538  }
539  } // end if(pixClus.isValid()) for(const auto &ds : *pixClus)
540 
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++) {
544  for(int stn=0; stn<NStationMAX; stn++) {
545  for(int rp=0; rp<NRPotsMAX; rp++) {
546  int index = getRPindex(arm,stn,rp);
547  if(RPindexValid[index]==0) continue;
548  hpRPactive->Fill(getRPglobalBin(arm,stn),RPactivity[index]);
549 // if(RPactivity[index]==0) continue;
550  if(!allRPactivity) continue;
551  hpixLTrack->Fill(getRPglobalBin(arm,stn),pixRPTracks[index]);
552  int ntr = pixRPTracks[index];
553  if(ntr > NLocalTracksMAX) ntr = NLocalTracksMAX;
554  for(int i=0; i<=NLocalTracksMAX; i++) {
555  if(i==ntr) htrackMult[index]->Fill(ntr,1.);
556  else htrackMult[index]->Fill(i,0.);
557  }
558 
559  int np = 0;
560  for(int p=0; p<NplaneMAX; p++) if(HitsMultPlane[index][p]>0) np++;
561  for(int p=0; p<=NplaneMAX; p++) {
562  if(p == np) hRPotActivPlanes[index]->Fill(p,1.);
563  else hRPotActivPlanes[index]->Fill(p,0.);
564  }
565  if(np>=5) hRPotActivBX[index]->Fill(event.bunchCrossing());
566  hRPotActivBXall[index]->Fill(event.bunchCrossing(),float(RPdigiSize[index]));
567 
568  int rocf[NplaneMAX];
569  for(int r=0; r<NROCsMAX; r++) rocf[r]=0;
570  for(int p=0; p<NplaneMAX; p++) {
571  int indp = getPlaneIndex(arm,stn,rp,p);
572  for(int r=0; r<NROCsMAX; r++) if(HitsMultROC[indp][r] > 0) ++rocf[r];
573  for(int r=0; r<NROCsMAX; r++) {
574  h2HitsMultROC[index]->Fill(p,r,HitsMultROC[indp][r]);
575  hp2HitsMultROC_LS[index]->Fill(lumiId,p*NROCsMAX+r,HitsMultROC[indp][r]);
576  }
577  }
578  int max = 0;
579  for(int r=0; r<NROCsMAX; r++)
580  if(max < rocf[r]) { max = rocf[r]; }
581  if(max >= 4) hRPotActivBXroc[index]->Fill(event.bunchCrossing());
582  } //end for(int rp=0; rp<NRPotsMAX; rp++) {
583  }
584  } //end for(int arm=0; arm<2; arm++) {
585 
586  if((nEvents % 100)) return;
587  if(verbosity) LogPrint("CTPPSPixelDQMSource")<<"analyze event "<<nEvents;
588 }
589 
590 //-----------------------------------------------------------------------------
592 {
593  if(!verbosity) return;
594  LogPrint("CTPPSPixelDQMSource")
595  <<"end of Run "<<run.run()<<": "<<nEvents<<" events\n"
596  <<"multHitsMax= "<<multHitsMax <<" cluSizeMax= "<<cluSizeMax
597  <<"\nx0: "<< x0_MIN<<"/" << x0_MAX<<"y0: "<<y0_MIN<<"/"<<y0_MAX<<"\n";
598 }
599 
600 //---------------------------------------------------------------------------
602 
int adc(sample_type sample)
get the ADC sample (12 bits)
uint32_t station() const
Definition: CTPPSDetId.h:63
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]
RunNumber_t run() const
Definition: RunBase.h:40
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelDigi > > tokenDigi
TProfile2D * getTProfile2D() const
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:160
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
MonitorElement * htrackMult[RPotsTotalNumber]
MonitorElement * h2HitsMultROC[RPotsTotalNumber]
uint32_t ID
Definition: Definitions.h:26
MonitorElement * h2trackXY0[RPotsTotalNumber]
MonitorElement * hpixLTrack
void setRP(uint32_t rp)
Definition: CTPPSDetId.h:79
int bunchCrossing() const
Definition: EventBase.h:66
int getDefaultRowDetSize() const
CTPPSDetId getStationId() const
Definition: CTPPSDetId.h:92
CTPPSPixelIndices thePixIndices
#define constexpr
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelCluster > > tokenCluster
void Fill(long long x)
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)
int RPindexValid[RPotsTotalNumber]
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * hROCadc[RPotsTotalNumber *NplaneMAX][NROCsMAX]
int np
Definition: AMPTWrapper.h:33
CTPPSPixelDQMSource(const edm::ParameterSet &ps)
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:166
MonitorElement * hRPotActivBX[RPotsTotalNumber]
int getDefaultColDetSize() const
TH2D * getTH2D() const
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
CTPPSDetId getRPId() const
Definition: CTPPSDetId.h:97
uint32_t arm() const
Definition: CTPPSDetId.h:52
bool isValid() const
Definition: HandleBase.h:74
void armName(std::string &name, NameFlag flag=nFull) const
Definition: CTPPSDetId.h:115
int getRPindex(int arm, int station, int rp)
TH2F * getTH2F() const
MonitorElement * hRPotActivBXroc[RPotsTotalNumber]
iterator begin()
Definition: DetSet.h:59
MonitorElement * h2xyROCHits[RPotsTotalNumber *NplaneMAX][NROCsMAX]
void setStation(uint32_t station)
Definition: CTPPSDetId.h:68
int ClusMultPlane[RPotsTotalNumber][NplaneMAX]
MonitorElement * hRPotActivBXall[RPotsTotalNumber]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
double sd
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
int transformToROC(const int col, const int row, int &rocId, int &colROC, int &rowROC) const
HLT enums.
static const int kDetOffset
Definition: DetId.h:22
col
Definition: cuy.py:1009
MonitorElement * h2AllPlanesActive
MonitorElement * book2DD(Args &&...args)
Definition: DQMStore.h:148
int getRPglobalBin(int arm, int stn)
int HitsMultROC[RPotsTotalNumber *NplaneMAX][NROCsMAX]
int getPlaneIndex(int arm, int station, int rp, int plane)
MonitorElement * h2xyHits[RPotsTotalNumber][NplaneMAX]
MonitorElement * hRPotActivPlanes[RPotsTotalNumber]
MonitorElement * book1DD(Args &&...args)
Definition: DQMStore.h:130
int RPstatus[StationIDMAX][RPotsIDMAX]
MonitorElement * hBXshort
MonitorElement * h2HitsMultipl[NArms][NStationMAX]
Definition: event.py:1
Definition: Run.h:44
uint32_t rp() const
Definition: CTPPSDetId.h:74