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
32 
33 // TrackingTools
36 
37 // DQMServices
40 
42 
43 // MagneticField
45 
46 // HLTrigger
48 
49 #include <iostream>
50 #include <fstream>
51 #include <utility>
52 #include <vector>
53 
54 class TauL1TPair {
55 public:
56  TauL1TPair(const reco::PFTau* tau, const l1t::Tau* regTau)
57  : m_tau(tau), m_regTau(regTau), m_eta(999.), m_phi_bar(999.), m_phi_end(999.){};
58 
59  TauL1TPair(const TauL1TPair& tauL1tPair);
60 
62 
63  double dR();
64  double eta() const { return m_tau->eta(); };
65  double phi() const { return m_tau->phi(); };
66  double pt() const { return m_tau->pt(); };
67  double l1tPt() const { return m_regTau ? m_regTau->pt() : -1.; };
68  double l1tIso() const { return m_regTau ? m_regTau->hwIso() : -1.; };
69  double l1tPhi() const { return m_regTau ? m_regTau->phi() : -5.; };
70  double l1tEta() const { return m_regTau ? m_regTau->eta() : -5.; };
71 
72 private:
73  const reco::PFTau* m_tau;
75 
76  double m_eta;
77  double m_phi_bar;
78  double m_phi_end;
79 };
80 
81 class L1TTauOffline : public DQMEDAnalyzer {
82 public:
84  ~L1TTauOffline() override;
85 
87 
88  static const std::map<std::string, unsigned int> PlotConfigNames;
89 
90 protected:
91  void dqmBeginRun(const edm::Run& run, const edm::EventSetup& iSetup) override;
92  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
93  void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;
94 
98 
99  // Cut and Matching
103  const reco::Vertex& vertex,
105  void getProbeTaus(const edm::Event& e,
108  const reco::Vertex& vertex);
109 
110 private:
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 
119 
121 
123 
127 
129 
130  // 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  // Histograms
178 
179  // electron reco vs L1
183 
187 
189 
190  // electron resolutions
194 
198 
200 
201  // tau turn-ons
202  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_pass_;
203  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_pass_;
204  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_pass_;
205 
206  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_pass_;
207  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_pass_;
208  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_pass_;
209 
210  // we could drop the map here, but L1TEfficiency_Harvesting expects
211  // identical names except for the suffix
212  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_total_;
213  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_total_;
214  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_total_;
215 
216  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_total_;
217  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_total_;
218  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_total_;
219 };
220 
221 #endif
Propagator.h
L1TTauOffline::comb3TWPIndex_
int comb3TWPIndex_
Definition: L1TTauOffline.h:141
L1TTauOffline::analyze
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
Definition: L1TTauOffline.cc:170
L1TTauOffline::L1TTauOffline
L1TTauOffline(const edm::ParameterSet &ps)
Definition: L1TTauOffline.cc:45
L1TTauOffline::h_efficiencyIsoTauET_EE_pass_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_pass_
Definition: L1TTauOffline.h:203
TauL1TPair::m_regTau
const l1t::Tau * m_regTau
Definition: L1TTauOffline.h:74
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
L1TTauOffline::nVertex
Definition: L1TTauOffline.h:86
TauL1TPair::l1tPt
double l1tPt() const
Definition: L1TTauOffline.h:67
ProcessHistoryID.h
TauL1TPair::m_eta
double m_eta
Definition: L1TTauOffline.h:76
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
PFTauFwd.h
TauL1TPair::l1tIso
double l1tIso() const
Definition: L1TTauOffline.h:68
L1TTauOffline::matchHlt
bool matchHlt(edm::Handle< trigger::TriggerEvent > const &triggerEvent, const reco::Muon *muon)
Definition: L1TTauOffline.cc:529
BXVector.h
L1TTauOffline::DistancePhi
double DistancePhi(const reco::Candidate &c1, const reco::Candidate &c2)
TauL1TPair
Definition: L1TTauOffline.h:54
L1TTauOffline::h_efficiencyNonIsoTauET_EB_EE_total_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_total_
Definition: L1TTauOffline.h:218
ESHandle.h
TriggerResults.h
PFTauDiscriminator.h
metsig::tau
Definition: SignAlgoResolutions.h:49
L1TTauOffline::m_TauL1tPairs
std::vector< TauL1TPair > m_TauL1tPairs
Definition: L1TTauOffline.h:159
muon
Definition: MuonCocktails.h:17
TauL1TPair::TauL1TPair
TauL1TPair(const reco::PFTau *tau, const l1t::Tau *regTau)
Definition: L1TTauOffline.h:56
L1TTauOffline::BsInputTag_
edm::EDGetTokenT< reco::BeamSpot > BsInputTag_
Definition: L1TTauOffline.h:145
edm::Run
Definition: Run.h:45
L1TTauOffline::h_L1TauPhivsTauPhi_EE_
MonitorElement * h_L1TauPhivsTauPhi_EE_
Definition: L1TTauOffline.h:185
TriggerEvent.h
edm::EDGetTokenT< reco::PFTauCollection >
Tau3MuMonitor_cff.taus
taus
Definition: Tau3MuMonitor_cff.py:7
LuminosityBlock.h
L1TTauOffline::h_efficiencyNonIsoTauET_EB_total_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_total_
Definition: L1TTauOffline.h:216
L1TTauOffline::h_resolutionTauET_EB_
MonitorElement * h_resolutionTauET_EB_
Definition: L1TTauOffline.h:191
L1TTauOffline::h_L1TauEtavsTauEta_
MonitorElement * h_L1TauEtavsTauEta_
Definition: L1TTauOffline.h:188
L1TTauOffline::normalise2DHistogramsToBinArea
void normalise2DHistogramsToBinArea()
Definition: L1TTauOffline.cc:717
L1TTauOffline::AntiEleWP_
std::string AntiEleWP_
Definition: L1TTauOffline.h:136
TauL1TPair::m_tau
const reco::PFTau * m_tau
Definition: L1TTauOffline.h:70
L1TTauOffline::getPrimaryVertex
const reco::Vertex getPrimaryVertex(edm::Handle< reco::VertexCollection > const &vertex, edm::Handle< reco::BeamSpot > const &beamSpot)
Definition: L1TTauOffline.cc:499
DQMStore.h
L1TTauOffline::getTauL1tPairs
void getTauL1tPairs(edm::Handle< l1t::TauBxCollection > const &l1tCands)
Definition: L1TTauOffline.cc:558
reco::PFTau
Definition: PFTau.h:36
L1TTauOffline::triggerResults_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
Definition: L1TTauOffline.h:148
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
EDAnalyzer.h
PFMETCollection.h
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
singleTopDQM_cfi.mets
mets
Definition: singleTopDQM_cfi.py:43
L1TTauOffline::dqmBeginRun
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &iSetup) override
Definition: L1TTauOffline.cc:126
TauL1TPair::dR
double dR()
Definition: L1TTauOffline.cc:38
TauL1TPair::pt
double pt() const
Definition: L1TTauOffline.h:66
L1TTauOffline::h_resolutionTauPhi_EB_EE_
MonitorElement * h_resolutionTauPhi_EB_EE_
Definition: L1TTauOffline.h:197
L1TTauOffline::m_MaxHltTauDR
float m_MaxHltTauDR
Definition: L1TTauOffline.h:171
L1TTauOffline::h_efficiencyIsoTauET_EB_pass_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
Definition: L1TTauOffline.h:202
L1TTauOffline::h_L1TauETvsTauET_EB_EE_
MonitorElement * h_L1TauETvsTauET_EB_EE_
Definition: L1TTauOffline.h:182
edm::Handle< reco::VertexCollection >
HistDefinition.h
L1TTauOffline::comb3TInputTag_
edm::EDGetTokenT< reco::TauDiscriminatorContainer > comb3TInputTag_
Definition: L1TTauOffline.h:139
L1TTauOffline::h_efficiencyIsoTauET_EB_EE_pass_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_pass_
Definition: L1TTauOffline.h:204
L1TTauOffline::theTauCollection_
edm::EDGetTokenT< reco::PFTauCollection > theTauCollection_
Definition: L1TTauOffline.h:131
reco::Muon
Definition: Muon.h:27
L1TTauOffline::h_nVertex_
MonitorElement * h_nVertex_
Definition: L1TTauOffline.h:176
L1TTauOffline::bookTauHistos
void bookTauHistos(DQMStore::IBooker &)
Definition: L1TTauOffline.cc:332
L1TTauOffline
Definition: L1TTauOffline.h:81
L1TTauOffline::getProbeTaus
void getProbeTaus(const edm::Event &e, edm::Handle< reco::PFTauCollection > const &taus, edm::Handle< reco::MuonCollection > const &muons, const reco::Vertex &vertex)
Definition: L1TTauOffline.cc:626
L1TTauOffline::m_propagatorAlong
edm::ESHandle< Propagator > m_propagatorAlong
Definition: L1TTauOffline.h:125
BXVector< l1t::Tau >
L1TTauOffline::getTightMuons
void getTightMuons(edm::Handle< reco::MuonCollection > const &muons, edm::Handle< reco::PFMETCollection > const &mets, const reco::Vertex &vertex, edm::Handle< trigger::TriggerEvent > const &trigEvent)
Definition: L1TTauOffline.cc:582
l1t::Tau
Definition: Tau.h:20
L1TTauOffline::m_RecoRecoTaus
std::vector< reco::PFTau > m_RecoRecoTaus
Definition: L1TTauOffline.h:163
MakerMacros.h
L1TTauOffline::triggerEvent_
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
Definition: L1TTauOffline.h:146
L1TTauOffline::efficiencyFolder_
std::string efficiencyFolder_
Definition: L1TTauOffline.h:151
L1TTauOffline::h_efficiencyNonIsoTauET_EE_total_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_total_
Definition: L1TTauOffline.h:217
L1TTauOffline::AntiMuWPIndex_
int AntiMuWPIndex_
Definition: L1TTauOffline.h:134
L1TTauOffline::h_L1TauPhivsTauPhi_EB_
MonitorElement * h_L1TauPhivsTauPhi_EB_
Definition: L1TTauOffline.h:184
L1TTauOffline::AntiMuInputTag_
edm::EDGetTokenT< reco::TauDiscriminatorContainer > AntiMuInputTag_
Definition: L1TTauOffline.h:132
BeamSpot.h
ProductProvenance.h
Service.h
TauL1TPair::m_phi_end
double m_phi_end
Definition: L1TTauOffline.h:78
edm::ESHandle< MagneticField >
edm::Hash< ProcessHistoryType >
L1TTauOffline::histFolder_
std::string histFolder_
Definition: L1TTauOffline.h:150
L1TTauOffline::h_resolutionTauPhi_EE_
MonitorElement * h_resolutionTauPhi_EE_
Definition: L1TTauOffline.h:196
L1TTauOffline::PlotConfig
PlotConfig
Definition: L1TTauOffline.h:86
L1TTauOffline::DecayModeFindingInputTag_
edm::EDGetTokenT< reco::PFTauDiscriminator > DecayModeFindingInputTag_
Definition: L1TTauOffline.h:138
B2GTnPMonitor_cfi.trigEvent
trigEvent
Definition: B2GTnPMonitor_cfi.py:39
DQMEDAnalyzer.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
L1TTauOffline::calcDeltaPhi
double calcDeltaPhi(double phi1, double phi2)
L1TTauOffline::histDefinitions_
dqmoffline::l1t::HistDefinitions histDefinitions_
Definition: L1TTauOffline.h:155
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Event.h
L1TTauOffline::trigProcess_
std::string trigProcess_
Definition: L1TTauOffline.h:147
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
TauL1TPair::m_phi_bar
double m_phi_bar
Definition: L1TTauOffline.h:77
L1TTauOffline::h_L1TauETvsTauET_EB_
MonitorElement * h_L1TauETvsTauET_EB_
Definition: L1TTauOffline.h:180
L1TTauOffline::~L1TTauOffline
~L1TTauOffline() override
Definition: L1TTauOffline.cc:119
L1TTauOffline::Distance
double Distance(const reco::Candidate &c1, const reco::Candidate &c2)
TauL1TPair::l1tEta
double l1tEta() const
Definition: L1TTauOffline.h:70
L1TTauOffline::h_resolutionTauET_EB_EE_
MonitorElement * h_resolutionTauET_EB_EE_
Definition: L1TTauOffline.h:193
L1TTauOffline::h_L1TauPhivsTauPhi_EB_EE_
MonitorElement * h_L1TauPhivsTauPhi_EB_EE_
Definition: L1TTauOffline.h:186
L1TTauOffline::triggerPath_
std::vector< std::string > triggerPath_
Definition: L1TTauOffline.h:149
L1TTauOffline::m_propagatorOpposite
edm::ESHandle< Propagator > m_propagatorOpposite
Definition: L1TTauOffline.h:126
PFMET.h
TauL1TPair::~TauL1TPair
~TauL1TPair()
Definition: L1TTauOffline.h:61
L1TTauOffline::h_efficiencyNonIsoTauET_EB_pass_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_pass_
Definition: L1TTauOffline.h:206
L1TTauOffline::m_trigIndices
std::vector< int > m_trigIndices
Definition: L1TTauOffline.h:173
L1TTauOffline::h_efficiencyIsoTauET_EB_EE_total_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_total_
Definition: L1TTauOffline.h:214
L1TTauOffline::m_hltConfig
HLTConfigProvider m_hltConfig
Definition: L1TTauOffline.h:122
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
TauL1TPair::phi
double phi() const
Definition: L1TTauOffline.h:65
L1TTauOffline::comb3TWP_
std::string comb3TWP_
Definition: L1TTauOffline.h:140
L1TTauOffline::h_resolutionTauEta_
MonitorElement * h_resolutionTauEta_
Definition: L1TTauOffline.h:199
TauDiscriminatorContainer.h
L1TTauOffline::m_MaxL1tTauDR
float m_MaxL1tTauDR
Definition: L1TTauOffline.h:170
L1TTauOffline::AntiEleWPIndex_
int AntiEleWPIndex_
Definition: L1TTauOffline.h:137
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:57
HLTConfigProvider.h
L1TTauOffline::h_resolutionTauPhi_EB_
MonitorElement * h_resolutionTauPhi_EB_
Definition: L1TTauOffline.h:195
PDWG_DiPhoton_SD_cff.triggerEvent
triggerEvent
Definition: PDWG_DiPhoton_SD_cff.py:39
dqmoffline::l1t::HistDefinitions
std::vector< HistDefinition > HistDefinitions
Definition: HistDefinition.h:51
L1TTauOffline::h_resolutionTauET_EE_
MonitorElement * h_resolutionTauET_EE_
Definition: L1TTauOffline.h:192
TriggerObject.h
L1TTauOffline::m_RecoTaus
std::vector< reco::PFTauCollection > m_RecoTaus
Definition: L1TTauOffline.h:161
reco::Candidate
Definition: Candidate.h:27
L1TTauOffline::m_MaxTauEta
float m_MaxTauEta
Definition: L1TTauOffline.h:169
VertexFwd.h
L1TTauOffline::MuonInputTag_
edm::EDGetTokenT< reco::MuonCollection > MuonInputTag_
Definition: L1TTauOffline.h:142
L1TTauOffline::ETvsET
Definition: L1TTauOffline.h:86
L1TTauOffline::phID_
edm::ProcessHistoryID phID_
Definition: L1TTauOffline.h:128
HLTConfigProvider
Definition: HLTConfigProvider.h:29
writedatasetfile.run
run
Definition: writedatasetfile.py:27
L1TTauOffline::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: L1TTauOffline.cc:138
L1TTauOffline::PHIvsPHI
Definition: L1TTauOffline.h:86
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
Frameworkfwd.h
TrackingComponentsRecord.h
METFwd.h
L1TTauOffline::tauEfficiencyThresholds_
std::vector< int > tauEfficiencyThresholds_
Definition: L1TTauOffline.h:153
L1TTauOffline::PlotConfigNames
static const std::map< std::string, unsigned int > PlotConfigNames
Definition: L1TTauOffline.h:88
L1TTauOffline::h_efficiencyIsoTauET_EE_total_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_total_
Definition: L1TTauOffline.h:213
L1TTauOffline::tauEfficiencyBins_
std::vector< double > tauEfficiencyBins_
Definition: L1TTauOffline.h:154
Provenance.h
L1TTauOffline::m_L1tTaus
std::vector< l1t::TauBxCollection > m_L1tTaus
Definition: L1TTauOffline.h:162
L1TTauOffline::MetInputTag_
edm::EDGetTokenT< reco::PFMETCollection > MetInputTag_
Definition: L1TTauOffline.h:143
dqm::implementation::IBooker
Definition: DQMStore.h:43
L1TTauOffline::PVPoint_
math::XYZPoint PVPoint_
Definition: L1TTauOffline.h:120
L1TTauOffline::VtxInputTag_
edm::EDGetTokenT< reco::VertexCollection > VtxInputTag_
Definition: L1TTauOffline.h:144
L1TTauOffline::AntiEleInputTag_
edm::EDGetTokenT< reco::TauDiscriminatorContainer > AntiEleInputTag_
Definition: L1TTauOffline.h:135
TauL1TPair::l1tPhi
double l1tPhi() const
Definition: L1TTauOffline.h:69
ParameterSet.h
L1TTauOffline::m_L1tPtCuts
std::vector< int > m_L1tPtCuts
Definition: L1TTauOffline.h:167
L1TTauOffline::AntiMuWP_
std::string AntiMuWP_
Definition: L1TTauOffline.h:133
L1TTauOffline::h_efficiencyNonIsoTauET_EB_EE_pass_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_pass_
Definition: L1TTauOffline.h:208
L1TTauOffline::h_L1TauETvsTauET_EE_
MonitorElement * h_L1TauETvsTauET_EE_
Definition: L1TTauOffline.h:181
L1TTauOffline::h_efficiencyIsoTauET_EB_total_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_total_
Definition: L1TTauOffline.h:212
L1TTauOffline::h_efficiencyNonIsoTauET_EE_pass_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_pass_
Definition: L1TTauOffline.h:207
edm::Event
Definition: Event.h:73
L1TTauOffline::h_tagAndProbeMass_
MonitorElement * h_tagAndProbeMass_
Definition: L1TTauOffline.h:177
L1TTauOffline::m_L1tL1tTaus
BXVector< l1t::Tau > m_L1tL1tTaus
Definition: L1TTauOffline.h:164
L1TTauOffline::m_TightMuons
std::vector< const reco::Muon * > m_TightMuons
Definition: L1TTauOffline.h:157
reco::Vertex
Definition: Vertex.h:35
TauL1TPair::eta
double eta() const
Definition: L1TTauOffline.h:64
L1TTauOffline::stage2CaloLayer2TauToken_
edm::EDGetTokenT< l1t::TauBxCollection > stage2CaloLayer2TauToken_
Definition: L1TTauOffline.h:152
l1t::L1Candidate::hwIso
int hwIso() const
Definition: L1Candidate.h:39
Tau.h
L1TTauOffline::m_BField
edm::ESHandle< MagneticField > m_BField
Definition: L1TTauOffline.h:124
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
L1TTauOffline::m_ProbeTaus
std::vector< const reco::PFTau * > m_ProbeTaus
Definition: L1TTauOffline.h:158