CMS 3D CMS Logo

PixelBaryCentreAnalyzer.cc
Go to the documentation of this file.
1 
15 // Framework
23 
24 // Phase-1 Pixel
31 
32 // pixel quality
35 // global postion
38 // tracker alignment
41 // beamspot
44 
45 // Point and Vector
48 
49 // TFileService
52 
53 // ROOT
54 #include "TTree.h"
55 #include "TString.h"
56 
57 //
58 // class declaration
59 //
60 
61 class PixelBaryCentreAnalyzer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
62 public:
64  ~PixelBaryCentreAnalyzer() override = default;
65 
66  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
67 
68  struct SimplePoint {
69  float x, y, z;
70  SimplePoint(const GlobalPoint& p) : x(p.x()), y(p.y()), z(p.z()){};
71  SimplePoint() : x(0), y(0), z(0){};
72  };
73  static const unsigned int nPixelLayers = 4;
74  static const unsigned int nPixelDiscs = 3;
75 
76 private:
77  void beginJob() override;
78  void analyze(const edm::Event&, const edm::EventSetup&) override;
79  void endJob() override;
80 
81  void initBC();
82  void initBS();
83 
85  int phase_;
86 
87  // ----------member data ---------------------------
90 
91  // labels of TkAlign tags
92  std::vector<std::string> bcLabels_;
93  // labels of beamspot tags
94  std::vector<std::string> bsLabels_;
95 
99 
101  std::map<std::string, edm::ESGetToken<Alignments, TrackerAlignmentRcd>> tkAlignTokens_;
102  std::map<std::string, edm::ESGetToken<BeamSpotObjects, BeamSpotObjectsRcd>> bsTokens_;
103 
104  // tree content
105  int run_;
106  int ls_;
107 
109 
112 
117 
121 
123 
126 
131 
135 
137  std::map<std::string, TTree*> bcTrees_;
138  std::map<std::string, TTree*> bsTrees_;
139 };
140 
141 //
142 // constructors and destructor
143 //
145  : usePixelQuality_(iConfig.getUntrackedParameter<bool>("usePixelQuality")),
146  bcLabels_(iConfig.getUntrackedParameter<std::vector<std::string>>("tkAlignLabels")),
147  bsLabels_(iConfig.getUntrackedParameter<std::vector<std::string>>("beamSpotLabels")),
148  trackerGeometryToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()),
149  trackerTopologyToken_(esConsumes<TrackerTopology, TrackerTopologyRcd>()),
150  siPixelQualityToken_(esConsumes<SiPixelQuality, SiPixelQualityFromDbRcd>()),
151  gprToken_(esConsumes<Alignments, GlobalPositionRcd>()) {
152  for (const auto& label : bcLabels_) {
153  bcTrees_[label] = nullptr;
154  tkAlignTokens_[label] = esConsumes<Alignments, TrackerAlignmentRcd>(edm::ESInputTag{"", label});
155  }
156 
157  for (const auto& label : bsLabels_) {
158  bsTrees_[label] = nullptr;
159  bsTokens_[label] = esConsumes<BeamSpotObjects, BeamSpotObjectsRcd>(edm::ESInputTag{"", label});
160  }
161 
162  usesResource("TFileService");
163 }
164 
165 //
166 // member functions
167 //
168 
170  double dummy_float = 999999.0;
171 
172  BS_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
173  vBS_ = SimplePoint(BS_);
174 }
175 
177  // init to large number (unreasonable number) not zero
178  double dummy_float = 999999.0;
179 
180  PIX_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
181  BPIX_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
182  FPIX_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
183 
184  BPIX_Flipped_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
185  BPIX_NonFlipped_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
186  BPIX_DiffFlippedNonFlipped_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
187 
188  FPIX_plus_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
189  FPIX_minus_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
190 
191  for (unsigned int i = 0; i < nPixelLayers; i++) {
192  BPIXLayer_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
193  BPIXLayer_Flipped_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
194  BPIXLayer_NonFlipped_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
195  BPIXLayer_DiffFlippedNonFlipped_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
196  }
197 
198  for (unsigned int i = 0; i < nPixelDiscs; i++) {
199  FPIXDisks_plus_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
200  FPIXDisks_minus_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
201  }
202 
206 
210 
213 
214  for (unsigned int i = 0; i < nPixelLayers; i++) {
219  }
220 
221  for (unsigned int i = 0; i < nPixelDiscs; i++) {
224  }
225 }
226 
227 // ------------ method called for each event ------------
229  bool prepareTkAlign = false;
230  bool prepareBS = false;
231 
232  // ES watcher can noly run once in the same event,
233  // otherwise it will turn false whatsoever because the condition doesn't change in the second time call.
234  if (watcherTkAlign_.check(iSetup))
235  prepareTkAlign = true;
236  if (watcherBS_.check(iSetup))
237  prepareBS = true;
238 
239  if (!prepareTkAlign && !prepareBS)
240  return;
241 
242  run_ = iEvent.id().run();
243  ls_ = iEvent.id().luminosityBlock();
244 
245  if (prepareTkAlign) { // check for new IOV for TKAlign
246 
247  phase_ = -1;
248 
249  const TrackerGeometry* tkGeo = &iSetup.getData(trackerGeometryToken_);
250  const TrackerTopology* tkTopo = &iSetup.getData(trackerTopologyToken_);
251 
253  phase_ = 0;
255  phase_ = 1;
256 
257  // pixel quality
258  const SiPixelQuality* badPixelInfo = &iSetup.getData(siPixelQualityToken_);
259 
260  // Tracker global position
261  const Alignments* globalAlignments = &iSetup.getData(gprToken_);
262  std::unique_ptr<const Alignments> globalPositions = std::make_unique<Alignments>(*globalAlignments);
263  const AlignTransform& globalCoordinates = align::DetectorGlobalPosition(*globalPositions, DetId(DetId::Tracker));
264  GlobalVector globalTkPosition(
265  globalCoordinates.translation().x(), globalCoordinates.translation().y(), globalCoordinates.translation().z());
266 
267  // loop over bclabels
268  for (const auto& label : bcLabels_) {
269  // init tree content
271 
272  // Get TkAlign from EventSetup:
273  const Alignments* alignments = &iSetup.getData(tkAlignTokens_[label]);
274  std::vector<AlignTransform> tkAlignments = alignments->m_align;
275 
276  // PIX
277  GlobalVector barycentre_PIX(0.0, 0.0, 0.0);
278  // BPIX
279  GlobalVector barycentre_BPIX(0.0, 0.0, 0.0);
280  float nmodules_BPIX(0.);
281  // FPIX
282  GlobalVector barycentre_FPIX(0.0, 0.0, 0.0);
283  float nmodules_FPIX(0.);
284 
285  // Per-layer/ladder barycentre for BPIX
286  std::map<int, std::map<int, float>> nmodules_bpix; // layer-ladder
287  std::map<int, std::map<int, GlobalVector>> barycentre_bpix; // layer-ladder
288 
289  // Per-disk/ring barycentre for FPIX
290  std::map<int, std::map<int, float>> nmodules_fpix; // disk-ring
291  std::map<int, std::map<int, GlobalVector>> barycentre_fpix; // disk-ring
292 
293  // Loop over tracker module
294  for (const auto& ali : tkAlignments) {
295  //DetId
296  const DetId& detId = DetId(ali.rawId());
297  // remove bad module
298  if (usePixelQuality_ && badPixelInfo->IsModuleBad(detId))
299  continue;
300 
301  // alignment for a given module
302  GlobalVector ali_translation(ali.translation().x(), ali.translation().y(), ali.translation().z());
303 
304  int subid = DetId(detId).subdetId();
305  // BPIX
306  if (subid == PixelSubdetector::PixelBarrel) {
307  nmodules_BPIX += 1;
308  barycentre_BPIX += ali_translation;
309  barycentre_PIX += ali_translation;
310 
311  int layer = tkTopo->pxbLayer(detId);
312  int ladder = tkTopo->pxbLadder(detId);
313  nmodules_bpix[layer][ladder] += 1;
314  barycentre_bpix[layer][ladder] += ali_translation;
315 
316  } // BPIX
317 
318  // FPIX
319  if (subid == PixelSubdetector::PixelEndcap) {
320  nmodules_FPIX += 1;
321  barycentre_FPIX += ali_translation;
322  barycentre_PIX += ali_translation;
323 
324  int disk = tkTopo->pxfDisk(detId);
326  if (quadrant < 3)
327  disk *= -1;
328 
329  int ring = -9999;
330  if (phase_ == 0) {
331  ring = 1 + (tkTopo->pxfPanel(detId) + tkTopo->pxfModule(detId.rawId()) > 3);
332  } else if (phase_ == 1) {
333  ring = PixelEndcapName(detId, tkTopo, phase_).ringName();
334  }
335 
336  nmodules_fpix[disk][ring] += 1;
337  barycentre_fpix[disk][ring] += ali_translation;
338 
339  } // FPIX
340 
341  } // loop over tracker module
342 
343  //PIX
344  float nmodules_PIX = nmodules_BPIX + nmodules_FPIX;
345  barycentre_PIX *= (1.0 / nmodules_PIX);
346  barycentre_PIX += globalTkPosition;
347  PIX_ = GlobalPoint(barycentre_PIX.x(), barycentre_PIX.y(), barycentre_PIX.z());
349 
350  //BPIX
351  barycentre_BPIX *= (1.0 / nmodules_BPIX);
352  barycentre_BPIX += globalTkPosition;
353  BPIX_ = GlobalPoint(barycentre_BPIX.x(), barycentre_BPIX.y(), barycentre_BPIX.z());
355  //FPIX
356  barycentre_FPIX *= (1.0 / nmodules_FPIX);
357  barycentre_FPIX += globalTkPosition;
358  FPIX_ = GlobalPoint(barycentre_FPIX.x(), barycentre_FPIX.y(), barycentre_FPIX.z());
360  // Pixel substructures
361 
362  // BPix barycentre per-layer/per-ladder
363  // assuming each ladder has the same number of modules in the same layer
364  // inner = flipped; outer = non-flipped
365  //
366  // Phase 0: Outer ladders are odd for layer 1,3 and even for layer 2
367  // Phase 1: Outer ladders are odd for layer 4 and even for layer 1,2,3
368  //
369 
370  int nmodules_BPIX_Flipped = 0;
371  int nmodules_BPIX_NonFlipped = 0;
372  GlobalVector BPIX_Flipped(0.0, 0.0, 0.0);
373  GlobalVector BPIX_NonFlipped(0.0, 0.0, 0.0);
374 
375  // loop over layers
376  for (std::map<int, std::map<int, GlobalVector>>::iterator il = barycentre_bpix.begin();
377  il != barycentre_bpix.end();
378  ++il) {
379  int layer = il->first;
380 
381  int nmodulesLayer = 0;
382  int nmodulesLayer_Flipped = 0;
383  int nmodulesLayer_NonFlipped = 0;
384  GlobalVector BPIXLayer(0.0, 0.0, 0.0);
385  GlobalVector BPIXLayer_Flipped(0.0, 0.0, 0.0);
386  GlobalVector BPIXLayer_NonFlipped(0.0, 0.0, 0.0);
387 
388  // loop over ladder
389  std::map<int, GlobalVector> barycentreLayer = barycentre_bpix[layer];
390  for (std::map<int, GlobalVector>::iterator it = barycentreLayer.begin(); it != barycentreLayer.end(); ++it) {
391  int ladder = it->first;
392  //BPIXLayerLadder_[layer][ladder] = (1.0/nmodules[layer][ladder])*barycentreLayer[ladder] + globalTkPosition;
393 
394  nmodulesLayer += nmodules_bpix[layer][ladder];
395  BPIXLayer += barycentreLayer[ladder];
396 
397  // Phase-1
398  //
399  // Phase 1: Outer ladders are odd for layer 4 and even for layer 1,2,3
400  if (phase_ == 1) {
401  if (layer != 4) { // layer 1-3
402 
403  if (ladder % 2 != 0) { // odd ladder = outer ladder = unflipped
404  nmodulesLayer_NonFlipped += nmodules_bpix[layer][ladder];
405  BPIXLayer_NonFlipped += barycentreLayer[ladder];
406  } else { // even ladder = inner ladder = flipped
407  nmodulesLayer_Flipped += nmodules_bpix[layer][ladder];
408  BPIXLayer_Flipped += barycentreLayer[ladder];
409  }
410  } else { // layer-4
411 
412  if (ladder % 2 != 0) { // odd ladder = inner = flipped
413  nmodulesLayer_Flipped += nmodules_bpix[layer][ladder];
414  BPIXLayer_Flipped += barycentreLayer[ladder];
415  } else { //even ladder = outer ladder = unflipped
416  nmodulesLayer_NonFlipped += nmodules_bpix[layer][ladder];
417  BPIXLayer_NonFlipped += barycentreLayer[ladder];
418  }
419  }
420 
421  } // phase-1
422 
423  // Phase-0
424  //
425  // Phase 0: Outer ladders are odd for layer 1,3 and even for layer 2
426  if (phase_ == 0) {
427  if (layer == 2) { // layer-2
428 
429  if (ladder % 2 != 0) { // odd ladder = inner = flipped
430  nmodulesLayer_Flipped += nmodules_bpix[layer][ladder];
431  BPIXLayer_Flipped += barycentreLayer[ladder];
432  } else {
433  nmodulesLayer_NonFlipped += nmodules_bpix[layer][ladder];
434  BPIXLayer_NonFlipped += barycentreLayer[ladder];
435  }
436  } else { // layer-1,3
437 
438  if (ladder % 2 == 0) { // even ladder = inner = flipped
439  nmodulesLayer_Flipped += nmodules_bpix[layer][ladder];
440  BPIXLayer_Flipped += barycentreLayer[ladder];
441  } else { // odd ladder = outer = non-flipped
442  nmodulesLayer_NonFlipped += nmodules_bpix[layer][ladder];
443  BPIXLayer_NonFlipped += barycentreLayer[ladder];
444  }
445  }
446 
447  } // phase-0
448 
449  } //loop over ladders
450 
451  // total BPIX flipped/non-flipped
452  BPIX_Flipped += BPIXLayer_Flipped;
453  BPIX_NonFlipped += BPIXLayer_NonFlipped;
454  nmodules_BPIX_Flipped += nmodulesLayer_Flipped;
455  nmodules_BPIX_NonFlipped += nmodulesLayer_NonFlipped;
456 
457  //BPIX per-layer
458  BPIXLayer *= (1.0 / nmodulesLayer);
459  BPIXLayer += globalTkPosition;
460  BPIXLayer_Flipped *= (1.0 / nmodulesLayer_Flipped);
461  BPIXLayer_Flipped += globalTkPosition;
462  BPIXLayer_NonFlipped *= (1.0 / nmodulesLayer_NonFlipped);
463  BPIXLayer_NonFlipped += globalTkPosition;
464 
465  BPIXLayer_[layer - 1] = GlobalPoint(BPIXLayer.x(), BPIXLayer.y(), BPIXLayer.z());
468  GlobalPoint(BPIXLayer_Flipped.x(), BPIXLayer_Flipped.y(), BPIXLayer_Flipped.z());
471  GlobalPoint(BPIXLayer_NonFlipped.x(), BPIXLayer_NonFlipped.y(), BPIXLayer_NonFlipped.z());
473  BPIXLayer_DiffFlippedNonFlipped_[layer - 1] = GlobalPoint(BPIXLayer_Flipped.x() - BPIXLayer_NonFlipped.x(),
474  BPIXLayer_Flipped.y() - BPIXLayer_NonFlipped.y(),
475  BPIXLayer_Flipped.z() - BPIXLayer_NonFlipped.z());
477 
478  } // loop over layers
479 
480  BPIX_Flipped *= (1.0 / nmodules_BPIX_Flipped);
481  BPIX_Flipped += globalTkPosition;
482  BPIX_Flipped_ = GlobalPoint(BPIX_Flipped.x(), BPIX_Flipped.y(), BPIX_Flipped.z());
484  BPIX_NonFlipped *= (1.0 / nmodules_BPIX_NonFlipped);
485  BPIX_NonFlipped += globalTkPosition;
486  BPIX_NonFlipped_ = GlobalPoint(BPIX_NonFlipped.x(), BPIX_NonFlipped.y(), BPIX_NonFlipped.z());
488  BPIX_DiffFlippedNonFlipped_ = GlobalPoint(BPIX_Flipped.x() - BPIX_NonFlipped.x(),
489  BPIX_Flipped.y() - BPIX_NonFlipped.y(),
490  BPIX_Flipped.z() - BPIX_NonFlipped.z());
492 
493  // FPIX substructures per-(signed)disk/per-ring
494  int nmodules_FPIX_plus = 0;
495  int nmodules_FPIX_minus = 0;
496  GlobalVector FPIX_plus(0.0, 0.0, 0.0);
497  GlobalVector FPIX_minus(0.0, 0.0, 0.0);
498  // loop over disks
499  for (std::map<int, std::map<int, GlobalVector>>::iterator id = barycentre_fpix.begin();
500  id != barycentre_fpix.end();
501  ++id) {
502  int disk = id->first;
503 
504  int nmodulesDisk = 0;
505  GlobalVector FPIXDisk(0.0, 0.0, 0.0);
506 
507  std::map<int, GlobalVector> baryCentreDisk = id->second;
508  for (std::map<int, GlobalVector>::iterator ir = baryCentreDisk.begin(); ir != baryCentreDisk.end();
509  ++ir) { // loop over rings
510  int ring = ir->first;
511  nmodulesDisk += nmodules_fpix[disk][ring];
512  FPIXDisk += ir->second;
513  if (disk > 0) {
514  nmodules_FPIX_plus += nmodules_fpix[disk][ring];
515  FPIX_plus += ir->second;
516  }
517  if (disk < 0) {
518  nmodules_FPIX_minus += nmodules_fpix[disk][ring];
519  FPIX_minus += ir->second;
520  }
521 
522  } // loop over rings
523 
524  FPIXDisk *= (1.0 / nmodulesDisk);
525  FPIXDisk += globalTkPosition;
526 
527  if (disk > 0) {
528  FPIXDisks_plus_[disk - 1] = GlobalPoint(FPIXDisk.x(), FPIXDisk.y(), FPIXDisk.z());
529  vFPIXDisks_plus_[disk - 1] = SimplePoint(FPIXDisks_plus_[disk - 1]);
530  }
531  if (disk < 0) {
532  FPIXDisks_minus_[-disk - 1] = GlobalPoint(FPIXDisk.x(), FPIXDisk.y(), FPIXDisk.z());
533  vFPIXDisks_minus_[-disk - 1] = SimplePoint(FPIXDisks_minus_[-disk - 1]);
534  }
535  } // loop over disks
536 
537  FPIX_plus *= (1.0 / nmodules_FPIX_plus);
538  FPIX_plus += globalTkPosition;
539  FPIX_plus_ = GlobalPoint(FPIX_plus.x(), FPIX_plus.y(), FPIX_plus.z());
541  FPIX_minus *= (1.0 / nmodules_FPIX_minus);
542  FPIX_minus += globalTkPosition;
543  FPIX_minus_ = GlobalPoint(FPIX_minus.x(), FPIX_minus.y(), FPIX_minus.z());
545 
546  bcTrees_[label]->Fill();
547 
548  } // bcLabels_
549 
550  } // check for new IOV for TKAlign
551 
552  // beamspot
553  if (prepareBS) {
554  // loop over bsLabels_
555  for (const auto& label : bsLabels_) {
556  // init bstree content
558 
559  // Get BeamSpot from EventSetup
560  const BeamSpotObjects* mybeamspot = &iSetup.getData(bsTokens_[label]);
561 
562  BS_ = GlobalPoint(mybeamspot->x(), mybeamspot->y(), mybeamspot->z());
563  vBS_ = SimplePoint(BS_);
564 
565  bsTrees_[label]->Fill();
566  } // bsLabels_
567 
568  } // check for new IOV for BS
569 }
570 
571 // ------------ method called once each job just before starting event loop ------------
573  // init bc bs trees
574  for (const auto& label : bsLabels_) {
575  std::string treeName = "BeamSpot";
576  if (!label.empty())
577  treeName = "BeamSpot_";
578  treeName += label;
579 
580  bsTrees_[label] = tFileService->make<TTree>(TString(treeName), "PixelBarycentre analyzer ntuple");
581 
582  bsTrees_[label]->Branch("run", &run_, "run/I");
583  bsTrees_[label]->Branch("ls", &ls_, "ls/I");
584 
585  bsTrees_[label]->Branch("BS", &vBS_, "x/F:y/F:z/F");
586 
587  } // bsLabels_
588 
589  for (const auto& label : bcLabels_) {
590  std::string treeName = "PixelBarycentre";
591  if (!label.empty())
592  treeName = "PixelBarycentre_";
593  treeName += label;
594  bcTrees_[label] = tFileService->make<TTree>(TString(treeName), "PixelBarycentre analyzer ntuple");
595 
596  bcTrees_[label]->Branch("run", &run_, "run/I");
597  bcTrees_[label]->Branch("ls", &ls_, "ls/I");
598 
599  bcTrees_[label]->Branch("PIX", &vPIX_, "x/F:y/F:z/F");
600 
601  bcTrees_[label]->Branch("BPIX", &vBPIX_, "x/F:y/F:z/F");
602  bcTrees_[label]->Branch("BPIX_Flipped", &vBPIX_Flipped_, "x/F:y/F:z/F");
603  bcTrees_[label]->Branch("BPIX_NonFlipped", &vBPIX_NonFlipped_, "x/F:y/F:z/F");
604  bcTrees_[label]->Branch("BPIX_DiffFlippedNonFlipped", &vBPIX_DiffFlippedNonFlipped_, "x/F:y/F:z/F");
605 
606  bcTrees_[label]->Branch("FPIX", &vFPIX_, "x/F:y/F:z/F");
607  bcTrees_[label]->Branch("FPIX_plus", &vFPIX_plus_, "x/F:y/F:z/F");
608  bcTrees_[label]->Branch("FPIX_minus", &vFPIX_minus_, "x/F:y/F:z/F");
609 
610  //per-layer
611  for (unsigned int i = 0; i < nPixelLayers; i++) {
612  TString structure = "BPIXLYR";
613  int layer = i + 1;
614  structure += layer;
615 
616  bcTrees_[label]->Branch(structure, &vBPIXLayer_[i], "x/F:y/F:z/F");
617  bcTrees_[label]->Branch(structure + "_Flipped", &vBPIXLayer_Flipped_[i], "x/F:y/F:z/F");
618  bcTrees_[label]->Branch(structure + "_NonFlipped", &vBPIXLayer_NonFlipped_[i], "x/F:y/F:z/F");
619  bcTrees_[label]->Branch(
620  structure + "_DiffFlippedNonFlipped", &vBPIXLayer_DiffFlippedNonFlipped_[i], "x/F:y/F:z/F");
621  }
622 
623  //per-disk/ring
624  for (unsigned int i = 0; i < nPixelDiscs; i++) {
625  TString structure = "FPIXDisk_plus";
626  int disk = i + 1;
627  structure += disk;
628  bcTrees_[label]->Branch(structure, &vFPIXDisks_plus_[i], "x/F:y/F:z/F");
629 
630  structure = "FPIXDisk_minus";
631  structure += disk;
632  bcTrees_[label]->Branch(structure, &vFPIXDisks_minus_[i], "x/F:y/F:z/F");
633  }
634 
635  } // bcLabels_
636 }
637 
638 // ------------ method called once each job just after ending the event loop ------------
640  bcLabels_.clear();
641  bsLabels_.clear();
642 
643  bcTrees_.clear();
644  bsTrees_.clear();
645 }
646 
647 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
650  desc.setComment("Validates alignment payloads by providing the position of the pixel barycenter positions");
651  desc.addUntracked<bool>("usePixelQuality", false);
652  desc.addUntracked<std::vector<std::string>>("tkAlignLabels", {});
653  desc.addUntracked<std::vector<std::string>>("beamSpotLabels", {});
654  descriptions.addWithDefaultLabel(desc);
655 }
656 
657 //define this as a plug-in
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
GlobalPoint BPIXLayer_Flipped_[nPixelLayers]
SimplePoint vFPIXDisks_minus_[nPixelDiscs]
unsigned int pxbLayer(const DetId &id) const
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
double z() const
get Z beam position
static const unsigned int nPixelDiscs
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
int ringName() const
ring Id
edm::ESWatcher< BeamSpotObjectsRcd > watcherBS_
SimplePoint vBPIXLayer_NonFlipped_[nPixelLayers]
PixelBaryCentreAnalyzer(const edm::ParameterSet &)
SimplePoint vBPIXLayer_DiffFlippedNonFlipped_[nPixelLayers]
T z() const
Definition: PV3DBase.h:61
GlobalPoint BPIXLayer_DiffFlippedNonFlipped_[nPixelLayers]
unsigned int pxfModule(const DetId &id) const
GlobalPoint FPIXDisks_plus_[nPixelDiscs]
int quadrant(const DetId &detid, const TrackerTopology *tTopo_, bool phase_)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const Translation & translation() const
bool IsModuleBad(const uint32_t &detid) const
unsigned int pxbLadder(const DetId &id) const
SimplePoint vBPIXLayer_Flipped_[nPixelLayers]
edm::Service< TFileService > tFileService
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
char const * label
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
GlobalPoint BPIXLayer_[nPixelLayers]
int iEvent
Definition: GenABIO.cc:224
GlobalPoint FPIXDisks_minus_[nPixelDiscs]
edm::ESWatcher< TrackerAlignmentRcd > watcherTkAlign_
bool isThere(GeomDetEnumerators::SubDetector subdet) const
HalfCylinder halfCylinder() const
unsigned int pxfDisk(const DetId &id) const
double x() const
get X beam position
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
SimplePoint vFPIXDisks_plus_[nPixelDiscs]
edm::ESGetToken< SiPixelQuality, SiPixelQualityFromDbRcd > siPixelQualityToken_
~PixelBaryCentreAnalyzer() override=default
std::vector< std::string > bsLabels_
unsigned int pxfPanel(const DetId &id) const
double y() const
get Y beam position
Definition: DetId.h:17
std::vector< std::string > bcLabels_
SimplePoint vBPIXLayer_[nPixelLayers]
std::map< std::string, TTree * > bsTrees_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static const unsigned int nPixelLayers
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::ESGetToken< Alignments, GlobalPositionRcd > gprToken_
std::map< std::string, edm::ESGetToken< Alignments, TrackerAlignmentRcd > > tkAlignTokens_
std::map< std::string, TTree * > bcTrees_
GlobalPoint BPIXLayer_NonFlipped_[nPixelLayers]
std::map< std::string, edm::ESGetToken< BeamSpotObjects, BeamSpotObjectsRcd > > bsTokens_