CMS 3D CMS Logo

L1TTauOffline.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_L1TRIGGER_L1TTAUOFFLINE_H
2 #define DQMOFFLINE_L1TRIGGER_L1TTAUOFFLINE_H
3 
4 //DataFormats
18 
19 //FWCore
28 
29 //TrackingTools
32 
33 //DQMServices
36 
37 //MagneticField
39 
40 //HLTrigger
42 
43 #include <iostream>
44 #include <fstream>
45 #include <utility>
46 #include <vector>
47 
48 class TauL1TPair {
49 
50  public :
51 
52  TauL1TPair(const reco::PFTau *tau, const l1t::Tau *regTau) :
53  m_tau(tau), m_regTau(regTau), m_eta(999.), m_phi_bar(999.), m_phi_end(999.) { };
54 
55  TauL1TPair(const TauL1TPair& tauL1tPair);
56 
57  ~TauL1TPair() { };
58 
59  double dR();
60  double eta() const { return m_tau->eta(); };
61  double phi() const { return m_tau->phi(); };
62  double pt() const { return m_tau->pt(); };
63 
64  double l1tPt() const { return m_regTau ? m_regTau->pt() : -1.; };
65  double l1tIso() const { return m_regTau ? m_regTau->hwIso() : -1.; };
66  double l1tPhi() const { return m_regTau ? m_regTau->phi() : -5.; };
67  double l1tEta() const { return m_regTau ? m_regTau->eta() : -5.; };
68 
69 private :
70 
71  const reco::PFTau *m_tau;
72  const l1t::Tau *m_regTau;
73 
74  double m_eta;
75  double m_phi_bar;
76  double m_phi_end;
77 
78 };
79 
81 
82 public:
83 
85  virtual ~L1TTauOffline();
86 
87 protected:
88 
89  void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
90  /* void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override; */
91  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
92  void analyze(edm::Event const& e, edm::EventSetup const& eSetup);
93  void beginLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& eSetup);
94  void endLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& eSetup);
95  void endRun(edm::Run const& run, edm::EventSetup const& eSetup);
96 
97  const reco::Vertex getPrimaryVertex( edm::Handle<reco::VertexCollection> const& vertex, edm::Handle<reco::BeamSpot> const& beamSpot );
98  bool matchHlt(edm::Handle<trigger::TriggerEvent> const& triggerEvent, const reco::Muon * muon);
99 
100  // Cut and Matching
101  void getTauL1tPairs(edm::Handle<l1t::TauBxCollection> const& l1tCands);
102  void getTightMuons(edm::Handle<reco::MuonCollection> const& muons, edm::Handle<reco::PFMETCollection> const& mets, const reco::Vertex & vertex, edm::Handle<trigger::TriggerEvent> const& trigEvent);
103  void getProbeTaus(const edm::Event& e, edm::Handle<reco::PFTauCollection> const& taus, edm::Handle<reco::MuonCollection> const& muons, const reco::Vertex & vertex);
104 
105 private:
106  void bookTauHistos(DQMStore::IBooker &);
107 
108  //other functions
109  double Distance(const reco::Candidate & c1, const reco::Candidate & c2);
110  double DistancePhi(const reco::Candidate & c1, const reco::Candidate & c2);
111  double calcDeltaPhi(double phi1, double phi2);
112 
114 
116 
120 
121  //variables from config file
134  std::vector<std::string> triggerPath_;
138  std::vector<int> tauEfficiencyThresholds_;
139  std::vector<double> tauEfficiencyBins_;
140 
141  std::vector<const reco::Muon*> m_TightMuons;
142  std::vector<const reco::PFTau*> m_ProbeTaus;
143  std::vector<TauL1TPair> m_TauL1tPairs;
144 
145 
146  std::vector<reco::PFTauCollection> m_RecoTaus;
147  std::vector<l1t::TauBxCollection> m_L1tTaus;
148  std::vector<reco::PFTau> m_RecoRecoTaus;
150 
151  // config params
152  std::vector<int> m_L1tPtCuts;
153 
154  float m_MaxTauEta;
157 
158  std::vector<int> m_trigIndices;
159 
160  // Histograms
163 
164  // electron reco vs L1
168 
172 
174 
175  // electron resolutions
179 
183 
185 
186  // tau turn-ons
187  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_pass_;
188  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_pass_;
189  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_pass_;
190 
191  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_pass_;
192  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_pass_;
193  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_pass_;
194 
195  // we could drop the map here, but L1TEfficiency_Harvesting expects
196  // identical names except for the suffix
197  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_total_;
198  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_total_;
199  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_total_;
200 
201  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_total_;
202  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_total_;
203  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_total_;
204 
205 };
206 
207 #endif
edm::EDGetTokenT< reco::VertexCollection > VtxInputTag_
virtual double pt() const final
transverse momentum
double calcDeltaPhi(double phi1, double phi2)
Definition: EwkTauDQM.cc:1028
std::vector< std::string > triggerPath_
double l1tPt() const
Definition: L1TTauOffline.h:64
double m_phi_bar
Definition: L1TTauOffline.h:75
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
std::vector< int > m_trigIndices
std::vector< l1t::TauBxCollection > m_L1tTaus
virtual double eta() const final
momentum pseudorapidity
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
std::vector< TauL1TPair > m_TauL1tPairs
double l1tPhi() const
Definition: L1TTauOffline.h:66
math::XYZPoint PVPoint_
MonitorElement * h_L1TauPhivsTauPhi_EB_
Definition: Tau.h:16
edm::ESHandle< MagneticField > m_BField
double phi() const
Definition: L1TTauOffline.h:61
edm::EDGetTokenT< reco::PFTauDiscriminator > comb3TInputTag_
double pt() const
Definition: L1TTauOffline.h:62
std::vector< double > tauEfficiencyBins_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_pass_
MonitorElement * h_nVertex_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_pass_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_total_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_pass_
std::string efficiencyFolder_
double l1tIso() const
Definition: L1TTauOffline.h:65
std::vector< int > m_L1tPtCuts
std::string histFolder_
void bookHistograms(fwlite::EventContainer &eventCont)
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_total_
MonitorElement * h_resolutionTauPhi_EB_
MonitorElement * h_L1TauPhivsTauPhi_EE_
virtual double phi() const final
momentum azimuthal angle
int hwIso() const
Definition: L1Candidate.h:52
std::vector< int > tauEfficiencyThresholds_
HLTConfigProvider m_hltConfig
std::vector< const reco::PFTau * > m_ProbeTaus
MonitorElement * h_resolutionTauPhi_EB_EE_
const l1t::Tau * m_regTau
Definition: L1TTauOffline.h:72
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_total_
MonitorElement * h_resolutionTauPhi_EE_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_pass_
MonitorElement * h_L1TauEtavsTauEta_
edm::EDGetTokenT< l1t::TauBxCollection > stage2CaloLayer2TauToken_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_total_
edm::EDGetTokenT< reco::PFTauDiscriminator > AntiMuInputTag_
MonitorElement * h_resolutionTauEta_
double m_eta
Definition: L1TTauOffline.h:74
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_total_
edm::EDGetTokenT< reco::BeamSpot > BsInputTag_
edm::EDGetTokenT< reco::PFMETCollection > MetInputTag_
MonitorElement * h_resolutionTauET_EB_EE_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
edm::ESHandle< Propagator > m_propagatorOpposite
std::vector< const reco::Muon * > m_TightMuons
MonitorElement * h_resolutionTauET_EE_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_total_
const reco::PFTau * m_tau
Definition: L1TTauOffline.h:67
edm::EDGetTokenT< reco::MuonCollection > MuonInputTag_
std::string trigProcess_
edm::EDGetTokenT< reco::PFTauDiscriminator > DecayModeFindingInputTag_
MonitorElement * h_tagAndProbeMass_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double dR()
double eta() const
Definition: L1TTauOffline.h:60
BXVector< l1t::Tau > m_L1tL1tTaus
TauL1TPair(const reco::PFTau *tau, const l1t::Tau *regTau)
Definition: L1TTauOffline.h:52
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
edm::EDGetTokenT< reco::PFTauDiscriminator > AntiEleInputTag_
double l1tEta() const
Definition: L1TTauOffline.h:67
edm::EDGetTokenT< reco::PFTauCollection > theTauCollection_
MonitorElement * h_L1TauETvsTauET_EB_EE_
MonitorElement * h_L1TauETvsTauET_EE_
MonitorElement * h_L1TauPhivsTauPhi_EB_EE_
MonitorElement * h_resolutionTauET_EB_
edm::ESHandle< Propagator > m_propagatorAlong
std::vector< reco::PFTauCollection > m_RecoTaus
MonitorElement * h_L1TauETvsTauET_EB_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_pass_
Definition: Run.h:42
double m_phi_end
Definition: L1TTauOffline.h:76
std::vector< reco::PFTau > m_RecoRecoTaus