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
150  std::vector<std::string> triggerPath_;
154  std::vector<int> tauEfficiencyThresholds_;
155  std::vector<double> tauEfficiencyBins_;
157 
158  std::vector<const reco::Muon*> m_TightMuons;
159  std::vector<const reco::PFTau*> m_ProbeTaus;
160  std::vector<TauL1TPair> m_TauL1tPairs;
161 
162  std::vector<reco::PFTauCollection> m_RecoTaus;
163  std::vector<l1t::TauBxCollection> m_L1tTaus;
164  std::vector<reco::PFTau> m_RecoRecoTaus;
166 
167  // config params
168  std::vector<int> m_L1tPtCuts;
169 
170  float m_MaxTauEta;
173 
174  std::vector<int> m_trigIndices;
175 
176  // Histograms
179 
180  // electron reco vs L1
184 
188 
190 
191  // electron resolutions
195 
199 
201 
202  // tau turn-ons
203  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_pass_;
204  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_pass_;
205  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_pass_;
206 
207  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_pass_;
208  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_pass_;
209  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_pass_;
210 
211  // we could drop the map here, but L1TEfficiency_Harvesting expects
212  // identical names except for the suffix
213  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_total_;
214  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EE_total_;
215  std::map<double, MonitorElement*> h_efficiencyIsoTauET_EB_EE_total_;
216 
217  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_total_;
218  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EE_total_;
219  std::map<double, MonitorElement*> h_efficiencyNonIsoTauET_EB_EE_total_;
220 };
221 
222 #endif
Propagator.h
L1TTauOffline::comb3TWPIndex_
int comb3TWPIndex_
Definition: L1TTauOffline.h:142
L1TTauOffline::analyze
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
Definition: L1TTauOffline.cc:171
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:204
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:531
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:219
ESHandle.h
TriggerResults.h
PFTauDiscriminator.h
metsig::tau
Definition: SignAlgoResolutions.h:49
L1TTauOffline::m_TauL1tPairs
std::vector< TauL1TPair > m_TauL1tPairs
Definition: L1TTauOffline.h:160
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:146
edm::Run
Definition: Run.h:45
L1TTauOffline::h_L1TauPhivsTauPhi_EE_
MonitorElement * h_L1TauPhivsTauPhi_EE_
Definition: L1TTauOffline.h:186
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:217
L1TTauOffline::h_resolutionTauET_EB_
MonitorElement * h_resolutionTauET_EB_
Definition: L1TTauOffline.h:192
L1TTauOffline::h_L1TauEtavsTauEta_
MonitorElement * h_L1TauEtavsTauEta_
Definition: L1TTauOffline.h:189
L1TTauOffline::normalise2DHistogramsToBinArea
void normalise2DHistogramsToBinArea()
Definition: L1TTauOffline.cc:733
L1TTauOffline::AntiEleWP_
std::string AntiEleWP_
Definition: L1TTauOffline.h:137
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:501
DQMStore.h
L1TTauOffline::getTauL1tPairs
void getTauL1tPairs(edm::Handle< l1t::TauBxCollection > const &l1tCands)
Definition: L1TTauOffline.cc:560
reco::PFTau
Definition: PFTau.h:36
L1TTauOffline::triggerResults_
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
Definition: L1TTauOffline.h:149
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
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:127
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:198
L1TTauOffline::m_MaxHltTauDR
float m_MaxHltTauDR
Definition: L1TTauOffline.h:172
L1TTauOffline::h_efficiencyIsoTauET_EB_pass_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
Definition: L1TTauOffline.h:203
L1TTauOffline::h_L1TauETvsTauET_EB_EE_
MonitorElement * h_L1TauETvsTauET_EB_EE_
Definition: L1TTauOffline.h:183
edm::Handle< reco::VertexCollection >
HistDefinition.h
L1TTauOffline::comb3TInputTag_
edm::EDGetTokenT< reco::TauDiscriminatorContainer > comb3TInputTag_
Definition: L1TTauOffline.h:140
L1TTauOffline::h_efficiencyIsoTauET_EB_EE_pass_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_pass_
Definition: L1TTauOffline.h:205
L1TTauOffline::mFieldToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mFieldToken_
Definition: L1TTauOffline.h:133
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:177
L1TTauOffline::bookTauHistos
void bookTauHistos(DQMStore::IBooker &)
Definition: L1TTauOffline.cc:334
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:628
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:584
l1t::Tau
Definition: Tau.h:20
L1TTauOffline::m_RecoRecoTaus
std::vector< reco::PFTau > m_RecoRecoTaus
Definition: L1TTauOffline.h:164
MakerMacros.h
L1TTauOffline::triggerEvent_
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
Definition: L1TTauOffline.h:147
L1TTauOffline::efficiencyFolder_
std::string efficiencyFolder_
Definition: L1TTauOffline.h:152
L1TTauOffline::h_efficiencyNonIsoTauET_EE_total_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_total_
Definition: L1TTauOffline.h:218
L1TTauOffline::AntiMuWPIndex_
int AntiMuWPIndex_
Definition: L1TTauOffline.h:135
L1TTauOffline::h_L1TauPhivsTauPhi_EB_
MonitorElement * h_L1TauPhivsTauPhi_EB_
Definition: L1TTauOffline.h:185
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:151
L1TTauOffline::h_resolutionTauPhi_EE_
MonitorElement * h_resolutionTauPhi_EE_
Definition: L1TTauOffline.h:197
L1TTauOffline::PlotConfig
PlotConfig
Definition: L1TTauOffline.h:86
L1TTauOffline::DecayModeFindingInputTag_
edm::EDGetTokenT< reco::PFTauDiscriminator > DecayModeFindingInputTag_
Definition: L1TTauOffline.h:139
B2GTnPMonitor_cfi.trigEvent
trigEvent
Definition: B2GTnPMonitor_cfi.py:39
DQMEDAnalyzer.h
L1TTauOffline::calcDeltaPhi
double calcDeltaPhi(double phi1, double phi2)
L1TTauOffline::histDefinitions_
dqmoffline::l1t::HistDefinitions histDefinitions_
Definition: L1TTauOffline.h:156
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:148
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:181
L1TTauOffline::~L1TTauOffline
~L1TTauOffline() override
Definition: L1TTauOffline.cc:120
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:194
L1TTauOffline::h_L1TauPhivsTauPhi_EB_EE_
MonitorElement * h_L1TauPhivsTauPhi_EB_EE_
Definition: L1TTauOffline.h:187
L1TTauOffline::triggerPath_
std::vector< std::string > triggerPath_
Definition: L1TTauOffline.h:150
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:207
L1TTauOffline::m_trigIndices
std::vector< int > m_trigIndices
Definition: L1TTauOffline.h:174
L1TTauOffline::h_efficiencyIsoTauET_EB_EE_total_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_total_
Definition: L1TTauOffline.h:215
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:141
L1TTauOffline::h_resolutionTauEta_
MonitorElement * h_resolutionTauEta_
Definition: L1TTauOffline.h:200
TauDiscriminatorContainer.h
L1TTauOffline::m_MaxL1tTauDR
float m_MaxL1tTauDR
Definition: L1TTauOffline.h:171
L1TTauOffline::AntiEleWPIndex_
int AntiEleWPIndex_
Definition: L1TTauOffline.h:138
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:58
HLTConfigProvider.h
L1TTauOffline::h_resolutionTauPhi_EB_
MonitorElement * h_resolutionTauPhi_EB_
Definition: L1TTauOffline.h:196
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:193
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
TriggerObject.h
L1TTauOffline::m_RecoTaus
std::vector< reco::PFTauCollection > m_RecoTaus
Definition: L1TTauOffline.h:162
reco::Candidate
Definition: Candidate.h:27
L1TTauOffline::m_MaxTauEta
float m_MaxTauEta
Definition: L1TTauOffline.h:170
VertexFwd.h
L1TTauOffline::MuonInputTag_
edm::EDGetTokenT< reco::MuonCollection > MuonInputTag_
Definition: L1TTauOffline.h:143
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:139
L1TTauOffline::PHIvsPHI
Definition: L1TTauOffline.h:86
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
Vertex.h
Frameworkfwd.h
TrackingComponentsRecord.h
METFwd.h
L1TTauOffline::tauEfficiencyThresholds_
std::vector< int > tauEfficiencyThresholds_
Definition: L1TTauOffline.h:154
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:214
L1TTauOffline::tauEfficiencyBins_
std::vector< double > tauEfficiencyBins_
Definition: L1TTauOffline.h:155
Provenance.h
L1TTauOffline::m_L1tTaus
std::vector< l1t::TauBxCollection > m_L1tTaus
Definition: L1TTauOffline.h:163
L1TTauOffline::MetInputTag_
edm::EDGetTokenT< reco::PFMETCollection > MetInputTag_
Definition: L1TTauOffline.h:144
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:145
L1TTauOffline::AntiEleInputTag_
edm::EDGetTokenT< reco::TauDiscriminatorContainer > AntiEleInputTag_
Definition: L1TTauOffline.h:136
TauL1TPair::l1tPhi
double l1tPhi() const
Definition: L1TTauOffline.h:69
ParameterSet.h
L1TTauOffline::m_L1tPtCuts
std::vector< int > m_L1tPtCuts
Definition: L1TTauOffline.h:168
L1TTauOffline::AntiMuWP_
std::string AntiMuWP_
Definition: L1TTauOffline.h:134
L1TTauOffline::h_efficiencyNonIsoTauET_EB_EE_pass_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_pass_
Definition: L1TTauOffline.h:209
L1TTauOffline::h_L1TauETvsTauET_EE_
MonitorElement * h_L1TauETvsTauET_EE_
Definition: L1TTauOffline.h:182
L1TTauOffline::h_efficiencyIsoTauET_EB_total_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_total_
Definition: L1TTauOffline.h:213
L1TTauOffline::h_efficiencyNonIsoTauET_EE_pass_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_pass_
Definition: L1TTauOffline.h:208
edm::Event
Definition: Event.h:73
L1TTauOffline::h_tagAndProbeMass_
MonitorElement * h_tagAndProbeMass_
Definition: L1TTauOffline.h:178
L1TTauOffline::m_L1tL1tTaus
BXVector< l1t::Tau > m_L1tL1tTaus
Definition: L1TTauOffline.h:165
L1TTauOffline::m_TightMuons
std::vector< const reco::Muon * > m_TightMuons
Definition: L1TTauOffline.h:158
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:153
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:159