Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:33:11

0001 #ifndef Validation_RecoMuon_RecoMuonValidator_H
0002 #define Validation_RecoMuon_RecoMuonValidator_H
0003 
0004 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0005 #include "FWCore/Framework/interface/Frameworkfwd.h"
0006 #include "FWCore/Framework/interface/ESHandle.h"
0007 #include "FWCore/Framework/interface/Event.h"
0008 
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "FWCore/Utilities/interface/InputTag.h"
0011 
0012 #include "SimTracker/Common/interface/TrackingParticleSelector.h"
0013 
0014 #include "DataFormats/TrackReco/interface/Track.h"
0015 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0016 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0017 #include "DataFormats/VertexReco/interface/Vertex.h"
0018 #include "DataFormats/MuonReco/interface/Muon.h"
0019 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0020 #include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h"
0021 
0022 #include "SimDataFormats/Associations/interface/MuonToTrackingParticleAssociator.h"
0023 
0024 // for selection cut
0025 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
0026 
0027 class TrackAssociatorBase;
0028 
0029 class RecoMuonValidator : public DQMOneEDAnalyzer<> {
0030 public:
0031   RecoMuonValidator(const edm::ParameterSet& pset);
0032   ~RecoMuonValidator() override;
0033 
0034   void dqmBeginRun(const edm::Run&, const edm::EventSetup& eventSetup) override;
0035   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0036   void dqmEndRun(edm::Run const&, edm::EventSetup const&) override;
0037   void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override;
0038   virtual int countMuonHits(const reco::Track& track) const;
0039   virtual int countTrackerHits(const reco::Track& track) const;
0040 
0041 protected:
0042   unsigned int verbose_;
0043 
0044   edm::InputTag simLabel_;
0045   edm::InputTag muonLabel_;
0046   std::string muonSelection_;
0047   edm::EDGetTokenT<TrackingParticleCollection> simToken_;
0048   edm::EDGetTokenT<TrackingParticleRefVector> tpRefVectorToken_;
0049   bool tpRefVector;
0050 
0051   edm::EDGetTokenT<edm::View<reco::Muon> > muonToken_;
0052 
0053   edm::InputTag muAssocLabel_;
0054   edm::EDGetTokenT<reco::MuonToTrackingParticleAssociator> muAssocToken_;
0055 
0056   edm::InputTag beamspotLabel_;
0057   edm::InputTag primvertexLabel_;
0058   edm::EDGetTokenT<reco::BeamSpot> beamspotToken_;
0059   edm::EDGetTokenT<reco::VertexCollection> primvertexToken_;
0060 
0061   std::string outputFileName_;
0062   std::string subDir_;
0063   std::string subsystemname_;
0064   edm::ParameterSet pset;
0065 
0066   DQMStore* dbe_;
0067 
0068   bool doAbsEta_;
0069   bool doAssoc_;
0070   bool usePFMuon_;
0071 
0072   TrackingParticleSelector tpSelector_;
0073 
0074   // Track to use
0075   reco::MuonTrackType trackType_;
0076 
0077   struct MuonME;
0078   MuonME* muonME_;
0079 
0080   struct CommonME;
0081   CommonME* commonME_;
0082 
0083   //
0084   //struct for histogram dimensions
0085   //
0086   struct HistoDimensions {
0087     //p
0088     unsigned int nBinP;
0089     double minP, maxP;
0090     //pt
0091     unsigned int nBinPt;
0092     double minPt, maxPt;
0093     //if abs eta
0094     bool doAbsEta;
0095     //eta
0096     unsigned int nBinEta;
0097     double minEta, maxEta;
0098     //phi
0099     unsigned int nBinPhi;
0100     double minPhi, maxPhi;
0101     //dxy
0102     unsigned int nBinDxy;
0103     double minDxy, maxDxy;
0104     //dz
0105     unsigned int nBinDz;
0106     double minDz, maxDz;
0107     //pulls
0108     unsigned int nBinPull;
0109     double wPull;
0110     //resolustions
0111     unsigned int nBinErr;
0112     double minErrP, maxErrP;
0113     double minErrPt, maxErrPt;
0114     double minErrQPt, maxErrQPt;
0115     double minErrEta, maxErrEta;
0116     double minErrPhi, maxErrPhi;
0117     double minErrDxy, maxErrDxy;
0118     double minErrDz, maxErrDz;
0119     //track multiplicities
0120     unsigned int nTrks, nAssoc;
0121     unsigned int nDof;
0122     // for PF muons
0123     bool usePFMuon;
0124   };
0125 
0126   HistoDimensions hDim;
0127 
0128 private:
0129   StringCutObjectSelector<reco::Muon> selector_;
0130   bool wantTightMuon_;
0131 };
0132 
0133 #endif