Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-01-24 01:11:30

0001 #ifndef TrackAnalyzer_H
0002 #define TrackAnalyzer_H
0003 //
0004 /**\class TrackingAnalyzer TrackingAnalyzer.cc 
0005 Monitoring source for general quantities related to tracks.
0006 */
0007 // Original Author:  Suchandra Dutta, Giorgia Mila
0008 //         Created:  Thu 28 22:45:30 CEST 2008
0009 
0010 #include <memory>
0011 #include <fstream>
0012 #include <unordered_map>
0013 #include "FWCore/Utilities/interface/EDGetToken.h"
0014 #include "FWCore/Utilities/interface/ESGetToken.h"
0015 #include "FWCore/Framework/interface/ConsumesCollector.h"
0016 #include "FWCore/Framework/interface/Frameworkfwd.h"
0017 #include "FWCore/Framework/interface/Event.h"
0018 #include "FWCore/Framework/interface/MakerMacros.h"
0019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0020 #include "FWCore/ServiceRegistry/interface/Service.h"
0021 #include "DQMServices/Core/interface/DQMStore.h"
0022 
0023 #include "DataFormats/BeamSpot/interface/BeamSpot.h"
0024 #include "DataFormats/VertexReco/interface/Vertex.h"
0025 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0026 
0027 #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
0028 #include "DataFormats/Scalers/interface/LumiScalers.h"
0029 #include "DataFormats/OnlineMetaData/interface/OnlineLuminosityRecord.h"
0030 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0031 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0032 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0033 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0034 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
0035 #include "TrackingTools/Records/interface/TransientTrackRecord.h"
0036 
0037 class BeamSpot;
0038 namespace tadqm {
0039   class TrackAnalyzer {
0040   public:
0041     typedef dqm::legacy::DQMStore DQMStore;
0042     typedef dqm::legacy::MonitorElement MonitorElement;
0043     TrackAnalyzer(const edm::ParameterSet&);
0044     TrackAnalyzer(const edm::ParameterSet&, edm::ConsumesCollector& iC);
0045     ~TrackAnalyzer();
0046     void initHisto(DQMStore::IBooker& ibooker, const edm::EventSetup&, const edm::ParameterSet&);
0047 
0048     void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup, const reco::Track& track);
0049 
0050     // Compute and locally store the number of Good vertices found
0051     // in the event. This information is used as X-axis value in
0052     // the hit-efficiency plots derived from the hit patter. This
0053     // ugly design to avoid comuting this very same quantity for
0054     // each and every track while in the analyze method. A
0055     // redesign of the class is needed in the future.
0056     void setNumberOfGoodVertices(const edm::Event&);
0057     void setBX(const edm::Event&);
0058     void setLumi(const edm::Event&, const edm::EventSetup& iSetup);
0059 
0060   private:
0061     void initHistos();
0062     void fillHistosForState(const edm::EventSetup& iSetup, const reco::Track& track, std::string sname);
0063     void bookHistosForState(std::string sname, DQMStore::IBooker& ibooker);
0064     void bookHistosForHitProperties(DQMStore::IBooker& ibooker);
0065     void bookHistosForLScertification(DQMStore::IBooker& ibooker);
0066     void bookHistosForBeamSpot(DQMStore::IBooker& ibooker);
0067     void bookHistosForTrackerSpecific(DQMStore::IBooker& ibooker);
0068     void bookHistosForEfficiencyFromHitPatter(DQMStore::IBooker& ibooker,
0069                                               const edm::EventSetup& iSetup,
0070                                               const std::string suffix,
0071                                               bool useInac);
0072     void fillHistosForHitProperties(const edm::EventSetup& iSetup, const reco::Track& track, std::string sname);
0073     void fillHistosForLScertification(const edm::EventSetup& iSetup, const reco::Track& track, std::string sname);
0074     void fillHistosForTrackerSpecific(const reco::Track& track);
0075     void fillHistosForEfficiencyFromHitPatter(const reco::Track& track,
0076                                               const std::string suffix,
0077                                               const float monitoring,
0078                                               bool useInac);
0079 
0080     // ----------member data ---------------------------
0081     std::string TopFolder_;
0082 
0083     edm::EDGetTokenT<reco::BeamSpot> beamSpotToken_;
0084     edm::EDGetTokenT<reco::VertexCollection> pvToken_;
0085     edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > pixelClustersToken_;
0086     edm::EDGetTokenT<LumiScalersCollection> lumiscalersToken_;
0087     edm::EDGetTokenT<OnlineLuminosityRecord> metaDataToken_;
0088     edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeometryToken_;
0089     edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopologyToken_;
0090     edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> transientTrackBuilderToken_;
0091 
0092     float lumi_factor_per_bx_;
0093 
0094     edm::ParameterSet const* conf_;
0095 
0096     std::string stateName_;
0097 
0098     bool doTrackerSpecific_;
0099     bool doAllPlots_;
0100     bool doBSPlots_;
0101     bool doPVPlots_;
0102     bool doDCAPlots_;
0103     bool doGeneralPropertiesPlots_;
0104     bool doMeasurementStatePlots_;
0105     bool doHitPropertiesPlots_;
0106     bool doRecHitVsPhiVsEtaPerTrack_;
0107     bool doRecHitVsPtVsEtaPerTrack_;
0108     // ADD by Mia
0109     bool doLayersVsPhiVsEtaPerTrack_;
0110     bool doTrackRecHitVsPhiVsEtaPerTrack_;
0111     bool doTrackRecHitVsPtVsEtaPerTrack_;
0112     bool doTrackLayersVsPhiVsEtaPerTrack_;
0113     bool doTrack2DChi2Plots_;
0114     bool doRecHitsPerTrackProfile_;
0115     // ADD by Mia in order to clean the tracking MEs
0116     // do not plot *Theta* and TrackPx* and TrackPy*
0117     bool doThetaPlots_;
0118     bool doTrackPxPyPlots_;
0119     // ADD by Mia in order to not plot DistanceOfClosestApproach w.r.t. (0,0,0)
0120     // the DistanceOfClosestApproach w.r.t. the beam-spot is already shown in DistanceOfClosestApproachToBS
0121     bool doDCAwrtPVPlots_;
0122     bool doDCAwrt000Plots_;
0123 
0124     bool doLumiAnalysis_;
0125 
0126     // ADD by Mia in order to turnON test MEs
0127     bool doTestPlots_;
0128 
0129     //For HI Plots
0130     bool doHIPlots_;
0131 
0132     // IP significance plots
0133     bool doSIPPlots_;
0134 
0135     // Compute the hit-finding efficiency using the HitPattern of
0136     // the reconstructed tracks
0137     bool doEffFromHitPatternVsPU_;
0138     bool doEffFromHitPatternVsBX_;
0139     bool doEffFromHitPatternVsLUMI_;
0140     int pvNDOF_;
0141     const bool forceSCAL_;
0142     bool useBPixLayer1_;
0143     int minNumberOfPixelsPerCluster_;
0144     float minPixelClusterCharge_;
0145     std::string qualityString_;
0146 
0147     struct TkParameterMEs {
0148       TkParameterMEs()
0149           : TrackP(nullptr),
0150             TrackPx(nullptr),
0151             TrackPy(nullptr),
0152             TrackPz(nullptr),
0153             TrackPt(nullptr)
0154 
0155             ,
0156             TrackPxErr(nullptr),
0157             TrackPyErr(nullptr),
0158             TrackPzErr(nullptr),
0159             TrackPtErr(nullptr),
0160             TrackPErr(nullptr)
0161 
0162             ,
0163             TrackPtErrVsEta(nullptr)
0164 
0165             ,
0166             TrackQ(nullptr)
0167 
0168             ,
0169             TrackPhi(nullptr),
0170             TrackEta(nullptr),
0171             TrackTheta(nullptr)
0172 
0173             ,
0174             TrackPhiErr(nullptr),
0175             TrackEtaErr(nullptr),
0176             TrackThetaErr(nullptr)
0177 
0178             ,
0179             NumberOfRecHitsPerTrackVsPhi(nullptr),
0180             NumberOfRecHitsPerTrackVsTheta(nullptr),
0181             NumberOfRecHitsPerTrackVsEta(nullptr),
0182             NumberOfRecHitVsPhiVsEtaPerTrack(nullptr)
0183 
0184             ,
0185             NumberOfValidRecHitsPerTrackVsPhi(nullptr),
0186             NumberOfValidRecHitsPerTrackVsTheta(nullptr),
0187             NumberOfValidRecHitsPerTrackVsEta(nullptr),
0188             NumberOfValidRecHitsPerTrackVsPt(nullptr),
0189             NumberOfValidRecHitVsPhiVsEtaPerTrack(nullptr),
0190             NumberOfValidRecHitVsPtVsEtaPerTrack(nullptr)
0191 
0192             ,
0193             NumberOfLostRecHitsPerTrackVsPhi(nullptr),
0194             NumberOfLostRecHitsPerTrackVsTheta(nullptr),
0195             NumberOfLostRecHitsPerTrackVsEta(nullptr),
0196             NumberOfLostRecHitsPerTrackVsPt(nullptr),
0197             NumberOfLostRecHitVsPhiVsEtaPerTrack(nullptr),
0198             NumberOfLostRecHitVsPtVsEtaPerTrack(nullptr)
0199 
0200             ,
0201             NumberOfMIRecHitsPerTrackVsPhi(nullptr),
0202             NumberOfMIRecHitsPerTrackVsTheta(nullptr),
0203             NumberOfMIRecHitsPerTrackVsEta(nullptr),
0204             NumberOfMIRecHitsPerTrackVsPt(nullptr),
0205             NumberOfMIRecHitVsPhiVsEtaPerTrack(nullptr),
0206             NumberOfMIRecHitVsPtVsEtaPerTrack(nullptr)
0207 
0208             ,
0209             NumberOfMORecHitsPerTrackVsPhi(nullptr),
0210             NumberOfMORecHitsPerTrackVsTheta(nullptr),
0211             NumberOfMORecHitsPerTrackVsEta(nullptr),
0212             NumberOfMORecHitsPerTrackVsPt(nullptr),
0213             NumberOfMORecHitVsPhiVsEtaPerTrack(nullptr),
0214             NumberOfMORecHitVsPtVsEtaPerTrack(nullptr)
0215 
0216             ,
0217             NumberOfLayersPerTrackVsPhi(nullptr),
0218             NumberOfLayersPerTrackVsTheta(nullptr),
0219             NumberOfLayersPerTrackVsEta(nullptr)
0220 
0221             ,
0222             Chi2oNDFVsNHits(nullptr),
0223             Chi2oNDFVsPt(nullptr),
0224             Chi2oNDFVsEta(nullptr),
0225             Chi2oNDFVsPhi(nullptr),
0226             Chi2oNDFVsTheta(nullptr)
0227 
0228             ,
0229             Chi2ProbVsEta(nullptr),
0230             Chi2ProbVsPhi(nullptr),
0231             Chi2ProbVsTheta(nullptr) {}
0232 
0233       MonitorElement* TrackP;
0234       MonitorElement* TrackPx;
0235       MonitorElement* TrackPy;
0236       MonitorElement* TrackPz;
0237       MonitorElement* TrackPt;
0238       MonitorElement* TrackPt_NegEta_Phi_btw_neg16_neg32;
0239       MonitorElement* TrackPt_NegEta_Phi_btw_0_neg16;
0240       MonitorElement* TrackPt_NegEta_Phi_btw_16_0;
0241       MonitorElement* TrackPt_NegEta_Phi_btw_32_16;
0242       MonitorElement* TrackPt_PosEta_Phi_btw_neg16_neg32;
0243       MonitorElement* TrackPt_PosEta_Phi_btw_0_neg16;
0244       MonitorElement* TrackPt_PosEta_Phi_btw_16_0;
0245       MonitorElement* TrackPt_PosEta_Phi_btw_32_16;
0246       MonitorElement* Ratio_byFolding;
0247       MonitorElement* Ratio_byFolding2;
0248       MonitorElement* TrackPtHighPurity;
0249       MonitorElement* TrackPtTight;
0250       MonitorElement* TrackPtLoose;
0251       MonitorElement* Quality;
0252 
0253       MonitorElement* TrackPxErr;
0254       MonitorElement* TrackPyErr;
0255       MonitorElement* TrackPzErr;
0256       MonitorElement* TrackPtErr;
0257       MonitorElement* TrackPErr;
0258 
0259       MonitorElement* TrackPtErrVsEta;
0260 
0261       MonitorElement* TrackQ;
0262       MonitorElement* TrackQoverP;
0263 
0264       MonitorElement* TrackPhi;
0265       MonitorElement* TrackEta;
0266       MonitorElement* TrackEtaHighPurity;
0267       MonitorElement* TrackEtaTight;
0268       MonitorElement* TrackEtaLoose;
0269       MonitorElement* TrackEtaPhi = nullptr;
0270       MonitorElement* TrackEtaPhiInverted = nullptr;
0271       MonitorElement* TrackEtaPhiInvertedoutofphase = nullptr;
0272       MonitorElement* TrackEtaPhiInner = nullptr;
0273       MonitorElement* TrackEtaPhiOuter = nullptr;
0274 
0275       MonitorElement* TrackTheta;
0276 
0277       MonitorElement* TrackPhiErr;
0278       MonitorElement* TrackEtaErr;
0279       MonitorElement* TrackThetaErr;
0280 
0281       MonitorElement* NumberOfRecHitsPerTrackVsPhi;
0282       MonitorElement* NumberOfRecHitsPerTrackVsTheta;
0283       MonitorElement* NumberOfRecHitsPerTrackVsEta;
0284       MonitorElement* NumberOfRecHitVsPhiVsEtaPerTrack;
0285 
0286       MonitorElement* NumberOfValidRecHitsPerTrackVsPhi;
0287       MonitorElement* NumberOfValidRecHitsPerTrackVsTheta;
0288       MonitorElement* NumberOfValidRecHitsPerTrackVsEta;
0289       MonitorElement* NumberOfValidRecHitsPerTrackVsPt;
0290       MonitorElement* NumberOfValidRecHitVsPhiVsEtaPerTrack;
0291       MonitorElement* NumberOfValidRecHitVsPtVsEtaPerTrack;
0292 
0293       MonitorElement* NumberOfLostRecHitsPerTrackVsPhi;
0294       MonitorElement* NumberOfLostRecHitsPerTrackVsTheta;
0295       MonitorElement* NumberOfLostRecHitsPerTrackVsEta;
0296       MonitorElement* NumberOfLostRecHitsPerTrackVsPt;
0297       MonitorElement* NumberOfLostRecHitVsPhiVsEtaPerTrack;
0298       MonitorElement* NumberOfLostRecHitVsPtVsEtaPerTrack;
0299 
0300       MonitorElement* NumberOfMIRecHitsPerTrackVsPhi;
0301       MonitorElement* NumberOfMIRecHitsPerTrackVsTheta;
0302       MonitorElement* NumberOfMIRecHitsPerTrackVsEta;
0303       MonitorElement* NumberOfMIRecHitsPerTrackVsPt;
0304       MonitorElement* NumberOfMIRecHitVsPhiVsEtaPerTrack;
0305       MonitorElement* NumberOfMIRecHitVsPtVsEtaPerTrack;
0306 
0307       MonitorElement* NumberOfMORecHitsPerTrackVsPhi;
0308       MonitorElement* NumberOfMORecHitsPerTrackVsTheta;
0309       MonitorElement* NumberOfMORecHitsPerTrackVsEta;
0310       MonitorElement* NumberOfMORecHitsPerTrackVsPt;
0311       MonitorElement* NumberOfMORecHitVsPhiVsEtaPerTrack;
0312       MonitorElement* NumberOfMORecHitVsPtVsEtaPerTrack;
0313 
0314       MonitorElement* NumberOfLayersPerTrackVsPhi;
0315       MonitorElement* NumberOfLayersPerTrackVsTheta;
0316       MonitorElement* NumberOfLayersPerTrackVsEta;
0317 
0318       MonitorElement* Chi2oNDFVsNHits;
0319       MonitorElement* Chi2oNDFVsPt;
0320       MonitorElement* Chi2oNDFVsEta;
0321       MonitorElement* Chi2oNDFVsPhi;
0322       MonitorElement* Chi2oNDFVsTheta;
0323 
0324       MonitorElement* Chi2ProbVsEta;
0325       MonitorElement* Chi2ProbVsPhi;
0326       MonitorElement* Chi2ProbVsTheta;
0327     };
0328     std::map<std::string, TkParameterMEs> TkParameterMEMap;
0329 
0330     MonitorElement* NumberOfRecHitsPerTrack;
0331     MonitorElement* NumberOfValidRecHitsPerTrack;
0332     MonitorElement* NumberOfLostRecHitsPerTrack;
0333     MonitorElement* NumberOfMIRecHitsPerTrack = nullptr;
0334     MonitorElement* NumberOfMORecHitsPerTrack = nullptr;
0335 
0336     MonitorElement* NumberOfRecHitsPerTrackVsPhi = nullptr;
0337     MonitorElement* NumberOfRecHitsPerTrackVsTheta = nullptr;
0338     MonitorElement* NumberOfRecHitsPerTrackVsEta = nullptr;
0339     MonitorElement* NumberOfRecHitVsPhiVsEtaPerTrack = nullptr;
0340 
0341     MonitorElement* NumberOfValidRecHitsPerTrackVsPhi = nullptr;
0342     MonitorElement* NumberOfValidRecHitsPerTrackVsTheta = nullptr;
0343     MonitorElement* NumberOfValidRecHitsPerTrackVsEta = nullptr;
0344     MonitorElement* NumberOfValidRecHitsPerTrackVsPt = nullptr;
0345     MonitorElement* NumberOfValidRecHitVsPhiVsEtaPerTrack = nullptr;
0346     MonitorElement* NumberOfValidRecHitVsPtVsEtaPerTrack = nullptr;
0347 
0348     MonitorElement* NumberOfLostRecHitsPerTrackVsPhi = nullptr;
0349     MonitorElement* NumberOfLostRecHitsPerTrackVsTheta = nullptr;
0350     MonitorElement* NumberOfLostRecHitsPerTrackVsEta = nullptr;
0351     MonitorElement* NumberOfLostRecHitsPerTrackVsPt = nullptr;
0352     MonitorElement* NumberOfLostRecHitVsPhiVsEtaPerTrack = nullptr;
0353     MonitorElement* NumberOfLostRecHitVsPtVsEtaPerTrack = nullptr;
0354 
0355     MonitorElement* NumberOfMIRecHitsPerTrackVsPhi = nullptr;
0356     MonitorElement* NumberOfMIRecHitsPerTrackVsTheta = nullptr;
0357     MonitorElement* NumberOfMIRecHitsPerTrackVsEta = nullptr;
0358     MonitorElement* NumberOfMIRecHitsPerTrackVsPt = nullptr;
0359     MonitorElement* NumberOfMIRecHitVsPhiVsEtaPerTrack = nullptr;
0360     MonitorElement* NumberOfMIRecHitVsPtVsEtaPerTrack = nullptr;
0361 
0362     MonitorElement* NumberOfMORecHitsPerTrackVsPhi = nullptr;
0363     MonitorElement* NumberOfMORecHitsPerTrackVsTheta = nullptr;
0364     MonitorElement* NumberOfMORecHitsPerTrackVsEta = nullptr;
0365     MonitorElement* NumberOfMORecHitsPerTrackVsPt = nullptr;
0366     MonitorElement* NumberOfMORecHitVsPhiVsEtaPerTrack = nullptr;
0367     MonitorElement* NumberOfMORecHitVsPtVsEtaPerTrack = nullptr;
0368 
0369     MonitorElement* ValidFractionPerTrack = nullptr;
0370     MonitorElement* ValidFractionVsPhiVsEtaPerTrack = nullptr;
0371 
0372     MonitorElement* NumberOfLayersPerTrack[4] = {nullptr, nullptr, nullptr, nullptr};
0373 
0374     MonitorElement* NumberOfLayersPerTrackVsPhi;
0375     MonitorElement* NumberOfLayersPerTrackVsTheta;
0376     MonitorElement* NumberOfLayersPerTrackVsEta;
0377 
0378     MonitorElement* NumberOfLayersVsPhiVsEtaPerTrack[5] = {nullptr, nullptr, nullptr, nullptr, nullptr};
0379 
0380     MonitorElement* Chi2;
0381     MonitorElement* Chi2Prob;
0382     MonitorElement* Chi2oNDF;
0383 
0384     MonitorElement* Chi2oNDFVsNHits = nullptr;
0385     MonitorElement* Chi2oNDFVsPt = nullptr;
0386     MonitorElement* Chi2oNDFVsEta = nullptr;
0387     MonitorElement* Chi2oNDFVsPhi;
0388     MonitorElement* Chi2oNDFVsTheta;
0389 
0390     MonitorElement* Chi2ProbVsEta;
0391     MonitorElement* Chi2ProbVsPhi;
0392     MonitorElement* Chi2ProbVsTheta;
0393 
0394     MonitorElement* DistanceOfClosestApproach;
0395     MonitorElement* DistanceOfClosestApproachError;
0396     MonitorElement* DistanceOfClosestApproachErrorVsPt;
0397     MonitorElement* DistanceOfClosestApproachErrorVsEta;
0398     MonitorElement* DistanceOfClosestApproachErrorVsPhi;
0399     MonitorElement* DistanceOfClosestApproachErrorVsDxy;
0400     MonitorElement* DistanceOfClosestApproachToBS;
0401     MonitorElement* DistanceOfClosestApproachToBSdz;
0402     MonitorElement* AbsDistanceOfClosestApproachToBS;
0403     MonitorElement* DistanceOfClosestApproachToPV;
0404     MonitorElement* DistanceOfClosestApproachToPVZoom;
0405     MonitorElement* DeltaZToPV;
0406     MonitorElement* DeltaZToPVZoom;
0407     MonitorElement* DistanceOfClosestApproachVsTheta;
0408     MonitorElement* DistanceOfClosestApproachVsPhi;
0409     MonitorElement* DistanceOfClosestApproachToBSVsPhi;
0410     MonitorElement* DistanceOfClosestApproachToBSVsEta;
0411     MonitorElement* DistanceOfClosestApproachToPVVsPhi;
0412     MonitorElement* DistanceOfClosestApproachVsEta;
0413     MonitorElement* xPointOfClosestApproach;
0414     MonitorElement* xPointOfClosestApproachToPV;
0415     MonitorElement* xPointOfClosestApproachVsZ0wrt000;
0416     MonitorElement* xPointOfClosestApproachVsZ0wrtBS;
0417     MonitorElement* xPointOfClosestApproachVsZ0wrtPV;
0418     MonitorElement* yPointOfClosestApproach;
0419     MonitorElement* yPointOfClosestApproachToPV;
0420     MonitorElement* yPointOfClosestApproachVsZ0wrt000;
0421     MonitorElement* yPointOfClosestApproachVsZ0wrtBS;
0422     MonitorElement* yPointOfClosestApproachVsZ0wrtPV;
0423     MonitorElement* zPointOfClosestApproach;
0424     MonitorElement* zPointOfClosestApproachToPV;
0425     MonitorElement* zPointOfClosestApproachVsPhi;
0426     MonitorElement *algorithm, *oriAlgo;
0427     MonitorElement* stoppingSource;
0428     MonitorElement* stoppingSourceVSeta;
0429     MonitorElement* stoppingSourceVSphi;
0430     // TESTING MEs
0431     MonitorElement* TESTDistanceOfClosestApproachToBS;
0432     MonitorElement* TESTDistanceOfClosestApproachToBSVsPhi;
0433 
0434     // add by Mia in order to deal w/ LS transitions
0435     MonitorElement* Chi2oNDF_lumiFlag;
0436     MonitorElement* NumberOfRecHitsPerTrack_lumiFlag;
0437 
0438     //new plots for Heavy Ion DQM
0439     MonitorElement* LongDCASig;
0440     MonitorElement* TransDCASig;
0441     MonitorElement* dNdPhi_HighPurity;
0442     MonitorElement* dNdEta_HighPurity;
0443     MonitorElement* dNdPt_HighPurity;
0444     MonitorElement* NhitVsEta_HighPurity;
0445     MonitorElement* NhitVsPhi_HighPurity;
0446     MonitorElement* Ptdist_HighPurity;
0447     MonitorElement* dNhitdPt_HighPurity;
0448 
0449     // IP significance plots
0450     MonitorElement* sipDxyToBS;
0451     MonitorElement* sipDzToBS;
0452     MonitorElement* sip3dToPV;
0453     MonitorElement* sip2dToPV;
0454     MonitorElement* sipDxyToPV;
0455     MonitorElement* sipDzToPV;
0456 
0457     struct TkRecHitsPerSubDetMEs {
0458       MonitorElement* NumberOfRecHitsPerTrack;
0459       MonitorElement* NumberOfRecHitsPerTrackVsPhi;
0460       MonitorElement* NumberOfRecHitsPerTrackVsEta;
0461       MonitorElement* NumberOfRecHitsPerTrackVsPt;
0462       MonitorElement* NumberOfLayersPerTrack;
0463       MonitorElement* NumberOfLayersPerTrackVsPhi;
0464       MonitorElement* NumberOfLayersPerTrackVsEta;
0465       MonitorElement* NumberOfLayersPerTrackVsPt;
0466       MonitorElement* RecHitChi2PerTrack;
0467 
0468       int detectorId;
0469       std::string detectorTag;
0470     };
0471     std::map<std::string, TkRecHitsPerSubDetMEs> TkRecHitsPerSubDetMEMap;
0472 
0473     struct Key {
0474       int det;
0475       int subdet;
0476       int monitoring;
0477       explicit Key(int det, int subdet, int monitoring) : det(det), subdet(subdet), monitoring(monitoring){};
0478       bool operator==(const Key& other) const {
0479         return (det == other.det && subdet == other.subdet && monitoring == other.monitoring);
0480       }
0481     };
0482 
0483     struct KeyHasher {
0484       std::size_t operator()(const Key& k) const {
0485         // 3 bits (0x7) for kind of monitoring (7 kinds at most)
0486         // next 8 bits to the subdetector (255 subdetectors at most)
0487         // next 8 bits to the detector (255 detectors at most)
0488         return (size_t)((k.monitoring & (0x7)) | ((k.subdet & (0xff)) << 3) | ((k.det & (0xff)) << 11));
0489       }
0490     };
0491 
0492     std::unordered_map<Key, MonitorElement*, KeyHasher> hits_valid_;
0493     std::unordered_map<Key, MonitorElement*, KeyHasher> hits_missing_;
0494     std::unordered_map<Key, MonitorElement*, KeyHasher> hits_inactive_;
0495     std::unordered_map<Key, MonitorElement*, KeyHasher> hits_bad_;
0496     std::unordered_map<Key, MonitorElement*, KeyHasher> hits_total_;
0497     unsigned int good_vertices_;
0498     unsigned int bx_;
0499     float pixel_lumi_;
0500     float scal_lumi_;
0501     enum monQuantity { VsPU, VsBX, VsPIXELLUMI, VsSCALLUMI, END };
0502     std::string monName[monQuantity::END] = {"", "VsBX", "VsPIXELLUMI", "VsSCALLUMI"};
0503 
0504     std::string histname;  //for naming the histograms according to algorithm used
0505   };
0506 }  // namespace tadqm
0507 #endif