Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-07 23:57:44

0001 #ifndef PrimaryVertexValidation_h
0002 #define PrimaryVertexValidation_h
0003 
0004 // system include files
0005 #include <string>
0006 #include <sstream>
0007 #include <vector>
0008 #include <map>
0009 
0010 // ROOT Included
0011 #include "TFile.h"
0012 #include "TH1D.h"
0013 #include "TH1I.h"
0014 #include "TH2D.h"
0015 #include "TTree.h"
0016 
0017 // CMSSW includes
0018 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0019 #include "FWCore/ServiceRegistry/interface/Service.h"
0020 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0021 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0022 #include "DataFormats/TrackCandidate/interface/TrackCandidate.h"
0023 #include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h"
0024 #include "DataFormats/TrackReco/interface/Track.h"
0025 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0026 #include "DataFormats/TrackerRecHit2D/interface/ProjectedSiStripRecHit2D.h"
0027 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
0028 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
0029 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
0030 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
0031 #include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h"
0032 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
0033 #include "DataFormats/VertexReco/interface/Vertex.h"
0034 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0035 #include "FWCore/Framework/interface/ConsumesCollector.h"
0036 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0037 #include "FWCore/Framework/interface/Event.h"
0038 #include "FWCore/Framework/interface/EventSetup.h"
0039 #include "FWCore/Framework/interface/Frameworkfwd.h"
0040 #include "FWCore/Framework/interface/MakerMacros.h"
0041 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0042 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0043 #include "FWCore/Utilities/interface/EDGetToken.h"
0044 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0045 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0046 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0047 #include "RecoVertex/AdaptiveVertexFit/interface/AdaptiveVertexFitter.h"
0048 #include "RecoVertex/PrimaryVertexProducer/interface/PrimaryVertexProducerAlgorithm.h"
0049 #include "RecoVertex/PrimaryVertexProducer/interface/TrackClusterizerInZ.h"
0050 #include "RecoVertex/PrimaryVertexProducer/interface/TrackFilterForPVFinding.h"
0051 #include "RecoVertex/PrimaryVertexProducer/interface/TrackFilterForPVFindingBase.h"
0052 #include "RecoVertex/VertexPrimitives/interface/VertexFitter.h"
0053 #include "TrackingTools/IPTools/interface/IPTools.h"
0054 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateClosestToPoint.h"
0055 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
0056 #include "Alignment/OfflineValidation/interface/PVValidationHelpers.h"
0057 #include "MagneticField/Engine/interface/MagneticField.h"
0058 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0059 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
0060 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
0061 #include "CondFormats/RunInfo/interface/RunInfo.h"
0062 #include "TrackingTools/Records/interface/TransientTrackRecord.h"
0063 
0064 //
0065 // ancyllary enum for
0066 // residuals moments estimation
0067 //
0068 
0069 //
0070 // class decleration
0071 //
0072 
0073 class PrimaryVertexValidation : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::SharedResources> {
0074 public:
0075   explicit PrimaryVertexValidation(const edm::ParameterSet&);
0076   ~PrimaryVertexValidation() override;
0077   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0078 
0079 private:
0080   // framework provided methods
0081   void beginJob() override;
0082   void beginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) override;
0083   void analyze(const edm::Event&, const edm::EventSetup&) override;
0084   void endRun(edm::Run const&, edm::EventSetup const&) override{};
0085   void endJob() override;
0086 
0087   // user defined methods
0088   bool isBFieldConsistentWithMode(const edm::EventSetup& iSetup) const;
0089   std::pair<long long, long long> getRunTime(const edm::EventSetup& iSetup) const;
0090   bool isHit2D(const TrackingRecHit& hit, const PVValHelper::detectorPhase& thePhase) const;
0091   bool hasFirstLayerPixelHits(const reco::TransientTrack& track);
0092   std::pair<bool, bool> pixelHitsCheck(const reco::TransientTrack& track);
0093   Measurement1D getMedian(TH1F* histo);
0094   Measurement1D getMAD(TH1F* histo);
0095   std::pair<Measurement1D, Measurement1D> fitResiduals(TH1* hist);
0096 
0097   void fillTrendPlot(TH1F* trendPlot, TH1F* residualsPlot[100], PVValHelper::estimator fitPar_, const std::string& var_);
0098   void fillTrendPlotByIndex(TH1F* trendPlot,
0099                             std::vector<TH1F*>& h,
0100                             PVValHelper::estimator fitPar_,
0101                             PVValHelper::plotVariable plotVar = PVValHelper::END_OF_PLOTS);
0102 
0103   static bool vtxSort(const reco::Vertex& a, const reco::Vertex& b);
0104   bool passesTrackCuts(const reco::Track& track,
0105                        const reco::Vertex& vertex,
0106                        const std::string& qualityString_,
0107                        double dxyErrMax_,
0108                        double dzErrMax_,
0109                        double ptErrMax_);
0110 
0111   std::vector<TH1F*> bookResidualsHistogram(const TFileDirectory& dir,
0112                                             unsigned int theNOfBins,
0113                                             PVValHelper::residualType resType,
0114                                             PVValHelper::plotVariable varType,
0115                                             bool isNormalized = false);
0116   std::map<std::string, TH1*> bookVertexHistograms(const TFileDirectory& dir);
0117 
0118   void fillTrackHistos(std::map<std::string, TH1*>& h,
0119                        const std::string& ttype,
0120                        const reco::TransientTrack* tt,
0121                        const reco::Vertex& v,
0122                        const reco::BeamSpot& beamSpot,
0123                        double fBfield);
0124   void add(std::map<std::string, TH1*>& h, TH1* hist);
0125 
0126   void fill(std::map<std::string, TH1*>& h, const std::string& s, double x);
0127   void fill(std::map<std::string, TH1*>& h, const std::string& s, double x, double y);
0128   void fillByIndex(std::vector<TH1F*>& h, unsigned int index, double x, std::string tag = "");
0129 
0130   void shrinkHistVectorToFit(std::vector<TH1F*>& h, unsigned int desired_size);
0131   std::tuple<std::string, std::string, std::string> getTypeString(PVValHelper::residualType type);
0132   std::tuple<std::string, std::string, std::string> getVarString(PVValHelper::plotVariable var);
0133 
0134   void fillMap(TH2F* trendMap,
0135                TH1F* residualsMapPlot[100][100],
0136                PVValHelper::estimator fitPar_,
0137                const int nXBins_,
0138                const int nYBins_);
0139 
0140   inline double square(double x) { return x * x; }
0141 
0142   // ----------member data ---------------------------
0143   int Nevt_;
0144 
0145   std::unique_ptr<TrackFilterForPVFindingBase> theTrackFilter_;
0146   std::unique_ptr<TrackClusterizerInZ> theTrackClusterizer_;
0147 
0148   // setting of the number of plots
0149   static const int nMaxBins_ = 100;  // maximum number of bookable histograms
0150 
0151   // Output
0152 
0153   // tokens form the EventSetup
0154   const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magFieldToken_;
0155   const edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> trackingGeomToken_;
0156   const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> ttkToken_;
0157   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoToken_;
0158   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> topoTokenBR_;
0159   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geomTokenBR_;
0160   const edm::ESGetToken<RunInfo, RunInfoRcd> runInfoTokenBR_;
0161 
0162   const int compressionSettings_;  // determines the ROOT compression settings in TFileService
0163   bool storeNtuple_;
0164   bool lightNtupleSwitch_;  // switch to keep only info for daily validation
0165   bool useTracksFromRecoVtx_;
0166 
0167   // histogram details
0168   PVValHelper::histodetails theDetails_;
0169 
0170   // requirements on the vertex
0171   double vertexZMax_;
0172 
0173   // integrated lumi (if info available)
0174   double intLumi_;
0175 
0176   // requirements on the probe
0177   bool askFirstLayerHit_;  // ask hit in the first layer of pixels
0178   bool doBPix_;
0179   bool doFPix_;
0180   double ptOfProbe_;
0181   double pOfProbe_;
0182   double etaOfProbe_;
0183   double nHitsOfProbe_;
0184   PVValHelper::detectorPhase phase_;
0185 
0186   // actual number of histograms
0187   int nBins_;
0188 
0189   // limits of the pt binned plots range
0190   const double minPt_;
0191   const double maxPt_;
0192 
0193   std::vector<unsigned int> runControlNumbers_;
0194 
0195   bool debug_;
0196   bool runControl_;
0197 
0198   // force to use beamspot in the vertex fit
0199   bool forceBeamSpotContraint_;
0200 
0201   edm::EDGetTokenT<reco::TrackCollection> theTrackCollectionToken_;
0202   edm::EDGetTokenT<reco::VertexCollection> theVertexCollectionToken_;
0203   edm::EDGetTokenT<reco::BeamSpot> theBeamspotToken_;
0204 
0205   TTree* rootTree_;
0206 
0207   // Root-Tuple variables :
0208   //=======================
0209   void SetVarToZero();
0210 
0211   static const int nMaxtracks_ = 10000;
0212   static const int cmToum = 10000;
0213   static const int nPtBins_ = 48;
0214 
0215   // use the maximum of each of the three phases
0216   unsigned int nLadders_ = 20;
0217   unsigned int nModZ_ = 9;
0218 
0219   // pT binning as in paragraph 3.2 of CMS-PAS-TRK-10-005 (https://cds.cern.ch/record/1279383/files/TRK-10-005-pas.pdf)
0220 
0221   //                                      0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  33  34  35  36   37  38   39  40  41  42  43  44  45   46  47  48
0222   //const float mypT_bins_[nPtBins_+1] = {0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.0,4.1,4.25,4.5,4.75,5.0,5.5,6.0,7.0,8.0,9.0,11.0,14.0,20.};
0223 
0224   std::array<float, nPtBins_ + 1> mypT_bins_;
0225 
0226   // event-related quantities
0227   int nTracks_;
0228   int nTracksPerClus_;
0229   int nClus_;
0230   int nOfflineVertices_;
0231   unsigned int RunNumber_;
0232   unsigned int EventNumber_;
0233   unsigned int LuminosityBlockNumber_;
0234   double xOfflineVertex_;
0235   double yOfflineVertex_;
0236   double zOfflineVertex_;
0237 
0238   double xErrOfflineVertex_;
0239   double yErrOfflineVertex_;
0240   double zErrOfflineVertex_;
0241 
0242   double BSx0_;
0243   double BSy0_;
0244   double BSz0_;
0245   double Beamsigmaz_;
0246   double Beamdxdz_;
0247   double BeamWidthX_;
0248   double BeamWidthY_;
0249   double wxy2_;
0250 
0251   // track-related quantities
0252   double pt_[nMaxtracks_];
0253   double p_[nMaxtracks_];
0254   int nhits_[nMaxtracks_];
0255   int nhits1D_[nMaxtracks_];
0256   int nhits2D_[nMaxtracks_];
0257   int nhitsBPIX_[nMaxtracks_];
0258   int nhitsFPIX_[nMaxtracks_];
0259   int nhitsTIB_[nMaxtracks_];
0260   int nhitsTID_[nMaxtracks_];
0261   int nhitsTOB_[nMaxtracks_];
0262   int nhitsTEC_[nMaxtracks_];
0263   int isHighPurity_[nMaxtracks_];
0264   double eta_[nMaxtracks_];
0265   double theta_[nMaxtracks_];
0266   double phi_[nMaxtracks_];
0267   double chi2_[nMaxtracks_];
0268   double chi2ndof_[nMaxtracks_];
0269   int charge_[nMaxtracks_];
0270   double qoverp_[nMaxtracks_];
0271   double dz_[nMaxtracks_];
0272   double dxy_[nMaxtracks_];
0273   double dxyBs_[nMaxtracks_];
0274   double dzBs_[nMaxtracks_];
0275   double xPCA_[nMaxtracks_];
0276   double yPCA_[nMaxtracks_];
0277   double zPCA_[nMaxtracks_];
0278   double xUnbiasedVertex_[nMaxtracks_];
0279   double yUnbiasedVertex_[nMaxtracks_];
0280   double zUnbiasedVertex_[nMaxtracks_];
0281   float chi2normUnbiasedVertex_[nMaxtracks_];
0282   float chi2UnbiasedVertex_[nMaxtracks_];
0283   float chi2ProbUnbiasedVertex_[nMaxtracks_];
0284   float DOFUnbiasedVertex_[nMaxtracks_];
0285   float sumOfWeightsUnbiasedVertex_[nMaxtracks_];
0286   int tracksUsedForVertexing_[nMaxtracks_];
0287 
0288   double dxyFromMyVertex_[nMaxtracks_];
0289   double dzFromMyVertex_[nMaxtracks_];
0290   double d3DFromMyVertex_[nMaxtracks_];
0291 
0292   double dxyErrorFromMyVertex_[nMaxtracks_];
0293   double dzErrorFromMyVertex_[nMaxtracks_];
0294   double d3DErrorFromMyVertex_[nMaxtracks_];
0295 
0296   double IPTsigFromMyVertex_[nMaxtracks_];
0297   double IPLsigFromMyVertex_[nMaxtracks_];
0298   double IP3DsigFromMyVertex_[nMaxtracks_];
0299 
0300   int hasRecVertex_[nMaxtracks_];
0301   int isGoodTrack_[nMaxtracks_];
0302 
0303   edm::Service<TFileService> fs;
0304 
0305   TFileDirectory MeanTrendsDir;
0306   TFileDirectory WidthTrendsDir;
0307   TFileDirectory MedianTrendsDir;
0308   TFileDirectory MADTrendsDir;
0309 
0310   TFileDirectory Mean2DMapsDir;
0311   TFileDirectory Width2DMapsDir;
0312 
0313   // histogram for sanity check
0314   TH1F* h_etaMax;
0315   TH1F* h_nbins;
0316   TH1F* h_nLadders;
0317   TH1F* h_nModZ;
0318   TH1F* h_pTinfo;
0319 
0320   std::map<unsigned int, std::pair<long long, long long> > runNumbersTimesLog_;
0321   TH1I* h_runStartTimes;
0322   TH1I* h_runEndTimes;
0323 
0324   // ---- directly histograms // ===> unbiased residuals
0325 
0326   // absolute residuals
0327 
0328   std::vector<TH1F*> a_dxyPhiResiduals;
0329   std::vector<TH1F*> a_dxyEtaResiduals;
0330 
0331   std::vector<TH1F*> a_dxPhiResiduals;
0332   std::vector<TH1F*> a_dxEtaResiduals;
0333 
0334   std::vector<TH1F*> a_dyPhiResiduals;
0335   std::vector<TH1F*> a_dyEtaResiduals;
0336 
0337   std::vector<TH1F*> a_dzPhiResiduals;
0338   std::vector<TH1F*> a_dzEtaResiduals;
0339 
0340   std::vector<TH1F*> a_IP2DPhiResiduals;
0341   std::vector<TH1F*> a_IP2DEtaResiduals;
0342 
0343   std::vector<TH1F*> a_IP3DPhiResiduals;
0344   std::vector<TH1F*> a_IP3DEtaResiduals;
0345 
0346   std::vector<TH1F*> a_reszPhiResiduals;
0347   std::vector<TH1F*> a_reszEtaResiduals;
0348 
0349   std::vector<TH1F*> a_d3DPhiResiduals;
0350   std::vector<TH1F*> a_d3DEtaResiduals;
0351 
0352   // normalized residuals
0353 
0354   std::vector<TH1F*> n_dxyPhiResiduals;
0355   std::vector<TH1F*> n_dxyEtaResiduals;
0356 
0357   std::vector<TH1F*> n_dzPhiResiduals;
0358   std::vector<TH1F*> n_dzEtaResiduals;
0359 
0360   std::vector<TH1F*> n_IP2DPhiResiduals;
0361   std::vector<TH1F*> n_IP2DEtaResiduals;
0362 
0363   std::vector<TH1F*> n_IP3DPhiResiduals;
0364   std::vector<TH1F*> n_IP3DEtaResiduals;
0365 
0366   std::vector<TH1F*> n_reszPhiResiduals;
0367   std::vector<TH1F*> n_reszEtaResiduals;
0368 
0369   std::vector<TH1F*> n_d3DPhiResiduals;
0370   std::vector<TH1F*> n_d3DEtaResiduals;
0371 
0372   // for the maps
0373 
0374   TH1F* a_dxyResidualsMap[nMaxBins_][nMaxBins_];
0375   TH1F* a_dzResidualsMap[nMaxBins_][nMaxBins_];
0376   TH1F* a_d3DResidualsMap[nMaxBins_][nMaxBins_];
0377 
0378   TH1F* n_dxyResidualsMap[nMaxBins_][nMaxBins_];
0379   TH1F* n_dzResidualsMap[nMaxBins_][nMaxBins_];
0380   TH1F* n_d3DResidualsMap[nMaxBins_][nMaxBins_];
0381 
0382   // for the L1 maps
0383 
0384   TH1F* a_dxyL1ResidualsMap[nMaxBins_][nMaxBins_];
0385   TH1F* a_dzL1ResidualsMap[nMaxBins_][nMaxBins_];
0386   TH1F* n_dxyL1ResidualsMap[nMaxBins_][nMaxBins_];
0387   TH1F* n_dzL1ResidualsMap[nMaxBins_][nMaxBins_];
0388 
0389   // ---- trends as function of phi and eta
0390 
0391   TH1F* a_dxyPhiMeanTrend;
0392   TH1F* a_dxyPhiWidthTrend;
0393   TH1F* a_dzPhiMeanTrend;
0394   TH1F* a_dzPhiWidthTrend;
0395 
0396   TH1F* a_dxyEtaMeanTrend;
0397   TH1F* a_dxyEtaWidthTrend;
0398   TH1F* a_dzEtaMeanTrend;
0399   TH1F* a_dzEtaWidthTrend;
0400 
0401   TH1F* n_dxyPhiMeanTrend;
0402   TH1F* n_dxyPhiWidthTrend;
0403   TH1F* n_dzPhiMeanTrend;
0404   TH1F* n_dzPhiWidthTrend;
0405 
0406   TH1F* n_dxyEtaMeanTrend;
0407   TH1F* n_dxyEtaWidthTrend;
0408   TH1F* n_dzEtaMeanTrend;
0409   TH1F* n_dzEtaWidthTrend;
0410 
0411   // ---- trends as a function of pT
0412 
0413   TH1F* a_dxypTMeanTrend;
0414   TH1F* a_dxypTWidthTrend;
0415   TH1F* a_dzpTMeanTrend;
0416   TH1F* a_dzpTWidthTrend;
0417 
0418   TH1F* a_dxypTCentralMeanTrend;
0419   TH1F* a_dxypTCentralWidthTrend;
0420   TH1F* a_dzpTCentralMeanTrend;
0421   TH1F* a_dzpTCentralWidthTrend;
0422 
0423   TH1F* n_dxypTMeanTrend;
0424   TH1F* n_dxypTWidthTrend;
0425   TH1F* n_dzpTMeanTrend;
0426   TH1F* n_dzpTWidthTrend;
0427 
0428   TH1F* n_dxypTCentralMeanTrend;
0429   TH1F* n_dxypTCentralWidthTrend;
0430   TH1F* n_dzpTCentralMeanTrend;
0431   TH1F* n_dzpTCentralWidthTrend;
0432 
0433   // --- trend as a function of the ladder/module number
0434 
0435   TH1F* a_dxymodZMeanTrend;
0436   TH1F* a_dxymodZWidthTrend;
0437   TH1F* a_dzmodZMeanTrend;
0438   TH1F* a_dzmodZWidthTrend;
0439 
0440   TH1F* a_dxyladderMeanTrend;
0441   TH1F* a_dxyladderWidthTrend;
0442   TH1F* a_dzladderMeanTrend;
0443   TH1F* a_dzladderWidthTrend;
0444 
0445   TH1F* n_dxymodZMeanTrend;
0446   TH1F* n_dxymodZWidthTrend;
0447   TH1F* n_dzmodZMeanTrend;
0448   TH1F* n_dzmodZWidthTrend;
0449 
0450   TH1F* n_dxyladderMeanTrend;
0451   TH1F* n_dxyladderWidthTrend;
0452   TH1F* n_dzladderMeanTrend;
0453   TH1F* n_dzladderWidthTrend;
0454 
0455   // ---- medians and MAD
0456 
0457   TH1F* a_dxyPhiMedianTrend;
0458   TH1F* a_dxyPhiMADTrend;
0459   TH1F* a_dzPhiMedianTrend;
0460   TH1F* a_dzPhiMADTrend;
0461 
0462   TH1F* a_dxyEtaMedianTrend;
0463   TH1F* a_dxyEtaMADTrend;
0464   TH1F* a_dzEtaMedianTrend;
0465   TH1F* a_dzEtaMADTrend;
0466 
0467   TH1F* n_dxyPhiMedianTrend;
0468   TH1F* n_dxyPhiMADTrend;
0469   TH1F* n_dzPhiMedianTrend;
0470   TH1F* n_dzPhiMADTrend;
0471 
0472   TH1F* n_dxyEtaMedianTrend;
0473   TH1F* n_dxyEtaMADTrend;
0474   TH1F* n_dzEtaMedianTrend;
0475   TH1F* n_dzEtaMADTrend;
0476 
0477   // 2D residuals
0478 
0479   TH2F* a_dxyVsPhi;
0480   TH2F* a_dzVsPhi;
0481 
0482   TH2F* n_dxyVsPhi;
0483   TH2F* n_dzVsPhi;
0484 
0485   TH2F* a_dxyVsEta;
0486   TH2F* a_dzVsEta;
0487 
0488   TH2F* n_dxyVsEta;
0489   TH2F* n_dzVsEta;
0490 
0491   // 2D maps
0492 
0493   TH2F* a_dxyMeanMap;
0494   TH2F* a_dzMeanMap;
0495 
0496   TH2F* n_dxyMeanMap;
0497   TH2F* n_dzMeanMap;
0498 
0499   TH2F* a_dxyWidthMap;
0500   TH2F* a_dzWidthMap;
0501 
0502   TH2F* n_dxyWidthMap;
0503   TH2F* n_dzWidthMap;
0504 
0505   //2D maps of residuals in bins of L1 modules
0506 
0507   TH2F* a_dxyL1MeanMap;
0508   TH2F* a_dzL1MeanMap;
0509 
0510   TH2F* n_dxyL1MeanMap;
0511   TH2F* n_dzL1MeanMap;
0512 
0513   TH2F* a_dxyL1WidthMap;
0514   TH2F* a_dzL1WidthMap;
0515 
0516   TH2F* n_dxyL1WidthMap;
0517   TH2F* n_dzL1WidthMap;
0518 
0519   //
0520   // ---- directly histograms
0521   // biased residuals
0522 
0523   // absolute residuals
0524 
0525   std::vector<TH1F*> a_dxyPhiBiasResiduals;
0526   std::vector<TH1F*> a_dxyEtaBiasResiduals;
0527 
0528   std::vector<TH1F*> a_dzPhiBiasResiduals;
0529   std::vector<TH1F*> a_dzEtaBiasResiduals;
0530 
0531   // normalized BiasResiduals
0532 
0533   std::vector<TH1F*> n_dxyPhiBiasResiduals;
0534   std::vector<TH1F*> n_dxyEtaBiasResiduals;
0535 
0536   std::vector<TH1F*> n_dzPhiBiasResiduals;
0537   std::vector<TH1F*> n_dzEtaBiasResiduals;
0538 
0539   // for the maps
0540 
0541   TH1F* a_dxyBiasResidualsMap[nMaxBins_][nMaxBins_];
0542   TH1F* a_dzBiasResidualsMap[nMaxBins_][nMaxBins_];
0543 
0544   TH1F* n_dxyBiasResidualsMap[nMaxBins_][nMaxBins_];
0545   TH1F* n_dzBiasResidualsMap[nMaxBins_][nMaxBins_];
0546 
0547   // ---- trends as function of phi / eta
0548 
0549   TH1F* a_dxyPhiMeanBiasTrend;
0550   TH1F* a_dxyPhiWidthBiasTrend;
0551   TH1F* a_dzPhiMeanBiasTrend;
0552   TH1F* a_dzPhiWidthBiasTrend;
0553 
0554   TH1F* a_dxyEtaMeanBiasTrend;
0555   TH1F* a_dxyEtaWidthBiasTrend;
0556   TH1F* a_dzEtaMeanBiasTrend;
0557   TH1F* a_dzEtaWidthBiasTrend;
0558 
0559   TH1F* n_dxyPhiMeanBiasTrend;
0560   TH1F* n_dxyPhiWidthBiasTrend;
0561   TH1F* n_dzPhiMeanBiasTrend;
0562   TH1F* n_dzPhiWidthBiasTrend;
0563 
0564   TH1F* n_dxyEtaMeanBiasTrend;
0565   TH1F* n_dxyEtaWidthBiasTrend;
0566   TH1F* n_dzEtaMeanBiasTrend;
0567   TH1F* n_dzEtaWidthBiasTrend;
0568 
0569   // ---- medians and MAD
0570 
0571   TH1F* a_dxyPhiMedianBiasTrend;
0572   TH1F* a_dxyPhiMADBiasTrend;
0573   TH1F* a_dzPhiMedianBiasTrend;
0574   TH1F* a_dzPhiMADBiasTrend;
0575 
0576   TH1F* a_dxyEtaMedianBiasTrend;
0577   TH1F* a_dxyEtaMADBiasTrend;
0578   TH1F* a_dzEtaMedianBiasTrend;
0579   TH1F* a_dzEtaMADBiasTrend;
0580 
0581   TH1F* n_dxyPhiMedianBiasTrend;
0582   TH1F* n_dxyPhiMADBiasTrend;
0583   TH1F* n_dzPhiMedianBiasTrend;
0584   TH1F* n_dzPhiMADBiasTrend;
0585 
0586   TH1F* n_dxyEtaMedianBiasTrend;
0587   TH1F* n_dxyEtaMADBiasTrend;
0588   TH1F* n_dzEtaMedianBiasTrend;
0589   TH1F* n_dzEtaMADBiasTrend;
0590 
0591   // 2D maps
0592 
0593   TH2F* a_dxyMeanBiasMap;
0594   TH2F* a_dzMeanBiasMap;
0595 
0596   TH2F* n_dxyMeanBiasMap;
0597   TH2F* n_dzMeanBiasMap;
0598 
0599   TH2F* a_dxyWidthBiasMap;
0600   TH2F* a_dzWidthBiasMap;
0601 
0602   TH2F* n_dxyWidthBiasMap;
0603   TH2F* n_dzWidthBiasMap;
0604 
0605   // check event
0606   TH1F* h_nTracks;
0607   TH1F* h_nClus;
0608   TH1F* h_nOfflineVertices;
0609   TH1F* h_runNumber;
0610   TH1F* h_lumiFromConfig;
0611   TH1I* h_runFromConfig;
0612   TH1I* h_runFromEvent;
0613   TH1F* h_xOfflineVertex;
0614   TH1F* h_yOfflineVertex;
0615   TH1F* h_zOfflineVertex;
0616   TH1F* h_xErrOfflineVertex;
0617   TH1F* h_yErrOfflineVertex;
0618   TH1F* h_zErrOfflineVertex;
0619   TH1F* h_BSx0;
0620   TH1F* h_BSy0;
0621   TH1F* h_BSz0;
0622   TH1F* h_Beamsigmaz;
0623   TH1F* h_BeamWidthX;
0624   TH1F* h_BeamWidthY;
0625 
0626   // check probe
0627 
0628   TH2F* h2_probeEtaPhi_;
0629   TH2F* h2_probeEtaPt_;
0630 
0631   TH1F* h_probeP_;
0632   TH1F* h_probePt_;
0633   TH1F* h_probePtRebin_;
0634   TH1F* h_probeEta_;
0635   TH1F* h_probePhi_;
0636   TH1F* h_probeChi2_;
0637   TH1F* h_probeNormChi2_;
0638   TH1F* h_probeCharge_;
0639   TH1F* h_probeQoverP_;
0640 
0641   TH1F* h_probedzRecoV_;
0642   TH1F* h_probedxyRecoV_;
0643 
0644   TH1F* h_probedzRefitV_;
0645   TH1F* h_probedxyRefitV_;
0646 
0647   TH1F* h_probed0RefitV_;
0648   TH1F* h_probez0RefitV_;
0649 
0650   TH1F* h_probesignIP2DRefitV_;
0651   TH1F* h_probed3DRefitV_;
0652   TH1F* h_probereszRefitV_;
0653 
0654   TH1F* h_probeRecoVSigZ_;
0655   TH1F* h_probeRecoVSigXY_;
0656   TH1F* h_probeRefitVSigZ_;
0657   TH1F* h_probeRefitVSigXY_;
0658   TH1F* h_probeRefitVSig3D_;
0659   TH1F* h_probeRefitVLogSig3D_;
0660   TH1F* h_probeRefitVSigResZ_;
0661 
0662   TH1F* h_probeHits_;
0663   TH1F* h_probeHits1D_;
0664   TH1F* h_probeHits2D_;
0665   TH1F* h_probeHitsInTIB_;
0666   TH1F* h_probeHitsInTOB_;
0667   TH1F* h_probeHitsInTID_;
0668   TH1F* h_probeHitsInTEC_;
0669   TH1F* h_probeHitsInBPIX_;
0670   TH1F* h_probeHitsInFPIX_;
0671 
0672   TH1F* h_probeL1Ladder_;
0673   TH1F* h_probeL1Module_;
0674   TH1I* h_probeHasBPixL1Overlap_;
0675 
0676   TH1F* h_probeL1ClusterProb_;
0677   TH2F* h2_probeLayer1Map_;
0678   TH2F* h2_probePassingLayer1Map_;
0679 
0680   // check vertex
0681 
0682   TH1F* h_fitVtxNdof_;
0683   TH1F* h_fitVtxChi2_;
0684   TH1F* h_fitVtxNtracks_;
0685   TH1F* h_fitVtxChi2ndf_;
0686   TH1F* h_fitVtxChi2Prob_;
0687   TH1F* h_fitVtxTrackWeights_;
0688   TH1F* h_fitVtxTrackAverageWeight_;
0689 
0690   TH1F* h_recoVtxNtracks_;
0691   TH1F* h_recoVtxChi2ndf_;
0692   TH1F* h_recoVtxChi2Prob_;
0693   TH1F* h_recoVtxSumPt_;
0694 
0695   std::map<std::string, TH1*> hDA;
0696 
0697   // histograms for the plots as function of pT
0698 
0699   std::vector<TH1F*> h_dxy_pT_;
0700   std::vector<TH1F*> h_dz_pT_;
0701   std::vector<TH1F*> h_norm_dxy_pT_;
0702   std::vector<TH1F*> h_norm_dz_pT_;
0703 
0704   std::vector<TH1F*> h_dxy_Central_pT_;
0705   std::vector<TH1F*> h_dz_Central_pT_;
0706   std::vector<TH1F*> h_norm_dxy_Central_pT_;
0707   std::vector<TH1F*> h_norm_dz_Central_pT_;
0708 
0709   // histograms for the plots as function of module ladder and number
0710 
0711   std::vector<TH1F*> h_dxy_modZ_;
0712   std::vector<TH1F*> h_dz_modZ_;
0713   std::vector<TH1F*> h_norm_dxy_modZ_;
0714   std::vector<TH1F*> h_norm_dz_modZ_;
0715 
0716   std::vector<TH1F*> h_dxy_ladderOverlap_;
0717   std::vector<TH1F*> h_dxy_ladderNoOverlap_;
0718 
0719   std::vector<TH1F*> h_dxy_ladder_;
0720   std::vector<TH1F*> h_dz_ladder_;
0721   std::vector<TH1F*> h_norm_dxy_ladder_;
0722   std::vector<TH1F*> h_norm_dz_ladder_;
0723 };
0724 
0725 #endif