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 
50 class TauL1TPair {
51 
52  public :
53 
54  TauL1TPair(const reco::PFTau *tau, const l1t::Tau *regTau) :
55  m_tau(tau), m_regTau(regTau), m_eta(999.), m_phi_bar(999.), m_phi_end(999.) { };
56 
57  TauL1TPair(const TauL1TPair& tauL1tPair);
58 
59  ~TauL1TPair() { };
60 
61  double dR();
62  double eta() const { return m_tau->eta(); };
63  double phi() const { return m_tau->phi(); };
64  double pt() const { return m_tau->pt(); };
65 
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 
73  const reco::PFTau *m_tau;
75 
76  double m_eta;
77  double m_phi_bar;
78  double m_phi_end;
79 
80 };
81 
83 
84 public:
85 
87  ~L1TTauOffline() override;
88 
89  enum PlotConfig {
92  PHIvsPHI
93  };
94 
95  static const std::map<std::string, unsigned int> PlotConfigNames;
96 
97 protected:
98 
99  void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
100  /* void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override; */
101  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
102  void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
103  void beginLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& eSetup) override;
104  void endLuminosityBlock(edm::LuminosityBlock const& lumi, edm::EventSetup const& eSetup) override;
105  void endRun(edm::Run const& run, edm::EventSetup const& eSetup) override;
106 
107  const reco::Vertex getPrimaryVertex( edm::Handle<reco::VertexCollection> const& vertex, edm::Handle<reco::BeamSpot> const& beamSpot );
108  bool matchHlt(edm::Handle<trigger::TriggerEvent> const& triggerEvent, const reco::Muon * muon);
109 
110  // Cut and Matching
111  void getTauL1tPairs(edm::Handle<l1t::TauBxCollection> const& l1tCands);
112  void getTightMuons(edm::Handle<reco::MuonCollection> const& muons, edm::Handle<reco::PFMETCollection> const& mets, const reco::Vertex & vertex, edm::Handle<trigger::TriggerEvent> const& trigEvent);
113  void getProbeTaus(const edm::Event& e, edm::Handle<reco::PFTauCollection> const& taus, edm::Handle<reco::MuonCollection> const& muons, const reco::Vertex & vertex);
114 
115 private:
116  void bookTauHistos(DQMStore::IBooker &);
117 
118  //other functions
119  double Distance(const reco::Candidate & c1, const reco::Candidate & c2);
120  double DistancePhi(const reco::Candidate & c1, const reco::Candidate & c2);
121  double calcDeltaPhi(double phi1, double phi2);
122 
124 
126 
130 
131  //variables from config file
144  std::vector<std::string> triggerPath_;
148  std::vector<int> tauEfficiencyThresholds_;
149  std::vector<double> tauEfficiencyBins_;
151 
152  std::vector<const reco::Muon*> m_TightMuons;
153  std::vector<const reco::PFTau*> m_ProbeTaus;
154  std::vector<TauL1TPair> m_TauL1tPairs;
155 
156 
157  std::vector<reco::PFTauCollection> m_RecoTaus;
158  std::vector<l1t::TauBxCollection> m_L1tTaus;
159  std::vector<reco::PFTau> m_RecoRecoTaus;
161 
162  // config params
163  std::vector<int> m_L1tPtCuts;
164 
165  float m_MaxTauEta;
168 
169  std::vector<int> m_trigIndices;
170 
171  // Histograms
174 
175  // electron reco vs L1
179 
183 
185 
186  // electron resolutions
190 
194 
196 
197  // tau turn-ons
198  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_pass_;
199  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_pass_;
200  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_pass_;
201 
202  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_pass_;
203  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_pass_;
204  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_pass_;
205 
206  // we could drop the map here, but L1TEfficiency_Harvesting expects
207  // identical names except for the suffix
208  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_total_;
209  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_total_;
210  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_total_;
211 
212  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_total_;
213  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_total_;
214  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_total_;
215 
216 };
217 
218 #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:66
double eta() const final
momentum pseudorapidity
double m_phi_bar
Definition: L1TTauOffline.h:77
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:68
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:63
edm::EDGetTokenT< reco::PFTauDiscriminator > comb3TInputTag_
double pt() const
Definition: L1TTauOffline.h:64
double pt() const final
transverse momentum
static const std::map< std::string, unsigned int > PlotConfigNames
Definition: L1TTauOffline.h:95
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:67
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:74
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:76
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: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 dR()
double eta() const
Definition: L1TTauOffline.h:62
BXVector< l1t::Tau > m_L1tL1tTaus
TauL1TPair(const reco::PFTau *tau, const l1t::Tau *regTau)
Definition: L1TTauOffline.h:54
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
edm::EDGetTokenT< reco::PFTauDiscriminator > AntiEleInputTag_
dqmoffline::l1t::HistDefinitions histDefinitions_
double l1tEta() const
Definition: L1TTauOffline.h:69
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:43
double m_phi_end
Definition: L1TTauOffline.h:78
std::vector< reco::PFTau > m_RecoRecoTaus