CMS 3D CMS Logo

TrackerOfflineValidationSummary.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: TrackerOfflineValidationSummary
4 // Class: TrackerOfflineValidationSummary
5 //
13 //
14 // Original Author: Johannes Hauk
15 // Created: Sat Aug 22 10:31:34 CEST 2009
16 // $Id: TrackerOfflineValidationSummary.cc,v 1.7 2012/06/30 09:09:47 eulisse Exp $
17 //
18 //
19 
20 // system include files
21 #include <memory>
22 
23 // user include files
26 
29 
31 
36 
37 #include "TTree.h"
38 //#include "Alignment/OfflineValidation/interface/TrackerValidationVariables.h"
40 
48 #include "TH1.h"
49 #include "TMath.h"
50 
53 
54 //
55 // class decleration
56 //
57 
59 public:
63 
64 private:
65  struct ModuleHistos {
68  TH1* ResHisto;
74  };
75 
79  TH1* DmrXprime;
80  TH1* DmrYprime;
81  };
82 
85  HarvestingHierarchy(const std::string& name, const std::string& component, const std::vector<unsigned int>& entries)
86  : hierarchyName(name), componentName(component), treeEntries(entries) {}
87  // Needed for naming of histogram according to residual histograms
89  // "Pixel" or "Strip"
91  // Modules belonging to selected hierarchy
92  std::vector<unsigned int> treeEntries;
94  };
95 
96  void analyze(const edm::Event& evt, const edm::EventSetup&) override;
97  void endJob() override;
98 
99  void fillTree(TTree& tree,
100  std::map<int, TrackerOfflineValidationSummary::ModuleHistos>& moduleHist,
101  TkOffTreeVariables& treeMem,
102  const TrackerGeometry& tkgeom,
103  std::map<std::string, std::string>& substructureName,
104  const TrackerTopology* tTopo);
105 
106  std::pair<float, float> fitResiduals(TH1* hist) const;
107  float getMedian(const TH1* hist) const;
108 
111  std::map<std::string, std::string>& substructureName);
112 
113  void collateHarvestingHists(TTree& tree);
114  void applyHarvestingHierarchy(TTree& treeMem);
115  void bookHarvestingHists();
116  void getBinning(const std::string& binningPSetName, int& nBinsX, double& lowerBoundX, double& upperBoundX) const;
117  void fillHarvestingHists(TTree& tree);
118 
119  // ----------member data ---------------------------
120 
123 
124  // parameters from cfg to steer
126  const bool useFit_;
127 
129 
131 
132  std::map<int, TrackerOfflineValidationSummary::ModuleHistos> mPxbResiduals_;
133  std::map<int, TrackerOfflineValidationSummary::ModuleHistos> mPxeResiduals_;
134  std::map<int, TrackerOfflineValidationSummary::ModuleHistos> mTibResiduals_;
135  std::map<int, TrackerOfflineValidationSummary::ModuleHistos> mTidResiduals_;
136  std::map<int, TrackerOfflineValidationSummary::ModuleHistos> mTobResiduals_;
137  std::map<int, TrackerOfflineValidationSummary::ModuleHistos> mTecResiduals_;
138 
139  std::vector<HarvestingHierarchy> vHarvestingHierarchy_;
140 
142 };
143 
144 //
145 // constants, enums and typedefs
146 //
147 
148 //
149 // static data member definitions
150 //
151 
152 //
153 // constructors and destructor
154 //
156  : parSet_(iConfig),
157  moduleDirectory_(parSet_.getParameter<std::string>("moduleDirectoryInOutput")),
158  useFit_(parSet_.getParameter<bool>("useFit")),
159  dbe_(nullptr),
160  moduleMapsInitialized(false),
161  lastSetup_(nullptr) {
162  //now do what ever initialization is needed
163  dbe_ = edm::Service<DQMStore>().operator->();
164 }
165 
167  // do anything here that needs to be done at desctruction time
168  // (e.g. close files, deallocate resources etc.)
169 }
170 
171 //
172 // member functions
173 //
174 
175 // ------------ method called to for each event ------------
177  lastSetup_ = &iSetup;
178 
179  // Access of EventSetup is needed to get the list of silicon-modules and their IDs
180  // Since they do not change, it is accessed only once
182  return;
184  const TrackerGeometry* bareTkGeomPtr = &(*tkGeom_);
185  const TrackingGeometry::DetIdContainer& detIdContainer = bareTkGeomPtr->detIds();
186  std::vector<DetId>::const_iterator iDet;
187  for (iDet = detIdContainer.begin(); iDet != detIdContainer.end(); ++iDet) {
188  const DetId& detId = *iDet;
189  const uint32_t rawId = detId.rawId();
190  const unsigned int subdetId = detId.subdetId();
191  if (subdetId == PixelSubdetector::PixelBarrel)
192  mPxbResiduals_[rawId];
193  else if (subdetId == PixelSubdetector::PixelEndcap)
194  mPxeResiduals_[rawId];
195  else if (subdetId == StripSubdetector::TIB)
196  mTibResiduals_[rawId];
197  else if (subdetId == StripSubdetector::TID)
198  mTidResiduals_[rawId];
199  else if (subdetId == StripSubdetector::TOB)
200  mTobResiduals_[rawId];
201  else if (subdetId == StripSubdetector::TEC)
202  mTecResiduals_[rawId];
203  else {
204  throw cms::Exception("Geometry Error")
205  << "[TrackerOfflineValidationSummary] Error, tried to get reference for non-tracker subdet " << subdetId
206  << " from detector " << detId.det();
207  }
208  }
209  moduleMapsInitialized = true;
210 }
211 
212 // ------------ method called once each job just after ending the event loop ------------
214  //Retrieve tracker topology from geometry
215  edm::ESHandle<TrackerTopology> tTopoHandle;
216  lastSetup_->get<TrackerTopologyRcd>().get(tTopoHandle);
217  const TrackerTopology* const tTopo = tTopoHandle.product();
218 
219  AlignableTracker aliTracker(&(*tkGeom_), tTopo);
220 
221  TTree* tree = new TTree("TkOffVal", "TkOffVal");
222 
223  TkOffTreeVariables* treeMemPtr = new TkOffTreeVariables;
224  // We create branches for all members of 'TkOffTreeVariables' (even if not needed).
225  // This works because we have a dictionary for 'TkOffTreeVariables'
226  // (see src/classes_def.xml and src/classes.h):
227  tree->Branch("TkOffTreeVariables", &treeMemPtr); // address of pointer!
228  // second branch needed for assigning names and titles to harvesting histograms consistent to others
229  std::map<std::string, std::string>* substructureName = new std::map<std::string, std::string>;
230  tree->Branch("SubstructureName", &substructureName, 32000, 00); // SplitLevel must be set to zero
231 
232  this->fillTree(*tree, mPxbResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo);
233  this->fillTree(*tree, mPxeResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo);
234  this->fillTree(*tree, mTibResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo);
235  this->fillTree(*tree, mTidResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo);
236  this->fillTree(*tree, mTobResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo);
237  this->fillTree(*tree, mTecResiduals_, *treeMemPtr, *tkGeom_, *substructureName, tTopo);
238 
239  //dbe_->save("dqmOut.root");
240 
241  // Method for filling histograms which show summarized values (mean, rms, median ...)
242  // of the module-based histograms from TrackerOfflineValidation
243  this->collateHarvestingHists(*tree);
244 
245  delete tree;
246  tree = nullptr;
247  delete treeMemPtr;
248  treeMemPtr = nullptr;
249  delete substructureName;
250  substructureName = nullptr;
251 }
252 
254  std::map<int, TrackerOfflineValidationSummary::ModuleHistos>& moduleHist,
255  TkOffTreeVariables& treeMem,
256  const TrackerGeometry& tkgeom,
257  std::map<std::string, std::string>& substructureName,
258  const TrackerTopology* tTopo) {
259  for (std::map<int, TrackerOfflineValidationSummary::ModuleHistos>::iterator it = moduleHist.begin(),
260  itEnd = moduleHist.end();
261  it != itEnd;
262  ++it) {
263  treeMem.clear(); // make empty/default
264 
265  //variables concerning the tracker components/hierarchy levels
266  const DetId detId = it->first;
267  treeMem.moduleId = detId;
268  treeMem.subDetId = detId.subdetId();
269 
270  if (treeMem.subDetId == PixelSubdetector::PixelBarrel) {
271  unsigned int whichHalfBarrel(1), rawId(detId.rawId()); //DetId does not know about halfBarrels is PXB ...
272  if ((rawId >= 302056964 && rawId < 302059300) || (rawId >= 302123268 && rawId < 302127140) ||
273  (rawId >= 302189572 && rawId < 302194980))
274  whichHalfBarrel = 2;
275  treeMem.layer = tTopo->pxbLayer(detId);
276  treeMem.half = whichHalfBarrel;
277  treeMem.rod = tTopo->pxbLadder(
278  detId); // ... so, ladder is not per halfBarrel-Layer, but per barrel-layer! Needs complicated calculation in associateModuleHistsWithTree()
279  treeMem.module = tTopo->pxbModule(detId);
280  } else if (treeMem.subDetId == PixelSubdetector::PixelEndcap) {
281  unsigned int whichHalfCylinder(1), rawId(detId.rawId()); //DetId does not kmow about halfCylinders in PXF
282  if ((rawId >= 352394500 && rawId < 352406032) || (rawId >= 352460036 && rawId < 352471568) ||
283  (rawId >= 344005892 && rawId < 344017424) || (rawId >= 344071428 && rawId < 344082960))
284  whichHalfCylinder = 2;
285  treeMem.layer = tTopo->pxfDisk(detId);
286  treeMem.side = tTopo->pxfSide(detId);
287  treeMem.half = whichHalfCylinder;
288  treeMem.blade = tTopo->pxfBlade(detId);
289  treeMem.panel = tTopo->pxfPanel(detId);
290  treeMem.module = tTopo->pxfModule(detId);
291  } else if (treeMem.subDetId == StripSubdetector::TIB) {
292  unsigned int whichHalfShell(1), rawId(detId.rawId()); //DetId does not kmow about halfShells in TIB
293  if ((rawId >= 369120484 && rawId < 369120688) || (rawId >= 369121540 && rawId < 369121776) ||
294  (rawId >= 369136932 && rawId < 369137200) || (rawId >= 369137988 && rawId < 369138288) ||
295  (rawId >= 369153396 && rawId < 369153744) || (rawId >= 369154436 && rawId < 369154800) ||
296  (rawId >= 369169844 && rawId < 369170256) || (rawId >= 369170900 && rawId < 369171344) ||
297  (rawId >= 369124580 && rawId < 369124784) || (rawId >= 369125636 && rawId < 369125872) ||
298  (rawId >= 369141028 && rawId < 369141296) || (rawId >= 369142084 && rawId < 369142384) ||
299  (rawId >= 369157492 && rawId < 369157840) || (rawId >= 369158532 && rawId < 369158896) ||
300  (rawId >= 369173940 && rawId < 369174352) || (rawId >= 369174996 && rawId < 369175440))
301  whichHalfShell = 2;
302  treeMem.layer = tTopo->tibLayer(detId);
303  treeMem.side = tTopo->tibStringInfo(detId)[0];
304  treeMem.half = whichHalfShell;
305  treeMem.rod = tTopo->tibStringInfo(detId)[2];
306  treeMem.outerInner = tTopo->tibStringInfo(detId)[1];
307  treeMem.module = tTopo->tibModule(detId);
308  treeMem.isStereo = tTopo->tibStereo(detId);
309  treeMem.isDoubleSide = tTopo->tibIsDoubleSide(detId);
310  } else if (treeMem.subDetId == StripSubdetector::TID) {
311  treeMem.layer = tTopo->tidWheel(detId);
312  treeMem.side = tTopo->tidSide(detId);
313  treeMem.ring = tTopo->tidRing(detId);
314  treeMem.outerInner = tTopo->tidModuleInfo(detId)[0];
315  treeMem.module = tTopo->tidModuleInfo(detId)[1];
316  treeMem.isStereo = tTopo->tidStereo(detId);
317  treeMem.isDoubleSide = tTopo->tidIsDoubleSide(detId);
318  } else if (treeMem.subDetId == StripSubdetector::TOB) {
319  treeMem.layer = tTopo->tobLayer(detId);
320  treeMem.side = tTopo->tobRodInfo(detId)[0];
321  treeMem.rod = tTopo->tobRodInfo(detId)[1];
322  treeMem.module = tTopo->tobModule(detId);
323  treeMem.isStereo = tTopo->tobStereo(detId);
324  treeMem.isDoubleSide = tTopo->tobIsDoubleSide(detId);
325  } else if (treeMem.subDetId == StripSubdetector::TEC) {
326  treeMem.layer = tTopo->tecWheel(detId);
327  treeMem.side = tTopo->tecSide(detId);
328  treeMem.ring = tTopo->tecRing(detId);
329  treeMem.petal = tTopo->tecPetalInfo(detId)[1];
330  treeMem.outerInner = tTopo->tecPetalInfo(detId)[0];
331  treeMem.module = tTopo->tecModule(detId);
332  treeMem.isStereo = tTopo->tecStereo(detId);
333  treeMem.isDoubleSide = tTopo->tecIsDoubleSide(detId);
334  }
335 
336  //variables concerning the tracker geometry
337 
338  const Surface::PositionType& gPModule = tkgeom.idToDet(detId)->position();
339  treeMem.posPhi = gPModule.phi();
340  treeMem.posEta = gPModule.eta();
341  treeMem.posR = gPModule.perp();
342  treeMem.posX = gPModule.x();
343  treeMem.posY = gPModule.y();
344  treeMem.posZ = gPModule.z();
345 
346  const Surface& surface = tkgeom.idToDet(detId)->surface();
347 
348  //global Orientation of local coordinate system of dets/detUnits
349  LocalPoint lUDirection(1., 0., 0.), lVDirection(0., 1., 0.), lWDirection(0., 0., 1.);
350  GlobalPoint gUDirection = surface.toGlobal(lUDirection), gVDirection = surface.toGlobal(lVDirection),
351  gWDirection = surface.toGlobal(lWDirection);
352  double dR(999.), dPhi(999.), dZ(999.);
354  treeMem.subDetId == StripSubdetector::TOB) {
355  dR = gWDirection.perp() - gPModule.perp();
356  dPhi = deltaPhi(gUDirection.barePhi(), gPModule.barePhi());
357  dZ = gVDirection.z() - gPModule.z();
358  if (dZ >= 0.)
359  treeMem.rOrZDirection = 1;
360  else
361  treeMem.rOrZDirection = -1;
362  } else if (treeMem.subDetId == PixelSubdetector::PixelEndcap) {
363  dR = gUDirection.perp() - gPModule.perp();
364  dPhi = deltaPhi(gVDirection.barePhi(), gPModule.barePhi());
365  dZ = gWDirection.z() - gPModule.z();
366  if (dR >= 0.)
367  treeMem.rOrZDirection = 1;
368  else
369  treeMem.rOrZDirection = -1;
370  } else if (treeMem.subDetId == StripSubdetector::TID || treeMem.subDetId == StripSubdetector::TEC) {
371  dR = gVDirection.perp() - gPModule.perp();
372  dPhi = deltaPhi(gUDirection.barePhi(), gPModule.barePhi());
373  dZ = gWDirection.z() - gPModule.z();
374  if (dR >= 0.)
375  treeMem.rOrZDirection = 1;
376  else
377  treeMem.rOrZDirection = -1;
378  }
379  if (dR >= 0.)
380  treeMem.rDirection = 1;
381  else
382  treeMem.rDirection = -1;
383  if (dPhi >= 0.)
384  treeMem.phiDirection = 1;
385  else
386  treeMem.phiDirection = -1;
387  if (dZ >= 0.)
388  treeMem.zDirection = 1;
389  else
390  treeMem.zDirection = -1;
391 
392  // Assign histos from first step (TrackerOfflineValidation) to the module's entry in the TTree for retrieving mean, rms, median ...
393  const std::string histDir = associateModuleHistsWithTree(treeMem, it->second, substructureName);
394 
395  //mean and RMS values (extracted from histograms Xprime on module level)
396  treeMem.entries = static_cast<UInt_t>(it->second.ResXprimeHisto->GetEntries());
397  treeMem.meanX = it->second.ResXprimeHisto->GetMean();
398  treeMem.rmsX = it->second.ResXprimeHisto->GetRMS();
399  //treeMem.sigmaX = Fwhm(it->second.ResXprimeHisto)/2.355;
400  if (useFit_) {
401  //call fit function which returns mean and sigma from the fit
402  //for absolute residuals
403  std::pair<float, float> fitResult1 = this->fitResiduals(it->second.ResXprimeHisto);
404  treeMem.fitMeanX = fitResult1.first;
405  treeMem.fitSigmaX = fitResult1.second;
406  //for normalized residuals
407  std::pair<float, float> fitResult2 = this->fitResiduals(it->second.NormResXprimeHisto);
408  treeMem.fitMeanNormX = fitResult2.first;
409  treeMem.fitSigmaNormX = fitResult2.second;
410  }
411 
412  //get median for absolute residuals
413  treeMem.medianX = this->getMedian(it->second.ResXprimeHisto);
414 
415  int numberOfBins = it->second.ResXprimeHisto->GetNbinsX();
416  treeMem.numberOfUnderflows = it->second.ResXprimeHisto->GetBinContent(0);
417  treeMem.numberOfOverflows = it->second.ResXprimeHisto->GetBinContent(numberOfBins + 1);
418  treeMem.numberOfOutliers =
419  it->second.ResXprimeHisto->GetBinContent(0) + it->second.ResXprimeHisto->GetBinContent(numberOfBins + 1);
420  //mean and RMS values (extracted from histograms(normalized Xprime on module level)
421  treeMem.meanNormX = it->second.NormResXprimeHisto->GetMean();
422  treeMem.rmsNormX = it->second.NormResXprimeHisto->GetRMS();
423 
424  double stats[20];
425  it->second.NormResXprimeHisto->GetStats(stats);
426  // GF treeMem.chi2PerDofX = stats[3]/(stats[0]-1);
427  if (stats[0])
428  treeMem.chi2PerDofX = stats[3] / stats[0];
429 
430  //treeMem.sigmaNormX = Fwhm(it->second.NormResXprimeHisto)/2.355;
431  treeMem.histNameX = it->second.ResXprimeHisto->GetName();
432  treeMem.histNameNormX = it->second.NormResXprimeHisto->GetName();
433 
434  // fill tree variables in local coordinates if set in cfg of TrackerOfllineValidation
435  if (it->second.ResHisto && it->second.NormResHisto) { // if(lCoorHistOn_) {
436  treeMem.meanLocalX = it->second.ResHisto->GetMean();
437  treeMem.rmsLocalX = it->second.ResHisto->GetRMS();
438  treeMem.meanNormLocalX = it->second.NormResHisto->GetMean();
439  treeMem.rmsNormLocalX = it->second.NormResHisto->GetRMS();
440  treeMem.histNameLocalX = it->second.ResHisto->GetName();
441  treeMem.histNameNormLocalX = it->second.NormResHisto->GetName();
442  }
443 
444  // mean and RMS values in local y (extracted from histograms Yprime on module level)
445  // might exist in pixel only
446  if (it->second.ResYprimeHisto) { //(stripYResiduals_){
447  TH1* h = it->second.ResYprimeHisto;
448  treeMem.meanY = h->GetMean();
449  treeMem.rmsY = h->GetRMS();
450 
451  if (useFit_) { // fit function which returns mean and sigma from the fit
452  std::pair<float, float> fitMeanSigma = this->fitResiduals(h);
453  treeMem.fitMeanY = fitMeanSigma.first;
454  treeMem.fitSigmaY = fitMeanSigma.second;
455  }
456 
457  //get median for absolute residuals
458  treeMem.medianY = this->getMedian(h);
459 
460  treeMem.histNameY = h->GetName();
461  }
462 
463  if (it->second.NormResYprimeHisto) {
464  TH1* h = it->second.NormResYprimeHisto;
465  treeMem.meanNormY = h->GetMean();
466  treeMem.rmsNormY = h->GetRMS();
467  h->GetStats(stats); // stats buffer defined above
468  if (stats[0])
469  treeMem.chi2PerDofY = stats[3] / stats[0];
470 
471  if (useFit_) { // fit function which returns mean and sigma from the fit
472  std::pair<float, float> fitMeanSigma = this->fitResiduals(h);
473  treeMem.fitMeanNormY = fitMeanSigma.first;
474  treeMem.fitSigmaNormY = fitMeanSigma.second;
475  }
476  treeMem.histNameNormY = h->GetName();
477  }
478 
479  tree.Fill();
480  }
481 }
482 
484  const TkOffTreeVariables& treeMem,
486  std::map<std::string, std::string>& substructureName) {
487  std::stringstream histDir, sSubdetName;
488  std::string componentName;
489  if (moduleDirectory_.length() != 0)
490  histDir << moduleDirectory_ << "/";
491  std::string wheelOrLayer("_layer_");
492  if (treeMem.subDetId == PixelSubdetector::PixelBarrel) {
493  unsigned int half(treeMem.half), layer(treeMem.layer), ladder(0);
494  if (layer == 1) {
495  if (half == 2)
496  ladder = treeMem.rod - 5;
497  else if (treeMem.rod > 15)
498  ladder = treeMem.rod - 10;
499  else
500  ladder = treeMem.rod;
501  } else if (layer == 2) {
502  if (half == 2)
503  ladder = treeMem.rod - 8;
504  else if (treeMem.rod > 24)
505  ladder = treeMem.rod - 16;
506  else
507  ladder = treeMem.rod;
508  } else if (layer == 3) {
509  if (half == 2)
510  ladder = treeMem.rod - 11;
511  else if (treeMem.rod > 33)
512  ladder = treeMem.rod - 22;
513  else
514  ladder = treeMem.rod;
515  }
516  componentName = "Pixel";
517  sSubdetName << "TPBBarrel_1";
518  histDir << componentName << "/" << sSubdetName.str() << "/TPBHalfBarrel_" << treeMem.half << "/TPBLayer_"
519  << treeMem.layer << "/TPBLadder_" << ladder;
520  } else if (treeMem.subDetId == PixelSubdetector::PixelEndcap) {
521  unsigned int side(treeMem.side), half(treeMem.half), blade(0);
522  if (side == 1)
523  side = 3;
524  if (half == 2)
525  blade = treeMem.blade - 6;
526  else if (treeMem.blade > 18)
527  blade = treeMem.blade - 12;
528  else
529  blade = treeMem.blade;
530  componentName = "Pixel";
531  sSubdetName << "TPEEndcap_" << side;
532  histDir << componentName << "/" << sSubdetName.str() << "/TPEHalfCylinder_" << treeMem.half << "/TPEHalfDisk_"
533  << treeMem.layer << "/TPEBlade_" << blade << "/TPEPanel_" << treeMem.panel;
534  wheelOrLayer = "_wheel_";
535  } else if (treeMem.subDetId == StripSubdetector::TIB) {
536  unsigned int half(treeMem.half), layer(treeMem.layer), surface(treeMem.outerInner), string(0);
537  if (half == 2) {
538  if (layer == 1) {
539  if (surface == 1)
540  string = treeMem.rod - 13;
541  else if (surface == 2)
542  string = treeMem.rod - 15;
543  }
544  if (layer == 2) {
545  if (surface == 1)
546  string = treeMem.rod - 17;
547  else if (surface == 2)
548  string = treeMem.rod - 19;
549  }
550  if (layer == 3) {
551  if (surface == 1)
552  string = treeMem.rod - 22;
553  else if (surface == 2)
554  string = treeMem.rod - 23;
555  }
556  if (layer == 4) {
557  if (surface == 1)
558  string = treeMem.rod - 26;
559  else if (surface == 2)
560  string = treeMem.rod - 28;
561  }
562  } else
563  string = treeMem.rod;
564  std::stringstream detString;
565  if (treeMem.layer < 3 && !treeMem.isDoubleSide)
566  detString << "/Det_" << treeMem.module;
567  else
568  detString << "";
569  componentName = "Strip";
570  sSubdetName << "TIBBarrel_1";
571  histDir << componentName << "/" << sSubdetName.str() << "/TIBHalfBarrel_" << treeMem.side << "/TIBLayer_"
572  << treeMem.layer << "/TIBHalfShell_" << treeMem.half << "/TIBSurface_" << treeMem.outerInner
573  << "/TIBString_" << string << detString.str();
574  } else if (treeMem.subDetId == StripSubdetector::TID) {
575  unsigned int side(treeMem.side), outerInner(0);
576  if (side == 1)
577  side = 3;
578  if (treeMem.outerInner == 1)
579  outerInner = 2;
580  else if (treeMem.outerInner == 2)
581  outerInner = 1;
582  std::stringstream detString;
583  if (treeMem.ring < 3 && !treeMem.isDoubleSide)
584  detString << "/Det_" << treeMem.module;
585  else
586  detString << "";
587  componentName = "Strip";
588  sSubdetName << "TIDEndcap_" << side;
589  histDir << componentName << "/" << sSubdetName.str() << "/TIDDisk_" << treeMem.layer << "/TIDRing_" << treeMem.ring
590  << "/TIDSide_" << outerInner << detString.str();
591  wheelOrLayer = "_wheel_";
592  } else if (treeMem.subDetId == StripSubdetector::TOB) {
593  std::stringstream detString;
594  if (treeMem.layer < 3 && !treeMem.isDoubleSide)
595  detString << "/Det_" << treeMem.module;
596  else
597  detString << "";
598  componentName = "Strip";
599  sSubdetName << "TOBBarrel_4";
600  histDir << componentName << "/" << sSubdetName.str() << "/TOBHalfBarrel_" << treeMem.side << "/TOBLayer_"
601  << treeMem.layer << "/TOBRod_" << treeMem.rod << detString.str();
602  } else if (treeMem.subDetId == StripSubdetector::TEC) {
603  unsigned int side(0), outerInner(0), ring(0);
604  if (treeMem.side == 1)
605  side = 6;
606  else if (treeMem.side == 2)
607  side = 5;
608  if (treeMem.outerInner == 1)
609  outerInner = 2;
610  else if (treeMem.outerInner == 2)
611  outerInner = 1;
612  if (treeMem.layer > 3 && treeMem.layer < 7)
613  ring = treeMem.ring - 1;
614  else if (treeMem.layer == 7 || treeMem.layer == 8)
615  ring = treeMem.ring - 2;
616  else if (treeMem.layer == 9)
617  ring = treeMem.ring - 3;
618  else
619  ring = treeMem.ring;
620  std::stringstream detString;
621  if ((treeMem.ring < 3 || treeMem.ring == 5) && !treeMem.isDoubleSide)
622  detString << "/Det_" << treeMem.module;
623  else
624  detString << "";
625  componentName = "Strip";
626  sSubdetName << "TECEndcap_" << side;
627  histDir << componentName << "/" << sSubdetName.str() << "/TECDisk_" << treeMem.layer << "/TECSide_" << outerInner
628  << "/TECPetal_" << treeMem.petal << "/TECRing_" << ring << detString.str();
629  wheelOrLayer = "_wheel_";
630  }
631 
632  substructureName["component"] = componentName;
633  substructureName["subdet"] = sSubdetName.str();
634 
635  std::stringstream histName;
636  histName << "residuals_subdet_" << treeMem.subDetId << wheelOrLayer << treeMem.layer << "_module_"
637  << treeMem.moduleId;
638 
640  fullPath = histDir.str() + "/h_xprime_" + histName.str();
641  if (dbe_->get(fullPath))
642  moduleHists.ResXprimeHisto = dbe_->get(fullPath)->getTH1();
643  else {
644  edm::LogError("TrackerOfflineValidationSummary")
645  << "Problem with names in input file produced in TrackerOfflineValidation ...\n"
646  << "This histogram should exist in every configuration, "
647  << "but no histogram with name " << fullPath << " is found!";
648  return "";
649  }
650  fullPath = histDir.str() + "/h_normxprime" + histName.str();
651  if (dbe_->get(fullPath))
652  moduleHists.NormResXprimeHisto = dbe_->get(fullPath)->getTH1();
653  fullPath = histDir.str() + "/h_yprime_" + histName.str();
654  if (dbe_->get(fullPath))
655  moduleHists.ResYprimeHisto = dbe_->get(fullPath)->getTH1();
656  fullPath = histDir.str() + "/h_normyprime" + histName.str();
657  if (dbe_->get(fullPath))
658  moduleHists.NormResYprimeHisto = dbe_->get(fullPath)->getTH1();
659  fullPath = histDir.str() + "/h_" + histName.str();
660  if (dbe_->get(fullPath))
661  moduleHists.ResHisto = dbe_->get(fullPath)->getTH1();
662  fullPath = histDir.str() + "/h_norm" + histName.str();
663  if (dbe_->get(fullPath))
664  moduleHists.NormResHisto = dbe_->get(fullPath)->getTH1();
665 
666  return histDir.str();
667 }
668 
669 std::pair<float, float> TrackerOfflineValidationSummary::fitResiduals(TH1* hist) const {
670  std::pair<float, float> fitResult(9999., 9999.);
671  if (!hist || hist->GetEntries() < 20)
672  return fitResult;
673 
674  float mean = hist->GetMean();
675  float sigma = hist->GetRMS();
676 
677  try { // for < CMSSW_2_2_0 since ROOT warnings from fit are converted to exceptions
678  // Remove the try/catch for more recent CMSSW!
679  // first fit: two RMS around mean
680  TF1 func("tmp", "gaus", mean - 2. * sigma, mean + 2. * sigma);
681  if (0 == hist->Fit(&func, "QNR")) { // N: do not blow up file by storing fit!
682  mean = func.GetParameter(1);
683  sigma = func.GetParameter(2);
684  // second fit: three sigma of first fit around mean of first fit
685  func.SetRange(mean - 3. * sigma, mean + 3. * sigma);
686  // I: integral gives more correct results if binning is too wide
687  // L: Likelihood can treat empty bins correctly (if hist not weighted...)
688  if (0 == hist->Fit(&func, "Q0LR")) {
689  if (hist->GetFunction(func.GetName())) { // Take care that it is later on drawn:
690  hist->GetFunction(func.GetName())->ResetBit(TF1::kNotDraw);
691  }
692  fitResult.first = func.GetParameter(1);
693  fitResult.second = func.GetParameter(2);
694  }
695  }
696  } catch (cms::Exception const& e) {
697  edm::LogWarning("Alignment") << "@SUB=TrackerOfflineValidation::fitResiduals"
698  << "Caught this exception during ROOT fit: " << e.what();
699  }
700  return fitResult;
701 }
702 
704  float median = 999;
705  const int nbins = histo->GetNbinsX();
706 
707  //extract median from histogram
708  double* x = new double[nbins];
709  double* y = new double[nbins];
710  for (int j = 0; j < nbins; j++) {
711  x[j] = histo->GetBinCenter(j + 1);
712  y[j] = histo->GetBinContent(j + 1);
713  }
714  median = TMath::Median(nbins, x, y);
715 
716  delete[] x;
717  x = nullptr;
718  delete[] y;
719  y = nullptr;
720 
721  return median;
722 }
723 
725  this->applyHarvestingHierarchy(tree);
726  this->fillHarvestingHists(tree);
727 }
728 
730  TkOffTreeVariables* treeMemPtr = nullptr;
731  std::map<std::string, std::string>* substructureName = nullptr;
732  tree.SetBranchAddress("TkOffTreeVariables", &treeMemPtr);
733  tree.SetBranchAddress("SubstructureName", &substructureName);
734 
735  // Loop over modules to select accumulation criteria for harvesting plots
736  for (unsigned int iSubdet = 1; iSubdet < 7; ++iSubdet) {
737  std::string hierarchyName("");
738  std::string componentName("");
739  std::vector<unsigned int> treeEntries;
740  for (unsigned int iSide = 1; iSide < 3; ++iSide) {
741  // Set up only one collection for Barrels, not separated for side
742  if (iSide == 1 && (iSubdet == PixelSubdetector::PixelBarrel || iSubdet == StripSubdetector::TIB ||
743  iSubdet == StripSubdetector::TOB))
744  continue;
745  for (int iTree = 0; iTree < tree.GetEntries(); ++iTree) {
746  tree.GetEntry(iTree);
747  // Do not use glued Dets
748  if (treeMemPtr->isDoubleSide)
749  continue;
750  if (treeMemPtr->subDetId == iSubdet) {
751  if (iSide != treeMemPtr->side && (iSubdet == PixelSubdetector::PixelEndcap ||
752  iSubdet == StripSubdetector::TID || iSubdet == StripSubdetector::TEC))
753  continue;
754  treeEntries.push_back(iTree);
755  if (hierarchyName.length() == 0) {
756  hierarchyName = (*substructureName)["subdet"];
757  componentName = (*substructureName)["component"];
758  }
759  }
760  }
761  HarvestingHierarchy harvestingHierarchy(hierarchyName, componentName, treeEntries);
762  vHarvestingHierarchy_.push_back(harvestingHierarchy);
763  hierarchyName = "";
764  componentName = "";
765  treeEntries.clear();
766  }
767  }
768  // Here could be a further separation of the HarvestingHierarchy.
769  // E.g. separate the existing ones by layer and add them to the vector without deleting any element from the vector.
770  // The existing hists will stay and the new ones are added
771 
772  // Now, book the corresponding histos
773  this->bookHarvestingHists();
774 }
775 
777  edm::LogInfo("TrackerOfflineValidationSummary") << "Harvesting histograms will be booked for "
778  << vHarvestingHierarchy_.size() << " different hierarchy selections";
779  for (std::vector<HarvestingHierarchy>::iterator iHier = vHarvestingHierarchy_.begin();
780  iHier != vHarvestingHierarchy_.end();
781  ++iHier) {
782  std::stringstream dmrXprimeHistoName, dmrYprimeHistoName, dmrXprimeHistoTitle, dmrYprimeHistoTitle;
783  dmrXprimeHistoName << "h_DmrXprime_" << iHier->hierarchyName;
784  dmrYprimeHistoName << "h_DmrYprime_" << iHier->hierarchyName;
785  dmrXprimeHistoTitle << "DMR for " << iHier->hierarchyName << ";<#DeltaX> [cm];# modules";
786  dmrYprimeHistoTitle << "DMR for " << iHier->hierarchyName << ";<#DeltaY> [cm];# modules";
787 
788  std::string directoryString(moduleDirectory_);
789  if (directoryString.length() != 0)
790  directoryString += "/";
791  directoryString += iHier->componentName;
792  dbe_->setCurrentFolder(directoryString);
793 
794  int nBinsX(0);
795  double xMin(0.), xMax(0.);
796  if (iHier->componentName == "Pixel") {
797  this->getBinning("TH1DmrXprimePixelModules", nBinsX, xMin, xMax);
798  iHier->harvestingHistos.DmrXprime =
799  dbe_->book1D(dmrXprimeHistoName.str(), dmrXprimeHistoTitle.str(), nBinsX, xMin, xMax)->getTH1();
800  this->getBinning("TH1DmrYprimePixelModules", nBinsX, xMin, xMax);
801  iHier->harvestingHistos.DmrYprime =
802  dbe_->book1D(dmrYprimeHistoName.str(), dmrYprimeHistoTitle.str(), nBinsX, xMin, xMax)->getTH1();
803  } else if (iHier->componentName == "Strip") {
804  this->getBinning("TH1DmrXprimeStripModules", nBinsX, xMin, xMax);
805  iHier->harvestingHistos.DmrXprime =
806  dbe_->book1D(dmrXprimeHistoName.str(), dmrXprimeHistoTitle.str(), nBinsX, xMin, xMax)->getTH1();
807  if (!parSet_.getParameter<bool>("stripYDmrs"))
808  continue;
809  this->getBinning("TH1DmrYprimeStripModules", nBinsX, xMin, xMax);
810  iHier->harvestingHistos.DmrYprime =
811  dbe_->book1D(dmrYprimeHistoName.str(), dmrYprimeHistoTitle.str(), nBinsX, xMin, xMax)->getTH1();
812  }
813  }
814 }
815 
817  int& nBinsX,
818  double& lowerBoundX,
819  double& upperBoundX) const {
820  const edm::ParameterSet& binningPSet = parSet_.getParameter<edm::ParameterSet>(binningPSetName);
821  nBinsX = binningPSet.getParameter<int>("Nbinx");
822  lowerBoundX = binningPSet.getParameter<double>("xmin");
823  upperBoundX = binningPSet.getParameter<double>("xmax");
824 }
825 
827  TkOffTreeVariables* treeMemPtr = nullptr;
828  std::map<std::string, std::string>* substructureName = nullptr;
829  tree.SetBranchAddress("TkOffTreeVariables", &treeMemPtr);
830  tree.SetBranchAddress("SubstructureName", &substructureName);
831 
832  const unsigned int minEntriesPerModule(parSet_.getParameter<unsigned int>("minEntriesPerModuleForDmr"));
833  edm::LogInfo("TrackerOfflineValidationSummary")
834  << "Median of a module is added to DMR plots if it contains at least " << minEntriesPerModule << " hits";
835 
836  for (std::vector<HarvestingHierarchy>::iterator iHier = vHarvestingHierarchy_.begin();
837  iHier != vHarvestingHierarchy_.end();
838  ++iHier) {
839  for (std::vector<unsigned int>::const_iterator iTreeEntries = iHier->treeEntries.begin();
840  iTreeEntries != iHier->treeEntries.end();
841  ++iTreeEntries) {
842  tree.GetEntry(*iTreeEntries);
843  if (treeMemPtr->entries < minEntriesPerModule)
844  continue;
845  iHier->harvestingHistos.DmrXprime->Fill(treeMemPtr->medianX);
846  if (iHier->harvestingHistos.DmrYprime)
847  iHier->harvestingHistos.DmrYprime->Fill(treeMemPtr->medianY);
848  }
849  }
850 }
851 
852 //define this as a plug-in
TrackerOfflineValidationSummary::mTidResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTidResiduals_
Definition: TrackerOfflineValidationSummary.cc:135
GeomDet::position
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
TrackerTopology::tobIsDoubleSide
bool tobIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:245
TkOffTreeVariables::meanY
Float_t meanY
Definition: TkOffTreeVariables.h:50
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
TrackerOfflineValidationSummary::DQMStore
dqm::legacy::DQMStore DQMStore
Definition: TrackerOfflineValidationSummary.cc:60
TrackerOfflineValidationSummary::HarvestingHierarchy::componentName
std::string componentName
Definition: TrackerOfflineValidationSummary.cc:90
DDAxes::y
electrons_cff.bool
bool
Definition: electrons_cff.py:372
PixelSubdetector.h
TrackerOfflineValidationSummary::ModuleHistos::ResHisto
TH1 * ResHisto
Definition: TrackerOfflineValidationSummary.cc:68
TkOffTreeVariables::medianX
Float_t medianX
Definition: TkOffTreeVariables.h:50
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
funct::false
false
Definition: Factorize.h:34
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
TrackerGeometry.h
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
TrackerOfflineValidationSummary::moduleDirectory_
const std::string moduleDirectory_
Definition: TrackerOfflineValidationSummary.cc:125
TkOffTreeVariables::medianY
Float_t medianY
Definition: TkOffTreeVariables.h:50
ESHandle.h
TkOffTreeVariables::petal
UInt_t petal
Definition: TkOffTreeVariables.h:59
TrackerTopology::pxfSide
unsigned int pxfSide(const DetId &id) const
Definition: TrackerTopology.h:192
TrackerOfflineValidationSummary::getBinning
void getBinning(const std::string &binningPSetName, int &nBinsX, double &lowerBoundX, double &upperBoundX) const
Definition: TrackerOfflineValidationSummary.cc:816
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
TrackerOfflineValidationSummary::bookHarvestingHists
void bookHarvestingHists()
Definition: TrackerOfflineValidationSummary.cc:776
TkOffTreeVariables::rmsLocalX
Float_t rmsLocalX
Definition: TkOffTreeVariables.h:50
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
TkOffTreeVariables::rDirection
Float_t rDirection
Definition: TkOffTreeVariables.h:50
TrackerTopology
Definition: TrackerTopology.h:16
tree
Definition: tree.py:1
TrackerTopology::tecIsDoubleSide
bool tecIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:246
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
TrackerTopology::tidIsDoubleSide
bool tidIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:250
TrackerTopology::pxbLadder
unsigned int pxbLadder(const DetId &id) const
Definition: TrackerTopology.h:155
TrackerOfflineValidationSummary::collateHarvestingHists
void collateHarvestingHists(TTree &tree)
Definition: TrackerOfflineValidationSummary.cc:724
TkOffTreeVariables::phiDirection
Float_t phiDirection
Definition: TkOffTreeVariables.h:50
TkOffTreeVariables::fitMeanY
Float_t fitMeanY
Definition: TkOffTreeVariables.h:50
edm::LogInfo
Definition: MessageLogger.h:254
TrackerOfflineValidationSummary::lastSetup_
const edm::EventSetup * lastSetup_
Definition: TrackerOfflineValidationSummary.cc:141
TrackerOfflineValidationSummary::HarvestingHistos::DmrYprime
TH1 * DmrYprime
Definition: TrackerOfflineValidationSummary.cc:80
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
L1TStage2EMTFEventInfoClient_cfi.histDir
histDir
Location of output EventInfo/reportSummaryContents.
Definition: L1TStage2EMTFEventInfoClient_cfi.py:17
TrackerOfflineValidationSummary::ModuleHistos::NormResYprimeHisto
TH1 * NormResYprimeHisto
Definition: TrackerOfflineValidationSummary.cc:73
Surface
Definition: Surface.h:36
DQMStore.h
TrackerOfflineValidationSummary::ModuleHistos::NormResXprimeHisto
TH1 * NormResXprimeHisto
Definition: TrackerOfflineValidationSummary.cc:71
EDAnalyzer.h
DDAxes::x
TkOffTreeVariables.h
TkOffTreeVariables::rod
UInt_t rod
Definition: TkOffTreeVariables.h:59
TkOffTreeVariables::outerInner
UInt_t outerInner
Definition: TkOffTreeVariables.h:59
TrackerOfflineValidationSummary::analyze
void analyze(const edm::Event &evt, const edm::EventSetup &) override
Definition: TrackerOfflineValidationSummary.cc:176
TkOffTreeVariables::meanNormY
Float_t meanNormY
Definition: TkOffTreeVariables.h:50
tools.TF1
TF1
Definition: tools.py:23
TkOffTreeVariables::histNameLocalX
std::string histNameLocalX
Definition: TkOffTreeVariables.h:67
TrackerTopology::tidRing
unsigned int tidRing(const DetId &id) const
Definition: TrackerTopology.h:218
TrackerOfflineValidationSummary
Definition: TrackerOfflineValidationSummary.cc:58
TrackerTopology::tobStereo
uint32_t tobStereo(const DetId &id) const
Definition: TrackerTopology.h:275
edm::EDAnalyzer
Definition: EDAnalyzer.h:29
TkOffTreeVariables::fitMeanNormY
Float_t fitMeanNormY
Definition: TkOffTreeVariables.h:50
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
TrackerOfflineValidationSummary::HarvestingHierarchy::HarvestingHierarchy
HarvestingHierarchy(const std::string &name, const std::string &component, const std::vector< unsigned int > &entries)
Definition: TrackerOfflineValidationSummary.cc:85
TrackerOfflineValidationSummary::tkGeom_
edm::ESHandle< TrackerGeometry > tkGeom_
Definition: TrackerOfflineValidationSummary.cc:122
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
TkOffTreeVariables::numberOfOverflows
Float_t numberOfOverflows
Definition: TkOffTreeVariables.h:50
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
TrackerTopology::pxfPanel
unsigned int pxfPanel(const DetId &id) const
Definition: TrackerTopology.h:450
TkOffTreeVariables::fitSigmaNormX
Float_t fitSigmaNormX
Definition: TkOffTreeVariables.h:50
photonAnalyzer_cfi.xMin
xMin
Definition: photonAnalyzer_cfi.py:82
TkOffTreeVariables::rmsX
Float_t rmsX
Definition: TkOffTreeVariables.h:50
TkOffTreeVariables::posR
Float_t posR
Definition: TkOffTreeVariables.h:50
DetId
Definition: DetId.h:17
TrackerTopology::tobRodInfo
std::vector< unsigned int > tobRodInfo(const DetId &id) const
Definition: TrackerTopology.h:226
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrackerOfflineValidationSummary::mTobResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTobResiduals_
Definition: TrackerOfflineValidationSummary.cc:136
MakerMacros.h
TkOffTreeVariables::posPhi
Float_t posPhi
Definition: TkOffTreeVariables.h:50
TrackerTopology.h
TrackerTopology::tibStringInfo
std::vector< unsigned int > tibStringInfo(const DetId &id) const
Definition: TrackerTopology.h:421
TrackerOfflineValidationSummary::HarvestingHistos
Put here the histograms created during harvesting.
Definition: TrackerOfflineValidationSummary.cc:77
TrackerTopology::tidModuleInfo
std::vector< unsigned int > tidModuleInfo(const DetId &id) const
Definition: TrackerTopology.h:434
TrackerTopologyRcd.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
dqm::legacy::DQMStore
Definition: DQMStore.h:727
Surface.h
TkOffTreeVariables::panel
UInt_t panel
Definition: TkOffTreeVariables.h:59
compare.hist
hist
Definition: compare.py:376
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
TkOffTreeVariables::histNameX
std::string histNameX
Definition: TkOffTreeVariables.h:68
TkOffTreeVariables::layer
UInt_t layer
Definition: TkOffTreeVariables.h:59
Service.h
TkOffTreeVariables::posY
Float_t posY
Definition: TkOffTreeVariables.h:50
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
TkOffTreeVariables::entries
UInt_t entries
Definition: TkOffTreeVariables.h:58
TkOffTreeVariables::numberOfUnderflows
Float_t numberOfUnderflows
Definition: TkOffTreeVariables.h:50
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
HLT_2018_cff.dPhi
dPhi
Definition: HLT_2018_cff.py:12290
edm::ESHandle< TrackerGeometry >
AlignableTracker
Definition: AlignableTracker.h:17
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
TkOffTreeVariables::clear
void clear()
set to empty values
Definition: TkOffTreeVariables.h:14
TrackerOfflineValidationSummary::mTibResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTibResiduals_
Definition: TrackerOfflineValidationSummary.cc:134
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
dbe_
dqm::legacy::DQMStore * dbe_
Definition: PFJetBenchmarkAnalyzer.cc:77
h
TkOffTreeVariables::fitSigmaY
Float_t fitSigmaY
Definition: TkOffTreeVariables.h:50
Point3DBase< float, GlobalTag >
TrackerOfflineValidationSummary::parSet_
const edm::ParameterSet parSet_
Definition: TrackerOfflineValidationSummary.cc:121
TkOffTreeVariables::histNameNormY
std::string histNameNormY
Definition: TkOffTreeVariables.h:68
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:474
TkOffTreeVariables::moduleId
UInt_t moduleId
Definition: TkOffTreeVariables.h:59
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
TrackerOfflineValidationSummary::mTecResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTecResiduals_
Definition: TrackerOfflineValidationSummary.cc:137
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TkOffTreeVariables::rOrZDirection
Float_t rOrZDirection
Definition: TkOffTreeVariables.h:50
TrackerTopology::tibStereo
uint32_t tibStereo(const DetId &id) const
Definition: TrackerTopology.h:279
TkOffTreeVariables::meanNormLocalX
Float_t meanNormLocalX
Definition: TkOffTreeVariables.h:50
edm::LogWarning
Definition: MessageLogger.h:141
TkOffTreeVariables::posZ
Float_t posZ
Definition: TkOffTreeVariables.h:50
TrackingGeometry::DetIdContainer
std::vector< DetId > DetIdContainer
Definition: TrackingGeometry.h:30
TkOffTreeVariables::fitSigmaNormY
Float_t fitSigmaNormY
Definition: TkOffTreeVariables.h:50
TrackerDigiGeometryRecord.h
TrackerOfflineValidationSummary::mPxeResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mPxeResiduals_
Definition: TrackerOfflineValidationSummary.cc:133
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
Event.h
PV3DBase::barePhi
T barePhi() const
Definition: PV3DBase.h:65
TkOffTreeVariables::rmsNormX
Float_t rmsNormX
Definition: TkOffTreeVariables.h:50
MainPageGenerator.tree
tree
Definition: MainPageGenerator.py:264
TrackerOfflineValidationSummary::mPxbResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mPxbResiduals_
Definition: TrackerOfflineValidationSummary.cc:132
TkOffTreeVariables::zDirection
Float_t zDirection
Definition: TkOffTreeVariables.h:50
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
TrackerTopology::tidStereo
uint32_t tidStereo(const DetId &id) const
Definition: TrackerTopology.h:283
TrackerTopology::tibModule
unsigned int tibModule(const DetId &id) const
Definition: TrackerTopology.h:172
TrackerTopology::tidSide
unsigned int tidSide(const DetId &id) const
Definition: TrackerTopology.h:190
edm::Service
Definition: Service.h:30
TrackerOfflineValidationSummary::getMedian
float getMedian(const TH1 *hist) const
Definition: TrackerOfflineValidationSummary.cc:703
pfParticleNetPreprocessParams_cfi.median
median
Definition: pfParticleNetPreprocessParams_cfi.py:16
TkOffTreeVariables::meanX
Float_t meanX
Definition: TkOffTreeVariables.h:50
TkOffTreeVariables::blade
UInt_t blade
Definition: TkOffTreeVariables.h:59
iEvent
int iEvent
Definition: GenABIO.cc:224
TrackerTopology::tecRing
unsigned int tecRing(const DetId &id) const
ring id
Definition: TrackerTopology.h:217
TrackerOfflineValidationSummary::associateModuleHistsWithTree
const std::string associateModuleHistsWithTree(const TkOffTreeVariables &treeMem, TrackerOfflineValidationSummary::ModuleHistos &moduleHists, std::map< std::string, std::string > &substructureName)
Definition: TrackerOfflineValidationSummary.cc:483
TrackerOfflineValidationSummary::ModuleHistos
Definition: TrackerOfflineValidationSummary.cc:65
TrackerTopology::pxfModule
unsigned int pxfModule(const DetId &id) const
Definition: TrackerTopology.h:163
TrackerTopology::pxfDisk
unsigned int pxfDisk(const DetId &id) const
Definition: TrackerTopology.h:446
TkOffTreeVariables::rmsNormY
Float_t rmsNormY
Definition: TkOffTreeVariables.h:50
dqmMemoryStats.stats
stats
Definition: dqmMemoryStats.py:134
edm::EventSetup
Definition: EventSetup.h:57
TkOffTreeVariables::fitMeanX
Float_t fitMeanX
Definition: TkOffTreeVariables.h:50
TkOffTreeVariables::side
UInt_t side
Definition: TkOffTreeVariables.h:59
TrackerOfflineValidationSummary::HarvestingHierarchy::harvestingHistos
HarvestingHistos harvestingHistos
Definition: TrackerOfflineValidationSummary.cc:93
TrackerOfflineValidationSummary::HarvestingHierarchy::HarvestingHierarchy
HarvestingHierarchy()
Definition: TrackerOfflineValidationSummary.cc:84
TkOffTreeVariables::half
UInt_t half
Definition: TkOffTreeVariables.h:59
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
get
#define get
TrackerOfflineValidationSummary::ModuleHistos::NormResHisto
TH1 * NormResHisto
Definition: TrackerOfflineValidationSummary.cc:69
TrackerOfflineValidationSummary::ModuleHistos::ResXprimeHisto
TH1 * ResXprimeHisto
Definition: TrackerOfflineValidationSummary.cc:70
TkOffTreeVariables::meanNormX
Float_t meanNormX
Definition: TkOffTreeVariables.h:50
TkOffTreeVariables::subDetId
UInt_t subDetId
Definition: TkOffTreeVariables.h:59
TkOffTreeVariables::isDoubleSide
Bool_t isDoubleSide
Definition: TkOffTreeVariables.h:64
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
TkOffTreeVariables::posX
Float_t posX
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidationSummary::fitResiduals
std::pair< float, float > fitResiduals(TH1 *hist) const
Definition: TrackerOfflineValidationSummary.cc:669
GeomDet.h
TrackerOfflineValidationSummary::HarvestingHierarchy::treeEntries
std::vector< unsigned int > treeEntries
Definition: TrackerOfflineValidationSummary.cc:92
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
TrackerTopology::tobModule
unsigned int tobModule(const DetId &id) const
Definition: TrackerTopology.h:166
TrackerTopology::pxbModule
unsigned int pxbModule(const DetId &id) const
Definition: TrackerTopology.h:160
TrackerTopology::tibIsDoubleSide
bool tibIsDoubleSide(const DetId &id) const
Definition: TrackerTopology.h:249
TkOffTreeVariables::ring
UInt_t ring
Definition: TkOffTreeVariables.h:59
TkOffTreeVariables::fitSigmaX
Float_t fitSigmaX
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidationSummary::HarvestingHistos::DmrXprime
TH1 * DmrXprime
Definition: TrackerOfflineValidationSummary.cc:79
Frameworkfwd.h
TrackerOfflineValidationSummary::ModuleHistos::ResYprimeHisto
TH1 * ResYprimeHisto
Definition: TrackerOfflineValidationSummary.cc:72
TkOffTreeVariables::chi2PerDofX
Float_t chi2PerDofX
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidationSummary::endJob
void endJob() override
Definition: TrackerOfflineValidationSummary.cc:213
TrackerOfflineValidationSummary::useFit_
const bool useFit_
Definition: TrackerOfflineValidationSummary.cc:126
Exception
Definition: hltDiff.cc:246
TrackerOfflineValidationSummary::HarvestingHierarchy::hierarchyName
std::string hierarchyName
Definition: TrackerOfflineValidationSummary.cc:88
TkOffTreeVariables::chi2PerDofY
Float_t chi2PerDofY
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidationSummary::HarvestingHistos::HarvestingHistos
HarvestingHistos()
Definition: TrackerOfflineValidationSummary.cc:78
TrackerOfflineValidationSummary::moduleMapsInitialized
bool moduleMapsInitialized
Definition: TrackerOfflineValidationSummary.cc:130
PVValHelper::ladder
Definition: PVValidationHelpers.h:72
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
TkOffTreeVariables::histNameY
std::string histNameY
Definition: TkOffTreeVariables.h:68
TrackerOfflineValidationSummary::dbe_
DQMStore * dbe_
Definition: TrackerOfflineValidationSummary.cc:128
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
multiplicitycorr_cfi.xMax
xMax
Definition: multiplicitycorr_cfi.py:5
TrackerGeometry::detIds
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: TrackerGeometry.h:64
TrackerOfflineValidationSummary::fillHarvestingHists
void fillHarvestingHists(TTree &tree)
Definition: TrackerOfflineValidationSummary.cc:826
TrackerTopology::tecModule
unsigned int tecModule(const DetId &id) const
Definition: TrackerTopology.h:169
TkOffTreeVariables::histNameNormX
std::string histNameNormX
Definition: TkOffTreeVariables.h:68
TkOffTreeVariables::histNameNormLocalX
std::string histNameNormLocalX
Definition: TkOffTreeVariables.h:67
TrackerOfflineValidationSummary::ModuleHistos::ModuleHistos
ModuleHistos()
Definition: TrackerOfflineValidationSummary.cc:66
TrackerOfflineValidationSummary::fillTree
void fillTree(TTree &tree, std::map< int, TrackerOfflineValidationSummary::ModuleHistos > &moduleHist, TkOffTreeVariables &treeMem, const TrackerGeometry &tkgeom, std::map< std::string, std::string > &substructureName, const TrackerTopology *tTopo)
Definition: TrackerOfflineValidationSummary.cc:253
TrackerTopology::pxfBlade
unsigned int pxfBlade(const DetId &id) const
Definition: TrackerTopology.h:447
TrackerTopology::tecPetalInfo
std::vector< unsigned int > tecPetalInfo(const DetId &id) const
Definition: TrackerTopology.h:407
TkOffTreeVariables::posEta
Float_t posEta
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidationSummary::vHarvestingHierarchy_
std::vector< HarvestingHierarchy > vHarvestingHierarchy_
Definition: TrackerOfflineValidationSummary.cc:139
AlignableTracker.h
cms::Exception
Definition: Exception.h:70
TrackerOfflineValidationSummary::HarvestingHierarchy
Definition: TrackerOfflineValidationSummary.cc:83
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
ParameterSet.h
TkOffTreeVariables::meanLocalX
Float_t meanLocalX
Definition: TkOffTreeVariables.h:50
spclusmultinvestigator_cfi.numberOfBins
numberOfBins
Definition: spclusmultinvestigator_cfi.py:17
TrackerOfflineValidationSummary::TrackerOfflineValidationSummary
TrackerOfflineValidationSummary(const edm::ParameterSet &)
Definition: TrackerOfflineValidationSummary.cc:155
TkOffTreeVariables::fitMeanNormX
Float_t fitMeanNormX
Definition: TkOffTreeVariables.h:50
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::Event
Definition: Event.h:73
TkOffTreeVariables::module
UInt_t module
Definition: TkOffTreeVariables.h:59
TkOffTreeVariables::rmsNormLocalX
Float_t rmsNormLocalX
Definition: TkOffTreeVariables.h:50
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
TkOffTreeVariables::isStereo
Bool_t isStereo
Definition: TkOffTreeVariables.h:65
TrackerOfflineValidationSummary::applyHarvestingHierarchy
void applyHarvestingHierarchy(TTree &treeMem)
Definition: TrackerOfflineValidationSummary.cc:729
StripSubdetector.h
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
TrackerOfflineValidationSummary::~TrackerOfflineValidationSummary
~TrackerOfflineValidationSummary() override
Definition: TrackerOfflineValidationSummary.cc:166
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
TkOffTreeVariables::rmsY
Float_t rmsY
Definition: TkOffTreeVariables.h:50
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
deltaPhi.h
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
TrackerTopology::tecStereo
uint32_t tecStereo(const DetId &id) const
Definition: TrackerTopology.h:287
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150
TrackerGeometry
Definition: TrackerGeometry.h:14
TkOffTreeVariables
container to hold data to be written into TTree
Definition: TkOffTreeVariables.h:9
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184
TkOffTreeVariables::numberOfOutliers
Float_t numberOfOutliers
Definition: TkOffTreeVariables.h:50