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 
38 
39 // MagneticField
41 
42 // HLTrigger
44 
45 #include <iostream>
46 #include <fstream>
47 #include <utility>
48 #include <vector>
49 
51 {
52  public:
53  TauL1TPair(const reco::PFTau* tau, const l1t::Tau* regTau)
54  : m_tau(tau), m_regTau(regTau), m_eta(999.), m_phi_bar(999.), m_phi_end(999.){};
55 
56  TauL1TPair(const TauL1TPair& tauL1tPair);
57 
59 
60  double dR();
61  double eta() const { return m_tau->eta(); };
62  double phi() const { return m_tau->phi(); };
63  double pt() const { return m_tau->pt(); };
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  private:
69  const reco::PFTau* m_tau;
71 
72  double m_eta;
73  double m_phi_bar;
74  double m_phi_end;
75 };
76 
78 {
79  public:
81  ~L1TTauOffline() override;
82 
83  enum PlotConfig { nVertex, ETvsET, PHIvsPHI };
84 
85  static const std::map<std::string, unsigned int> PlotConfigNames;
86 
87  protected:
88  void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
89  /* void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override; */
90  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
91  void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
92  void endRun(edm::Run const& run, edm::EventSetup const& eSetup) override;
93  void endJob() override;
94 
95  const reco::Vertex getPrimaryVertex(edm::Handle<reco::VertexCollection> const& vertex,
97  bool matchHlt(edm::Handle<trigger::TriggerEvent> const& triggerEvent, const reco::Muon* muon);
98 
99  // Cut and Matching
100  void getTauL1tPairs(edm::Handle<l1t::TauBxCollection> const& l1tCands);
101  void getTightMuons(edm::Handle<reco::MuonCollection> const& muons,
103  const reco::Vertex& vertex,
104  edm::Handle<trigger::TriggerEvent> const& trigEvent);
105  void getProbeTaus(const edm::Event& e,
108  const reco::Vertex& vertex);
109 
110  private:
111  void bookTauHistos(DQMStore::IBooker&);
112 
113  // other functions
114  double Distance(const reco::Candidate& c1, const reco::Candidate& c2);
115  double DistancePhi(const reco::Candidate& c1, const reco::Candidate& c2);
116  double calcDeltaPhi(double phi1, double phi2);
117 
118  void normalise2DHistogramsToBinArea();
119 
121 
123 
127 
128  // variables from config file
141  std::vector<std::string> triggerPath_;
145  std::vector<int> tauEfficiencyThresholds_;
146  std::vector<double> tauEfficiencyBins_;
148 
149  std::vector<const reco::Muon*> m_TightMuons;
150  std::vector<const reco::PFTau*> m_ProbeTaus;
151  std::vector<TauL1TPair> m_TauL1tPairs;
152 
153  std::vector<reco::PFTauCollection> m_RecoTaus;
154  std::vector<l1t::TauBxCollection> m_L1tTaus;
155  std::vector<reco::PFTau> m_RecoRecoTaus;
157 
158  // config params
159  std::vector<int> m_L1tPtCuts;
160 
161  float m_MaxTauEta;
164 
165  std::vector<int> m_trigIndices;
166 
167  // Histograms
170 
171  // electron reco vs L1
175 
179 
181 
182  // electron resolutions
186 
190 
192 
193  // tau turn-ons
194  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_pass_;
195  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_pass_;
196  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_pass_;
197 
198  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_pass_;
199  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_pass_;
200  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_pass_;
201 
202  // we could drop the map here, but L1TEfficiency_Harvesting expects
203  // identical names except for the suffix
204  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_total_;
205  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_total_;
206  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_total_;
207 
208  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_total_;
209  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_total_;
210  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_total_;
211 };
212 
213 #endif
edm::EDGetTokenT< reco::VertexCollection > VtxInputTag_
double calcDeltaPhi(double phi1, double phi2)
Definition: EwkTauDQM.cc:1028
std::vector< std::string > triggerPath_
double l1tPt() const
Definition: L1TTauOffline.h:64
double eta() const final
momentum pseudorapidity
double m_phi_bar
Definition: L1TTauOffline.h:73
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
std::vector< int > m_trigIndices
std::vector< l1t::TauBxCollection > m_L1tTaus
virtual example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< TauL1TPair > m_TauL1tPairs
double l1tPhi() const
Definition: L1TTauOffline.h:66
std::vector< HistDefinition > HistDefinitions
math::XYZPoint PVPoint_
MonitorElement * h_L1TauPhivsTauPhi_EB_
Definition: Tau.h:21
edm::ESHandle< MagneticField > m_BField
double phi() const
Definition: L1TTauOffline.h:62
edm::EDGetTokenT< reco::PFTauDiscriminator > comb3TInputTag_
double pt() const
Definition: L1TTauOffline.h:63
double pt() const final
transverse momentum
static const std::map< std::string, unsigned int > PlotConfigNames
Definition: L1TTauOffline.h:85
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_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_total_
MonitorElement * h_resolutionTauPhi_EB_
MonitorElement * h_L1TauPhivsTauPhi_EE_
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:70
virtual example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
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:72
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:61
BXVector< l1t::Tau > m_L1tL1tTaus
TauL1TPair(const reco::PFTau *tau, const l1t::Tau *regTau)
Definition: L1TTauOffline.h:53
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
edm::EDGetTokenT< reco::PFTauDiscriminator > AntiEleInputTag_
dqmoffline::l1t::HistDefinitions histDefinitions_
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_
double phi() const final
momentum azimuthal angle
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:44
double m_phi_end
Definition: L1TTauOffline.h:74
std::vector< reco::PFTau > m_RecoRecoTaus