File indexing completed on 2024-04-06 12:27:03
0001 #ifndef RecoMuon_MuonIdentification_MuonTimingValidator_H
0002 #define RecoMuon_MuonIdentification_MuonTimingValidator_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0012 #include "FWCore/Framework/interface/Event.h"
0013
0014 #include "SimDataFormats/Track/interface/SimTrack.h"
0015 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0016 #include "DataFormats/TrackReco/interface/Track.h"
0017 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0018 #include "DataFormats/TrackReco/interface/TrackExtraFwd.h"
0019 #include "DataFormats/TrackReco/interface/TrackToTrackMap.h"
0020 #include "DataFormats/MuonReco/interface/MuonTimeExtra.h"
0021 #include "DataFormats/MuonReco/interface/MuonTimeExtraMap.h"
0022
0023 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0024 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
0025 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
0026 #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
0027 #include "DataFormats/MuonReco/interface/Muon.h"
0028 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0029
0030 #include <TROOT.h>
0031 #include <TSystem.h>
0032
0033 namespace edm {
0034 class ParameterSet;
0035
0036 class EventSetup;
0037 class InputTag;
0038 }
0039
0040 class TFile;
0041 class TH1F;
0042 class TH2F;
0043
0044
0045
0046 class MuonServiceProxy;
0047 class GlobalTrackingGeometryRecord;
0048
0049 class MuonTimingValidator : public edm::one::EDAnalyzer<> {
0050 public:
0051 explicit MuonTimingValidator(const edm::ParameterSet&);
0052 ~MuonTimingValidator() override;
0053
0054 typedef std::pair<reco::TrackRef, SimTrackRef> CandToSim;
0055 typedef std::pair<reco::TrackRef, SimTrackRef> CandStaSim;
0056 typedef std::pair<reco::TrackRef, SimTrackRef> CandMuonSim;
0057
0058 private:
0059 void beginJob() override;
0060 void analyze(const edm::Event&, const edm::EventSetup&) override;
0061 void endJob() override;
0062
0063 virtual float calculateDistance(const math::XYZVector&, const math::XYZVector&);
0064 virtual TH1F* divideErr(TH1F*, TH1F*, TH1F*);
0065
0066
0067
0068 edm::InputTag TKtrackTags_;
0069 edm::EDGetTokenT<reco::TrackCollection> TKtrackTokens_;
0070 edm::InputTag MuonTags_;
0071 edm::EDGetTokenT<reco::MuonCollection> MuonTokens_;
0072 edm::InputTag CombinedTimeTags_;
0073 edm::EDGetTokenT<reco::MuonTimeExtraMap> CombinedTimeTokens_;
0074 edm::InputTag DtTimeTags_;
0075 edm::EDGetTokenT<reco::MuonTimeExtraMap> DtTimeTokens_;
0076 edm::InputTag CscTimeTags_;
0077 edm::EDGetTokenT<reco::MuonTimeExtraMap> CscTimeTokens_;
0078 edm::InputTag SIMtrackTags_;
0079
0080 edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> trackingGeometryToken_;
0081
0082 std::string out, open;
0083 double theMinEta, theMaxEta, theMinPt, thePtCut, theMinPtres, theMaxPtres, theScale;
0084 int theDtCut, theCscCut;
0085 int theNBins;
0086
0087 edm::Handle<reco::MuonCollection> MuCollection;
0088 edm::Handle<reco::MuonCollection> MuCollectionT;
0089 edm::Handle<reco::TrackCollection> TKTrackCollection;
0090 edm::Handle<reco::TrackCollection> STATrackCollection;
0091 edm::Handle<reco::TrackCollection> GLBTrackCollection;
0092 edm::Handle<reco::TrackCollection> PMRTrackCollection;
0093 edm::Handle<reco::TrackCollection> GMRTrackCollection;
0094 edm::Handle<reco::TrackCollection> FMSTrackCollection;
0095 edm::Handle<reco::TrackCollection> SLOTrackCollection;
0096 edm::Handle<edm::SimTrackContainer> SIMTrackCollection;
0097
0098 edm::Handle<reco::MuonTimeExtraMap> timeMap1;
0099 edm::Handle<reco::MuonTimeExtraMap> timeMap2;
0100 edm::Handle<reco::MuonTimeExtraMap> timeMap3;
0101
0102
0103 TFile* hFile;
0104 TStyle* effStyle;
0105
0106 TH1F* hi_sta_pt;
0107 TH1F* hi_tk_pt;
0108 TH1F* hi_glb_pt;
0109 TH1F* hi_sta_phi;
0110 TH1F* hi_tk_phi;
0111 TH1F* hi_glb_phi;
0112
0113 TH1F* hi_mutime_vtx;
0114 TH1F* hi_mutime_vtx_err;
0115
0116 TH1F* hi_dtcsc_vtx;
0117 TH1F* hi_dtecal_vtx;
0118 TH1F* hi_ecalcsc_vtx;
0119 TH1F* hi_dthcal_vtx;
0120 TH1F* hi_hcalcsc_vtx;
0121 TH1F* hi_hcalecal_vtx;
0122
0123 TH1F* hi_cmbtime_ibt;
0124 TH2F* hi_cmbtime_ibt_pt;
0125 TH1F* hi_cmbtime_ibt_err;
0126 TH1F* hi_cmbtime_ibt_pull;
0127 TH1F* hi_cmbtime_fib;
0128 TH1F* hi_cmbtime_fib_err;
0129 TH1F* hi_cmbtime_fib_pull;
0130 TH1F* hi_cmbtime_vtx;
0131 TH1F* hi_cmbtime_vtx_err;
0132 TH1F* hi_cmbtime_vtx_pull;
0133 TH1F* hi_cmbtime_vtxr;
0134 TH1F* hi_cmbtime_vtxr_err;
0135 TH1F* hi_cmbtime_vtxr_pull;
0136 TH1F* hi_cmbtime_ndof;
0137
0138 TH1F* hi_dttime_ibt;
0139 TH2F* hi_dttime_ibt_pt;
0140 TH1F* hi_dttime_ibt_err;
0141 TH1F* hi_dttime_ibt_pull;
0142 TH1F* hi_dttime_fib;
0143 TH1F* hi_dttime_fib_err;
0144 TH1F* hi_dttime_fib_pull;
0145 TH1F* hi_dttime_vtx;
0146 TH1F* hi_dttime_vtx_err;
0147 TH1F* hi_dttime_vtx_pull;
0148 TH1F* hi_dttime_vtxr;
0149 TH1F* hi_dttime_vtxr_err;
0150 TH1F* hi_dttime_vtxr_pull;
0151 TH1F* hi_dttime_errdiff;
0152 TH1F* hi_dttime_ndof;
0153
0154 TH1F* hi_csctime_ibt;
0155 TH2F* hi_csctime_ibt_pt;
0156 TH1F* hi_csctime_ibt_err;
0157 TH1F* hi_csctime_ibt_pull;
0158 TH1F* hi_csctime_fib;
0159 TH1F* hi_csctime_fib_err;
0160 TH1F* hi_csctime_fib_pull;
0161 TH1F* hi_csctime_vtx;
0162 TH1F* hi_csctime_vtx_err;
0163 TH1F* hi_csctime_vtx_pull;
0164 TH1F* hi_csctime_vtxr;
0165 TH1F* hi_csctime_vtxr_err;
0166 TH1F* hi_csctime_vtxr_pull;
0167 TH1F* hi_csctime_ndof;
0168
0169 TH1F* hi_ecal_time;
0170 TH1F* hi_ecal_time_err;
0171 TH1F* hi_ecal_time_pull;
0172 TH1F* hi_ecal_time_ecut;
0173 TH1F* hi_ecal_energy;
0174
0175 TH1F* hi_hcal_time;
0176 TH1F* hi_hcal_time_err;
0177 TH1F* hi_hcal_time_pull;
0178 TH1F* hi_hcal_time_ecut;
0179 TH1F* hi_hcal_energy;
0180
0181 TH1F* hi_tk_eta;
0182 TH1F* hi_sta_eta;
0183 TH1F* hi_glb_eta;
0184 };
0185 #endif