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;
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 
166  // do anything here that needs to be done at desctruction time
167  // (e.g. close files, deallocate resources etc.)
168 }
169 
170 //
171 // member functions
172 //
173 
175  double dummy_float = 999999.0;
176 
177  BS_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
178  vBS_ = SimplePoint(BS_);
179 }
180 
182  // init to large number (unreasonable number) not zero
183  double dummy_float = 999999.0;
184 
185  PIX_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
186  BPIX_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
187  FPIX_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
188 
189  BPIX_Flipped_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
190  BPIX_NonFlipped_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
191  BPIX_DiffFlippedNonFlipped_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
192 
193  FPIX_plus_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
194  FPIX_minus_ = GlobalPoint(dummy_float, dummy_float, dummy_float);
195 
196  for (unsigned int i = 0; i < nPixelLayers; i++) {
197  BPIXLayer_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
198  BPIXLayer_Flipped_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
199  BPIXLayer_NonFlipped_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
200  BPIXLayer_DiffFlippedNonFlipped_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
201  }
202 
203  for (unsigned int i = 0; i < nPixelDiscs; i++) {
204  FPIXDisks_plus_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
205  FPIXDisks_minus_[i] = GlobalPoint(dummy_float, dummy_float, dummy_float);
206  }
207 
211 
215 
218 
219  for (unsigned int i = 0; i < nPixelLayers; i++) {
224  }
225 
226  for (unsigned int i = 0; i < nPixelDiscs; i++) {
229  }
230 }
231 
232 // ------------ method called for each event ------------
234  bool prepareTkAlign = false;
235  bool prepareBS = false;
236 
237  // ES watcher can noly run once in the same event,
238  // otherwise it will turn false whatsoever because the condition doesn't change in the second time call.
239  if (watcherTkAlign_.check(iSetup))
240  prepareTkAlign = true;
241  if (watcherBS_.check(iSetup))
242  prepareBS = true;
243 
244  if (!prepareTkAlign && !prepareBS)
245  return;
246 
247  run_ = iEvent.id().run();
248  ls_ = iEvent.id().luminosityBlock();
249 
250  if (prepareTkAlign) { // check for new IOV for TKAlign
251 
252  phase_ = -1;
253 
254  const TrackerGeometry* tkGeo = &iSetup.getData(trackerGeometryToken_);
255  const TrackerTopology* tkTopo = &iSetup.getData(trackerTopologyToken_);
256 
258  phase_ = 0;
260  phase_ = 1;
261 
262  // pixel quality
263  const SiPixelQuality* badPixelInfo = &iSetup.getData(siPixelQualityToken_);
264 
265  // Tracker global position
266  const Alignments* globalAlignments = &iSetup.getData(gprToken_);
267  std::unique_ptr<const Alignments> globalPositions = std::make_unique<Alignments>(*globalAlignments);
268  const AlignTransform& globalCoordinates = align::DetectorGlobalPosition(*globalPositions, DetId(DetId::Tracker));
269  GlobalVector globalTkPosition(
270  globalCoordinates.translation().x(), globalCoordinates.translation().y(), globalCoordinates.translation().z());
271 
272  // loop over bclabels
273  for (const auto& label : bcLabels_) {
274  // init tree content
276 
277  // Get TkAlign from EventSetup:
278  const Alignments* alignments = &iSetup.getData(tkAlignTokens_[label]);
279  std::vector<AlignTransform> tkAlignments = alignments->m_align;
280 
281  // PIX
282  GlobalVector barycentre_PIX(0.0, 0.0, 0.0);
283  // BPIX
284  GlobalVector barycentre_BPIX(0.0, 0.0, 0.0);
285  float nmodules_BPIX(0.);
286  // FPIX
287  GlobalVector barycentre_FPIX(0.0, 0.0, 0.0);
288  float nmodules_FPIX(0.);
289 
290  // Per-layer/ladder barycentre for BPIX
291  std::map<int, std::map<int, float>> nmodules_bpix; // layer-ladder
292  std::map<int, std::map<int, GlobalVector>> barycentre_bpix; // layer-ladder
293 
294  // Per-disk/ring barycentre for FPIX
295  std::map<int, std::map<int, float>> nmodules_fpix; // disk-ring
296  std::map<int, std::map<int, GlobalVector>> barycentre_fpix; // disk-ring
297 
298  // Loop over tracker module
299  for (const auto& ali : tkAlignments) {
300  //DetId
301  const DetId& detId = DetId(ali.rawId());
302  // remove bad module
303  if (usePixelQuality_ && badPixelInfo->IsModuleBad(detId))
304  continue;
305 
306  // alignment for a given module
307  GlobalVector ali_translation(ali.translation().x(), ali.translation().y(), ali.translation().z());
308 
309  int subid = DetId(detId).subdetId();
310  // BPIX
311  if (subid == PixelSubdetector::PixelBarrel) {
312  nmodules_BPIX += 1;
313  barycentre_BPIX += ali_translation;
314  barycentre_PIX += ali_translation;
315 
316  int layer = tkTopo->pxbLayer(detId);
317  int ladder = tkTopo->pxbLadder(detId);
318  nmodules_bpix[layer][ladder] += 1;
319  barycentre_bpix[layer][ladder] += ali_translation;
320 
321  } // BPIX
322 
323  // FPIX
324  if (subid == PixelSubdetector::PixelEndcap) {
325  nmodules_FPIX += 1;
326  barycentre_FPIX += ali_translation;
327  barycentre_PIX += ali_translation;
328 
329  int disk = tkTopo->pxfDisk(detId);
330  int quadrant = PixelEndcapName(detId, tkTopo, phase_).halfCylinder();
331  if (quadrant < 3)
332  disk *= -1;
333 
334  int ring = -9999;
335  if (phase_ == 0) {
336  ring = 1 + (tkTopo->pxfPanel(detId) + tkTopo->pxfModule(detId.rawId()) > 3);
337  } else if (phase_ == 1) {
338  ring = PixelEndcapName(detId, tkTopo, phase_).ringName();
339  }
340 
341  nmodules_fpix[disk][ring] += 1;
342  barycentre_fpix[disk][ring] += ali_translation;
343 
344  } // FPIX
345 
346  } // loop over tracker module
347 
348  //PIX
349  float nmodules_PIX = nmodules_BPIX + nmodules_FPIX;
350  barycentre_PIX *= (1.0 / nmodules_PIX);
351  barycentre_PIX += globalTkPosition;
352  PIX_ = GlobalPoint(barycentre_PIX.x(), barycentre_PIX.y(), barycentre_PIX.z());
354 
355  //BPIX
356  barycentre_BPIX *= (1.0 / nmodules_BPIX);
357  barycentre_BPIX += globalTkPosition;
358  BPIX_ = GlobalPoint(barycentre_BPIX.x(), barycentre_BPIX.y(), barycentre_BPIX.z());
360  //FPIX
361  barycentre_FPIX *= (1.0 / nmodules_FPIX);
362  barycentre_FPIX += globalTkPosition;
363  FPIX_ = GlobalPoint(barycentre_FPIX.x(), barycentre_FPIX.y(), barycentre_FPIX.z());
365  // Pixel substructures
366 
367  // BPix barycentre per-layer/per-ladder
368  // assuming each ladder has the same number of modules in the same layer
369  // inner = flipped; outer = non-flipped
370  //
371  // Phase 0: Outer ladders are odd for layer 1,3 and even for layer 2
372  // Phase 1: Outer ladders are odd for layer 4 and even for layer 1,2,3
373  //
374 
375  int nmodules_BPIX_Flipped = 0;
376  int nmodules_BPIX_NonFlipped = 0;
377  GlobalVector BPIX_Flipped(0.0, 0.0, 0.0);
378  GlobalVector BPIX_NonFlipped(0.0, 0.0, 0.0);
379 
380  // loop over layers
381  for (std::map<int, std::map<int, GlobalVector>>::iterator il = barycentre_bpix.begin();
382  il != barycentre_bpix.end();
383  ++il) {
384  int layer = il->first;
385 
386  int nmodulesLayer = 0;
387  int nmodulesLayer_Flipped = 0;
388  int nmodulesLayer_NonFlipped = 0;
389  GlobalVector BPIXLayer(0.0, 0.0, 0.0);
390  GlobalVector BPIXLayer_Flipped(0.0, 0.0, 0.0);
391  GlobalVector BPIXLayer_NonFlipped(0.0, 0.0, 0.0);
392 
393  // loop over ladder
394  std::map<int, GlobalVector> barycentreLayer = barycentre_bpix[layer];
395  for (std::map<int, GlobalVector>::iterator it = barycentreLayer.begin(); it != barycentreLayer.end(); ++it) {
396  int ladder = it->first;
397  //BPIXLayerLadder_[layer][ladder] = (1.0/nmodules[layer][ladder])*barycentreLayer[ladder] + globalTkPosition;
398 
399  nmodulesLayer += nmodules_bpix[layer][ladder];
400  BPIXLayer += barycentreLayer[ladder];
401 
402  // Phase-1
403  //
404  // Phase 1: Outer ladders are odd for layer 4 and even for layer 1,2,3
405  if (phase_ == 1) {
406  if (layer != 4) { // layer 1-3
407 
408  if (ladder % 2 != 0) { // odd ladder = inner = flipped
409  nmodulesLayer_Flipped += nmodules_bpix[layer][ladder];
410  BPIXLayer_Flipped += barycentreLayer[ladder];
411  } else {
412  nmodulesLayer_NonFlipped += nmodules_bpix[layer][ladder];
413  BPIXLayer_NonFlipped += barycentreLayer[ladder];
414  }
415  } else { // layer-4
416 
417  if (ladder % 2 == 0) { // even ladder = inner = flipped
418  nmodulesLayer_Flipped += nmodules_bpix[layer][ladder];
419  BPIXLayer_Flipped += barycentreLayer[ladder];
420  } else { // odd ladder = outer = non-flipped
421  nmodulesLayer_NonFlipped += nmodules_bpix[layer][ladder];
422  BPIXLayer_NonFlipped += barycentreLayer[ladder];
423  }
424  }
425 
426  } // phase-1
427 
428  // Phase-0
429  //
430  // Phase 0: Outer ladders are odd for layer 1,3 and even for layer 2
431  if (phase_ == 0) {
432  if (layer == 2) { // layer-2
433 
434  if (ladder % 2 != 0) { // odd ladder = inner = flipped
435  nmodulesLayer_Flipped += nmodules_bpix[layer][ladder];
436  BPIXLayer_Flipped += barycentreLayer[ladder];
437  } else {
438  nmodulesLayer_NonFlipped += nmodules_bpix[layer][ladder];
439  BPIXLayer_NonFlipped += barycentreLayer[ladder];
440  }
441  } else { // layer-1,3
442 
443  if (ladder % 2 == 0) { // even ladder = inner = flipped
444  nmodulesLayer_Flipped += nmodules_bpix[layer][ladder];
445  BPIXLayer_Flipped += barycentreLayer[ladder];
446  } else { // odd ladder = outer = non-flipped
447  nmodulesLayer_NonFlipped += nmodules_bpix[layer][ladder];
448  BPIXLayer_NonFlipped += barycentreLayer[ladder];
449  }
450  }
451 
452  } // phase-0
453 
454  } //loop over ladders
455 
456  // total BPIX flipped/non-flipped
457  BPIX_Flipped += BPIXLayer_Flipped;
458  BPIX_NonFlipped += BPIXLayer_NonFlipped;
459  nmodules_BPIX_Flipped += nmodulesLayer_Flipped;
460  nmodules_BPIX_NonFlipped += nmodulesLayer_NonFlipped;
461 
462  //BPIX per-layer
463  BPIXLayer *= (1.0 / nmodulesLayer);
464  BPIXLayer += globalTkPosition;
465  BPIXLayer_Flipped *= (1.0 / nmodulesLayer_Flipped);
466  BPIXLayer_Flipped += globalTkPosition;
467  BPIXLayer_NonFlipped *= (1.0 / nmodulesLayer_NonFlipped);
468  BPIXLayer_NonFlipped += globalTkPosition;
469 
470  BPIXLayer_[layer - 1] = GlobalPoint(BPIXLayer.x(), BPIXLayer.y(), BPIXLayer.z());
473  GlobalPoint(BPIXLayer_Flipped.x(), BPIXLayer_Flipped.y(), BPIXLayer_Flipped.z());
476  GlobalPoint(BPIXLayer_NonFlipped.x(), BPIXLayer_NonFlipped.y(), BPIXLayer_NonFlipped.z());
478  BPIXLayer_DiffFlippedNonFlipped_[layer - 1] = GlobalPoint(BPIXLayer_Flipped.x() - BPIXLayer_NonFlipped.x(),
479  BPIXLayer_Flipped.y() - BPIXLayer_NonFlipped.y(),
480  BPIXLayer_Flipped.z() - BPIXLayer_NonFlipped.z());
482 
483  } // loop over layers
484 
485  BPIX_Flipped *= (1.0 / nmodules_BPIX_Flipped);
486  BPIX_Flipped += globalTkPosition;
487  BPIX_Flipped_ = GlobalPoint(BPIX_Flipped.x(), BPIX_Flipped.y(), BPIX_Flipped.z());
489  BPIX_NonFlipped *= (1.0 / nmodules_BPIX_NonFlipped);
490  BPIX_NonFlipped += globalTkPosition;
491  BPIX_NonFlipped_ = GlobalPoint(BPIX_NonFlipped.x(), BPIX_NonFlipped.y(), BPIX_NonFlipped.z());
493  BPIX_DiffFlippedNonFlipped_ = GlobalPoint(BPIX_Flipped.x() - BPIX_NonFlipped.x(),
494  BPIX_Flipped.y() - BPIX_NonFlipped.y(),
495  BPIX_Flipped.z() - BPIX_NonFlipped.z());
497 
498  // FPIX substructures per-(signed)disk/per-ring
499  int nmodules_FPIX_plus = 0;
500  int nmodules_FPIX_minus = 0;
501  GlobalVector FPIX_plus(0.0, 0.0, 0.0);
502  GlobalVector FPIX_minus(0.0, 0.0, 0.0);
503  // loop over disks
504  for (std::map<int, std::map<int, GlobalVector>>::iterator id = barycentre_fpix.begin();
505  id != barycentre_fpix.end();
506  ++id) {
507  int disk = id->first;
508 
509  int nmodulesDisk = 0;
510  GlobalVector FPIXDisk(0.0, 0.0, 0.0);
511 
512  std::map<int, GlobalVector> baryCentreDisk = id->second;
513  for (std::map<int, GlobalVector>::iterator ir = baryCentreDisk.begin(); ir != baryCentreDisk.end();
514  ++ir) { // loop over rings
515  int ring = ir->first;
516  nmodulesDisk += nmodules_fpix[disk][ring];
517  FPIXDisk += ir->second;
518  if (disk > 0) {
519  nmodules_FPIX_plus += nmodules_fpix[disk][ring];
520  FPIX_plus += ir->second;
521  }
522  if (disk < 0) {
523  nmodules_FPIX_minus += nmodules_fpix[disk][ring];
524  FPIX_minus += ir->second;
525  }
526 
527  } // loop over rings
528 
529  FPIXDisk *= (1.0 / nmodulesDisk);
530  FPIXDisk += globalTkPosition;
531 
532  if (disk > 0) {
533  FPIXDisks_plus_[disk - 1] = GlobalPoint(FPIXDisk.x(), FPIXDisk.y(), FPIXDisk.z());
534  vFPIXDisks_plus_[disk - 1] = SimplePoint(FPIXDisks_plus_[disk - 1]);
535  }
536  if (disk < 0) {
537  FPIXDisks_minus_[-disk - 1] = GlobalPoint(FPIXDisk.x(), FPIXDisk.y(), FPIXDisk.z());
538  vFPIXDisks_minus_[-disk - 1] = SimplePoint(FPIXDisks_minus_[-disk - 1]);
539  }
540  } // loop over disks
541 
542  FPIX_plus *= (1.0 / nmodules_FPIX_plus);
543  FPIX_plus += globalTkPosition;
544  FPIX_plus_ = GlobalPoint(FPIX_plus.x(), FPIX_plus.y(), FPIX_plus.z());
546  FPIX_minus *= (1.0 / nmodules_FPIX_minus);
547  FPIX_minus += globalTkPosition;
548  FPIX_minus_ = GlobalPoint(FPIX_minus.x(), FPIX_minus.y(), FPIX_minus.z());
550 
551  bcTrees_[label]->Fill();
552 
553  } // bcLabels_
554 
555  } // check for new IOV for TKAlign
556 
557  // beamspot
558  if (prepareBS) {
559  // loop over bsLabels_
560  for (const auto& label : bsLabels_) {
561  // init bstree content
563 
564  // Get BeamSpot from EventSetup
565  const BeamSpotObjects* mybeamspot = &iSetup.getData(bsTokens_[label]);
566 
567  BS_ = GlobalPoint(mybeamspot->x(), mybeamspot->y(), mybeamspot->z());
568  vBS_ = SimplePoint(BS_);
569 
570  bsTrees_[label]->Fill();
571  } // bsLabels_
572 
573  } // check for new IOV for BS
574 }
575 
576 // ------------ method called once each job just before starting event loop ------------
578  // init bc bs trees
579  for (const auto& label : bsLabels_) {
580  std::string treeName = "BeamSpot";
581  if (!label.empty())
582  treeName = "BeamSpot_";
583  treeName += label;
584 
585  bsTrees_[label] = tFileService->make<TTree>(TString(treeName), "PixelBarycentre analyzer ntuple");
586 
587  bsTrees_[label]->Branch("run", &run_, "run/I");
588  bsTrees_[label]->Branch("ls", &ls_, "ls/I");
589 
590  bsTrees_[label]->Branch("BS", &vBS_, "x/F:y/F:z/F");
591 
592  } // bsLabels_
593 
594  for (const auto& label : bcLabels_) {
595  std::string treeName = "PixelBarycentre";
596  if (!label.empty())
597  treeName = "PixelBarycentre_";
598  treeName += label;
599  bcTrees_[label] = tFileService->make<TTree>(TString(treeName), "PixelBarycentre analyzer ntuple");
600 
601  bcTrees_[label]->Branch("run", &run_, "run/I");
602  bcTrees_[label]->Branch("ls", &ls_, "ls/I");
603 
604  bcTrees_[label]->Branch("PIX", &vPIX_, "x/F:y/F:z/F");
605 
606  bcTrees_[label]->Branch("BPIX", &vBPIX_, "x/F:y/F:z/F");
607  bcTrees_[label]->Branch("BPIX_Flipped", &vBPIX_Flipped_, "x/F:y/F:z/F");
608  bcTrees_[label]->Branch("BPIX_NonFlipped", &vBPIX_NonFlipped_, "x/F:y/F:z/F");
609  bcTrees_[label]->Branch("BPIX_DiffFlippedNonFlipped", &vBPIX_DiffFlippedNonFlipped_, "x/F:y/F:z/F");
610 
611  bcTrees_[label]->Branch("FPIX", &vFPIX_, "x/F:y/F:z/F");
612  bcTrees_[label]->Branch("FPIX_plus", &vFPIX_plus_, "x/F:y/F:z/F");
613  bcTrees_[label]->Branch("FPIX_minus", &vFPIX_minus_, "x/F:y/F:z/F");
614 
615  //per-layer
616  for (unsigned int i = 0; i < nPixelLayers; i++) {
617  TString structure = "BPIXLYR";
618  int layer = i + 1;
619  structure += layer;
620 
621  bcTrees_[label]->Branch(structure, &vBPIXLayer_[i], "x/F:y/F:z/F");
622  bcTrees_[label]->Branch(structure + "_Flipped", &vBPIXLayer_Flipped_[i], "x/F:y/F:z/F");
623  bcTrees_[label]->Branch(structure + "_NonFlipped", &vBPIXLayer_NonFlipped_[i], "x/F:y/F:z/F");
624  bcTrees_[label]->Branch(
625  structure + "_DiffFlippedNonFlipped", &vBPIXLayer_DiffFlippedNonFlipped_[i], "x/F:y/F:z/F");
626  }
627 
628  //per-disk/ring
629  for (unsigned int i = 0; i < nPixelDiscs; i++) {
630  TString structure = "FPIXDisk_plus";
631  int disk = i + 1;
632  structure += disk;
633  bcTrees_[label]->Branch(structure, &vFPIXDisks_plus_[i], "x/F:y/F:z/F");
634 
635  structure = "FPIXDisk_minus";
636  structure += disk;
637  bcTrees_[label]->Branch(structure, &vFPIXDisks_minus_[i], "x/F:y/F:z/F");
638  }
639 
640  } // bcLabels_
641 }
642 
643 // ------------ method called once each job just after ending the event loop ------------
645  bcLabels_.clear();
646  bsLabels_.clear();
647 
648  bcTrees_.clear();
649  bsTrees_.clear();
650 }
651 
652 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
654  //The following says we do not know what parameters are allowed so do no validation
655  // Please change this to state exactly what you do use, even if it is no parameters
657  desc.setUnknown();
658  descriptions.addDefault(desc);
659 }
660 
661 //define this as a plug-in
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
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
constexpr std::array< uint8_t, layerIndexSize > layer
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
void addDefault(ParameterSetDescription const &psetDescription)
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
bool getData(T &iHolder) const
Definition: EventSetup.h:122
SimplePoint vFPIXDisks_plus_[nPixelDiscs]
edm::ESGetToken< SiPixelQuality, SiPixelQualityFromDbRcd > siPixelQualityToken_
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]
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
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_