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
21 
22 // FWCore
31 
32 // TrackingTools
35 
36 // DQMServices
39 
41 
42 // MagneticField
44 
45 // HLTrigger
47 
48 #include <iostream>
49 #include <fstream>
50 #include <utility>
51 #include <vector>
52 
53 class TauL1TPair {
54 public:
55  TauL1TPair(const reco::PFTau* tau, const l1t::Tau* regTau)
56  : m_tau(tau), m_regTau(regTau), m_eta(999.), m_phi_bar(999.), m_phi_end(999.){};
57 
58  TauL1TPair(const TauL1TPair& tauL1tPair);
59  TauL1TPair& operator=(const TauL1TPair& tauL1tPair) = default;
61 
62  double dR();
63  double eta() const { return m_tau->eta(); };
64  double phi() const { return m_tau->phi(); };
65  double pt() const { return m_tau->pt(); };
66  double l1tPt() const { return m_regTau ? m_regTau->pt() : -1.; };
67  double l1tIso() const { return m_regTau ? m_regTau->hwIso() : -1.; };
68  double l1tPhi() const { return m_regTau ? m_regTau->phi() : -5.; };
69  double l1tEta() const { return m_regTau ? m_regTau->eta() : -5.; };
70 
71 private:
72  const reco::PFTau* m_tau;
74 
75  double m_eta;
76  double m_phi_bar;
77  double m_phi_end;
78 };
79 
80 class L1TTauOffline : public DQMEDAnalyzer {
81 public:
83  ~L1TTauOffline() override;
84 
86 
87  static const std::map<std::string, unsigned int> PlotConfigNames;
88 
89 protected:
90  void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
91  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
92  void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
93 
97 
98  // Cut and Matching
102  const reco::Vertex& vertex,
104  void getProbeTaus(const edm::Event& e,
107  const reco::Vertex& vertex);
108 
109 private:
111 
112  // other functions
113  double Distance(const reco::Candidate& c1, const reco::Candidate& c2);
114  double DistancePhi(const reco::Candidate& c1, const reco::Candidate& c2);
115  double calcDeltaPhi(double phi1, double phi2);
116 
118 
120 
122 
126 
128 
129  // variables from config file
149  std::vector<std::string> triggerPath_;
153  std::vector<int> tauEfficiencyThresholds_;
154  std::vector<double> tauEfficiencyBins_;
156 
157  std::vector<const reco::Muon*> m_TightMuons;
158  std::vector<const reco::PFTau*> m_ProbeTaus;
159  std::vector<TauL1TPair> m_TauL1tPairs;
160 
161  std::vector<reco::PFTauCollection> m_RecoTaus;
162  std::vector<l1t::TauBxCollection> m_L1tTaus;
163  std::vector<reco::PFTau> m_RecoRecoTaus;
165 
166  // config params
167  std::vector<int> m_L1tPtCuts;
168 
169  float m_MaxTauEta;
172 
173  std::vector<int> m_trigIndices;
174 
175  //V.M. 16.3.2023. Temporary variable for checking the anti-ele discriminator
177 
178  // Histograms
181 
182  // electron reco vs L1
186 
190 
192 
193  // electron resolutions
197 
201 
203 
204  // tau turn-ons
205  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_pass_;
206  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_pass_;
207  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_pass_;
208 
209  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_pass_;
210  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_pass_;
211  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_pass_;
212 
213  // we could drop the map here, but L1TEfficiency_Harvesting expects
214  // identical names except for the suffix
215  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_total_;
216  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_total_;
217  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_total_;
218 
219  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_total_;
220  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_total_;
221  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_total_;
222 };
223 
224 #endif
edm::EDGetTokenT< reco::VertexCollection > VtxInputTag_
std::vector< std::string > triggerPath_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mFieldToken_
double phi() const
Definition: L1TTauOffline.h:64
~L1TTauOffline() override
double pt() const final
transverse momentum
double m_phi_bar
Definition: L1TTauOffline.h:76
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
std::vector< int > m_trigIndices
std::vector< l1t::TauBxCollection > m_L1tTaus
double l1tEta() const
Definition: L1TTauOffline.h:69
std::vector< TauL1TPair > m_TauL1tPairs
std::vector< HistDefinition > HistDefinitions
math::XYZPoint PVPoint_
MonitorElement * h_L1TauPhivsTauPhi_EB_
void bookTauHistos(DQMStore::IBooker &)
Definition: Tau.h:20
edm::ESHandle< MagneticField > m_BField
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &iSetup) override
static const std::map< std::string, unsigned int > PlotConfigNames
Definition: L1TTauOffline.h:87
std::vector< double > tauEfficiencyBins_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_pass_
edm::EDGetTokenT< reco::TauDiscriminatorContainer > AntiMuInputTag_
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_
void getProbeTaus(const edm::Event &e, edm::Handle< reco::PFTauCollection > const &taus, edm::Handle< reco::MuonCollection > const &muons, const reco::Vertex &vertex)
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
std::string AntiEleWP_
std::vector< int > m_L1tPtCuts
std::string histFolder_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_total_
double Distance(const reco::Candidate &c1, const reco::Candidate &c2)
MonitorElement * h_resolutionTauPhi_EB_
edm::ProcessHistoryID phID_
L1TTauOffline(const edm::ParameterSet &ps)
MonitorElement * h_L1TauPhivsTauPhi_EE_
void normalise2DHistogramsToBinArea()
std::vector< int > tauEfficiencyThresholds_
HLTConfigProvider m_hltConfig
std::vector< const reco::PFTau * > m_ProbeTaus
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
MonitorElement * h_resolutionTauPhi_EB_EE_
edm::EDGetTokenT< reco::TauDiscriminatorContainer > comb3TInputTag_
std::string comb3TWP_
const reco::Vertex getPrimaryVertex(edm::Handle< reco::VertexCollection > const &vertex, edm::Handle< reco::BeamSpot > const &beamSpot)
const l1t::Tau * m_regTau
Definition: L1TTauOffline.h:73
double DistancePhi(const reco::Candidate &c1, const reco::Candidate &c2)
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_total_
double l1tPhi() const
Definition: L1TTauOffline.h:68
MonitorElement * h_resolutionTauPhi_EE_
double calcDeltaPhi(double phi1, double phi2)
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_
double l1tPt() const
Definition: L1TTauOffline.h:66
MonitorElement * h_resolutionTauEta_
double m_eta
Definition: L1TTauOffline.h:75
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_total_
double eta() const
Definition: L1TTauOffline.h:63
edm::EDGetTokenT< reco::BeamSpot > BsInputTag_
edm::EDGetTokenT< reco::PFMETCollection > MetInputTag_
MonitorElement * h_resolutionTauET_EB_EE_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
edm::EDGetTokenT< reco::TauDiscriminatorContainer > AntiEleInputTag_
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:69
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 l1tIso() const
Definition: L1TTauOffline.h:67
double pt() const
Definition: L1TTauOffline.h:65
double dR()
void getTauL1tPairs(edm::Handle< l1t::TauBxCollection > const &l1tCands)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
BXVector< l1t::Tau > m_L1tL1tTaus
TauL1TPair(const reco::PFTau *tau, const l1t::Tau *regTau)
Definition: L1TTauOffline.h:55
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
int hwIso() const
Definition: L1Candidate.h:39
bool matchHlt(edm::Handle< trigger::TriggerEvent > const &triggerEvent, const reco::Muon *muon)
dqmoffline::l1t::HistDefinitions histDefinitions_
edm::EDGetTokenT< reco::PFTauCollection > theTauCollection_
MonitorElement * h_L1TauETvsTauET_EB_EE_
std::string AntiMuWP_
MonitorElement * h_L1TauETvsTauET_EE_
MonitorElement * h_L1TauPhivsTauPhi_EB_EE_
void getTightMuons(edm::Handle< reco::MuonCollection > const &muons, edm::Handle< reco::PFMETCollection > const &mets, const reco::Vertex &vertex, edm::Handle< trigger::TriggerEvent > const &trigEvent)
double phi() const final
momentum azimuthal angle
MonitorElement * h_resolutionTauET_EB_
edm::ESHandle< Propagator > m_propagatorAlong
std::vector< reco::PFTauCollection > m_RecoTaus
MonitorElement * h_L1TauETvsTauET_EB_
TauL1TPair & operator=(const TauL1TPair &tauL1tPair)=default
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_pass_
Definition: Run.h:45
double m_phi_end
Definition: L1TTauOffline.h:77
double eta() const final
momentum pseudorapidity
std::vector< reco::PFTau > m_RecoRecoTaus