CMS 3D CMS Logo

TrackerOfflineValidation.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: TrackerOfflineValidation
4 // Class: TrackerOfflineValidation
5 //
13 //
14 // Original Author: Erik Butz
15 // Created: Tue Dec 11 14:03:05 CET 2007
16 // $Id: TrackerOfflineValidation.cc,v 1.55 2012/09/28 20:48:06 flucke Exp $
17 //
18 //
19 
20 // system include files
21 #include <memory>
22 #include <map>
23 #include <sstream>
24 #include <cmath>
25 #include <tuple>
26 #include <utility>
27 #include <vector>
28 #include <iostream>
29 
30 // ROOT includes
31 #include "TH1.h"
32 #include "TH2.h"
33 #include "TProfile.h"
34 #include "TFile.h"
35 #include "TTree.h"
36 #include "TF1.h"
37 #include "TMath.h"
38 
39 // user include files
49 
55 
58 
63 
65 
71 
74 
75 //
76 // class declaration
77 //
78 class TrackerOfflineValidation : public edm::one::EDAnalyzer<edm::one::SharedResources> {
79 public:
82  ~TrackerOfflineValidation() override;
83 
87  YResidual, /*NormYResidual, */
94  };
95 
96 private:
99 
100  struct ModuleHistos {
102  : ResHisto(),
103  NormResHisto(),
104  ResYHisto(), /*NormResYHisto(),*/
105  ResXprimeHisto(),
107  ResYprimeHisto(),
109  ResXvsXProfile(),
110  ResXvsYProfile(),
111  ResYvsXProfile(),
112  ResYvsYProfile(),
113  LocalX(),
114  LocalY() {}
115  TH1* ResHisto;
117  TH1* ResYHisto;
118  /* TH1* NormResYHisto; */
123 
124  TProfile* ResXvsXProfile;
125  TProfile* ResXvsYProfile;
126  TProfile* ResYvsXProfile;
127  TProfile* ResYvsYProfile;
128 
129  TH1* LocalX;
130  TH1* LocalY;
131  };
132 
133  // container struct to organize collection of histograms during endJob
136  : sumXResiduals_(),
140  sumYResiduals_(),
147  sumResYvsYProfile_() {}
148 
157 
162  };
163 
166  const std::string& newDir,
167  const std::string& basedir,
168  bool useDqmMode)
169  : tfd(nullptr), dqmMode(useDqmMode), theDbe(nullptr) {
170  if (newDir.length() != 0) {
171  if (upDir.directoryString.length() != 0)
172  directoryString = upDir.directoryString + "/" + newDir;
173  else
174  directoryString = newDir;
175  } else
177 
178  if (!dqmMode) {
179  if (newDir.length() == 0)
180  tfd.reset(&(*upDir.tfd));
181  else
182  tfd = std::make_unique<TFileDirectory>(upDir.tfd->mkdir(newDir));
183  } else {
184  theDbe = edm::Service<DQMStore>().operator->();
185  }
186  }
187 
188  DirectoryWrapper(const std::string& newDir, const std::string& basedir, bool useDqmMode)
189  : tfd(nullptr), dqmMode(useDqmMode), theDbe(nullptr) {
190  if (!dqmMode) {
192  if (newDir.length() == 0) {
193  tfd = std::make_unique<TFileDirectory>(fs->tFileDirectory());
194  } else {
195  tfd = std::make_unique<TFileDirectory>(fs->mkdir(newDir));
196  directoryString = newDir;
197  }
198  } else {
199  if (newDir.length() != 0) {
200  if (basedir.length() != 0)
201  directoryString = basedir + "/" + newDir;
202  else
203  directoryString = newDir;
204  } else
206  theDbe = edm::Service<DQMStore>().operator->();
207  }
208  }
209  // Generalization of Histogram Booking; allows switch between TFileService and DQMStore
210  template <typename T>
211  TH1* make(const char* name, const char* title, int nBinX, double minBinX, double maxBinX);
212  template <typename T>
213  TH1* make(const char* name, const char* title, int nBinX, double* xBins); //variable bin size in x for profile histo
214  template <typename T>
215  TH1* make(const char* name,
216  const char* title,
217  int nBinX,
218  double minBinX,
219  double maxBinX,
220  int nBinY,
221  double minBinY,
222  double maxBinY);
223  template <typename T>
224  TH1* make(const char* name,
225  const char* title,
226  int nBinX,
227  double minBinX,
228  double maxBinX,
229  double minBinY,
230  double maxBinY); // at present not used
231 
232  std::unique_ptr<TFileDirectory> tfd;
234  const bool dqmMode;
236  };
237 
238  //
239  // ------------- private member function -------------
240  //
241  void analyze(const edm::Event&, const edm::EventSetup&) override;
242  void endJob() override;
243 
244  virtual void checkBookHists(const edm::EventSetup& setup);
245 
247  void bookDirHists(DirectoryWrapper& tfd, const Alignable& ali, const TrackerTopology* tTopo);
248  void bookHists(
249  DirectoryWrapper& tfd, const Alignable& ali, const TrackerTopology* tTopo, align::StructureType type, int i);
250 
252  const Alignable& ali,
253  std::vector<TrackerOfflineValidation::SummaryContainer>& vLevelProfiles);
254  void collateSummaryHists();
255 
256  void setUpTreeMembers(const std::map<int, TrackerOfflineValidation::ModuleHistos>& moduleHist_,
257  const TrackerGeometry& tkgeom,
258  const TrackerTopology* tTopo);
259  void fillTree(TTree& tree,
260  TkOffTreeVariables& treeMem,
261  const std::map<int, TrackerOfflineValidation::ModuleHistos>& moduleHist_);
262 
264  const Alignable& ali,
266  int i);
267 
268  ModuleHistos& getHistStructFromMap(const DetId& detid);
269 
270  bool isBarrel(uint32_t subDetId);
271  bool isEndCap(uint32_t subDetId);
272  bool isPixel(uint32_t subDetId);
274 
275  TH1* bookTH1F(bool isTransient,
276  DirectoryWrapper& tfd,
277  const char* histName,
278  const char* histTitle,
279  int nBinsX,
280  double lowX,
281  double highX);
282 
283  TProfile* bookTProfile(bool isTransient,
284  DirectoryWrapper& tfd,
285  const char* histName,
286  const char* histTitle,
287  int nBinsX,
288  double lowX,
289  double highX);
290 
291  TProfile* bookTProfile(bool isTransient,
292  DirectoryWrapper& tfd,
293  const char* histName,
294  const char* histTitle,
295  int nBinsX,
296  double lowX,
297  double highX,
298  double lowY,
299  double highY);
300 
301  void getBinning(uint32_t subDetId,
303  int& nBinsX,
304  double& lowerBoundX,
305  double& upperBoundX);
306 
307  void summarizeBinInContainer(int bin, SummaryContainer& targetContainer, SummaryContainer& sourceContainer);
308 
309  void summarizeBinInContainer(int bin,
310  uint32_t subDetId,
311  SummaryContainer& targetContainer,
312  ModuleHistos& sourceContainer);
313 
314  void setSummaryBin(int bin, TH1* targetHist, TH1* sourceHist);
315 
316  float Fwhm(const TH1* hist) const;
317  std::pair<float, float> fitResiduals(TH1* hist) const; //, float meantmp, float rmstmp);
318  float getMedian(const TH1* hist) const;
319 
320  // From MillePedeAlignmentMonitor: Get Index for Arbitary vector<class> by name
321  template <class OBJECT_TYPE>
322  int GetIndex(const std::vector<OBJECT_TYPE*>& vec, const TString& name);
323 
324  // ---------- member data ---------------------------
325 
328  const TrackerGeometry* bareTkGeomPtr_; // ugly hack to book hists only once, but check
329  std::unique_ptr<AlignableTracker> alignableTracker_;
330 
331  // parameters from cfg to steer
333  const bool lCoorHistOn_;
336  const bool stripYResiduals_;
337  const bool useFwhm_;
338  const bool useFit_;
339  const bool useOverflowForRMS_;
340  const bool dqmMode_;
342 
343  const int chargeCut_;
344 
345  // a vector to keep track which pointers should be deleted at the very end
346  std::vector<TH1*> vDeleteObjects_;
347 
348  std::vector<TH1*> vTrackHistos_;
349  std::vector<TH1*> vTrackProfiles_;
350  std::vector<TH1*> vTrack2DHistos_;
351 
352  std::map<int, TrackerOfflineValidation::ModuleHistos> mPxbResiduals_;
353  std::map<int, TrackerOfflineValidation::ModuleHistos> mPxeResiduals_;
354  std::map<int, TrackerOfflineValidation::ModuleHistos> mTibResiduals_;
355  std::map<int, TrackerOfflineValidation::ModuleHistos> mTidResiduals_;
356  std::map<int, TrackerOfflineValidation::ModuleHistos> mTobResiduals_;
357  std::map<int, TrackerOfflineValidation::ModuleHistos> mTecResiduals_;
358 
359  std::map<int, TkOffTreeVariables> mTreeMembers_;
360 
361  //There are two types of summary histograms. The first contains, for each component, a bin per subcomponent.
362  //These are set up through summarizeBinInContainer(). The second type is just the sum of the lower level histograms.
363  //Prepare the filling of both types at the beginning, when the tracker topology is available through the eventsetup.
364  //They are not actually filled until the end, but at that time eventsetup is no longer accessible.
365 
366  //To fill the summary hists, store the arguments of setSummaryBin()
367  //At the end, call the function
368  std::vector<std::tuple<int, TH1*, TH1*> > summaryBins_;
369  //To fill the sum hists, just store pairs of TH1*. At the end, first->Add(second).
370  std::vector<std::pair<TH1*, TH1*> > sumHistStructure_;
371  //sum hists are fit at the end using fitResiduals()
372  std::vector<TH1*> toFit_;
373 
374  unsigned long long nTracks_;
375  const unsigned long long maxTracks_;
376 
378 };
379 
380 //
381 // constants, enums and typedefs
382 //
383 
384 //
385 // static data member definitions
386 //
387 
388 template <class OBJECT_TYPE>
389 int TrackerOfflineValidation::GetIndex(const std::vector<OBJECT_TYPE*>& vec, const TString& name) {
390  int result = 0;
391  for (typename std::vector<OBJECT_TYPE*>::const_iterator iter = vec.begin(), iterEnd = vec.end(); iter != iterEnd;
392  ++iter, ++result) {
393  if (*iter && (*iter)->GetName() == name)
394  return result;
395  }
396  edm::LogError("Alignment") << "@SUB=TrackerOfflineValidation::GetIndex"
397  << " could not find " << name;
398  return -1;
399 }
400 
401 template <>
402 TH1* TrackerOfflineValidation::DirectoryWrapper::make<TH1F>(
403  const char* name, const char* title, int nBinX, double minBinX, double maxBinX) {
404  if (dqmMode) {
406  return theDbe->book1D(name, title, nBinX, minBinX, maxBinX)->getTH1();
407  } else {
408  return tfd->make<TH1F>(name, title, nBinX, minBinX, maxBinX);
409  }
410 }
411 
412 template <>
413 TH1* TrackerOfflineValidation::DirectoryWrapper::make<TProfile>(const char* name,
414  const char* title,
415  int nBinX,
416  double* xBins) {
417  if (dqmMode) {
418  theDbe->setCurrentFolder(directoryString);
419  //DQM profile requires y-bins for construction... using TProfile creator by hand...
420  TProfile* tmpProfile = new TProfile(name, title, nBinX, xBins);
421  tmpProfile->SetDirectory(nullptr);
422  return theDbe->bookProfile(name, tmpProfile)->getTH1();
423  } else {
424  return tfd->make<TProfile>(name, title, nBinX, xBins);
425  }
426 }
427 
428 template <>
429 TH1* TrackerOfflineValidation::DirectoryWrapper::make<TProfile>(
430  const char* name, const char* title, int nBinX, double minBinX, double maxBinX) {
431  if (dqmMode) {
432  theDbe->setCurrentFolder(directoryString);
433  //DQM profile requires y-bins for construction... using TProfile creator by hand...
434  TProfile* tmpProfile = new TProfile(name, title, nBinX, minBinX, maxBinX);
435  tmpProfile->SetDirectory(nullptr);
436  return theDbe->bookProfile(name, tmpProfile)->getTH1();
437  } else {
438  return tfd->make<TProfile>(name, title, nBinX, minBinX, maxBinX);
439  }
440 }
441 
442 template <>
443 TH1* TrackerOfflineValidation::DirectoryWrapper::make<TProfile>(
444  const char* name, const char* title, int nbinX, double minX, double maxX, double minY, double maxY) {
445  if (dqmMode) {
446  theDbe->setCurrentFolder(directoryString);
447  int dummy(0); // DQMProfile wants Y channels... does not use them!
448  return (theDbe->bookProfile(name, title, nbinX, minX, maxX, dummy, minY, maxY)->getTH1());
449  } else {
450  return tfd->make<TProfile>(name, title, nbinX, minX, maxX, minY, maxY);
451  }
452 }
453 
454 template <>
455 TH1* TrackerOfflineValidation::DirectoryWrapper::make<TH2F>(const char* name,
456  const char* title,
457  int nBinX,
458  double minBinX,
459  double maxBinX,
460  int nBinY,
461  double minBinY,
462  double maxBinY) {
463  if (dqmMode) {
464  theDbe->setCurrentFolder(directoryString);
465  return theDbe->book2D(name, title, nBinX, minBinX, maxBinX, nBinY, minBinY, maxBinY)->getTH1();
466  } else {
467  return tfd->make<TH2F>(name, title, nBinX, minBinX, maxBinX, nBinY, minBinY, maxBinY);
468  }
469 }
470 
471 //
472 // constructors and destructor
473 //
475  : geomToken_(esConsumes()),
477  parSet_(iConfig),
478  bareTkGeomPtr_(nullptr),
479  compressionSettings_(parSet_.getUntrackedParameter<int>("compressionSettings", -1)),
480  lCoorHistOn_(parSet_.getParameter<bool>("localCoorHistosOn")),
481  moduleLevelHistsTransient_(parSet_.getParameter<bool>("moduleLevelHistsTransient")),
482  moduleLevelProfiles_(parSet_.getParameter<bool>("moduleLevelProfiles")),
483  stripYResiduals_(parSet_.getParameter<bool>("stripYResiduals")),
484  useFwhm_(parSet_.getParameter<bool>("useFwhm")),
485  useFit_(parSet_.getParameter<bool>("useFit")),
486  useOverflowForRMS_(parSet_.getParameter<bool>("useOverflowForRMS")),
487  dqmMode_(parSet_.getParameter<bool>("useInDqmMode")),
488  moduleDirectory_(parSet_.getParameter<std::string>("moduleDirectoryInOutput")),
489  chargeCut_(parSet_.getParameter<int>("chargeCut")),
490  nTracks_(0),
491  maxTracks_(parSet_.getParameter<unsigned long long>("maxTracks")),
492  avalidator_(iConfig, consumesCollector()) {
493  usesResource(TFileService::kSharedResource);
494 }
495 
497  // do anything here that needs to be done at desctruction time
498  // (e.g. close files, deallocate resources etc.)
499  for (std::vector<TH1*>::const_iterator it = vDeleteObjects_.begin(), itEnd = vDeleteObjects_.end(); it != itEnd; ++it)
500  delete *it;
501 }
502 
503 //
504 // member functions
505 //
506 
507 // ------------ method called once each job just before starting event loop ------------
510  const TrackerGeometry* newBareTkGeomPtr = &(*tkGeom_);
511 
512  if (newBareTkGeomPtr == bareTkGeomPtr_)
513  return; // already booked hists, nothing changed
514 
515  if (!bareTkGeomPtr_) { // pointer not yet set: called the first time => book hists
516 
517  //Retrieve tracker topology from geometry
518  const TrackerTopology* const tTopo = &es.getData(topoToken_);
519 
520  // construct alignable tracker to get access to alignable hierarchy
521  alignableTracker_ = std::make_unique<AlignableTracker>(&(*tkGeom_), tTopo);
522 
523  edm::LogInfo("TrackerOfflineValidation")
524  << "There are " << newBareTkGeomPtr->detIds().size() << " dets in the Geometry record.\n"
525  << "Out of these " << newBareTkGeomPtr->detUnitIds().size() << " are detUnits";
526 
527  // Book histograms for global track quantities
528  std::string globDir("GlobalTrackVariables");
529  DirectoryWrapper trackglobal(globDir, moduleDirectory_, dqmMode_);
530  this->bookGlobalHists(trackglobal);
531 
532  // recursively book histograms on lowest level
534  this->bookDirHists(tfdw, *alignableTracker_, tTopo);
535  // and prepare the higher level histograms
536  std::vector<TrackerOfflineValidation::SummaryContainer> vTrackerprofiles;
537  this->prepareSummaryHists(tfdw, *alignableTracker_, vTrackerprofiles);
538 
539  setUpTreeMembers(mPxbResiduals_, *newBareTkGeomPtr, tTopo);
540  setUpTreeMembers(mPxeResiduals_, *newBareTkGeomPtr, tTopo);
541  setUpTreeMembers(mTibResiduals_, *newBareTkGeomPtr, tTopo);
542  setUpTreeMembers(mTidResiduals_, *newBareTkGeomPtr, tTopo);
543  setUpTreeMembers(mTobResiduals_, *newBareTkGeomPtr, tTopo);
544  setUpTreeMembers(mTecResiduals_, *newBareTkGeomPtr, tTopo);
545  } else { // histograms booked, but changed TrackerGeometry?
546  edm::LogWarning("GeometryChange") << "@SUB=checkBookHists"
547  << "TrackerGeometry changed, but will not re-book hists!";
548  }
549  bareTkGeomPtr_ = newBareTkGeomPtr;
550 }
551 
553  vTrackHistos_.push_back(tfd.make<TH1F>("h_tracketa", "Track #eta;#eta_{Track};Number of Tracks", 90, -3., 3.));
554  vTrackHistos_.push_back(tfd.make<TH1F>("h_trackphi", "Track #phi;#phi_{Track};Number of Tracks", 90, -3.15, 3.15));
555  vTrackHistos_.push_back(tfd.make<TH1F>(
556  "h_trackNumberOfValidHits", "Track # of valid hits;# of valid hits _{Track};Number of Tracks", 40, 0., 40.));
557  vTrackHistos_.push_back(tfd.make<TH1F>(
558  "h_trackNumberOfLostHits", "Track # of lost hits;# of lost hits _{Track};Number of Tracks", 10, 0., 10.));
559  vTrackHistos_.push_back(
560  tfd.make<TH1F>("h_curvature", "Curvature #kappa;#kappa_{Track};Number of Tracks", 100, -.05, .05));
561  vTrackHistos_.push_back(tfd.make<TH1F>(
562  "h_curvature_pos", "Curvature |#kappa| Positive Tracks;|#kappa_{pos Track}|;Number of Tracks", 100, .0, .05));
563  vTrackHistos_.push_back(tfd.make<TH1F>(
564  "h_curvature_neg", "Curvature |#kappa| Negative Tracks;|#kappa_{neg Track}|;Number of Tracks", 100, .0, .05));
565  vTrackHistos_.push_back(
566  tfd.make<TH1F>("h_diff_curvature",
567  "Curvature |#kappa| Tracks Difference;|#kappa_{Track}|;# Pos Tracks - # Neg Tracks",
568  100,
569  .0,
570  .05));
571  vTrackHistos_.push_back(tfd.make<TH1F>("h_chi2", "#chi^{2};#chi^{2}_{Track};Number of Tracks", 500, -0.01, 500.));
572  vTrackHistos_.push_back(
573  tfd.make<TH1F>("h_chi2Prob", "#chi^{2} probability;#chi^{2}prob_{Track};Number of Tracks", 100, 0.0, 1.));
574  vTrackHistos_.push_back(
575  tfd.make<TH1F>("h_normchi2", "#chi^{2}/ndof;#chi^{2}/ndof;Number of Tracks", 100, -0.01, 10.));
576  vTrackHistos_.push_back(tfd.make<TH1F>("h_pt", "p_{T}^{track};p_{T}^{track} [GeV];Number of Tracks", 250, 0., 250));
577  vTrackHistos_.push_back(tfd.make<TH1F>(
578  "h_ptResolution", "#delta_{p_{T}}/p_{T}^{track};#delta_{p_{T}}/p_{T}^{track};Number of Tracks", 100, 0., 0.5));
579  vTrackProfiles_.push_back(tfd.make<TProfile>(
580  "p_d0_vs_phi", "Transverse Impact Parameter vs. #phi;#phi_{Track};#LT d_{0} #GT [cm]", 100, -3.15, 3.15));
581  vTrackProfiles_.push_back(tfd.make<TProfile>(
582  "p_dz_vs_phi", "Longitudinal Impact Parameter vs. #phi;#phi_{Track};#LT d_{z} #GT [cm]", 100, -3.15, 3.15));
583  vTrackProfiles_.push_back(tfd.make<TProfile>(
584  "p_d0_vs_eta", "Transverse Impact Parameter vs. #eta;#eta_{Track};#LT d_{0} #GT [cm]", 100, -3.15, 3.15));
585  vTrackProfiles_.push_back(tfd.make<TProfile>(
586  "p_dz_vs_eta", "Longitudinal Impact Parameter vs. #eta;#eta_{Track};#LT d_{z} #GT [cm]", 100, -3.15, 3.15));
587  vTrackProfiles_.push_back(
588  tfd.make<TProfile>("p_chi2_vs_phi", "#chi^{2} vs. #phi;#phi_{Track};#LT #chi^{2} #GT", 100, -3.15, 3.15));
589  vTrackProfiles_.push_back(tfd.make<TProfile>(
590  "p_chi2Prob_vs_phi", "#chi^{2} probablility vs. #phi;#phi_{Track};#LT #chi^{2} probability#GT", 100, -3.15, 3.15));
591  vTrackProfiles_.push_back(tfd.make<TProfile>(
592  "p_chi2Prob_vs_d0", "#chi^{2} probablility vs. |d_{0}|;|d_{0}|[cm];#LT #chi^{2} probability#GT", 100, 0, 80));
593  vTrackProfiles_.push_back(tfd.make<TProfile>(
594  "p_normchi2_vs_phi", "#chi^{2}/ndof vs. #phi;#phi_{Track};#LT #chi^{2}/ndof #GT", 100, -3.15, 3.15));
595  vTrackProfiles_.push_back(
596  tfd.make<TProfile>("p_chi2_vs_eta", "#chi^{2} vs. #eta;#eta_{Track};#LT #chi^{2} #GT", 100, -3.15, 3.15));
597  //variable binning for chi2/ndof vs. pT
598  double xBins[19] = {0., 0.15, 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 7., 10., 15., 25., 40., 100., 200.};
599  vTrackProfiles_.push_back(tfd.make<TProfile>(
600  "p_normchi2_vs_pt", "norm #chi^{2} vs. p_{T}_{Track}; p_{T}_{Track};#LT #chi^{2}/ndof #GT", 18, xBins));
601 
602  vTrackProfiles_.push_back(
603  tfd.make<TProfile>("p_normchi2_vs_p", "#chi^{2}/ndof vs. p_{Track};p_{Track};#LT #chi^{2}/ndof #GT", 18, xBins));
604  vTrackProfiles_.push_back(tfd.make<TProfile>(
605  "p_chi2Prob_vs_eta", "#chi^{2} probability vs. #eta;#eta_{Track};#LT #chi^{2} probability #GT", 100, -3.15, 3.15));
606  vTrackProfiles_.push_back(tfd.make<TProfile>(
607  "p_normchi2_vs_eta", "#chi^{2}/ndof vs. #eta;#eta_{Track};#LT #chi^{2}/ndof #GT", 100, -3.15, 3.15));
608  vTrackProfiles_.push_back(
609  tfd.make<TProfile>("p_kappa_vs_phi", "#kappa vs. #phi;#phi_{Track};#kappa", 100, -3.15, 3.15));
610  vTrackProfiles_.push_back(
611  tfd.make<TProfile>("p_kappa_vs_eta", "#kappa vs. #eta;#eta_{Track};#kappa", 100, -3.15, 3.15));
612  vTrackProfiles_.push_back(tfd.make<TProfile>("p_ptResolution_vs_phi",
613  "#delta_{p_{T}}/p_{T}^{track};#phi^{track};#delta_{p_{T}}/p_{T}^{track}",
614  100,
615  -3.15,
616  3.15));
617  vTrackProfiles_.push_back(tfd.make<TProfile>("p_ptResolution_vs_eta",
618  "#delta_{p_{T}}/p_{T}^{track};#eta^{track};#delta_{p_{T}}/p_{T}^{track}",
619  100,
620  -3.15,
621  3.15));
622 
623  vTrack2DHistos_.push_back(tfd.make<TH2F>(
624  "h2_d0_vs_phi", "Transverse Impact Parameter vs. #phi;#phi_{Track};d_{0} [cm]", 100, -3.15, 3.15, 100, -1., 1.));
625  vTrack2DHistos_.push_back(tfd.make<TH2F>("h2_dz_vs_phi",
626  "Longitudinal Impact Parameter vs. #phi;#phi_{Track};d_{z} [cm]",
627  100,
628  -3.15,
629  3.15,
630  100,
631  -100.,
632  100.));
633  vTrack2DHistos_.push_back(tfd.make<TH2F>(
634  "h2_d0_vs_eta", "Transverse Impact Parameter vs. #eta;#eta_{Track};d_{0} [cm]", 100, -3.15, 3.15, 100, -1., 1.));
635  vTrack2DHistos_.push_back(tfd.make<TH2F>("h2_dz_vs_eta",
636  "Longitudinal Impact Parameter vs. #eta;#eta_{Track};d_{z} [cm]",
637  100,
638  -3.15,
639  3.15,
640  100,
641  -100.,
642  100.));
643  vTrack2DHistos_.push_back(
644  tfd.make<TH2F>("h2_chi2_vs_phi", "#chi^{2} vs. #phi;#phi_{Track};#chi^{2}", 100, -3.15, 3.15, 500, 0., 500.));
645  vTrack2DHistos_.push_back(tfd.make<TH2F>("h2_chi2Prob_vs_phi",
646  "#chi^{2} probability vs. #phi;#phi_{Track};#chi^{2} probability",
647  100,
648  -3.15,
649  3.15,
650  100,
651  0.,
652  1.));
653  vTrack2DHistos_.push_back(tfd.make<TH2F>("h2_chi2Prob_vs_d0",
654  "#chi^{2} probability vs. |d_{0}|;|d_{0}| [cm];#chi^{2} probability",
655  100,
656  0,
657  80,
658  100,
659  0.,
660  1.));
661  vTrack2DHistos_.push_back(tfd.make<TH2F>(
662  "h2_normchi2_vs_phi", "#chi^{2}/ndof vs. #phi;#phi_{Track};#chi^{2}/ndof", 100, -3.15, 3.15, 100, 0., 10.));
663  vTrack2DHistos_.push_back(
664  tfd.make<TH2F>("h2_chi2_vs_eta", "#chi^{2} vs. #eta;#eta_{Track};#chi^{2}", 100, -3.15, 3.15, 500, 0., 500.));
665  vTrack2DHistos_.push_back(tfd.make<TH2F>("h2_chi2Prob_vs_eta",
666  "#chi^{2} probaility vs. #eta;#eta_{Track};#chi^{2} probability",
667  100,
668  -3.15,
669  3.15,
670  100,
671  0.,
672  1.));
673  vTrack2DHistos_.push_back(tfd.make<TH2F>(
674  "h2_normchi2_vs_eta", "#chi^{2}/ndof vs. #eta;#eta_{Track};#chi^{2}/ndof", 100, -3.15, 3.15, 100, 0., 10.));
675  vTrack2DHistos_.push_back(
676  tfd.make<TH2F>("h2_kappa_vs_phi", "#kappa vs. #phi;#phi_{Track};#kappa", 100, -3.15, 3.15, 100, .0, .05));
677  vTrack2DHistos_.push_back(
678  tfd.make<TH2F>("h2_kappa_vs_eta", "#kappa vs. #eta;#eta_{Track};#kappa", 100, -3.15, 3.15, 100, .0, .05));
679  vTrack2DHistos_.push_back(tfd.make<TH2F>(
680  "h2_normchi2_vs_kappa", "#kappa vs. #chi^{2}/ndof;#chi^{2}/ndof;#kappa", 100, 0., 10, 100, -.03, .03));
681 
682  /****************** Definition of 2-D Histos of ResX vs momenta ****************************/
683  vTrack2DHistos_.push_back(tfd.make<TH2F>(
684  "p_vs_resXprime_pixB", "res_{x'} vs momentum in BPix;p [GeV]; res_{x'}", 15, 0., 15., 200, -0.1, 0.1));
685  vTrack2DHistos_.push_back(tfd.make<TH2F>(
686  "p_vs_resXprime_pixE", "res_{x'} vs momentum in FPix;p [GeV]; res_{x'}", 15, 0., 15., 200, -0.1, 0.1));
687  vTrack2DHistos_.push_back(tfd.make<TH2F>(
688  "p_vs_resXprime_TIB", "res_{x'} vs momentum in TIB;p [GeV]; res_{x'}", 15, 0., 15., 200, -0.1, 0.1));
689  vTrack2DHistos_.push_back(tfd.make<TH2F>(
690  "p_vs_resXprime_TID", "res_{x'} vs momentum in TID;p [GeV]; res_{x'}", 15, 0., 15., 200, -0.1, 0.1));
691  vTrack2DHistos_.push_back(tfd.make<TH2F>(
692  "p_vs_resXprime_TOB", "res_{x'} vs momentum in TOB;p [GeV]; res_{x'}", 15, 0., 15., 200, -0.1, 0.1));
693  vTrack2DHistos_.push_back(tfd.make<TH2F>(
694  "p_vs_resXprime_TEC", "res_{x'} vs momentum in TEC;p [GeV]; res_{x'}", 15, 0., 15., 200, -0.1, 0.1));
695 
696  /****************** Definition of 2-D Histos of ResY vs momenta ****************************/
697  vTrack2DHistos_.push_back(tfd.make<TH2F>(
698  "p_vs_resYprime_pixB", "res_{y'} vs momentum in BPix;p [GeV]; res_{y'}", 15, 0., 15., 200, -0.1, 0.1));
699  vTrack2DHistos_.push_back(tfd.make<TH2F>(
700  "p_vs_resYprime_pixE", "res_{y'} vs momentum in FPix;p [GeV]; res_{y'}", 15, 0., 15., 200, -0.1, 0.1));
701 }
702 
704  const auto& alivec = ali.components();
705  for (int i = 0, iEnd = ali.components().size(); i < iEnd; ++i) {
706  std::string structurename = alignableTracker_->objectIdProvider().idToString((alivec)[i]->alignableObjectId());
707  LogDebug("TrackerOfflineValidation") << "StructureName = " << structurename;
708  std::stringstream dirname;
709  dirname << structurename;
710  // add no suffix counter to Strip and Pixel, just aesthetics
711  if (structurename != "Strip" && structurename != "Pixel")
712  dirname << "_" << i + 1;
713 
714  if (structurename.find("Endcap", 0) != std::string::npos) {
716  bookHists(f, *(alivec)[i], tTopo, ali.alignableObjectId(), i);
717  bookDirHists(f, *(alivec)[i], tTopo);
718  } else if (!(this->isDetOrDetUnit((alivec)[i]->alignableObjectId())) || alivec[i]->components().size() > 1) {
720  bookHists(tfd, *(alivec)[i], tTopo, ali.alignableObjectId(), i);
721  bookDirHists(f, *(alivec)[i], tTopo);
722  } else {
723  bookHists(tfd, *(alivec)[i], tTopo, ali.alignableObjectId(), i);
724  }
725  }
726 }
727 
729  DirectoryWrapper& tfd, const Alignable& ali, const TrackerTopology* tTopo, align::StructureType type, int i) {
730  TrackerAlignableId aliid;
731  const DetId id = ali.id();
732 
733  // comparing subdetandlayer to subdetIds gives a warning at compile time
734  // -> subdetandlayer could also be pair<uint,uint> but this has to be adapted
735  // in AlignableObjId
736  std::pair<int, int> subdetandlayer = aliid.typeAndLayerFromDetId(id, tTopo);
737 
739 
740  // are we on or just above det, detunit level respectively?
742  subtype = type;
743  else if (this->isDetOrDetUnit(ali.alignableObjectId()))
744  subtype = ali.alignableObjectId();
745 
746  // construct histogram title and name
747  std::stringstream histoname, histotitle, normhistoname, normhistotitle, yhistoname, yhistotitle, xprimehistoname,
748  xprimehistotitle, normxprimehistoname, normxprimehistotitle, yprimehistoname, yprimehistotitle,
749  normyprimehistoname, normyprimehistotitle, localxname, localxtitle, localyname, localytitle, resxvsxprofilename,
750  resxvsxprofiletitle, resyvsxprofilename, resyvsxprofiletitle, resxvsyprofilename, resxvsyprofiletitle,
751  resyvsyprofilename, resyvsyprofiletitle;
752 
753  std::string wheel_or_layer;
754 
755  if (this->isEndCap(static_cast<uint32_t>(subdetandlayer.first)))
756  wheel_or_layer = "_wheel_";
757  else if (this->isBarrel(static_cast<uint32_t>(subdetandlayer.first)))
758  wheel_or_layer = "_layer_";
759  else
760  edm::LogWarning("TrackerOfflineValidation") << "@SUB=TrackerOfflineValidation::bookHists"
761  << "Unknown subdetid: " << subdetandlayer.first;
762 
763  histoname << "h_residuals_subdet_" << subdetandlayer.first << wheel_or_layer << subdetandlayer.second << "_module_"
764  << id.rawId();
765  yhistoname << "h_y_residuals_subdet_" << subdetandlayer.first << wheel_or_layer << subdetandlayer.second << "_module_"
766  << id.rawId();
767  xprimehistoname << "h_xprime_residuals_subdet_" << subdetandlayer.first << wheel_or_layer << subdetandlayer.second
768  << "_module_" << id.rawId();
769  yprimehistoname << "h_yprime_residuals_subdet_" << subdetandlayer.first << wheel_or_layer << subdetandlayer.second
770  << "_module_" << id.rawId();
771  normhistoname << "h_normresiduals_subdet_" << subdetandlayer.first << wheel_or_layer << subdetandlayer.second
772  << "_module_" << id.rawId();
773  normxprimehistoname << "h_normxprimeresiduals_subdet_" << subdetandlayer.first << wheel_or_layer
774  << subdetandlayer.second << "_module_" << id.rawId();
775  normyprimehistoname << "h_normyprimeresiduals_subdet_" << subdetandlayer.first << wheel_or_layer
776  << subdetandlayer.second << "_module_" << id.rawId();
777  histotitle << "X Residual for module " << id.rawId() << ";x_{tr} - x_{hit} [cm]";
778  yhistotitle << "Y Residual for module " << id.rawId() << ";y_{tr} - y_{hit} [cm]";
779  normhistotitle << "Normalized Residual for module " << id.rawId() << ";x_{tr} - x_{hit}/#sigma";
780  xprimehistotitle << "X' Residual for module " << id.rawId() << ";(x_{tr} - x_{hit})' [cm]";
781  normxprimehistotitle << "Normalized X' Residual for module " << id.rawId() << ";(x_{tr} - x_{hit})'/#sigma";
782  yprimehistotitle << "Y' Residual for module " << id.rawId() << ";(y_{tr} - y_{hit})' [cm]";
783  normyprimehistotitle << "Normalized Y' Residual for module " << id.rawId() << ";(y_{tr} - y_{hit})'/#sigma";
784 
785  if (moduleLevelProfiles_) {
786  localxname << "h_localx_subdet_" << subdetandlayer.first << wheel_or_layer << subdetandlayer.second << "_module_"
787  << id.rawId();
788  localyname << "h_localy_subdet_" << subdetandlayer.first << wheel_or_layer << subdetandlayer.second << "_module_"
789  << id.rawId();
790  localxtitle << "u local for module " << id.rawId() << "; u_{tr,r}";
791  localytitle << "v local for module " << id.rawId() << "; v_{tr,r}";
792 
793  resxvsxprofilename << "p_residuals_x_vs_x_subdet_" << subdetandlayer.first << wheel_or_layer
794  << subdetandlayer.second << "_module_" << id.rawId();
795  resyvsxprofilename << "p_residuals_y_vs_x_subdet_" << subdetandlayer.first << wheel_or_layer
796  << subdetandlayer.second << "_module_" << id.rawId();
797  resxvsyprofilename << "p_residuals_x_vs_y_subdet_" << subdetandlayer.first << wheel_or_layer
798  << subdetandlayer.second << "_module_" << id.rawId();
799  resyvsyprofilename << "p_residuals_y_vs_y_subdet_" << subdetandlayer.first << wheel_or_layer
800  << subdetandlayer.second << "_module_" << id.rawId();
801  resxvsxprofiletitle << "U Residual vs u for module " << id.rawId()
802  << "; u_{tr,r} ;(u_{tr} - u_{hit})/tan#alpha [cm]";
803  resyvsxprofiletitle << "V Residual vs u for module " << id.rawId()
804  << "; u_{tr,r} ;(v_{tr} - v_{hit})/tan#beta [cm]";
805  resxvsyprofiletitle << "U Residual vs v for module " << id.rawId()
806  << "; v_{tr,r} ;(u_{tr} - u_{hit})/tan#alpha [cm]";
807  resyvsyprofiletitle << "V Residual vs v for module " << id.rawId()
808  << "; v_{tr,r} ;(v_{tr} - v_{hit})/tan#beta [cm]";
809  }
810 
811  if (this->isDetOrDetUnit(subtype)) {
812  ModuleHistos& histStruct = this->getHistStructFromMap(id);
813  int nbins = 0;
814  double xmin = 0., xmax = 0.;
815  double ymin = -0.1, ymax = 0.1;
816 
817  // do not allow transient hists in DQM mode
819  if (dqmMode_)
820  moduleLevelHistsTransient = false;
821 
822  // decide via cfg if hists in local coordinates should be booked
823  if (lCoorHistOn_) {
824  this->getBinning(id.subdetId(), XResidual, nbins, xmin, xmax);
825  histStruct.ResHisto = this->bookTH1F(
826  moduleLevelHistsTransient, tfd, histoname.str().c_str(), histotitle.str().c_str(), nbins, xmin, xmax);
827  this->getBinning(id.subdetId(), NormXResidual, nbins, xmin, xmax);
828  histStruct.NormResHisto = this->bookTH1F(
829  moduleLevelHistsTransient, tfd, normhistoname.str().c_str(), normhistotitle.str().c_str(), nbins, xmin, xmax);
830  }
831  this->getBinning(id.subdetId(), XprimeResidual, nbins, xmin, xmax);
832  histStruct.ResXprimeHisto = this->bookTH1F(moduleLevelHistsTransient,
833  tfd,
834  xprimehistoname.str().c_str(),
835  xprimehistotitle.str().c_str(),
836  nbins,
837  xmin,
838  xmax);
839  this->getBinning(id.subdetId(), NormXprimeResidual, nbins, xmin, xmax);
840  histStruct.NormResXprimeHisto = this->bookTH1F(moduleLevelHistsTransient,
841  tfd,
842  normxprimehistoname.str().c_str(),
843  normxprimehistotitle.str().c_str(),
844  nbins,
845  xmin,
846  xmax);
847 
848  if (moduleLevelProfiles_) {
849  this->getBinning(id.subdetId(), XResidualProfile, nbins, xmin, xmax);
850 
851  histStruct.LocalX = this->bookTH1F(
852  moduleLevelHistsTransient, tfd, localxname.str().c_str(), localxtitle.str().c_str(), nbins, xmin, xmax);
853  histStruct.LocalY = this->bookTH1F(
854  moduleLevelHistsTransient, tfd, localyname.str().c_str(), localytitle.str().c_str(), nbins, xmin, xmax);
855  histStruct.ResXvsXProfile = this->bookTProfile(moduleLevelHistsTransient,
856  tfd,
857  resxvsxprofilename.str().c_str(),
858  resxvsxprofiletitle.str().c_str(),
859  nbins,
860  xmin,
861  xmax,
862  ymin,
863  ymax);
864  histStruct.ResXvsXProfile->Sumw2(); // to be filled with weights, so uncertainties need sum of square of weights
865  histStruct.ResXvsYProfile = this->bookTProfile(moduleLevelHistsTransient,
866  tfd,
867  resxvsyprofilename.str().c_str(),
868  resxvsyprofiletitle.str().c_str(),
869  nbins,
870  xmin,
871  xmax,
872  ymin,
873  ymax);
874  histStruct.ResXvsYProfile->Sumw2(); // to be filled with weights, so uncertainties need sum of square of weights
875  }
876 
877  if (this->isPixel(subdetandlayer.first) || stripYResiduals_) {
878  this->getBinning(id.subdetId(), YprimeResidual, nbins, xmin, xmax);
879  histStruct.ResYprimeHisto = this->bookTH1F(moduleLevelHistsTransient,
880  tfd,
881  yprimehistoname.str().c_str(),
882  yprimehistotitle.str().c_str(),
883  nbins,
884  xmin,
885  xmax);
886  if (lCoorHistOn_) { // un-primed y-residual
887  this->getBinning(id.subdetId(), YResidual, nbins, xmin, xmax);
888  histStruct.ResYHisto = this->bookTH1F(
889  moduleLevelHistsTransient, tfd, yhistoname.str().c_str(), yhistotitle.str().c_str(), nbins, xmin, xmax);
890  }
891  this->getBinning(id.subdetId(), NormYprimeResidual, nbins, xmin, xmax);
892  histStruct.NormResYprimeHisto = this->bookTH1F(moduleLevelHistsTransient,
893  tfd,
894  normyprimehistoname.str().c_str(),
895  normyprimehistotitle.str().c_str(),
896  nbins,
897  xmin,
898  xmax);
899  // Here we could add un-primed normalised y-residuals if(lCoorHistOn_)...
900  if (moduleLevelProfiles_) {
901  this->getBinning(id.subdetId(), YResidualProfile, nbins, xmin, xmax);
902 
903  histStruct.ResYvsXProfile = this->bookTProfile(moduleLevelHistsTransient,
904  tfd,
905  resyvsxprofilename.str().c_str(),
906  resyvsxprofiletitle.str().c_str(),
907  nbins,
908  xmin,
909  xmax,
910  ymin,
911  ymax);
912  histStruct.ResYvsXProfile->Sumw2(); // to be filled with weights, so uncertainties need sum of square of weights
913  histStruct.ResYvsYProfile = this->bookTProfile(moduleLevelHistsTransient,
914  tfd,
915  resyvsyprofilename.str().c_str(),
916  resyvsyprofiletitle.str().c_str(),
917  nbins,
918  xmin,
919  xmax,
920  ymin,
921  ymax);
922  histStruct.ResYvsYProfile->Sumw2(); // to be filled with weights, so uncertainties need sum of square of weights
923  }
924  }
925  }
926 }
927 
929  DirectoryWrapper& tfd,
930  const char* histName,
931  const char* histTitle,
932  int nBinsX,
933  double lowX,
934  double highX) {
935  if (isTransient) {
936  vDeleteObjects_.push_back(new TH1F(histName, histTitle, nBinsX, lowX, highX));
937  return vDeleteObjects_.back(); // return last element of vector
938  } else
939  return tfd.make<TH1F>(histName, histTitle, nBinsX, lowX, highX);
940 }
941 
942 TProfile* TrackerOfflineValidation::bookTProfile(bool isTransient,
943  DirectoryWrapper& tfd,
944  const char* histName,
945  const char* histTitle,
946  int nBinsX,
947  double lowX,
948  double highX) {
949  if (isTransient) {
950  TProfile* profile = new TProfile(histName, histTitle, nBinsX, lowX, highX);
951  vDeleteObjects_.push_back(profile);
952  return profile;
953  } else
954  return (TProfile*)tfd.make<TProfile>(histName, histTitle, nBinsX, lowX, highX);
955 }
956 
957 TProfile* TrackerOfflineValidation::bookTProfile(bool isTransient,
958  DirectoryWrapper& tfd,
959  const char* histName,
960  const char* histTitle,
961  int nBinsX,
962  double lowX,
963  double highX,
964  double lowY,
965  double highY) {
966  if (isTransient) {
967  TProfile* profile = new TProfile(histName, histTitle, nBinsX, lowX, highX, lowY, highY);
968  vDeleteObjects_.push_back(profile);
969  return profile;
970  } else
971  return (TProfile*)tfd.make<TProfile>(histName, histTitle, nBinsX, lowX, highX, lowY, highY);
972 }
973 
977 }
978 
982 }
983 
986 }
987 
990 }
991 
994  int& nBinsX,
995  double& lowerBoundX,
996  double& upperBoundX) {
997  // determine if
998  const bool isPixel = this->isPixel(subDetId);
999 
1000  edm::ParameterSet binningPSet;
1001 
1002  switch (residualType) {
1003  case XResidual:
1004  if (isPixel)
1005  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1XResPixelModules");
1006  else
1007  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1XResStripModules");
1008  break;
1009  case NormXResidual:
1010  if (isPixel)
1011  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1NormXResPixelModules");
1012  else
1013  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1NormXResStripModules");
1014  break;
1015  case XprimeResidual:
1016  if (isPixel)
1017  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1XprimeResPixelModules");
1018  else
1019  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1XprimeResStripModules");
1020  break;
1021  case NormXprimeResidual:
1022  if (isPixel)
1023  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1NormXprimeResPixelModules");
1024  else
1025  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1NormXprimeResStripModules");
1026  break;
1027  case YResidual: // borrow y-residual binning from yprime
1028  case YprimeResidual:
1029  if (isPixel)
1030  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1YResPixelModules");
1031  else
1032  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1YResStripModules");
1033  break;
1034  /* case NormYResidual :*/
1035  case NormYprimeResidual:
1036  if (isPixel)
1037  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1NormYResPixelModules");
1038  else
1039  binningPSet = parSet_.getParameter<edm::ParameterSet>("TH1NormYResStripModules");
1040  break;
1041  case XResidualProfile:
1042  if (isPixel)
1043  binningPSet = parSet_.getParameter<edm::ParameterSet>("TProfileXResPixelModules");
1044  else
1045  binningPSet = parSet_.getParameter<edm::ParameterSet>("TProfileXResStripModules");
1046  break;
1047  case YResidualProfile:
1048  if (isPixel)
1049  binningPSet = parSet_.getParameter<edm::ParameterSet>("TProfileYResPixelModules");
1050  else
1051  binningPSet = parSet_.getParameter<edm::ParameterSet>("TProfileYResStripModules");
1052  break;
1053  }
1054  nBinsX = binningPSet.getParameter<int32_t>("Nbinx");
1055  lowerBoundX = binningPSet.getParameter<double>("xmin");
1056  upperBoundX = binningPSet.getParameter<double>("xmax");
1057 }
1058 
1059 void TrackerOfflineValidation::setSummaryBin(int bin, TH1* targetHist, TH1* sourceHist) {
1060  if (targetHist && sourceHist) {
1061  targetHist->SetBinContent(bin, sourceHist->GetMean(1));
1062  if (useFwhm_)
1063  targetHist->SetBinError(bin, Fwhm(sourceHist) / 2.);
1064  else
1065  targetHist->SetBinError(bin, sourceHist->GetRMS(1));
1066  } else
1067  return;
1068 }
1069 
1071  SummaryContainer& targetContainer,
1072  SummaryContainer& sourceContainer) {
1073  summaryBins_.emplace_back(bin, targetContainer.summaryXResiduals_, sourceContainer.sumXResiduals_);
1074  summaryBins_.emplace_back(bin, targetContainer.summaryNormXResiduals_, sourceContainer.sumNormXResiduals_);
1075  // If no y-residual hists, just returns:
1076  summaryBins_.emplace_back(bin, targetContainer.summaryYResiduals_, sourceContainer.sumYResiduals_);
1077  summaryBins_.emplace_back(bin, targetContainer.summaryNormYResiduals_, sourceContainer.sumNormYResiduals_);
1078 }
1079 
1081  uint32_t subDetId,
1082  SummaryContainer& targetContainer,
1083  ModuleHistos& sourceContainer) {
1084  // takes two summary Containers and sets summaryBins for all histograms
1085  summaryBins_.emplace_back(bin, targetContainer.summaryXResiduals_, sourceContainer.ResXprimeHisto);
1086  summaryBins_.emplace_back(bin, targetContainer.summaryNormXResiduals_, sourceContainer.NormResXprimeHisto);
1087  if (this->isPixel(subDetId) || stripYResiduals_) {
1088  summaryBins_.emplace_back(bin, targetContainer.summaryYResiduals_, sourceContainer.ResYprimeHisto);
1089  summaryBins_.emplace_back(bin, targetContainer.summaryNormYResiduals_, sourceContainer.NormResYprimeHisto);
1090  }
1091 }
1092 
1094  // get a struct with histograms from the respective map
1095  // if no object exist, the reference is automatically created by the map
1096  // throw exception if non-tracker id is passed
1097  uint subdetid = detid.subdetId();
1098  if (subdetid == PixelSubdetector::PixelBarrel) {
1099  return mPxbResiduals_[detid.rawId()];
1100  } else if (subdetid == PixelSubdetector::PixelEndcap) {
1101  return mPxeResiduals_[detid.rawId()];
1102  } else if (subdetid == StripSubdetector::TIB) {
1103  return mTibResiduals_[detid.rawId()];
1104  } else if (subdetid == StripSubdetector::TID) {
1105  return mTidResiduals_[detid.rawId()];
1106  } else if (subdetid == StripSubdetector::TOB) {
1107  return mTobResiduals_[detid.rawId()];
1108  } else if (subdetid == StripSubdetector::TEC) {
1109  return mTecResiduals_[detid.rawId()];
1110  } else {
1111  throw cms::Exception("Geometry Error")
1112  << "[TrackerOfflineValidation] Error, tried to get reference for non-tracker subdet " << subdetid
1113  << " from detector " << detid.det();
1114  return mPxbResiduals_[0];
1115  }
1116 }
1117 
1118 // ------------ method called to for each event ------------
1120  if (maxTracks_ > 0 && nTracks_ >= maxTracks_)
1121  return; //don't do anything after hitting the max number of tracks
1122  //(could just rely on break below, but this way saves fillTrackQuantities)
1123 
1124  if (useOverflowForRMS_)
1125  TH1::StatOverflows(kTRUE);
1126  this->checkBookHists(iSetup); // check whether hists are booked and do so if not yet done
1127 
1128  std::vector<TrackerValidationVariables::AVTrackStruct> vTrackstruct;
1129  avalidator_.fillTrackQuantities(iEvent, iSetup, vTrackstruct);
1130 
1131  for (std::vector<TrackerValidationVariables::AVTrackStruct>::const_iterator itT = vTrackstruct.begin();
1132  itT != vTrackstruct.end();
1133  ++itT) {
1134  if (itT->charge * chargeCut_ < 0)
1135  continue;
1136 
1137  if (maxTracks_ > 0 && nTracks_++ >= maxTracks_)
1138  break; //exit the loop after hitting the max number of tracks
1139  // Fill 1D track histos
1140  static const int etaindex = this->GetIndex(vTrackHistos_, "h_tracketa");
1141  vTrackHistos_[etaindex]->Fill(itT->eta);
1142  static const int phiindex = this->GetIndex(vTrackHistos_, "h_trackphi");
1143  vTrackHistos_[phiindex]->Fill(itT->phi);
1144  static const int numOfValidHitsindex = this->GetIndex(vTrackHistos_, "h_trackNumberOfValidHits");
1145  vTrackHistos_[numOfValidHitsindex]->Fill(itT->numberOfValidHits);
1146  static const int numOfLostHitsindex = this->GetIndex(vTrackHistos_, "h_trackNumberOfLostHits");
1147  vTrackHistos_[numOfLostHitsindex]->Fill(itT->numberOfLostHits);
1148  static const int kappaindex = this->GetIndex(vTrackHistos_, "h_curvature");
1149  vTrackHistos_[kappaindex]->Fill(itT->kappa);
1150  static const int kappaposindex = this->GetIndex(vTrackHistos_, "h_curvature_pos");
1151  if (itT->charge > 0)
1152  vTrackHistos_[kappaposindex]->Fill(fabs(itT->kappa));
1153  static const int kappanegindex = this->GetIndex(vTrackHistos_, "h_curvature_neg");
1154  if (itT->charge < 0)
1155  vTrackHistos_[kappanegindex]->Fill(fabs(itT->kappa));
1156  static const int normchi2index = this->GetIndex(vTrackHistos_, "h_normchi2");
1157  vTrackHistos_[normchi2index]->Fill(itT->normchi2);
1158  static const int chi2index = this->GetIndex(vTrackHistos_, "h_chi2");
1159  vTrackHistos_[chi2index]->Fill(itT->chi2);
1160  static const int chi2Probindex = this->GetIndex(vTrackHistos_, "h_chi2Prob");
1161  vTrackHistos_[chi2Probindex]->Fill(itT->chi2Prob);
1162  static const int ptindex = this->GetIndex(vTrackHistos_, "h_pt");
1163  vTrackHistos_[ptindex]->Fill(itT->pt);
1164  if (itT->ptError != 0.) {
1165  static const int ptResolutionindex = this->GetIndex(vTrackHistos_, "h_ptResolution");
1166  vTrackHistos_[ptResolutionindex]->Fill(itT->ptError / itT->pt);
1167  }
1168  // Fill track profiles
1169  static const int d0phiindex = this->GetIndex(vTrackProfiles_, "p_d0_vs_phi");
1170  vTrackProfiles_[d0phiindex]->Fill(itT->phi, itT->d0);
1171  static const int dzphiindex = this->GetIndex(vTrackProfiles_, "p_dz_vs_phi");
1172  vTrackProfiles_[dzphiindex]->Fill(itT->phi, itT->dz);
1173  static const int d0etaindex = this->GetIndex(vTrackProfiles_, "p_d0_vs_eta");
1174  vTrackProfiles_[d0etaindex]->Fill(itT->eta, itT->d0);
1175  static const int dzetaindex = this->GetIndex(vTrackProfiles_, "p_dz_vs_eta");
1176  vTrackProfiles_[dzetaindex]->Fill(itT->eta, itT->dz);
1177  static const int chiphiindex = this->GetIndex(vTrackProfiles_, "p_chi2_vs_phi");
1178  vTrackProfiles_[chiphiindex]->Fill(itT->phi, itT->chi2);
1179  static const int chiProbphiindex = this->GetIndex(vTrackProfiles_, "p_chi2Prob_vs_phi");
1180  vTrackProfiles_[chiProbphiindex]->Fill(itT->phi, itT->chi2Prob);
1181  static const int chiProbabsd0index = this->GetIndex(vTrackProfiles_, "p_chi2Prob_vs_d0");
1182  vTrackProfiles_[chiProbabsd0index]->Fill(fabs(itT->d0), itT->chi2Prob);
1183  static const int normchiphiindex = this->GetIndex(vTrackProfiles_, "p_normchi2_vs_phi");
1184  vTrackProfiles_[normchiphiindex]->Fill(itT->phi, itT->normchi2);
1185  static const int chietaindex = this->GetIndex(vTrackProfiles_, "p_chi2_vs_eta");
1186  vTrackProfiles_[chietaindex]->Fill(itT->eta, itT->chi2);
1187  static const int normchiptindex = this->GetIndex(vTrackProfiles_, "p_normchi2_vs_pt");
1188  vTrackProfiles_[normchiptindex]->Fill(itT->pt, itT->normchi2);
1189  static const int normchipindex = this->GetIndex(vTrackProfiles_, "p_normchi2_vs_p");
1190  vTrackProfiles_[normchipindex]->Fill(itT->p, itT->normchi2);
1191  static const int chiProbetaindex = this->GetIndex(vTrackProfiles_, "p_chi2Prob_vs_eta");
1192  vTrackProfiles_[chiProbetaindex]->Fill(itT->eta, itT->chi2Prob);
1193  static const int normchietaindex = this->GetIndex(vTrackProfiles_, "p_normchi2_vs_eta");
1194  vTrackProfiles_[normchietaindex]->Fill(itT->eta, itT->normchi2);
1195  static const int kappaphiindex = this->GetIndex(vTrackProfiles_, "p_kappa_vs_phi");
1196  vTrackProfiles_[kappaphiindex]->Fill(itT->phi, itT->kappa);
1197  static const int kappaetaindex = this->GetIndex(vTrackProfiles_, "p_kappa_vs_eta");
1198  vTrackProfiles_[kappaetaindex]->Fill(itT->eta, itT->kappa);
1199  static const int ptResphiindex = this->GetIndex(vTrackProfiles_, "p_ptResolution_vs_phi");
1200  vTrackProfiles_[ptResphiindex]->Fill(itT->phi, itT->ptError / itT->pt);
1201  static const int ptResetaindex = this->GetIndex(vTrackProfiles_, "p_ptResolution_vs_eta");
1202  vTrackProfiles_[ptResetaindex]->Fill(itT->eta, itT->ptError / itT->pt);
1203 
1204  // Fill 2D track histos
1205  static const int d0phiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_d0_vs_phi");
1206  vTrack2DHistos_[d0phiindex_2d]->Fill(itT->phi, itT->d0);
1207  static const int dzphiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_dz_vs_phi");
1208  vTrack2DHistos_[dzphiindex_2d]->Fill(itT->phi, itT->dz);
1209  static const int d0etaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_d0_vs_eta");
1210  vTrack2DHistos_[d0etaindex_2d]->Fill(itT->eta, itT->d0);
1211  static const int dzetaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_dz_vs_eta");
1212  vTrack2DHistos_[dzetaindex_2d]->Fill(itT->eta, itT->dz);
1213  static const int chiphiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_chi2_vs_phi");
1214  vTrack2DHistos_[chiphiindex_2d]->Fill(itT->phi, itT->chi2);
1215  static const int chiProbphiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_chi2Prob_vs_phi");
1216  vTrack2DHistos_[chiProbphiindex_2d]->Fill(itT->phi, itT->chi2Prob);
1217  static const int chiProbabsd0index_2d = this->GetIndex(vTrack2DHistos_, "h2_chi2Prob_vs_d0");
1218  vTrack2DHistos_[chiProbabsd0index_2d]->Fill(fabs(itT->d0), itT->chi2Prob);
1219  static const int normchiphiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_normchi2_vs_phi");
1220  vTrack2DHistos_[normchiphiindex_2d]->Fill(itT->phi, itT->normchi2);
1221  static const int chietaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_chi2_vs_eta");
1222  vTrack2DHistos_[chietaindex_2d]->Fill(itT->eta, itT->chi2);
1223  static const int chiProbetaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_chi2Prob_vs_eta");
1224  vTrack2DHistos_[chiProbetaindex_2d]->Fill(itT->eta, itT->chi2Prob);
1225  static const int normchietaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_normchi2_vs_eta");
1226  vTrack2DHistos_[normchietaindex_2d]->Fill(itT->eta, itT->normchi2);
1227  static const int kappaphiindex_2d = this->GetIndex(vTrack2DHistos_, "h2_kappa_vs_phi");
1228  vTrack2DHistos_[kappaphiindex_2d]->Fill(itT->phi, itT->kappa);
1229  static const int kappaetaindex_2d = this->GetIndex(vTrack2DHistos_, "h2_kappa_vs_eta");
1230  vTrack2DHistos_[kappaetaindex_2d]->Fill(itT->eta, itT->kappa);
1231  static const int normchi2kappa_2d = this->GetIndex(vTrack2DHistos_, "h2_normchi2_vs_kappa");
1232  vTrack2DHistos_[normchi2kappa_2d]->Fill(itT->normchi2, itT->kappa);
1233 
1234  // hit quantities: residuals, normalized residuals
1235  for (std::vector<TrackerValidationVariables::AVHitStruct>::const_iterator itH = itT->hits.begin();
1236  itH != itT->hits.end();
1237  ++itH) {
1238  DetId detid(itH->rawDetId);
1239  ModuleHistos& histStruct = this->getHistStructFromMap(detid);
1240 
1241  // fill histos in local coordinates if set in cf
1242  if (lCoorHistOn_) {
1243  histStruct.ResHisto->Fill(itH->resX);
1244  if (itH->resErrX != 0)
1245  histStruct.NormResHisto->Fill(itH->resX / itH->resErrX);
1246  if (this->isPixel(detid.subdetId()) || stripYResiduals_) {
1247  histStruct.ResYHisto->Fill(itH->resY);
1248  // here add un-primed normalised y-residuals if wanted
1249  }
1250  }
1251  if (itH->resXprime != -999.) {
1252  histStruct.ResXprimeHisto->Fill(itH->resXprime);
1253 
1254  /******************************* Fill 2-D histo ResX vs momenta *****************************/
1255  if (detid.subdetId() == PixelSubdetector::PixelBarrel) {
1256  static const int resXvsPindex_2d = this->GetIndex(vTrack2DHistos_, "p_vs_resXprime_pixB");
1257  vTrack2DHistos_[resXvsPindex_2d]->Fill(itT->p, itH->resXprime);
1258  }
1259  if (detid.subdetId() == PixelSubdetector::PixelEndcap) {
1260  static const int resXvsPindex_2d = this->GetIndex(vTrack2DHistos_, "p_vs_resXprime_pixE");
1261  vTrack2DHistos_[resXvsPindex_2d]->Fill(itT->p, itH->resXprime);
1262  }
1263  if (detid.subdetId() == StripSubdetector::TIB) {
1264  static const int resXvsPindex_2d = this->GetIndex(vTrack2DHistos_, "p_vs_resXprime_TIB");
1265  vTrack2DHistos_[resXvsPindex_2d]->Fill(itT->p, itH->resXprime);
1266  }
1267  if (detid.subdetId() == StripSubdetector::TID) {
1268  static const int resXvsPindex_2d = this->GetIndex(vTrack2DHistos_, "p_vs_resXprime_TID");
1269  vTrack2DHistos_[resXvsPindex_2d]->Fill(itT->p, itH->resXprime);
1270  }
1271  if (detid.subdetId() == StripSubdetector::TOB) {
1272  static const int resXvsPindex_2d = this->GetIndex(vTrack2DHistos_, "p_vs_resXprime_TOB");
1273  vTrack2DHistos_[resXvsPindex_2d]->Fill(itT->p, itH->resXprime);
1274  }
1275  if (detid.subdetId() == StripSubdetector::TEC) {
1276  static const int resXvsPindex_2d = this->GetIndex(vTrack2DHistos_, "p_vs_resXprime_TEC");
1277  vTrack2DHistos_[resXvsPindex_2d]->Fill(itT->p, itH->resXprime);
1278  }
1279  /******************************************/
1280 
1281  if (moduleLevelProfiles_ && itH->inside) {
1282  float tgalpha = tan(itH->localAlpha);
1283  if (fabs(tgalpha) != 0) {
1284  histStruct.LocalX->Fill(itH->localXnorm, tgalpha * tgalpha);
1285  histStruct.LocalY->Fill(itH->localYnorm, tgalpha * tgalpha);
1286  /* if (this->isEndCap(detid.subdetId()) && !this->isPixel(detid.subdetId())) {
1287  if((itH->resX)*(itH->resXprime)>0){
1288  histStruct.ResXvsXProfile->Fill(itH->localXnorm, itH->resXatTrkY/tgalpha, tgalpha*tgalpha);
1289  histStruct.ResXvsYProfile->Fill(itH->localYnorm, itH->resXatTrkY/tgalpha, tgalpha*tgalpha);
1290  } else {
1291  histStruct.ResXvsXProfile->Fill(itH->localXnorm, (-1)*itH->resXatTrkY/tgalpha, tgalpha*tgalpha);
1292  histStruct.ResXvsYProfile->Fill(itH->localYnorm, (-1)*itH->resXatTrkY/tgalpha, tgalpha*tgalpha);
1293  }
1294 
1295  }else {
1296 */
1297  histStruct.ResXvsXProfile->Fill(itH->localXnorm, itH->resXatTrkY / tgalpha, tgalpha * tgalpha);
1298  histStruct.ResXvsYProfile->Fill(itH->localYnorm, itH->resXatTrkY / tgalpha, tgalpha * tgalpha);
1299 
1300  // }
1301  }
1302  }
1303 
1304  if (itH->resXprimeErr != 0 && itH->resXprimeErr != -999) {
1305  histStruct.NormResXprimeHisto->Fill(itH->resXprime / itH->resXprimeErr);
1306  }
1307  }
1308 
1309  if (itH->resYprime != -999.) {
1310  if (this->isPixel(detid.subdetId()) || stripYResiduals_) {
1311  histStruct.ResYprimeHisto->Fill(itH->resYprime);
1312 
1313  /******************************* Fill 2-D histo ResY vs momenta *****************************/
1314  if (detid.subdetId() == PixelSubdetector::PixelBarrel) {
1315  static const int resYvsPindex_2d = this->GetIndex(vTrack2DHistos_, "p_vs_resYprime_pixB");
1316  vTrack2DHistos_[resYvsPindex_2d]->Fill(itT->p, itH->resYprime);
1317  }
1318  if (detid.subdetId() == PixelSubdetector::PixelEndcap) {
1319  static const int resYvsPindex_2d = this->GetIndex(vTrack2DHistos_, "p_vs_resYprime_pixE");
1320  vTrack2DHistos_[resYvsPindex_2d]->Fill(itT->p, itH->resYprime);
1321  }
1322  /******************************************/
1323 
1324  if (moduleLevelProfiles_ && itH->inside) {
1325  float tgbeta = tan(itH->localBeta);
1326  if (fabs(tgbeta) != 0) {
1327  /* if (this->isEndCap(detid.subdetId()) && !this->isPixel(detid.subdetId())) {
1328 
1329  if((itH->resY)*(itH->resYprime)>0){
1330  histStruct.ResYvsXProfile->Fill(itH->localXnorm, itH->resYprime/tgbeta, tgbeta*tgbeta);
1331  histStruct.ResYvsYProfile->Fill(itH->localYnorm, itH->resYprime/tgbeta, tgbeta*tgbeta);
1332  } else {
1333  histStruct.ResYvsXProfile->Fill(itH->localXnorm, (-1)*itH->resYprime/tgbeta, tgbeta*tgbeta);
1334  histStruct.ResYvsYProfile->Fill(itH->localYnorm, (-1)*itH->resYprime/tgbeta, tgbeta*tgbeta);
1335  }
1336 
1337  }else {
1338 */
1339  histStruct.ResYvsXProfile->Fill(itH->localXnorm, itH->resY / tgbeta, tgbeta * tgbeta);
1340  histStruct.ResYvsYProfile->Fill(itH->localYnorm, itH->resY / tgbeta, tgbeta * tgbeta);
1341  // }
1342  }
1343  }
1344 
1345  if (itH->resYprimeErr != 0 && itH->resYprimeErr != -999.) {
1346  histStruct.NormResYprimeHisto->Fill(itH->resYprime / itH->resYprimeErr);
1347  }
1348  }
1349  }
1350 
1351  } // finish loop over hit quantities
1352  } // finish loop over track quantities
1353 
1354  if (useOverflowForRMS_)
1355  TH1::StatOverflows(kFALSE);
1356 }
1357 
1358 // ------------ method called once each job just after ending the event loop ------------
1360  if (!tkGeom_.product())
1361  return;
1362 
1363  static const int kappadiffindex = this->GetIndex(vTrackHistos_, "h_diff_curvature");
1364  vTrackHistos_[kappadiffindex]->Add(vTrackHistos_[this->GetIndex(vTrackHistos_, "h_curvature_neg")],
1365  vTrackHistos_[this->GetIndex(vTrackHistos_, "h_curvature_pos")],
1366  -1,
1367  1);
1368 
1369  // Collate Information for Subdetectors
1370  // create summary histograms recursively
1371  this->collateSummaryHists();
1372 
1373  if (dqmMode_)
1374  return;
1375  // Should be excluded in dqmMode, since TTree is not usable
1376  // In dqmMode tree operations are are sourced out to the additional module TrackerOfflineValidationSummary
1377 
1379  if (compressionSettings_ > 0) {
1380  fs->file().SetCompressionSettings(compressionSettings_);
1381  }
1382 
1383  TTree* tree = fs->make<TTree>("TkOffVal", "TkOffVal");
1384 
1385  TkOffTreeVariables* treeMemPtr = new TkOffTreeVariables;
1386  // We create branches for all members of 'TkOffTreeVariables' (even if not needed).
1387  // This works because we have a dictionary for 'TkOffTreeVariables'
1388  // (see src/classes_def.xml and src/classes.h):
1389  tree->Branch("TkOffTreeVariables", &treeMemPtr); // address of pointer!
1390 
1391  this->fillTree(*tree, *treeMemPtr, mPxbResiduals_);
1392  this->fillTree(*tree, *treeMemPtr, mPxeResiduals_);
1393  this->fillTree(*tree, *treeMemPtr, mTibResiduals_);
1394  this->fillTree(*tree, *treeMemPtr, mTidResiduals_);
1395  this->fillTree(*tree, *treeMemPtr, mTobResiduals_);
1396  this->fillTree(*tree, *treeMemPtr, mTecResiduals_);
1397 
1398  delete treeMemPtr;
1399  treeMemPtr = nullptr;
1400 }
1401 
1403  DirectoryWrapper& tfd,
1404  const Alignable& ali,
1405  std::vector<TrackerOfflineValidation::SummaryContainer>& vLevelProfiles) {
1406  const auto& alivec = ali.components();
1407  if (this->isDetOrDetUnit((alivec)[0]->alignableObjectId()))
1408  return;
1409 
1410  for (int iComp = 0, iCompEnd = ali.components().size(); iComp < iCompEnd; ++iComp) {
1411  std::vector<TrackerOfflineValidation::SummaryContainer> vProfiles;
1412  std::string structurename = alignableTracker_->objectIdProvider().idToString((alivec)[iComp]->alignableObjectId());
1413 
1414  LogDebug("TrackerOfflineValidation") << "StructureName = " << structurename;
1415  std::stringstream dirname;
1416  dirname << structurename;
1417 
1418  // add no suffix counter to strip and pixel -> just aesthetics
1419  if (structurename != "Strip" && structurename != "Pixel")
1420  dirname << "_" << iComp + 1;
1421 
1422  if (!(this->isDetOrDetUnit((alivec)[iComp]->alignableObjectId())) || (alivec)[0]->components().size() > 1) {
1424  this->prepareSummaryHists(f, *(alivec)[iComp], vProfiles);
1425  vLevelProfiles.push_back(this->bookSummaryHists(tfd, *(alivec[iComp]), ali.alignableObjectId(), iComp + 1));
1426  TH1* hX = vLevelProfiles[iComp].sumXResiduals_;
1427  TH1* hNormX = vLevelProfiles[iComp].sumNormXResiduals_;
1428  TH1* hY = vLevelProfiles[iComp].sumYResiduals_;
1429  TH1* hNormY = vLevelProfiles[iComp].sumNormYResiduals_;
1430  TH1* pXX = vLevelProfiles[iComp].sumResXvsXProfile_;
1431  TH1* pXY = vLevelProfiles[iComp].sumResXvsYProfile_;
1432  TH1* pYX = vLevelProfiles[iComp].sumResYvsXProfile_;
1433  TH1* pYY = vLevelProfiles[iComp].sumResYvsYProfile_;
1434  for (uint n = 0; n < vProfiles.size(); ++n) {
1435  this->summarizeBinInContainer(n + 1, vLevelProfiles[iComp], vProfiles[n]);
1436  sumHistStructure_.emplace_back(hX, vProfiles[n].sumXResiduals_);
1437  sumHistStructure_.emplace_back(hNormX, vProfiles[n].sumNormXResiduals_);
1438  if (hY)
1439  sumHistStructure_.emplace_back(hY, vProfiles[n].sumYResiduals_); // only if existing
1440  if (hNormY)
1441  sumHistStructure_.emplace_back(hNormY, vProfiles[n].sumNormYResiduals_); // ditto (pxl, stripYResiduals_)
1442  if (pXX)
1443  sumHistStructure_.emplace_back(pXX, vProfiles[n].sumResXvsXProfile_);
1444  if (pXY)
1445  sumHistStructure_.emplace_back(pXY, vProfiles[n].sumResXvsYProfile_);
1446  if (pYX)
1447  sumHistStructure_.emplace_back(pYX, vProfiles[n].sumResYvsXProfile_);
1448  if (pYY)
1449  sumHistStructure_.emplace_back(pYY, vProfiles[n].sumResYvsYProfile_);
1450  }
1451  if (dqmMode_)
1452  continue; // No fits in dqmMode
1453  //add fit values to stat box
1454  toFit_.push_back(vLevelProfiles[iComp].sumXResiduals_);
1455  toFit_.push_back(vLevelProfiles[iComp].sumNormXResiduals_);
1456  if (hY)
1457  toFit_.push_back(hY); // only if existing (pixel or stripYResiduals_)
1458  if (hNormY)
1459  toFit_.push_back(hNormY); // ditto
1460  } else {
1461  // nothing to be done for det or detunits
1462  continue;
1463  }
1464  }
1465 }
1466 
1468  for (std::vector<std::pair<TH1*, TH1*> >::const_iterator it = sumHistStructure_.begin();
1469  it != sumHistStructure_.end();
1470  ++it)
1471  it->first->Add(it->second);
1472 
1473  for (std::vector<std::tuple<int, TH1*, TH1*> >::const_iterator it = summaryBins_.begin(); it != summaryBins_.end();
1474  ++it)
1475  setSummaryBin(std::get<0>(*it), std::get<1>(*it), std::get<2>(*it));
1476 
1477  for (std::vector<TH1*>::const_iterator it = toFit_.begin(); it != toFit_.end(); ++it)
1478  fitResiduals(*it);
1479 }
1480 
1482  const Alignable& ali,
1484  int i) {
1485  const uint aliSize = ali.components().size();
1486  const align::StructureType alitype = ali.alignableObjectId();
1487  const align::StructureType subtype = ali.components()[0]->alignableObjectId();
1488  const char* aliTypeName = alignableTracker_->objectIdProvider().idToString(alitype); // lifetime of char* OK
1489  const char* aliSubtypeName = alignableTracker_->objectIdProvider().idToString(subtype);
1490  const char* typeName = alignableTracker_->objectIdProvider().idToString(type);
1491 
1492  const DetId aliDetId = ali.id();
1493  // y residuals only if pixel or specially requested for strip:
1494  const bool bookResidY = this->isPixel(aliDetId.subdetId()) || stripYResiduals_;
1495 
1496  SummaryContainer sumContainer;
1497 
1498  // Book summary hists with one bin per component,
1499  // but special case for Det with two DetUnit that we want to summarize one level up
1500  // (e.g. in TOBRods with 12 bins for 6 stereo and 6 rphi DetUnit.)
1501  // component of ali is not Det or Det with just one components
1502  const uint subcompSize = ali.components()[0]->components().size();
1503  if (subtype != align::AlignableDet || subcompSize == 1) { // Det with 1 comp. should not exist anymore...
1504  const TString title(Form("Summary for substructures in %s %d;%s;", aliTypeName, i, aliSubtypeName));
1505 
1506  sumContainer.summaryXResiduals_ = tfd.make<TH1F>(
1507  Form("h_summaryX%s_%d", aliTypeName, i), title + "#LT #Delta x' #GT", aliSize, 0.5, aliSize + 0.5);
1508  sumContainer.summaryNormXResiduals_ = tfd.make<TH1F>(
1509  Form("h_summaryNormX%s_%d", aliTypeName, i), title + "#LT #Delta x'/#sigma #GT", aliSize, 0.5, aliSize + 0.5);
1510 
1511  if (bookResidY) {
1512  sumContainer.summaryYResiduals_ = tfd.make<TH1F>(
1513  Form("h_summaryY%s_%d", aliTypeName, i), title + "#LT #Delta y' #GT", aliSize, 0.5, aliSize + 0.5);
1514  sumContainer.summaryNormYResiduals_ = tfd.make<TH1F>(
1515  Form("h_summaryNormY%s_%d", aliTypeName, i), title + "#LT #Delta y'/#sigma #GT", aliSize, 0.5, aliSize + 0.5);
1516  }
1517 
1518  } else if (subtype == align::AlignableDet && subcompSize > 1) { // fixed: was aliSize before
1519  if (subcompSize != 2) { // strange... expect only 2 DetUnits in DS layers
1520  // this 2 is hardcoded factor 2 in binning below and also assumed later on
1521  edm::LogError("Alignment") << "@SUB=bookSummaryHists"
1522  << "Det with " << subcompSize << " components";
1523  }
1524  // title contains x-title
1525  const TString title(Form(
1526  "Summary for substructures in %s %d;%s;",
1527  aliTypeName,
1528  i,
1529  alignableTracker_->objectIdProvider().idToString(ali.components()[0]->components()[0]->alignableObjectId())));
1530 
1531  sumContainer.summaryXResiduals_ = tfd.make<TH1F>(
1532  Form("h_summaryX%s_%d", aliTypeName, i), title + "#LT #Delta x' #GT", (2 * aliSize), 0.5, 2 * aliSize + 0.5);
1533  sumContainer.summaryNormXResiduals_ = tfd.make<TH1F>(Form("h_summaryNormX%s_%d", aliTypeName, i),
1534  title + "#LT #Delta x'/#sigma #GT",
1535  (2 * aliSize),
1536  0.5,
1537  2 * aliSize + 0.5);
1538 
1539  if (bookResidY) {
1540  sumContainer.summaryYResiduals_ = tfd.make<TH1F>(
1541  Form("h_summaryY%s_%d", aliTypeName, i), title + "#LT #Delta y' #GT", (2 * aliSize), 0.5, 2 * aliSize + 0.5);
1542  sumContainer.summaryNormYResiduals_ = tfd.make<TH1F>(Form("h_summaryNormY%s_%d", aliTypeName, i),
1543  title + "#LT #Delta y'/#sigma #GT",
1544  (2 * aliSize),
1545  0.5,
1546  2 * aliSize + 0.5);
1547  }
1548 
1549  } else {
1550  edm::LogError("TrackerOfflineValidation")
1551  << "@SUB=TrackerOfflineValidation::bookSummaryHists"
1552  << "No summary histogram for hierarchy level " << aliTypeName << " in subdet " << aliDetId.subdetId();
1553  }
1554 
1555  // Now book hists that just sum up the residual histograms from lower levels.
1556  // Axis title is copied from lowest level module of structure.
1557  // Should be safe that y-hists are only touched if non-null pointers...
1558  int nbins = 0;
1559  double xmin = 0., xmax = 0.;
1560  const TString sumTitle(Form("Residual for %s %d in %s;", aliTypeName, i, typeName));
1561  const ModuleHistos& xTitHists = this->getHistStructFromMap(aliDetId); // for x-axis titles
1562  this->getBinning(aliDetId.subdetId(), XprimeResidual, nbins, xmin, xmax);
1563 
1564  sumContainer.sumXResiduals_ = tfd.make<TH1F>(Form("h_Xprime_%s_%d", aliTypeName, i),
1565  sumTitle + xTitHists.ResXprimeHisto->GetXaxis()->GetTitle(),
1566  nbins,
1567  xmin,
1568  xmax);
1569 
1570  this->getBinning(aliDetId.subdetId(), NormXprimeResidual, nbins, xmin, xmax);
1571  sumContainer.sumNormXResiduals_ = tfd.make<TH1F>(Form("h_NormXprime_%s_%d", aliTypeName, i),
1572  sumTitle + xTitHists.NormResXprimeHisto->GetXaxis()->GetTitle(),
1573  nbins,
1574  xmin,
1575  xmax);
1576 
1577  if (moduleLevelProfiles_) {
1578  this->getBinning(aliDetId.subdetId(), XResidualProfile, nbins, xmin, xmax);
1579  sumContainer.sumResXvsXProfile_ = tfd.make<TProfile>(Form("p_resXX_%s_%d", aliTypeName, i),
1580  sumTitle + xTitHists.ResXvsXProfile->GetXaxis()->GetTitle() +
1581  ";" + xTitHists.ResXvsXProfile->GetYaxis()->GetTitle(),
1582  nbins,
1583  xmin,
1584  xmax);
1585  sumContainer.sumResXvsXProfile_->Sumw2();
1586  sumContainer.sumResXvsYProfile_ = tfd.make<TProfile>(Form("p_resXY_%s_%d", aliTypeName, i),
1587  sumTitle + xTitHists.ResXvsYProfile->GetXaxis()->GetTitle() +
1588  ";" + xTitHists.ResXvsYProfile->GetYaxis()->GetTitle(),
1589  nbins,
1590  xmin,
1591  xmax);
1592  sumContainer.sumResXvsYProfile_->Sumw2();
1593  }
1594 
1595  if (bookResidY) {
1596  this->getBinning(aliDetId.subdetId(), YprimeResidual, nbins, xmin, xmax);
1597  sumContainer.sumYResiduals_ = tfd.make<TH1F>(Form("h_Yprime_%s_%d", aliTypeName, i),
1598  sumTitle + xTitHists.ResYprimeHisto->GetXaxis()->GetTitle(),
1599  nbins,
1600  xmin,
1601  xmax);
1602 
1603  this->getBinning(aliDetId.subdetId(), NormYprimeResidual, nbins, xmin, xmax);
1604  sumContainer.sumNormYResiduals_ = tfd.make<TH1F>(Form("h_NormYprime_%s_%d", aliTypeName, i),
1605  sumTitle + xTitHists.NormResYprimeHisto->GetXaxis()->GetTitle(),
1606  nbins,
1607  xmin,
1608  xmax);
1609 
1610  if (moduleLevelProfiles_) {
1611  this->getBinning(aliDetId.subdetId(), YResidualProfile, nbins, xmin, xmax);
1612  sumContainer.sumResYvsXProfile_ = tfd.make<TProfile>(Form("p_resYX_%s_%d", aliTypeName, i),
1613  sumTitle + xTitHists.ResYvsXProfile->GetXaxis()->GetTitle() +
1614  ";" + xTitHists.ResYvsXProfile->GetYaxis()->GetTitle(),
1615  nbins,
1616  xmin,
1617  xmax);
1618  sumContainer.sumResYvsXProfile_->Sumw2();
1619  sumContainer.sumResYvsYProfile_ = tfd.make<TProfile>(Form("p_resYY_%s_%d", aliTypeName, i),
1620  sumTitle + xTitHists.ResYvsYProfile->GetXaxis()->GetTitle() +
1621  ";" + xTitHists.ResYvsYProfile->GetYaxis()->GetTitle(),
1622  nbins,
1623  xmin,
1624  xmax);
1625  sumContainer.sumResYvsYProfile_->Sumw2();
1626  }
1627  }
1628 
1629  // If we are at the lowest level, we already sum up and fill the summary.
1630 
1631  // special case I: For DetUnits and Dets with only one subcomponent start filling summary histos
1632  if ((subtype == align::AlignableDet && subcompSize == 1) || subtype == align::AlignableDetUnit) {
1633  for (uint k = 0; k < aliSize; ++k) {
1634  DetId detid = ali.components()[k]->id();
1635  ModuleHistos& histStruct = this->getHistStructFromMap(detid);
1636  this->summarizeBinInContainer(k + 1, detid.subdetId(), sumContainer, histStruct);
1637  sumHistStructure_.emplace_back(sumContainer.sumXResiduals_, histStruct.ResXprimeHisto);
1638  sumHistStructure_.emplace_back(sumContainer.sumNormXResiduals_, histStruct.NormResXprimeHisto);
1639  if (moduleLevelProfiles_) {
1640  sumHistStructure_.emplace_back(sumContainer.sumResXvsXProfile_, histStruct.ResXvsXProfile);
1641  sumHistStructure_.emplace_back(sumContainer.sumResXvsYProfile_, histStruct.ResXvsYProfile);
1642  }
1643  if (this->isPixel(detid.subdetId()) || stripYResiduals_) {
1644  sumHistStructure_.emplace_back(sumContainer.sumYResiduals_, histStruct.ResYprimeHisto);
1645  sumHistStructure_.emplace_back(sumContainer.sumNormYResiduals_, histStruct.NormResYprimeHisto);
1646  if (moduleLevelProfiles_) {
1647  sumHistStructure_.emplace_back(sumContainer.sumResYvsXProfile_, histStruct.ResYvsXProfile);
1648  sumHistStructure_.emplace_back(sumContainer.sumResYvsYProfile_, histStruct.ResYvsYProfile);
1649  }
1650  }
1651  }
1652  } else if (subtype == align::AlignableDet && subcompSize > 1) { // fixed: was aliSize before
1653  // special case II: Fill summary histos for dets with two detunits
1654  for (uint k = 0; k < aliSize; ++k) {
1655  for (uint j = 0; j < subcompSize; ++j) { // assumes all have same size (as binning does)
1656  DetId detid = ali.components()[k]->components()[j]->id();
1657  ModuleHistos& histStruct = this->getHistStructFromMap(detid);
1658  this->summarizeBinInContainer(2 * k + j + 1, detid.subdetId(), sumContainer, histStruct);
1659  sumHistStructure_.emplace_back(sumContainer.sumXResiduals_, histStruct.ResXprimeHisto);
1660  sumHistStructure_.emplace_back(sumContainer.sumNormXResiduals_, histStruct.NormResXprimeHisto);
1661  if (moduleLevelProfiles_) {
1662  sumHistStructure_.emplace_back(sumContainer.sumResXvsXProfile_, histStruct.ResXvsXProfile);
1663  sumHistStructure_.emplace_back(sumContainer.sumResXvsYProfile_, histStruct.ResXvsYProfile);
1664  }
1665  if (this->isPixel(detid.subdetId()) || stripYResiduals_) {
1666  sumHistStructure_.emplace_back(sumContainer.sumYResiduals_, histStruct.ResYprimeHisto);
1667  sumHistStructure_.emplace_back(sumContainer.sumNormYResiduals_, histStruct.NormResYprimeHisto);
1668  if (moduleLevelProfiles_) {
1669  sumHistStructure_.emplace_back(sumContainer.sumResYvsXProfile_, histStruct.ResYvsXProfile);
1670  sumHistStructure_.emplace_back(sumContainer.sumResYvsYProfile_, histStruct.ResYvsYProfile);
1671  }
1672  }
1673  }
1674  }
1675  }
1676  return sumContainer;
1677 }
1678 
1679 float TrackerOfflineValidation::Fwhm(const TH1* hist) const {
1680  float max = hist->GetMaximum();
1681  int left = -1, right = -1;
1682  for (unsigned int i = 1, iEnd = hist->GetNbinsX(); i <= iEnd; ++i) {
1683  if (hist->GetBinContent(i) < max / 2. && hist->GetBinContent(i + 1) > max / 2. && left == -1) {
1684  if (max / 2. - hist->GetBinContent(i) < hist->GetBinContent(i + 1) - max / 2.) {
1685  left = i;
1686  ++i;
1687  } else {
1688  left = i + 1;
1689  ++i;
1690  }
1691  }
1692  if (left != -1 && right == -1) {
1693  if (hist->GetBinContent(i) > max / 2. && hist->GetBinContent(i + 1) < max / 2.) {
1694  if (hist->GetBinContent(i) - max / 2. < max / 2. - hist->GetBinContent(i + 1)) {
1695  right = i;
1696  } else {
1697  right = i + 1;
1698  }
1699  }
1700  }
1701  }
1702  return hist->GetXaxis()->GetBinCenter(right) - hist->GetXaxis()->GetBinCenter(left);
1703 }
1704 
1705 void TrackerOfflineValidation::setUpTreeMembers(const std::map<int, TrackerOfflineValidation::ModuleHistos>& moduleHist_,
1706  const TrackerGeometry& tkgeom,
1707  const TrackerTopology* tTopo) {
1708  for (std::map<int, TrackerOfflineValidation::ModuleHistos>::const_iterator it = moduleHist_.begin(),
1709  itEnd = moduleHist_.end();
1710  it != itEnd;
1711  ++it) {
1712  TkOffTreeVariables& treeMem = mTreeMembers_[it->first];
1713 
1714  //variables concerning the tracker components/hierarchy levels
1715  DetId detId_ = it->first;
1716  treeMem.moduleId = detId_;
1717  treeMem.subDetId = detId_.subdetId();
1718  treeMem.isDoubleSide = false;
1719 
1720  if (treeMem.subDetId == PixelSubdetector::PixelBarrel) {
1721  unsigned int whichHalfBarrel(1), rawId(detId_.rawId()); //DetId does not know about halfBarrels is PXB ...
1722  if ((rawId >= 302056964 && rawId < 302059300) || (rawId >= 302123268 && rawId < 302127140) ||
1723  (rawId >= 302189572 && rawId < 302194980))
1724  whichHalfBarrel = 2;
1725  treeMem.layer = tTopo->pxbLayer(detId_);
1726  treeMem.half = whichHalfBarrel;
1727  treeMem.rod = tTopo->pxbLadder(detId_); // ... so, ladder is not per halfBarrel-Layer, but per barrel-layer!
1728  treeMem.module = tTopo->pxbModule(detId_);
1729  } else if (treeMem.subDetId == PixelSubdetector::PixelEndcap) {
1730  unsigned int whichHalfCylinder(1), rawId(detId_.rawId()); //DetId does not kmow about halfCylinders in PXF
1731  if ((rawId >= 352394500 && rawId < 352406032) || (rawId >= 352460036 && rawId < 352471568) ||
1732  (rawId >= 344005892 && rawId < 344017424) || (rawId >= 344071428 && rawId < 344082960))
1733  whichHalfCylinder = 2;
1734  treeMem.layer = tTopo->pxfDisk(detId_);
1735  treeMem.side = tTopo->pxfSide(detId_);
1736  treeMem.half = whichHalfCylinder;
1737  treeMem.blade = tTopo->pxfBlade(detId_);
1738  treeMem.panel = tTopo->pxfPanel(detId_);
1739  treeMem.module = tTopo->pxfModule(detId_);
1740  } else if (treeMem.subDetId == StripSubdetector::TIB) {
1741  unsigned int whichHalfShell(1), rawId(detId_.rawId()); //DetId does not kmow about halfShells in TIB
1742  if ((rawId >= 369120484 && rawId < 369120688) || (rawId >= 369121540 && rawId < 369121776) ||
1743  (rawId >= 369136932 && rawId < 369137200) || (rawId >= 369137988 && rawId < 369138288) ||
1744  (rawId >= 369153396 && rawId < 369153744) || (rawId >= 369154436 && rawId < 369154800) ||
1745  (rawId >= 369169844 && rawId < 369170256) || (rawId >= 369170900 && rawId < 369171344) ||
1746  (rawId >= 369124580 && rawId < 369124784) || (rawId >= 369125636 && rawId < 369125872) ||
1747  (rawId >= 369141028 && rawId < 369141296) || (rawId >= 369142084 && rawId < 369142384) ||
1748  (rawId >= 369157492 && rawId < 369157840) || (rawId >= 369158532 && rawId < 369158896) ||
1749  (rawId >= 369173940 && rawId < 369174352) || (rawId >= 369174996 && rawId < 369175440))
1750  whichHalfShell = 2;
1751  treeMem.layer = tTopo->tibLayer(detId_);
1752  treeMem.side = tTopo->tibStringInfo(detId_)[0];
1753  treeMem.half = whichHalfShell;
1754  treeMem.rod = tTopo->tibStringInfo(detId_)[2];
1755  treeMem.outerInner = tTopo->tibStringInfo(detId_)[1];
1756  treeMem.module = tTopo->tibModule(detId_);
1757  treeMem.isStereo = tTopo->tibStereo(detId_);
1758  treeMem.isDoubleSide = tTopo->tibIsDoubleSide(detId_);
1759  } else if (treeMem.subDetId == StripSubdetector::TID) {
1760  treeMem.layer = tTopo->tidWheel(detId_);
1761  treeMem.side = tTopo->tidSide(detId_);
1762  treeMem.ring = tTopo->tidRing(detId_);
1763  treeMem.outerInner = tTopo->tidModuleInfo(detId_)[0];
1764  treeMem.module = tTopo->tidModuleInfo(detId_)[1];
1765  treeMem.isStereo = tTopo->tidStereo(detId_);
1766  treeMem.isDoubleSide = tTopo->tidIsDoubleSide(detId_);
1767  } else if (treeMem.subDetId == StripSubdetector::TOB) {
1768  treeMem.layer = tTopo->tobLayer(detId_);
1769  treeMem.side = tTopo->tobRodInfo(detId_)[0];
1770  treeMem.rod = tTopo->tobRodInfo(detId_)[1];
1771  treeMem.module = tTopo->tobModule(detId_);
1772  treeMem.isStereo = tTopo->tobStereo(detId_);
1773  treeMem.isDoubleSide = tTopo->tobIsDoubleSide(detId_);
1774  } else if (treeMem.subDetId == StripSubdetector::TEC) {
1775  treeMem.layer = tTopo->tecWheel(detId_);
1776  treeMem.side = tTopo->tecSide(detId_);
1777  treeMem.ring = tTopo->tecRing(detId_);
1778  treeMem.petal = tTopo->tecPetalInfo(detId_)[1];
1779  treeMem.outerInner = tTopo->tecPetalInfo(detId_)[0];
1780  treeMem.module = tTopo->tecModule(detId_);
1781  treeMem.isStereo = tTopo->tecStereo(detId_);
1782  treeMem.isDoubleSide = tTopo->tecIsDoubleSide(detId_);
1783  }
1784 
1785  //variables concerning the tracker geometry
1786  const Surface::PositionType& gPModule = tkgeom.idToDet(detId_)->position();
1787  treeMem.posPhi = gPModule.phi();
1788  treeMem.posEta = gPModule.eta();
1789  treeMem.posR = gPModule.perp();
1790  treeMem.posX = gPModule.x();
1791  treeMem.posY = gPModule.y();
1792  treeMem.posZ = gPModule.z();
1793 
1794  const Surface& surface = tkgeom.idToDet(detId_)->surface();
1795 
1796  //global Orientation of local coordinate system of dets/detUnits
1797  LocalPoint lUDirection(1., 0., 0.), lVDirection(0., 1., 0.), lWDirection(0., 0., 1.);
1798  GlobalPoint gUDirection = surface.toGlobal(lUDirection), gVDirection = surface.toGlobal(lVDirection),
1799  gWDirection = surface.toGlobal(lWDirection);
1800  double dR(999.), dPhi(999.), dZ(999.);
1802  treeMem.subDetId == StripSubdetector::TOB) {
1803  dR = gWDirection.perp() - gPModule.perp();
1804  dPhi = deltaPhi(gUDirection.barePhi(), gPModule.barePhi());
1805  dZ = gVDirection.z() - gPModule.z();
1806  if (dZ >= 0.)
1807  treeMem.rOrZDirection = 1;
1808  else
1809  treeMem.rOrZDirection = -1;
1810  } else if (treeMem.subDetId == PixelSubdetector::PixelEndcap) {
1811  dR = gUDirection.perp() - gPModule.perp();
1812  dPhi = deltaPhi(gVDirection.barePhi(), gPModule.barePhi());
1813  dZ = gWDirection.z() - gPModule.z();
1814  if (dR >= 0.)
1815  treeMem.rOrZDirection = 1;
1816  else
1817  treeMem.rOrZDirection = -1;
1818  } else if (treeMem.subDetId == StripSubdetector::TID || treeMem.subDetId == StripSubdetector::TEC) {
1819  dR = gVDirection.perp() - gPModule.perp();
1820  dPhi = deltaPhi(gUDirection.barePhi(), gPModule.barePhi());
1821  dZ = gWDirection.z() - gPModule.z();
1822  if (dR >= 0.)
1823  treeMem.rOrZDirection = 1;
1824  else
1825  treeMem.rOrZDirection = -1;
1826  }
1827  if (dR >= 0.)
1828  treeMem.rDirection = 1;
1829  else
1830  treeMem.rDirection = -1;
1831  if (dPhi >= 0.)
1832  treeMem.phiDirection = 1;
1833  else
1834  treeMem.phiDirection = -1;
1835  if (dZ >= 0.)
1836  treeMem.zDirection = 1;
1837  else
1838  treeMem.zDirection = -1;
1839  }
1840 }
1841 
1843  TkOffTreeVariables& treeMem,
1844  const std::map<int, TrackerOfflineValidation::ModuleHistos>& moduleHist_) {
1845  for (std::map<int, TrackerOfflineValidation::ModuleHistos>::const_iterator it = moduleHist_.begin(),
1846  itEnd = moduleHist_.end();
1847  it != itEnd;
1848  ++it) {
1849  treeMem = mTreeMembers_[it->first];
1850 
1851  //mean and RMS values (extracted from histograms(Xprime on module level)
1852  treeMem.entries = static_cast<UInt_t>(it->second.ResXprimeHisto->GetEntries());
1853  treeMem.meanX = it->second.ResXprimeHisto->GetMean();
1854  treeMem.rmsX = it->second.ResXprimeHisto->GetRMS();
1855  //treeMem.sigmaX = Fwhm(it->second.ResXprimeHisto)/2.355;
1856 
1857  if (useFit_) {
1858  //call fit function which returns mean and sigma from the fit
1859  //for absolute residuals
1860  std::pair<float, float> fitResult1 = this->fitResiduals(it->second.ResXprimeHisto);
1861  treeMem.fitMeanX = fitResult1.first;
1862  treeMem.fitSigmaX = fitResult1.second;
1863  //for normalized residuals
1864  std::pair<float, float> fitResult2 = this->fitResiduals(it->second.NormResXprimeHisto);
1865  treeMem.fitMeanNormX = fitResult2.first;
1866  treeMem.fitSigmaNormX = fitResult2.second;
1867  }
1868 
1869  //get median for absolute residuals
1870  treeMem.medianX = this->getMedian(it->second.ResXprimeHisto);
1871 
1872  int numberOfBins = it->second.ResXprimeHisto->GetNbinsX();
1873  treeMem.numberOfUnderflows = it->second.ResXprimeHisto->GetBinContent(0);
1874  treeMem.numberOfOverflows = it->second.ResXprimeHisto->GetBinContent(numberOfBins + 1);
1875  treeMem.numberOfOutliers =
1876  it->second.ResXprimeHisto->GetBinContent(0) + it->second.ResXprimeHisto->GetBinContent(numberOfBins + 1);
1877 
1878  //mean and RMS values (extracted from histograms(normalized Xprime on module level)
1879  treeMem.meanNormX = it->second.NormResXprimeHisto->GetMean();
1880  treeMem.rmsNormX = it->second.NormResXprimeHisto->GetRMS();
1881 
1882  double stats[20];
1883  it->second.NormResXprimeHisto->GetStats(stats);
1884  // GF treeMem.chi2PerDofX = stats[3]/(stats[0]-1);
1885  if (stats[0])
1886  treeMem.chi2PerDofX = stats[3] / stats[0];
1887 
1888  treeMem.sigmaNormX = Fwhm(it->second.NormResXprimeHisto) / 2.355;
1889  treeMem.histNameX = it->second.ResXprimeHisto->GetName();
1890  treeMem.histNameNormX = it->second.NormResXprimeHisto->GetName();
1891 
1892  // fill tree variables in local coordinates if set in cfg
1893  if (lCoorHistOn_) {
1894  treeMem.meanLocalX = it->second.ResHisto->GetMean();
1895  treeMem.rmsLocalX = it->second.ResHisto->GetRMS();
1896  treeMem.meanNormLocalX = it->second.NormResHisto->GetMean();
1897  treeMem.rmsNormLocalX = it->second.NormResHisto->GetRMS();
1898 
1899  treeMem.histNameLocalX = it->second.ResHisto->GetName();
1900  treeMem.histNameNormLocalX = it->second.NormResHisto->GetName();
1901  if (it->second.ResYHisto)
1902  treeMem.histNameLocalY = it->second.ResYHisto->GetName();
1903  }
1904 
1905  // mean and RMS values in local y (extracted from histograms(normalized Yprime on module level)
1906  // might exist in pixel only
1907  if (it->second.ResYprimeHisto) { //(stripYResiduals_)
1908  TH1* h = it->second.ResYprimeHisto;
1909  treeMem.meanY = h->GetMean();
1910  treeMem.rmsY = h->GetRMS();
1911 
1912  if (useFit_) { // fit function which returns mean and sigma from the fit
1913  std::pair<float, float> fitMeanSigma = this->fitResiduals(h);
1914  treeMem.fitMeanY = fitMeanSigma.first;
1915  treeMem.fitSigmaY = fitMeanSigma.second;
1916  }
1917 
1918  //get median for absolute residuals
1919  treeMem.medianY = this->getMedian(h);
1920 
1921  treeMem.histNameY = h->GetName();
1922  }
1923  if (it->second.NormResYprimeHisto) {
1924  TH1* h = it->second.NormResYprimeHisto;
1925  treeMem.meanNormY = h->GetMean();
1926  treeMem.rmsNormY = h->GetRMS();
1927  h->GetStats(stats); // stats buffer defined above
1928  if (stats[0])
1929  treeMem.chi2PerDofY = stats[3] / stats[0];
1930 
1931  if (useFit_) { // fit function which returns mean and sigma from the fit
1932  std::pair<float, float> fitMeanSigma = this->fitResiduals(h);
1933  treeMem.fitMeanNormY = fitMeanSigma.first;
1934  treeMem.fitSigmaNormY = fitMeanSigma.second;
1935  }
1936  treeMem.histNameNormY = h->GetName();
1937  }
1938 
1939  if (moduleLevelProfiles_) {
1940  if (it->second.ResXvsXProfile) {
1941  TH1* h = it->second.ResXvsXProfile;
1942  treeMem.meanResXvsX = h->GetMean();
1943  treeMem.rmsResXvsX = h->GetRMS();
1944  treeMem.profileNameResXvsX = h->GetName();
1945  }
1946  if (it->second.ResXvsYProfile) {
1947  TH1* h = it->second.ResXvsYProfile;
1948  treeMem.meanResXvsY = h->GetMean();
1949  treeMem.rmsResXvsY = h->GetRMS();
1950  treeMem.profileNameResXvsY = h->GetName();
1951  }
1952  if (it->second.ResYvsXProfile) {
1953  TH1* h = it->second.ResYvsXProfile;
1954  treeMem.meanResYvsX = h->GetMean();
1955  treeMem.rmsResYvsX = h->GetRMS();
1956  treeMem.profileNameResYvsX = h->GetName();
1957  }
1958  if (it->second.ResYvsYProfile) {
1959  TH1* h = it->second.ResYvsYProfile;
1960  treeMem.meanResYvsY = h->GetMean();
1961  treeMem.rmsResYvsY = h->GetRMS();
1962  treeMem.profileNameResYvsY = h->GetName();
1963  }
1964  }
1965 
1966  tree.Fill();
1967  }
1968 }
1969 
1970 std::pair<float, float> TrackerOfflineValidation::fitResiduals(TH1* hist) const {
1971  std::pair<float, float> fitResult(9999., 9999.);
1972  if (!hist || hist->GetEntries() < 20)
1973  return fitResult;
1974 
1975  float mean = hist->GetMean();
1976  float sigma = hist->GetRMS();
1977 
1978  try { // for < CMSSW_2_2_0 since ROOT warnings from fit are converted to exceptions
1979  // Remove the try/catch for more recent CMSSW!
1980  // first fit: two RMS around mean
1981  TF1 func("tmp", "gaus", mean - 2. * sigma, mean + 2. * sigma);
1982  if (0 == hist->Fit(&func, "QNR")) { // N: do not blow up file by storing fit!
1983  mean = func.GetParameter(1);
1984  sigma = func.GetParameter(2);
1985  // second fit: three sigma of first fit around mean of first fit
1986  func.SetRange(mean - 3. * sigma, mean + 3. * sigma);
1987  // I: integral gives more correct results if binning is too wide
1988  // L: Likelihood can treat empty bins correctly (if hist not weighted...)
1989  if (0 == hist->Fit(&func, "Q0LR")) {
1990  if (hist->GetFunction(func.GetName())) { // Take care that it is later on drawn:
1991  hist->GetFunction(func.GetName())->ResetBit(TF1::kNotDraw);
1992  }
1993  fitResult.first = func.GetParameter(1);
1994  fitResult.second = func.GetParameter(2);
1995  }
1996  }
1997  } catch (cms::Exception const& e) {
1998  edm::LogWarning("Alignment") << "@SUB=TrackerOfflineValidation::fitResiduals"
1999  << "Caught this exception during ROOT fit: " << e.what();
2000  }
2001  return fitResult;
2002 }
2003 
2005  float median = 999;
2006  int nbins = histo->GetNbinsX();
2007 
2008  //extract median from histogram
2009  double* x = new double[nbins];
2010  double* y = new double[nbins];
2011  for (int j = 0; j < nbins; j++) {
2012  x[j] = histo->GetBinCenter(j + 1);
2013  y[j] = histo->GetBinContent(j + 1);
2014  }
2015  median = TMath::Median(nbins, x, y);
2016 
2017  delete[] x;
2018  x = nullptr;
2019  delete[] y;
2020  y = nullptr;
2021 
2022  return median;
2023 }
2024 //define this as a plug-in
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
TrackerOfflineValidation::XprimeResidual
Definition: TrackerOfflineValidation.cc:88
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
TrackerValidationVariables.h
DDAxes::y
TrackerOfflineValidation::setSummaryBin
void setSummaryBin(int bin, TH1 *targetHist, TH1 *sourceHist)
Definition: TrackerOfflineValidation.cc:1059
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
electrons_cff.bool
bool
Definition: electrons_cff.py:393
EDAnalyzer.h
mps_fire.i
i
Definition: mps_fire.py:428
TrackerOfflineValidation::isBarrel
bool isBarrel(uint32_t subDetId)
Definition: TrackerOfflineValidation.cc:974
TrackerOfflineValidation::mTibResiduals_
std::map< int, TrackerOfflineValidation::ModuleHistos > mTibResiduals_
Definition: TrackerOfflineValidation.cc:354
TrackerOfflineValidation::mPxeResiduals_
std::map< int, TrackerOfflineValidation::ModuleHistos > mPxeResiduals_
Definition: TrackerOfflineValidation.cc:353
PixelSubdetector.h
TrackerOfflineValidation::vDeleteObjects_
std::vector< TH1 * > vDeleteObjects_
Definition: TrackerOfflineValidation.cc:346
TrackerOfflineValidation::TrackerOfflineValidation
TrackerOfflineValidation(const edm::ParameterSet &)
Definition: TrackerOfflineValidation.cc:474
TkOffTreeVariables::medianX
Float_t medianX
Definition: TkOffTreeVariables.h:50
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
PixelSubdetector::PixelEndcap
Definition: PixelSubdetector.h:11
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
TrackerGeometry.h
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
TrackerOfflineValidation::summarizeBinInContainer
void summarizeBinInContainer(int bin, SummaryContainer &targetContainer, SummaryContainer &sourceContainer)
Definition: TrackerOfflineValidation.cc:1070
TrackerOfflineValidation::DQMStore
dqm::legacy::DQMStore DQMStore
Definition: TrackerOfflineValidation.cc:80
TrackerOfflineValidation::~TrackerOfflineValidation
~TrackerOfflineValidation() override
Definition: TrackerOfflineValidation.cc:496
TrackerOfflineValidation::mPxbResiduals_
std::map< int, TrackerOfflineValidation::ModuleHistos > mPxbResiduals_
Definition: TrackerOfflineValidation.cc:352
TkOffTreeVariables::medianY
Float_t medianY
Definition: TkOffTreeVariables.h:50
ESHandle.h
TrackerOfflineValidation::DirectoryWrapper::DirectoryWrapper
DirectoryWrapper(const DirectoryWrapper &upDir, const std::string &newDir, const std::string &basedir, bool useDqmMode)
Definition: TrackerOfflineValidation.cc:165
TrackerOfflineValidation::ModuleHistos::NormResXprimeHisto
TH1 * NormResXprimeHisto
Definition: TrackerOfflineValidation.cc:120
TkOffTreeVariables::petal
UInt_t petal
Definition: TkOffTreeVariables.h:59
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
TrackerTopology::pxfSide
unsigned int pxfSide(const DetId &id) const
Definition: TrackerTopology.h:192
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
TrackerOfflineValidation::topoToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Definition: TrackerOfflineValidation.cc:98
TrackerOfflineValidation::SummaryContainer::sumYResiduals_
TH1 * sumYResiduals_
Definition: TrackerOfflineValidation.cc:153
TkOffTreeVariables::rmsLocalX
Float_t rmsLocalX
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidation::mTreeMembers_
std::map< int, TkOffTreeVariables > mTreeMembers_
Definition: TrackerOfflineValidation.cc:359
deltaPhi.h
TrackerOfflineValidation::geomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: TrackerOfflineValidation.cc:97
TrackerOfflineValidation::stripYResiduals_
const bool stripYResiduals_
Definition: TrackerOfflineValidation.cc:336
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
TFileService::file
TFile & file() const
return opened TFile
Definition: TFileService.h:37
TrackerOfflineValidation::bookDirHists
void bookDirHists(DirectoryWrapper &tfd, const Alignable &ali, const TrackerTopology *tTopo)
Definition: TrackerOfflineValidation.cc:703
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
Alignable
Definition: Alignable.h:27
pfDeepBoostedJetPreprocessParams_cfi.median
median
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:12
TrackerOfflineValidation::SummaryContainer::summaryNormYResiduals_
TH1 * summaryNormYResiduals_
Definition: TrackerOfflineValidation.cc:156
TkOffTreeVariables::phiDirection
Float_t phiDirection
Definition: TkOffTreeVariables.h:50
TkOffTreeVariables::rmsResXvsY
Float_t rmsResXvsY
Definition: TkOffTreeVariables.h:71
TkOffTreeVariables::fitMeanY
Float_t fitMeanY
Definition: TkOffTreeVariables.h:50
TrackerValidationVariables::fillTrackQuantities
void fillTrackQuantities(const edm::Event &, const edm::EventSetup &, std::vector< AVTrackStruct > &v_avtrackout)
Definition: TrackerValidationVariables.cc:423
TrackerOfflineValidation::bookHists
void bookHists(DirectoryWrapper &tfd, const Alignable &ali, const TrackerTopology *tTopo, align::StructureType type, int i)
Definition: TrackerOfflineValidation.cc:728
TFileService::tFileDirectory
TFileDirectory & tFileDirectory()
Definition: TFileService.h:42
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
TrackerOfflineValidation::ModuleHistos::LocalY
TH1 * LocalY
Definition: TrackerOfflineValidation.cc:130
TkOffTreeVariables::rmsResXvsX
Float_t rmsResXvsX
Definition: TkOffTreeVariables.h:71
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:46
Surface
Definition: Surface.h:36
DQMStore.h
TrackerValidationVariables
Definition: TrackerValidationVariables.h:22
TrackerOfflineValidation::GetIndex
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
Definition: TrackerOfflineValidation.cc:389
TrackerOfflineValidation::bookTProfile
TProfile * bookTProfile(bool isTransient, DirectoryWrapper &tfd, const char *histName, const char *histTitle, int nBinsX, double lowX, double highX)
Definition: TrackerOfflineValidation.cc:942
TrackerOfflineValidation::HistogramType
HistogramType
Definition: TrackerOfflineValidation.cc:84
TrackerOfflineValidation::getHistStructFromMap
ModuleHistos & getHistStructFromMap(const DetId &detid)
Definition: TrackerOfflineValidation.cc:1093
TrackerOfflineValidation::DirectoryWrapper::theDbe
DQMStore * theDbe
Definition: TrackerOfflineValidation.cc:235
DDAxes::x
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
TrackerOfflineValidation::SummaryContainer::summaryYResiduals_
TH1 * summaryYResiduals_
Definition: TrackerOfflineValidation.cc:154
TkOffTreeVariables.h
TkOffTreeVariables::rod
UInt_t rod
Definition: TkOffTreeVariables.h:59
TkOffTreeVariables::meanResXvsY
Float_t meanResXvsY
Definition: TkOffTreeVariables.h:70
HLT_FULL_cff.dPhi
dPhi
Definition: HLT_FULL_cff.py:13768
TkOffTreeVariables::outerInner
UInt_t outerInner
Definition: TkOffTreeVariables.h:59
TrackerOfflineValidation::maxTracks_
const unsigned long long maxTracks_
Definition: TrackerOfflineValidation.cc:375
TrackerOfflineValidation::getBinning
void getBinning(uint32_t subDetId, TrackerOfflineValidation::HistogramType residualtype, int &nBinsX, double &lowerBoundX, double &upperBoundX)
Definition: TrackerOfflineValidation.cc:992
TkOffTreeVariables::meanNormY
Float_t meanNormY
Definition: TkOffTreeVariables.h:50
tools.TF1
TF1
Definition: tools.py:23
parallelization.uint
uint
Definition: parallelization.py:124
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
TrackerOfflineValidation::ModuleHistos::ResYHisto
TH1 * ResYHisto
Definition: TrackerOfflineValidation.cc:117
HGVHistoProducerAlgoBlock_cfi.minX
minX
Definition: HGVHistoProducerAlgoBlock_cfi.py:153
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
TrackerOfflineValidation::mTobResiduals_
std::map< int, TrackerOfflineValidation::ModuleHistos > mTobResiduals_
Definition: TrackerOfflineValidation.cc:356
TkOffTreeVariables::histNameLocalX
std::string histNameLocalX
Definition: TkOffTreeVariables.h:67
TrackerTopology::tidRing
unsigned int tidRing(const DetId &id) const
Definition: TrackerTopology.h:218
TrackerOfflineValidation::compressionSettings_
const int compressionSettings_
Definition: TrackerOfflineValidation.cc:332
TrackerOfflineValidation::SummaryContainer::sumXResiduals_
TH1 * sumXResiduals_
Definition: TrackerOfflineValidation.cc:149
TrackerOfflineValidation::bookSummaryHists
TrackerOfflineValidation::SummaryContainer bookSummaryHists(DirectoryWrapper &tfd, const Alignable &ali, align::StructureType type, int i)
Definition: TrackerOfflineValidation.cc:1481
TrackerTopology::tobStereo
uint32_t tobStereo(const DetId &id) const
Definition: TrackerTopology.h:275
TkOffTreeVariables::fitMeanNormY
Float_t fitMeanNormY
Definition: TkOffTreeVariables.h:50
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
TrackerOfflineValidation::alignableTracker_
std::unique_ptr< AlignableTracker > alignableTracker_
Definition: TrackerOfflineValidation.cc:329
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
TFileDirectory.h
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
TrackerOfflineValidation::checkBookHists
virtual void checkBookHists(const edm::EventSetup &setup)
Definition: TrackerOfflineValidation.cc:508
BTVHLTOfflineSource_cfi.dirname
dirname
Definition: BTVHLTOfflineSource_cfi.py:7
TkOffTreeVariables::fitSigmaNormX
Float_t fitSigmaNormX
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidation::ModuleHistos::ResXvsYProfile
TProfile * ResXvsYProfile
Definition: TrackerOfflineValidation.cc:125
TrackerOfflineValidation::SummaryContainer::summaryXResiduals_
TH1 * summaryXResiduals_
Definition: TrackerOfflineValidation.cc:150
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
MakerMacros.h
TkOffTreeVariables::posPhi
Float_t posPhi
Definition: TkOffTreeVariables.h:50
TrackerTopology.h
TrackerOfflineValidation::nTracks_
unsigned long long nTracks_
Definition: TrackerOfflineValidation.cc:374
TrackerTopology::tibStringInfo
std::vector< unsigned int > tibStringInfo(const DetId &id) const
Definition: TrackerTopology.h:421
TkOffTreeVariables::meanResYvsX
Float_t meanResYvsX
Definition: TkOffTreeVariables.h:70
TrackerOfflineValidation::bookTH1F
TH1 * bookTH1F(bool isTransient, DirectoryWrapper &tfd, const char *histName, const char *histTitle, int nBinsX, double lowX, double highX)
Definition: TrackerOfflineValidation.cc:928
TrackerTopology::tidModuleInfo
std::vector< unsigned int > tidModuleInfo(const DetId &id) const
Definition: TrackerTopology.h:434
TrackerOfflineValidation::bareTkGeomPtr_
const TrackerGeometry * bareTkGeomPtr_
Definition: TrackerOfflineValidation.cc:328
TrackerTopologyRcd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
L1TOccupancyClient_cfi.ymax
ymax
Definition: L1TOccupancyClient_cfi.py:43
dqm::legacy::DQMStore
Definition: DQMStore.h:727
TrackerOfflineValidation::DirectoryWrapper::DirectoryWrapper
DirectoryWrapper(const std::string &newDir, const std::string &basedir, bool useDqmMode)
Definition: TrackerOfflineValidation.cc:188
TkOffTreeVariables::profileNameResXvsY
std::string profileNameResXvsY
Definition: TkOffTreeVariables.h:73
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::profileNameResYvsX
std::string profileNameResYvsX
Definition: TkOffTreeVariables.h:73
TrackerOfflineValidation::SummaryContainer::SummaryContainer
SummaryContainer()
Definition: TrackerOfflineValidation.cc:135
TrackerOfflineValidation::isPixel
bool isPixel(uint32_t subDetId)
Definition: TrackerOfflineValidation.cc:984
TrackerOfflineValidation::ModuleHistos::ResYvsYProfile
TProfile * ResYvsYProfile
Definition: TrackerOfflineValidation.cc:127
Alignable::alignableObjectId
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
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
TrackerOfflineValidation::vTrack2DHistos_
std::vector< TH1 * > vTrack2DHistos_
Definition: TrackerOfflineValidation.cc:350
TrackerOfflineValidation::ModuleHistos::LocalX
TH1 * LocalX
Definition: TrackerOfflineValidation.cc:129
TrackerOfflineValidation::SummaryContainer::sumResXvsYProfile_
TH1 * sumResXvsYProfile_
Definition: TrackerOfflineValidation.cc:159
TkOffTreeVariables::entries
UInt_t entries
Definition: TkOffTreeVariables.h:58
TrackerOfflineValidation::moduleDirectory_
const std::string moduleDirectory_
Definition: TrackerOfflineValidation.cc:341
TkOffTreeVariables::numberOfUnderflows
Float_t numberOfUnderflows
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidation::useFit_
const bool useFit_
Definition: TrackerOfflineValidation.cc:338
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
edm::ESHandle< TrackerGeometry >
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
TrackerOfflineValidation::mTecResiduals_
std::map< int, TrackerOfflineValidation::ModuleHistos > mTecResiduals_
Definition: TrackerOfflineValidation.cc:357
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
multiplicitycorr_cfi.xBins
xBins
Definition: multiplicitycorr_cfi.py:5
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
TrackerOfflineValidation::ModuleHistos::ResXprimeHisto
TH1 * ResXprimeHisto
Definition: TrackerOfflineValidation.cc:119
TrackerOfflineValidation::summaryBins_
std::vector< std::tuple< int, TH1 *, TH1 * > > summaryBins_
Definition: TrackerOfflineValidation.cc:368
TrackerOfflineValidation::toFit_
std::vector< TH1 * > toFit_
Definition: TrackerOfflineValidation.cc:372
h
dqmdumpme.k
k
Definition: dqmdumpme.py:60
TkOffTreeVariables::fitSigmaY
Float_t fitSigmaY
Definition: TkOffTreeVariables.h:50
Point3DBase< float, GlobalTag >
makeHippyCampaign.basedir
basedir
Definition: makeHippyCampaign.py:14
TkOffTreeVariables::histNameNormY
std::string histNameNormY
Definition: TkOffTreeVariables.h:68
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:474
TrackerOfflineValidation::fillTree
void fillTree(TTree &tree, TkOffTreeVariables &treeMem, const std::map< int, TrackerOfflineValidation::ModuleHistos > &moduleHist_)
Definition: TrackerOfflineValidation.cc:1842
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
TrackerAlignableId::typeAndLayerFromDetId
std::pair< int, int > typeAndLayerFromDetId(const DetId &detId, const TrackerTopology *tTopo) const
Definition: TrackerAlignableId.cc:17
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
align::StructureType
StructureType
Definition: StructureType.h:16
TkOffTreeVariables::rOrZDirection
Float_t rOrZDirection
Definition: TkOffTreeVariables.h:50
TrackerTopology::tibStereo
uint32_t tibStereo(const DetId &id) const
Definition: TrackerTopology.h:279
TrackerOfflineValidation::Fwhm
float Fwhm(const TH1 *hist) const
Definition: TrackerOfflineValidation.cc:1679
PostProcessor_cff.profile
profile
Definition: PostProcessor_cff.py:38
TkOffTreeVariables::meanNormLocalX
Float_t meanNormLocalX
Definition: TkOffTreeVariables.h:50
TFileService.h
TrackerOfflineValidation::ModuleHistos::NormResHisto
TH1 * NormResHisto
Definition: TrackerOfflineValidation.cc:116
TkOffTreeVariables::profileNameResXvsX
std::string profileNameResXvsX
Definition: TkOffTreeVariables.h:73
TkOffTreeVariables::posZ
Float_t posZ
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidation::YprimeResidual
Definition: TrackerOfflineValidation.cc:90
TFileService::mkdir
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
TkOffTreeVariables::fitSigmaNormY
Float_t fitSigmaNormY
Definition: TkOffTreeVariables.h:50
dqmiodumpindices.typeName
typeName
Definition: dqmiodumpindices.py:33
TrackerDigiGeometryRecord.h
align::AlignableDetUnit
Definition: StructureType.h:19
TrackerOfflineValidation::endJob
void endJob() override
Definition: TrackerOfflineValidation.cc:1359
anotherprimaryvertexanalyzer_cfi.nBinY
nBinY
Definition: anotherprimaryvertexanalyzer_cfi.py:13
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
TrackerOfflineValidation::avalidator_
TrackerValidationVariables avalidator_
Definition: TrackerOfflineValidation.cc:377
Event.h
TrackerOfflineValidation::chargeCut_
const int chargeCut_
Definition: TrackerOfflineValidation.cc:343
align::invalid
Definition: StructureType.h:18
B2GTnPMonitor_cfi.histTitle
histTitle
Definition: B2GTnPMonitor_cfi.py:112
PV3DBase::barePhi
T barePhi() const
Definition: PV3DBase.h:65
TrackerOfflineValidation::sumHistStructure_
std::vector< std::pair< TH1 *, TH1 * > > sumHistStructure_
Definition: TrackerOfflineValidation.cc:370
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
TkOffTreeVariables::rmsNormX
Float_t rmsNormX
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidation::tkGeom_
edm::ESHandle< TrackerGeometry > tkGeom_
Definition: TrackerOfflineValidation.cc:327
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
Alignable::id
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
Definition: Alignable.h:180
TkOffTreeVariables::zDirection
Float_t zDirection
Definition: TkOffTreeVariables.h:50
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
HGVHistoProducerAlgoBlock_cfi.minY
minY
Definition: HGVHistoProducerAlgoBlock_cfi.py:158
TrackerOfflineValidation::DirectoryWrapper::directoryString
std::string directoryString
Definition: TrackerOfflineValidation.cc:233
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
TrackerOfflineValidation::lCoorHistOn_
const bool lCoorHistOn_
Definition: TrackerOfflineValidation.cc:333
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
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
TrackerOfflineValidation::ModuleHistos::ResHisto
TH1 * ResHisto
Definition: TrackerOfflineValidation.cc:115
edm::Service
Definition: Service.h:30
createfilelist.int
int
Definition: createfilelist.py:10
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
TrackerOfflineValidation::isDetOrDetUnit
bool isDetOrDetUnit(align::StructureType type)
Definition: TrackerOfflineValidation.cc:988
TrackerTopology::tecRing
unsigned int tecRing(const DetId &id) const
ring id
Definition: TrackerTopology.h:217
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
PVValHelper::residualType
residualType
Definition: PVValidationHelpers.h:46
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
TkOffTreeVariables::rmsNormY
Float_t rmsNormY
Definition: TkOffTreeVariables.h:50
Utilities.h
TrackerOfflineValidation::SummaryContainer::sumNormXResiduals_
TH1 * sumNormXResiduals_
Definition: TrackerOfflineValidation.cc:151
TrackerOfflineValidation::DirectoryWrapper::make
TH1 * make(const char *name, const char *title, int nBinX, double minBinX, double maxBinX)
dqmMemoryStats.stats
stats
Definition: dqmMemoryStats.py:134
edm::EventSetup
Definition: EventSetup.h:57
TkOffTreeVariables::fitMeanX
Float_t fitMeanX
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidation::SummaryContainer::summaryNormXResiduals_
TH1 * summaryNormXResiduals_
Definition: TrackerOfflineValidation.cc:152
TkOffTreeVariables::side
UInt_t side
Definition: TkOffTreeVariables.h:59
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
TrackerOfflineValidation::YResidual
Definition: TrackerOfflineValidation.cc:87
TkOffTreeVariables::half
UInt_t half
Definition: TkOffTreeVariables.h:59
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
TrackerOfflineValidation_Standalone_cff.moduleLevelHistsTransient
moduleLevelHistsTransient
Definition: TrackerOfflineValidation_Standalone_cff.py:82
TrackerOfflineValidation::DirectoryWrapper
Definition: TrackerOfflineValidation.cc:164
TrackerOfflineValidation::collateSummaryHists
void collateSummaryHists()
Definition: TrackerOfflineValidation.cc:1467
TrackerOfflineValidation::DirectoryWrapper::tfd
std::unique_ptr< TFileDirectory > tfd
Definition: TrackerOfflineValidation.cc:232
TkOffTreeVariables::meanNormX
Float_t meanNormX
Definition: TkOffTreeVariables.h:50
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
TrackerOfflineValidation::DirectoryWrapper::dqmMode
const bool dqmMode
Definition: TrackerOfflineValidation.cc:234
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
TrackerOfflineValidation::ModuleHistos
Definition: TrackerOfflineValidation.cc:100
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
TrackerOfflineValidation::YResidualProfile
Definition: TrackerOfflineValidation.cc:93
TkOffTreeVariables::subDetId
UInt_t subDetId
Definition: TkOffTreeVariables.h:59
TkOffTreeVariables::profileNameResYvsY
std::string profileNameResYvsY
Definition: TkOffTreeVariables.h:73
TkOffTreeVariables::isDoubleSide
Bool_t isDoubleSide
Definition: TkOffTreeVariables.h:64
AlignableObjectId.h
align::AlignableDet
Definition: StructureType.h:20
TrackerOfflineValidation::XResidualProfile
Definition: TrackerOfflineValidation.cc:92
TrackerOfflineValidation::ModuleHistos::ModuleHistos
ModuleHistos()
Definition: TrackerOfflineValidation.cc:101
TkOffTreeVariables::posX
Float_t posX
Definition: TkOffTreeVariables.h:50
TkOffTreeVariables::meanResYvsY
Float_t meanResYvsY
Definition: TkOffTreeVariables.h:70
GeomDet.h
TrackerOfflineValidation::bookGlobalHists
void bookGlobalHists(DirectoryWrapper &tfd)
Definition: TrackerOfflineValidation.cc:552
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
TrackerAlignableId
Definition: TrackerAlignableId.h:22
TrackerOfflineValidation::NormXResidual
Definition: TrackerOfflineValidation.cc:86
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
L1TOccupancyClient_cfi.ymin
ymin
Definition: L1TOccupancyClient_cfi.py:43
TkOffTreeVariables::rmsResYvsX
Float_t rmsResYvsX
Definition: TkOffTreeVariables.h:71
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
DetId.h
Frameworkfwd.h
makeMuonMisalignmentScenario.components
string components
Definition: makeMuonMisalignmentScenario.py:58
TkOffTreeVariables::rmsResYvsY
Float_t rmsResYvsY
Definition: TkOffTreeVariables.h:71
TkOffTreeVariables::chi2PerDofX
Float_t chi2PerDofX
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
HGVHistoProducerAlgoBlock_cfi.maxY
maxY
Definition: HGVHistoProducerAlgoBlock_cfi.py:159
TkOffTreeVariables::meanResXvsX
Float_t meanResXvsX
Definition: TkOffTreeVariables.h:70
Exception
Definition: hltDiff.cc:246
TrackerOfflineValidation::setUpTreeMembers
void setUpTreeMembers(const std::map< int, TrackerOfflineValidation::ModuleHistos > &moduleHist_, const TrackerGeometry &tkgeom, const TrackerTopology *tTopo)
Definition: TrackerOfflineValidation.cc:1705
TFileService::kSharedResource
static const std::string kSharedResource
Definition: TFileService.h:76
TkOffTreeVariables::chi2PerDofY
Float_t chi2PerDofY
Definition: TkOffTreeVariables.h:50
anotherprimaryvertexanalyzer_cfi.nBinX
nBinX
Definition: anotherprimaryvertexanalyzer_cfi.py:12
TrackerOfflineValidation::parSet_
const edm::ParameterSet parSet_
Definition: TrackerOfflineValidation.cc:326
TrackerOfflineValidation::ModuleHistos::ResXvsXProfile
TProfile * ResXvsXProfile
Definition: TrackerOfflineValidation.cc:124
GeomDetEnumerators::subDetId
constexpr unsigned int subDetId[21]
Definition: GeomDetEnumerators.h:34
Alignable.h
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
TkOffTreeVariables::histNameY
std::string histNameY
Definition: TkOffTreeVariables.h:68
TrackerOfflineValidation::prepareSummaryHists
void prepareSummaryHists(DirectoryWrapper &tfd, const Alignable &ali, std::vector< TrackerOfflineValidation::SummaryContainer > &vLevelProfiles)
Definition: TrackerOfflineValidation.cc:1402
TrackerOfflineValidation
Definition: TrackerOfflineValidation.cc:78
TrackerOfflineValidation::getMedian
float getMedian(const TH1 *hist) const
Definition: TrackerOfflineValidation.cc:2004
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TrackerOfflineValidation::vTrackProfiles_
std::vector< TH1 * > vTrackProfiles_
Definition: TrackerOfflineValidation.cc:349
TrackerGeometry::detIds
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Definition: TrackerGeometry.h:64
TrackerTopology::tecModule
unsigned int tecModule(const DetId &id) const
Definition: TrackerTopology.h:169
TrackerOfflineValidation::SummaryContainer
Definition: TrackerOfflineValidation.cc:134
TkOffTreeVariables::histNameNormX
std::string histNameNormX
Definition: TkOffTreeVariables.h:68
TkOffTreeVariables::histNameNormLocalX
std::string histNameNormLocalX
Definition: TkOffTreeVariables.h:67
TrackerOfflineValidation::SummaryContainer::sumNormYResiduals_
TH1 * sumNormYResiduals_
Definition: TrackerOfflineValidation.cc:155
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:200
TrackerOfflineValidation::vTrackHistos_
std::vector< TH1 * > vTrackHistos_
Definition: TrackerOfflineValidation.cc:348
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
TrackerOfflineValidation::NormXprimeResidual
Definition: TrackerOfflineValidation.cc:89
TkOffTreeVariables::posEta
Float_t posEta
Definition: TkOffTreeVariables.h:50
mps_fire.result
result
Definition: mps_fire.py:311
AlignableTracker.h
ConsumesCollector.h
cms::Exception
Definition: Exception.h:70
TrackerOfflineValidation::useOverflowForRMS_
const bool useOverflowForRMS_
Definition: TrackerOfflineValidation.cc:339
TrackerOfflineValidation::moduleLevelHistsTransient_
const bool moduleLevelHistsTransient_
Definition: TrackerOfflineValidation.cc:334
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
ParameterSet.h
dummy
Definition: DummySelector.h:38
TkOffTreeVariables::meanLocalX
Float_t meanLocalX
Definition: TkOffTreeVariables.h:50
spclusmultinvestigator_cfi.numberOfBins
numberOfBins
Definition: spclusmultinvestigator_cfi.py:17
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
TkOffTreeVariables::fitMeanNormX
Float_t fitMeanNormX
Definition: TkOffTreeVariables.h:50
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
TrackerGeometry::detUnitIds
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
Definition: TrackerGeometry.h:63
TrackerOfflineValidation::SummaryContainer::sumResYvsYProfile_
TH1 * sumResYvsYProfile_
Definition: TrackerOfflineValidation.cc:161
edm::Event
Definition: Event.h:73
TkOffTreeVariables::module
UInt_t module
Definition: TkOffTreeVariables.h:59
TkOffTreeVariables::sigmaNormX
Float_t sigmaNormX
Definition: TkOffTreeVariables.h:50
TkOffTreeVariables::rmsNormLocalX
Float_t rmsNormLocalX
Definition: TkOffTreeVariables.h:50
Alignable::components
virtual const Alignables & components() const =0
Return vector of all direct components.
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
TrackerOfflineValidation::dqmMode_
const bool dqmMode_
Definition: TrackerOfflineValidation.cc:340
TkOffTreeVariables::isStereo
Bool_t isStereo
Definition: TkOffTreeVariables.h:65
TrackerOfflineValidation::mTidResiduals_
std::map< int, TrackerOfflineValidation::ModuleHistos > mTidResiduals_
Definition: TrackerOfflineValidation.cc:355
TrackerOfflineValidation::ModuleHistos::NormResYprimeHisto
TH1 * NormResYprimeHisto
Definition: TrackerOfflineValidation.cc:122
StripSubdetector.h
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
TrackerOfflineValidation::XResidual
Definition: TrackerOfflineValidation.cc:85
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
TkOffTreeVariables::rmsY
Float_t rmsY
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidation::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: TrackerOfflineValidation.cc:1119
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
TrackerOfflineValidation::SummaryContainer::sumResYvsXProfile_
TH1 * sumResYvsXProfile_
Definition: TrackerOfflineValidation.cc:160
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
TrackerOfflineValidation::ModuleHistos::ResYprimeHisto
TH1 * ResYprimeHisto
Definition: TrackerOfflineValidation.cc:121
TrackerOfflineValidation::useFwhm_
const bool useFwhm_
Definition: TrackerOfflineValidation.cc:337
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
TrackerOfflineValidation::ModuleHistos::ResYvsXProfile
TProfile * ResYvsXProfile
Definition: TrackerOfflineValidation.cc:126
TrackerOfflineValidation::moduleLevelProfiles_
const bool moduleLevelProfiles_
Definition: TrackerOfflineValidation.cc:335
TrackerTopology::tecStereo
uint32_t tecStereo(const DetId &id) const
Definition: TrackerTopology.h:287
HGVHistoProducerAlgoBlock_cfi.maxX
maxX
Definition: HGVHistoProducerAlgoBlock_cfi.py:154
TkOffTreeVariables::histNameLocalY
std::string histNameLocalY
Definition: TkOffTreeVariables.h:67
TrackerOfflineValidation::SummaryContainer::sumResXvsXProfile_
TH1 * sumResXvsXProfile_
Definition: TrackerOfflineValidation.cc:158
TrackerOfflineValidation::NormYprimeResidual
Definition: TrackerOfflineValidation.cc:91
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
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
TrackerAlignableId.h
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184
TkOffTreeVariables::numberOfOutliers
Float_t numberOfOutliers
Definition: TkOffTreeVariables.h:50
TrackerOfflineValidation::fitResiduals
std::pair< float, float > fitResiduals(TH1 *hist) const
Definition: TrackerOfflineValidation.cc:1970
TrackerOfflineValidation::isEndCap
bool isEndCap(uint32_t subDetId)
Definition: TrackerOfflineValidation.cc:979