CMS 3D CMS Logo

SiPixelClusterSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelMonitorCluster
4 // Class: SiPixelClusterSource
5 //
13 //
14 // Original Author: Vincenzo Chiochia & Andrew York
15 // Created:
16 //
17 //
18 // Updated by: Lukas Wehrli
19 // for pixel offline DQM
21 // Framework
25 // DQM Framework
28 // Geometry
31 // DataFormats
38 //
39 #include <cstdlib>
40 #include <string>
41 
42 using namespace std;
43 using namespace edm;
44 
46  : conf_(iConfig),
47  src_(conf_.getParameter<edm::InputTag>("src")),
48  digisrc_(conf_.getParameter<edm::InputTag>("digisrc")),
49  saveFile(conf_.getUntrackedParameter<bool>("saveFile", false)),
50  isPIB(conf_.getUntrackedParameter<bool>("isPIB", false)),
51  slowDown(conf_.getUntrackedParameter<bool>("slowDown", false)),
52  modOn(conf_.getUntrackedParameter<bool>("modOn", true)),
53  twoDimOn(conf_.getUntrackedParameter<bool>("twoDimOn", true)),
54  reducedSet(conf_.getUntrackedParameter<bool>("reducedSet", false)),
55  ladOn(conf_.getUntrackedParameter<bool>("ladOn", false)),
56  layOn(conf_.getUntrackedParameter<bool>("layOn", false)),
57  phiOn(conf_.getUntrackedParameter<bool>("phiOn", false)),
58  ringOn(conf_.getUntrackedParameter<bool>("ringOn", false)),
59  bladeOn(conf_.getUntrackedParameter<bool>("bladeOn", false)),
60  diskOn(conf_.getUntrackedParameter<bool>("diskOn", false)),
61  smileyOn(conf_.getUntrackedParameter<bool>("smileyOn", false)),
62  bigEventSize(conf_.getUntrackedParameter<int>("bigEventSize", 100)),
63  isUpgrade(conf_.getUntrackedParameter<bool>("isUpgrade", false)),
64  noOfLayers(0),
65  noOfDisks(0) {
66  LogInfo("PixelDQM") << "SiPixelClusterSource::SiPixelClusterSource: Got DQM BackEnd interface" << endl;
67 
68  // set Token(-s)
69  srcToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(conf_.getParameter<edm::InputTag>("src"));
70  digisrcToken_ = consumes<edm::DetSetVector<PixelDigi>>(conf_.getParameter<edm::InputTag>("digisrc"));
71 
72  trackerTopoToken_ = esConsumes<TrackerTopology, TrackerTopologyRcd>();
73  trackerGeomToken_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>();
74  trackerTopoTokenBeginRun_ = esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>();
75  trackerGeomTokenBeginRun_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>();
76 
77  firstRun = true;
78  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
79 }
80 
82  // do anything here that needs to be done at desctruction time
83  // (e.g. close files, deallocate resources etc.)
84  LogInfo("PixelDQM") << "SiPixelClusterSource::~SiPixelClusterSource: Destructor" << endl;
85 
86  std::map<uint32_t, SiPixelClusterModule *>::iterator struct_iter;
87  for (struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++) {
88  delete struct_iter->second;
89  struct_iter->second = nullptr;
90  }
91 }
92 
94  LogInfo("PixelDQM") << " SiPixelClusterSource::beginJob - Initialisation ... " << std::endl;
95  LogInfo("PixelDQM") << "Mod/Lad/Lay/Phi " << modOn << "/" << ladOn << "/" << layOn << "/" << phiOn << std::endl;
96  LogInfo("PixelDQM") << "Blade/Disk/Ring" << bladeOn << "/" << diskOn << "/" << ringOn << std::endl;
97  LogInfo("PixelDQM") << "2DIM IS " << twoDimOn << "\n";
98  LogInfo("PixelDQM") << "Smiley (Cluster sizeY vs. Cluster eta) is " << smileyOn << "\n";
99 
100  if (firstRun) {
101  eventNo = 0;
102  lumSec = 0;
103  nLumiSecs = 0;
104  nBigEvents = 0;
105  // Build map
106  buildStructure(iSetup);
107 
108  firstRun = false;
109  }
110 }
111 
113  bookMEs(iBooker, iSetup);
114  // Book occupancy maps in global coordinates for all clusters:
115  iBooker.setCurrentFolder(topFolderName_ + "/Clusters/OffTrack");
116  // bpix
117  std::stringstream ss1, ss2;
118  for (int i = 1; i <= noOfLayers; i++) {
119  ss1.str(std::string());
120  ss1 << "position_siPixelClusters_Layer_" << i;
121  ss2.str(std::string());
122  ss2 << "Clusters Layer" << i << ";Global Z (cm);Global #phi";
123  meClPosLayer.push_back(iBooker.book2D(ss1.str(), ss2.str(), 200, -30., 30., 128, -3.2, 3.2));
124  }
125  for (int i = 1; i <= noOfDisks; i++) {
126  ss1.str(std::string());
127  ss1 << "position_siPixelClusters_pz_Disk_" << i;
128  ss2.str(std::string());
129  ss2 << "Clusters +Z Disk" << i << ";Global X (cm);Global Y (cm)";
130  meClPosDiskpz.push_back(iBooker.book2D(ss1.str(), ss2.str(), 80, -20., 20., 80, -20., 20.));
131  ss1.str(std::string());
132  ss1 << "position_siPixelClusters_mz_Disk_" << i;
133  ss2.str(std::string());
134  ss2 << "Clusters -Z Disk" << i << ";Global X (cm);Global Y (cm)";
135  meClPosDiskmz.push_back(iBooker.book2D(ss1.str(), ss2.str(), 80, -20., 20., 80, -20., 20.));
136  }
137 
138  // Book trend cluster plots for barrel and endcap. Lumisections for offline
139  // and second for online - taken from strips
140  iBooker.setCurrentFolder(topFolderName_ + "/Barrel");
141  ss1.str(std::string());
142  ss1 << "totalNumberOfClustersProfile_siPixelClusters_Barrel";
143  ss2.str(std::string());
144  ss2 << "Total number of barrel clusters profile;Lumisection;";
145  meClusBarrelProf = iBooker.bookProfile(ss1.str(), ss2.str(), 2400, 0., 150, 0, 0, "");
146  meClusBarrelProf->getTH1()->SetCanExtend(TH1::kAllAxes);
147 
148  iBooker.setCurrentFolder(topFolderName_ + "/Endcap");
149 
150  ss1.str(std::string());
151  ss1 << "totalNumberOfClustersProfile_siPixelClusters_FPIX+";
152  ss2.str(std::string());
153  ss2 << "Total number of FPIX+ clusters profile;Lumisection;";
154  meClusFpixPProf = iBooker.bookProfile(ss1.str(), ss2.str(), 2400, 0., 150, 0, 0, "");
155  meClusFpixPProf->getTH1()->SetCanExtend(TH1::kAllAxes);
156 
157  ss1.str(std::string());
158  ss1 << "totalNumberOfClustersProfile_siPixelClusters_FPIX-";
159  ss2.str(std::string());
160  ss2 << "Total number of FPIX- clusters profile;Lumisection;";
161  meClusFpixMProf = iBooker.bookProfile(ss1.str(), ss2.str(), 2400, 0., 150, 0, 0, "");
162  meClusFpixMProf->getTH1()->SetCanExtend(TH1::kAllAxes);
163 
164  iBooker.setCurrentFolder(topFolderName_ + "/Barrel");
165  for (int i = 1; i <= noOfLayers; i++) {
166  int ybins = -1;
167  float ymin = 0.;
168  float ymax = 0.;
169  if (i == 1) {
170  ybins = 42;
171  ymin = -10.5;
172  ymax = 10.5;
173  }
174  if (i == 2) {
175  ybins = 66;
176  ymin = -16.5;
177  ymax = 16.5;
178  }
179  if (i == 3) {
180  ybins = 90;
181  ymin = -22.5;
182  ymax = 22.5;
183  }
184  if (i == 4) {
185  ybins = 130;
186  ymin = -32.5;
187  ymax = 32.5;
188  }
189  ss1.str(std::string());
190  ss1 << "pix_bar Occ_roc_online_" + digisrc_.label() + "_layer_" << i;
191  ss2.str(std::string());
192  ss2 << "Pixel Barrel Occupancy, ROC level (Online): Layer " << i;
193  meZeroRocBPIX.push_back(iBooker.book2D(ss1.str(), ss2.str(), 72, -4.5, 4.5, ybins, ymin, ymax));
194  meZeroRocBPIX.at(i - 1)->setAxisTitle("ROC / Module", 1);
195  meZeroRocBPIX.at(i - 1)->setAxisTitle("ROC / Ladder", 2);
196  }
197 
198  iBooker.setCurrentFolder(topFolderName_ + "/Endcap");
199  meZeroRocFPIX = iBooker.book2D(
200  "ROC_endcap_occupancy", "Pixel Endcap Occupancy, ROC level (Online)", 72, -4.5, 4.5, 288, -12.5, 12.5);
201  meZeroRocFPIX->setBinLabel(1, "Disk-2 Pnl2", 1);
202  meZeroRocFPIX->setBinLabel(9, "Disk-2 Pnl1", 1);
203  meZeroRocFPIX->setBinLabel(19, "Disk-1 Pnl2", 1);
204  meZeroRocFPIX->setBinLabel(27, "Disk-1 Pnl1", 1);
205  meZeroRocFPIX->setBinLabel(41, "Disk+1 Pnl1", 1);
206  meZeroRocFPIX->setBinLabel(49, "Disk+1 Pnl2", 1);
207  meZeroRocFPIX->setBinLabel(59, "Disk+2 Pnl1", 1);
208  meZeroRocFPIX->setBinLabel(67, "Disk+2 Pnl2", 1);
209  meZeroRocFPIX->setAxisTitle("Blades in Inner (>0) / Outer(<) Halves", 2);
210  meZeroRocFPIX->setAxisTitle("ROC occupancy", 3);
211 }
212 
213 //------------------------------------------------------------------
214 // Method called for every event
215 //------------------------------------------------------------------
217  eventNo++;
218 
219  if (meClPosLayer.at(0) && meClPosLayer.at(0)->getEntries() > 150000) {
220  for (int i = 0; i < noOfLayers; i++) {
221  meClPosLayer.at(i)->Reset();
222  }
223  for (int i = 0; i < noOfDisks; i++) {
224  meClPosDiskpz.at(i)->Reset();
225  meClPosDiskmz.at(i)->Reset();
226  }
227  }
228 
229  // get input data
231  iEvent.getByToken(srcToken_, input);
232  auto const &clustColl = *(input.product());
233 
235  const TrackerGeometry *tracker = &(*pDD);
236 
238  iEvent.getByToken(digisrcToken_, digiinput);
239  const edm::DetSetVector<PixelDigi> diginp = *(digiinput.product());
240 
242  const TrackerTopology *pTT = tTopoHandle.product();
243 
244  int lumiSection = (int)iEvent.luminosityBlock();
245  int nEventFpixClusters = 0;
246 
247  int nEventsBarrel = 0;
248  int nEventsFPIXm = 0;
249  int nEventsFPIXp = 0;
250 
251  std::map<uint32_t, SiPixelClusterModule *>::iterator struct_iter;
252  for (struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++) {
253  int numberOfFpixClusters = (*struct_iter)
254  .second->fill(*input,
255  pTT,
256  tracker,
257  &nEventsBarrel,
258  &nEventsFPIXp,
259  &nEventsFPIXm,
260  meClPosLayer,
263  modOn,
264  ladOn,
265  layOn,
266  phiOn,
267  bladeOn,
268  diskOn,
269  ringOn,
270  twoDimOn,
271  reducedSet,
272  smileyOn,
273  isUpgrade);
274  nEventFpixClusters = nEventFpixClusters + numberOfFpixClusters;
275  }
276 
277  if (nEventFpixClusters > bigEventSize) {
279  bigFpixClusterEventRate->Fill(lumiSection, 1. / 23.);
280  }
281  }
282 
283  float trendVar = iEvent.orbitNumber() / 262144.0; // lumisection : seconds - matches strip trend plot
284 
285  meClusBarrelProf->Fill(trendVar, nEventsBarrel);
286  meClusFpixPProf->Fill(trendVar, nEventsFPIXp);
287  meClusFpixMProf->Fill(trendVar, nEventsFPIXm);
288 
289  // std::cout<<"nEventFpixClusters: "<<nEventFpixClusters<<" , nLumiSecs:
290  // "<<nLumiSecs<<" , nBigEvents: "<<nBigEvents<<std::endl;
291 
292  for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++) {
293  DetId detId = (*it)->geographicalId();
294 
295  // fill barrel
296  if (detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
297  getrococcupancy(detId, diginp, pTT, meZeroRocBPIX);
298  }
299 
300  // fill endcap
301  if (detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) {
302  getrococcupancye(detId, clustColl, pTT, pDD, meZeroRocFPIX);
303  }
304  }
305 
306  // slow down...
307  if (slowDown)
308  usleep(10000);
309 }
310 
311 //------------------------------------------------------------------
312 // Build data structure
313 //------------------------------------------------------------------
315  LogInfo("PixelDQM") << " SiPixelClusterSource::buildStructure";
317 
319  const TrackerTopology *pTT = tTopoHandle.product();
320 
321  LogVerbatim("PixelDQM") << " *** Geometry node for TrackerGeom is " << &(*pDD) << std::endl;
322  LogVerbatim("PixelDQM") << " *** I have " << pDD->dets().size() << " detectors" << std::endl;
323  LogVerbatim("PixelDQM") << " *** I have " << pDD->detTypes().size() << " types" << std::endl;
324 
325  for (TrackerGeometry::DetContainer::const_iterator it = pDD->dets().begin(); it != pDD->dets().end(); it++) {
326  if (dynamic_cast<PixelGeomDetUnit const *>((*it)) != nullptr) {
327  DetId detId = (*it)->geographicalId();
328  const GeomDetUnit *geoUnit = pDD->idToDetUnit(detId);
329  const PixelGeomDetUnit *pixDet = dynamic_cast<const PixelGeomDetUnit *>(geoUnit);
330  int nrows = (pixDet->specificTopology()).nrows();
331  int ncols = (pixDet->specificTopology()).ncolumns();
332 
333  if ((detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) ||
334  (detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap))) {
335  uint32_t id = detId();
336  if (detId.subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel)) {
337  if (isPIB)
338  continue;
339  LogDebug("PixelDQM") << " ---> Adding Barrel Module " << detId.rawId() << endl;
340  int layer = PixelBarrelName(DetId(id), pTT, isUpgrade).layerName();
341  if (layer > noOfLayers)
342  noOfLayers = layer;
343  SiPixelClusterModule *theModule = new SiPixelClusterModule(id, ncols, nrows);
344  thePixelStructure.insert(pair<uint32_t, SiPixelClusterModule *>(id, theModule));
345  } else if (detId.subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap)) {
346  LogDebug("PixelDQM") << " ---> Adding Endcap Module " << detId.rawId() << endl;
348  int disk = PixelEndcapName(DetId(id), pTT, isUpgrade).diskName();
349  if (disk > noOfDisks)
350  noOfDisks = disk;
351  int blade = PixelEndcapName(DetId(id), pTT, isUpgrade).bladeName();
352  int panel = PixelEndcapName(DetId(id), pTT, isUpgrade).pannelName();
354  char sside[80];
355  sprintf(sside, "HalfCylinder_%i", side);
356  char sdisk[80];
357  sprintf(sdisk, "Disk_%i", disk);
358  char sblade[80];
359  sprintf(sblade, "Blade_%02i", blade);
360  char spanel[80];
361  sprintf(spanel, "Panel_%i", panel);
362  char smodule[80];
363  sprintf(smodule, "Module_%i", module);
364  std::string side_str = sside;
365  std::string disk_str = sdisk;
366  bool mask = side_str.find("HalfCylinder_1") != string::npos ||
367  side_str.find("HalfCylinder_2") != string::npos ||
368  side_str.find("HalfCylinder_4") != string::npos || disk_str.find("Disk_2") != string::npos;
369  // clutch to take all of FPIX, but no BPIX:
370  mask = false;
371  if (isPIB && mask)
372  continue;
373  SiPixelClusterModule *theModule = new SiPixelClusterModule(id, ncols, nrows);
374  thePixelStructure.insert(pair<uint32_t, SiPixelClusterModule *>(id, theModule));
375  }
376  }
377  }
378  }
379  LogInfo("PixelDQM") << " *** Pixel Structure Size " << thePixelStructure.size() << endl;
380 }
381 //------------------------------------------------------------------
382 // Book MEs
383 //------------------------------------------------------------------
385  // Get DQM interface
387  char title[256];
388  snprintf(title,
389  256,
390  "Rate of events with >%i FPIX clusters;LumiSection;Rate of large "
391  "FPIX events per LS [Hz]",
392  bigEventSize);
393  bigFpixClusterEventRate = iBooker.book1D("bigFpixClusterEventRate", title, 5000, 0., 5000.);
394 
395  std::map<uint32_t, SiPixelClusterModule *>::iterator struct_iter;
396 
397  SiPixelFolderOrganizer theSiPixelFolder(false);
398 
400  const TrackerTopology *pTT = tTopoHandle.product();
401 
402  for (struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++) {
404  if (modOn) {
405  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 0, isUpgrade)) {
406  (*struct_iter).second->book(conf_, pTT, iBooker, 0, twoDimOn, reducedSet, isUpgrade);
407  } else {
408  if (!isPIB)
409  throw cms::Exception("LogicError") << "[SiPixelClusterSource::bookMEs] Creation of DQM folder "
410  "failed";
411  }
412  }
413  if (ladOn) {
414  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 1, isUpgrade)) {
415  (*struct_iter).second->book(conf_, pTT, iBooker, 1, twoDimOn, reducedSet, isUpgrade);
416  } else {
417  LogDebug("PixelDQM") << "PROBLEM WITH LADDER-FOLDER\n";
418  }
419  }
420  if (layOn) {
421  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 2, isUpgrade)) {
422  (*struct_iter).second->book(conf_, pTT, iBooker, 2, twoDimOn, reducedSet, isUpgrade);
423  } else {
424  LogDebug("PixelDQM") << "PROBLEM WITH LAYER-FOLDER\n";
425  }
426  }
427  if (phiOn) {
428  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 3, isUpgrade)) {
429  (*struct_iter).second->book(conf_, pTT, iBooker, 3, twoDimOn, reducedSet, isUpgrade);
430  } else {
431  LogDebug("PixelDQM") << "PROBLEM WITH PHI-FOLDER\n";
432  }
433  }
434  if (bladeOn) {
435  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 4, isUpgrade)) {
436  (*struct_iter).second->book(conf_, pTT, iBooker, 4, twoDimOn, reducedSet, isUpgrade);
437  } else {
438  LogDebug("PixelDQM") << "PROBLEM WITH BLADE-FOLDER\n";
439  }
440  }
441  if (diskOn) {
442  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 5, isUpgrade)) {
443  (*struct_iter).second->book(conf_, pTT, iBooker, 5, twoDimOn, reducedSet, isUpgrade);
444  } else {
445  LogDebug("PixelDQM") << "PROBLEM WITH DISK-FOLDER\n";
446  }
447  }
448  if (ringOn) {
449  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 6, isUpgrade)) {
450  (*struct_iter).second->book(conf_, pTT, iBooker, 6, twoDimOn, reducedSet, isUpgrade);
451  } else {
452  LogDebug("PixelDQM") << "PROBLEM WITH RING-FOLDER\n";
453  }
454  }
455  if (smileyOn) {
456  if (theSiPixelFolder.setModuleFolder(iBooker, (*struct_iter).first, 7, isUpgrade)) {
457  (*struct_iter).second->book(conf_, pTT, iBooker, 7, twoDimOn, reducedSet, isUpgrade);
458  } else {
459  LogDebug("PixelDQM") << "PROBLEM WITH BARREL-FOLDER\n";
460  }
461  }
462  }
463 }
464 
466  const edm::DetSetVector<PixelDigi> &diginp,
467  const TrackerTopology *const tTopo,
468  std::vector<MonitorElement *> const &meinput) {
469  edm::DetSetVector<PixelDigi>::const_iterator ipxsearch = diginp.find(detId);
470  if (ipxsearch != diginp.end()) {
471  // Look at digis now
473  for (pxdi = ipxsearch->begin(); pxdi != ipxsearch->end(); pxdi++) {
474  bool isHalfModule = PixelBarrelName(DetId(detId), tTopo, isUpgrade).isHalfModule();
475  int DBlayer = PixelBarrelName(DetId(detId), tTopo, isUpgrade).layerName();
476  int DBmodule = PixelBarrelName(DetId(detId), tTopo, isUpgrade).moduleName();
477  int DBladder = PixelBarrelName(DetId(detId), tTopo, isUpgrade).ladderName();
478  int DBshell = PixelBarrelName(DetId(detId), tTopo, isUpgrade).shell();
479 
480  // add sign to the modules
481  if (DBshell == 1 || DBshell == 2) {
482  DBmodule = -DBmodule;
483  }
484  if (DBshell == 1 || DBshell == 3) {
485  DBladder = -DBladder;
486  }
487 
488  int col = pxdi->column();
489  int row = pxdi->row();
490 
491  float modsign = (float)DBmodule / (abs((float)DBmodule));
492  float ladsign = (float)DBladder / (abs((float)DBladder));
493  float rocx = ((float)col / (52. * 8.)) * modsign + ((float)DBmodule - (modsign)*0.5);
494  float rocy = ((float)row / (80. * 2.)) * ladsign + ((float)DBladder - (ladsign)*0.5);
495 
496  // do the flip where need
497  bool flip = false;
498  if ((DBladder % 2 == 0) && (!isHalfModule)) {
499  flip = true;
500  }
501  if ((flip) && (DBladder > 0)) {
502  if ((((float)DBladder - (ladsign)*0.5) <= rocy) && (rocy < (float)DBladder)) {
503  rocy = rocy + ladsign * 0.5;
504  } else if ((((float)DBladder) <= rocy) && (rocy < ((float)DBladder + (ladsign)*0.5))) {
505  rocy = rocy - ladsign * 0.5;
506  }
507  }
508 
509  // tweak border effect for negative modules/ladders
510  if (modsign < 0) {
511  rocx = rocx - 0.0001;
512  }
513  if (ladsign < 0) {
514  rocy = rocy - 0.0001;
515  } else {
516  rocy = rocy + 0.0001;
517  }
518  if (abs(DBladder) == 1) {
519  rocy = rocy + ladsign * 0.5;
520  } // take care of the half module
521  meinput[DBlayer - 1]->Fill(rocx, rocy);
522  } // end of looping over pxdi
523  }
524 }
525 
527  const edmNew::DetSetVector<SiPixelCluster> &clustColl,
528  const TrackerTopology *const pTT,
530  MonitorElement *meinput) {
531  edmNew::DetSetVector<SiPixelCluster>::const_iterator ipxsearch = clustColl.find(detId);
532  if (ipxsearch != clustColl.end()) {
533  // Look at clusters now
535  for (pxclust = ipxsearch->begin(); pxclust != ipxsearch->end(); pxclust++) {
536  const GeomDetUnit *geoUnit = pDD->idToDetUnit(detId);
537  const PixelGeomDetUnit *pixDet = dynamic_cast<const PixelGeomDetUnit *>(geoUnit);
538  const PixelTopology *topol = &(pixDet->specificTopology());
539  LocalPoint clustlp = topol->localPosition(MeasurementPoint(pxclust->x(), pxclust->y()));
540  GlobalPoint clustgp = geoUnit->surface().toGlobal(clustlp);
541 
542  float xclust = pxclust->x();
543  float yclust = pxclust->y();
544  float z = clustgp.z();
545 
546  int pxfside = PixelEndcapName(detId, pTT, isUpgrade).halfCylinder();
547  int pxfpanel = PixelEndcapName(detId, pTT, isUpgrade).pannelName();
548  int pxfmodule = PixelEndcapName(detId, pTT, isUpgrade).plaquetteName();
549  int pxfdisk = PixelEndcapName(detId, pTT, isUpgrade).diskName();
550  int pxfblade = PixelEndcapName(detId, pTT, isUpgrade).bladeName();
551 
552  if ((pxfside == 1) || (pxfside == 3)) {
553  pxfblade = -1. * pxfblade;
554  }
555 
556  if (z < 0.) {
557  pxfdisk = -1. * pxfdisk;
558  }
559 
560  int clu_sdpx = ((pxfdisk > 0) ? 1 : -1) * (2 * (abs(pxfdisk) - 1) + pxfpanel);
561  int binselx = (pxfpanel == 1 && (pxfmodule == 1 || pxfmodule == 4))
562  ? (pxfmodule == 1)
563  : ((pxfpanel == 1 && xclust < 80.0) || (pxfpanel == 2 && xclust >= 80.0));
564  int nperpan = 2 * pxfmodule + pxfpanel - 1 + binselx;
565  int clu_roc_binx =
566  ((pxfdisk > 0) ? nperpan : 9 - nperpan) + (clu_sdpx + 4) * 8 - 2 * ((abs(pxfdisk) == 1) ? pxfdisk : 0);
567 
568  int clu_roc_biny = -99.;
569  int nrocly = pxfmodule + pxfpanel;
570  for (int i = 0; i < nrocly; i++) {
571  int j = (pxfdisk < 0) ? i : nrocly - 1 - i;
572  if (yclust >= (j * 52.0) && yclust < ((j + 1) * 52.0))
573  clu_roc_biny = 6 - nrocly + 2 * i + ((pxfblade > 0) ? pxfblade - 1 : pxfblade + 12) * 12 + 1;
574  }
575  if (pxfblade > 0) {
576  clu_roc_biny = clu_roc_biny + 144;
577  }
578 
579  meinput->setBinContent(clu_roc_binx, clu_roc_biny, meinput->getBinContent(clu_roc_binx, clu_roc_biny) + 1);
580  meinput->setBinContent(
581  clu_roc_binx, clu_roc_biny + 1, meinput->getBinContent(clu_roc_binx, clu_roc_biny + 1) + 1);
582  }
583  }
584 }
585 
586 // define this as a plug-in
SiPixelClusterSource::getrococcupancye
void getrococcupancye(DetId detId, const edmNew::DetSetVector< SiPixelCluster > &clustColl, const TrackerTopology *const pTT, edm::ESHandle< TrackerGeometry > pDD, MonitorElement *meinput)
Definition: SiPixelClusterSource.cc:526
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::DetSetVector< PixelDigi >
dqm::impl::MonitorElement
Definition: MonitorElement.h:99
hgcalPlots.ncols
ncols
Definition: hgcalPlots.py:104
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
electrons_cff.bool
bool
Definition: electrons_cff.py:366
mps_fire.i
i
Definition: mps_fire.py:428
PixelSubdetector.h
input
static const std::string input
Definition: EdmProvDump.cc:48
PixelBarrelName.h
MessageLogger.h
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
funct::false
false
Definition: Factorize.h:29
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
GeomDet
Definition: GeomDet.h:27
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
edm::Handle::product
T const * product() const
Definition: Handle.h:70
PixelTopology.h
SiPixelClusterSource::meClusBarrelProf
MonitorElement * meClusBarrelProf
Definition: SiPixelClusterSource.h:80
edm::DetSetVector::end
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
SiPixelFolderOrganizer::setModuleFolder
bool setModuleFolder(const uint32_t &rawdetid=0, int type=0, bool isUpgrade=false)
Set folder name for a module or plaquette.
Definition: SiPixelFolderOrganizer.cc:27
SiPixelClusterSource::isPIB
bool isPIB
Definition: SiPixelClusterSource.h:56
SiPixelOfflineDQM_source_cff.reducedSet
reducedSet
Definition: SiPixelOfflineDQM_source_cff.py:8
SiPixelClusterSource::smileyOn
bool smileyOn
Definition: SiPixelClusterSource.h:67
SiPixelClusterSource
Definition: SiPixelClusterSource.h:35
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
SiPixelClusterSource::meZeroRocBPIX
std::vector< MonitorElement * > meZeroRocBPIX
Definition: SiPixelClusterSource.h:84
cuy.col
col
Definition: cuy.py:1009
SiPixelClusterSource::twoDimOn
bool twoDimOn
Definition: SiPixelClusterSource.h:61
PixelBarrelName
Definition: PixelBarrelName.h:16
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
SiPixelClusterSource::buildStructure
virtual void buildStructure(edm::EventSetup const &)
Definition: SiPixelClusterSource.cc:314
edm::DetSetVector::begin
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
DQMStore.h
SiPixelClusterSource::srcToken_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > srcToken_
Definition: SiPixelClusterSource.h:101
edmNew::DetSetVector::begin
const_iterator begin(bool update=false) const
Definition: DetSetVectorNew.h:545
Topology::localPosition
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
TrackerGeometry::detTypes
const DetTypeContainer & detTypes() const override
Return a vector of all det types.
Definition: TrackerGeometry.h:60
PixelEndcapName::halfCylinder
HalfCylinder halfCylinder() const
Definition: PixelEndcapName.h:42
fed_dqm_sourceclient-live_cfg.saveFile
saveFile
Definition: fed_dqm_sourceclient-live_cfg.py:53
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
PixelBarrelName::layerName
int layerName() const
layer id
Definition: PixelBarrelName.h:43
PixelEndcapName::pannelName
int pannelName() const
pannel id
Definition: PixelEndcapName.h:51
edm::Handle
Definition: AssociativeIterator.h:50
SiPixelOfflineDQM_source_cff.phiOn
phiOn
Definition: SiPixelOfflineDQM_source_cff.py:48
PixelEndcapName::bladeName
int bladeName() const
blade id
Definition: PixelEndcapName.h:48
TrackerGeometry::idToDetUnit
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: TrackerGeometry.cc:183
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
SiPixelOfflineDQM_source_cff.ladOn
ladOn
Definition: SiPixelOfflineDQM_source_cff.py:37
SiPixelClusterSource::diskOn
bool diskOn
Definition: SiPixelClusterSource.h:66
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
SiPixelClusterSource::digisrcToken_
edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > digisrcToken_
Definition: SiPixelClusterSource.h:102
DetId
Definition: DetId.h:17
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
MakerMacros.h
edmNew::DetSetVector::find
const_iterator find(id_type i, bool update=false) const
Definition: DetSetVectorNew.h:533
PixelEndcapName
Definition: PixelEndcapName.h:16
pfNegativeDeepFlavourTagInfos_cfi.flip
flip
Definition: pfNegativeDeepFlavourTagInfos_cfi.py:8
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
L1TOccupancyClient_cfi.ymax
ymax
Definition: L1TOccupancyClient_cfi.py:43
SiPixelOfflineDQM_source_cff.bladeOn
bladeOn
Definition: SiPixelOfflineDQM_source_cff.py:38
Service.h
SiPixelClusterSource::phiOn
bool phiOn
Definition: SiPixelClusterSource.h:64
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
SiPixelClusterSource::conf_
edm::ParameterSet conf_
Definition: SiPixelClusterSource.h:52
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
SiPixelOfflineDQM_source_cff.ringOn
ringOn
Definition: SiPixelOfflineDQM_source_cff.py:51
DDAxes::z
SiPixelClusterSource::digisrc_
edm::InputTag digisrc_
Definition: SiPixelClusterSource.h:54
edm::ESHandle< TrackerGeometry >
dqm::implementation::IBooker::bookProfile
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
SiPixelClusterSource::trackerGeomTokenBeginRun_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomTokenBeginRun_
Definition: SiPixelClusterSource.h:107
SiPixelOfflineDQM_source_cff.modOn
modOn
online/offline RawDataErrors
Definition: SiPixelOfflineDQM_source_cff.py:36
SiPixelClusterSource::SiPixelClusterSource
SiPixelClusterSource(const edm::ParameterSet &conf)
Definition: SiPixelClusterSource.cc:45
Point3DBase< float, LocalTag >
SiPixelClusterSource::firstRun
bool firstRun
Definition: SiPixelClusterSource.h:68
PixelTopology
Definition: PixelTopology.h:10
PixelBarrelName::ladderName
int ladderName() const
ladder id (index in phi)
Definition: PixelBarrelName.h:49
dqm::impl::MonitorElement::getTH1
virtual TH1 * getTH1()
Definition: MonitorElement.cc:972
SiPixelClusterSource::trackerTopoTokenBeginRun_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoTokenBeginRun_
Definition: SiPixelClusterSource.h:106
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
SiPixelClusterSource::reducedSet
bool reducedSet
Definition: SiPixelClusterSource.h:62
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
SiPixelClusterSource::meClPosDiskmz
std::vector< MonitorElement * > meClPosDiskmz
Definition: SiPixelClusterSource.h:78
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
SiPixelClusterSource::noOfLayers
int noOfLayers
Definition: SiPixelClusterSource.h:87
SiPixelClusterSource::meClPosLayer
std::vector< MonitorElement * > meClPosLayer
Definition: SiPixelClusterSource.h:76
SiPixelClusterSource::meZeroRocFPIX
MonitorElement * meZeroRocFPIX
Definition: SiPixelClusterSource.h:85
MeasurementPoint
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Definition: MeasurementPoint.h:12
funct::true
true
Definition: Factorize.h:173
SiPixelOfflineDQM_source_cff.twoDimOn
twoDimOn
Definition: SiPixelOfflineDQM_source_cff.py:41
SiPixelClusterSource::isUpgrade
bool isUpgrade
Definition: SiPixelClusterSource.h:74
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
edm::ParameterSet
Definition: ParameterSet.h:47
SiPixelClusterSource::dqmBeginRun
void dqmBeginRun(const edm::Run &, edm::EventSetup const &) override
Definition: SiPixelClusterSource.cc:93
SiPixelClusterSource::meClusFpixMProf
MonitorElement * meClusFpixMProf
Definition: SiPixelClusterSource.h:82
SiPixelClusterSource::meClPosDiskpz
std::vector< MonitorElement * > meClPosDiskpz
Definition: SiPixelClusterSource.h:77
PixelBarrelName::shell
Shell shell() const
Definition: PixelBarrelName.h:40
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
SiPixelClusterSource::thePixelStructure
std::map< uint32_t, SiPixelClusterModule * > thePixelStructure
Definition: SiPixelClusterSource.h:59
SiPixelClusterSource::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: SiPixelClusterSource.cc:112
edm::DetSetVector::find
iterator find(det_id_type id)
Definition: DetSetVector.h:264
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
SiPixelClusterSource::modOn
bool modOn
Definition: SiPixelClusterSource.h:60
dqm::impl::MonitorElement::setBinLabel
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:762
sipixel_dqm_source_example_cfg.smileyOn
smileyOn
Definition: sipixel_dqm_source_example_cfg.py:57
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
SiPixelOfflineDQM_source_cff.isPIB
isPIB
Definition: SiPixelOfflineDQM_source_cff.py:6
SiPixelClusterSource::~SiPixelClusterSource
~SiPixelClusterSource() override
Definition: SiPixelClusterSource.cc:81
SiPixelClusterSource::slowDown
bool slowDown
Definition: SiPixelClusterSource.h:57
edm::EventSetup
Definition: EventSetup.h:58
TrackerGeometry::dets
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
Definition: TrackerGeometry.h:62
SiPixelClusterSource::layOn
bool layOn
Definition: SiPixelClusterSource.h:64
PixelBarrelName::moduleName
int moduleName() const
module id (index in z)
Definition: PixelBarrelName.h:46
SiPixelClusterSource::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: SiPixelClusterSource.cc:216
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelOfflineDQM_source_cff.layOn
layOn
Definition: SiPixelOfflineDQM_source_cff.py:47
SiPixelClusterSource::trackerGeomToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
Definition: SiPixelClusterSource.h:105
alignCSCRings.r
r
Definition: alignCSCRings.py:93
callgraph.module
module
Definition: callgraph.py:61
fed_dqm_sourceclient-live_cfg.slowDown
slowDown
Definition: fed_dqm_sourceclient-live_cfg.py:54
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:682
edmNew::DetSetVector
Definition: DetSetNew.h:13
SiPixelClusterSource::trackerTopoToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoToken_
Definition: SiPixelClusterSource.h:104
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
PixelEndcapName::HalfCylinder
HalfCylinder
Definition: PixelEndcapName.h:18
PixelEndcapName::diskName
int diskName() const
disk id
Definition: PixelEndcapName.h:45
L1TOccupancyClient_cfi.ymin
ymin
Definition: L1TOccupancyClient_cfi.py:43
DetId.h
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
edmNew::DetSetVector::end
const_iterator end(bool update=false) const
Definition: DetSetVectorNew.h:550
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
SiPixelClusterSource::eventNo
int eventNo
Definition: SiPixelClusterSource.h:58
Exception
Definition: hltDiff.cc:245
SiPixelFolderOrganizer
Definition: SiPixelFolderOrganizer.h:26
PixelGeomDetUnit.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiPixelClusterSource::lumSec
int lumSec
Definition: SiPixelClusterSource.h:69
PixelEndcapNameUpgrade.h
SiPixelClusterSource::bladeOn
bool bladeOn
Definition: SiPixelClusterSource.h:66
dqm::implementation::IBooker
Definition: DQMStore.h:43
SiPixelClusterSource::nLumiSecs
int nLumiSecs
Definition: SiPixelClusterSource.h:70
SiPixelOfflineDQM_source_cff.diskOn
diskOn
Definition: SiPixelOfflineDQM_source_cff.py:50
SiPixelClusterSource.h
SiPixelClusterSource::nBigEvents
int nBigEvents
Definition: SiPixelClusterSource.h:71
SiPixelClusterSource::bigFpixClusterEventRate
MonitorElement * bigFpixClusterEventRate
Definition: SiPixelClusterSource.h:72
SiPixelFolderOrganizer.h
PixelEndcapName::plaquetteName
int plaquetteName() const
plaquetteId (in pannel)
Definition: PixelEndcapName.h:54
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SiPixelClusterSource::ladOn
bool ladOn
Definition: SiPixelClusterSource.h:64
SiPixelClusterSource::noOfDisks
int noOfDisks
Definition: SiPixelClusterSource.h:88
SiPixelClusterSource::getrococcupancy
void getrococcupancy(DetId detId, const edm::DetSetVector< PixelDigi > &diginp, const TrackerTopology *const tTopo, std::vector< MonitorElement * > const &meinput)
Definition: SiPixelClusterSource.cc:465
SiPixelOfflineDQM_client_cff.isUpgrade
isUpgrade
Definition: SiPixelOfflineDQM_client_cff.py:19
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SiPixelOfflineDQM_source_cff.bigEventSize
bigEventSize
Definition: SiPixelOfflineDQM_source_cff.py:52
PixelBarrelNameUpgrade.h
edm::Event
Definition: Event.h:73
SiPixelClusterSource::bigEventSize
int bigEventSize
Definition: SiPixelClusterSource.h:73
PixelBarrelName::isHalfModule
bool isHalfModule() const
full or half module
Definition: PixelBarrelName.cc:702
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:791
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:583
SiPixelClusterModule
Definition: SiPixelClusterModule.h:31
edm::InputTag
Definition: InputTag.h:15
SiPixelClusterSource::topFolderName_
std::string topFolderName_
Definition: SiPixelClusterSource.h:49
SiPixelClusterSource::ringOn
bool ringOn
Definition: SiPixelClusterSource.h:66
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
SiPixelClusterSource::bookMEs
virtual void bookMEs(DQMStore::IBooker &, const edm::EventSetup &iSetup)
Definition: SiPixelClusterSource.cc:384
SiPixelClusterSource::meClusFpixPProf
MonitorElement * meClusFpixPProf
Definition: SiPixelClusterSource.h:81
PixelEndcapName.h
TrackerGeometry
Definition: TrackerGeometry.h:14
edmNew::DetSet::const_iterator
const data_type * const_iterator
Definition: DetSetNew.h:31
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31