CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes
L1TTauOffline Class Reference

#include <L1TTauOffline.h>

Inheritance diagram for L1TTauOffline:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Types

enum  PlotConfig { nVertex, ETvsET, PHIvsPHI }
 

Public Member Functions

 L1TTauOffline (const edm::ParameterSet &ps)
 
 ~L1TTauOffline () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Static Public Attributes

static const std::map< std::string, unsigned int > PlotConfigNames
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &run, const edm::EventSetup &iSetup) override
 
void endJob () override
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
const reco::Vertex getPrimaryVertex (edm::Handle< reco::VertexCollection > const &vertex, edm::Handle< reco::BeamSpot > const &beamSpot)
 
void getProbeTaus (const edm::Event &e, edm::Handle< reco::PFTauCollection > const &taus, edm::Handle< reco::MuonCollection > const &muons, const reco::Vertex &vertex)
 
void getTauL1tPairs (edm::Handle< l1t::TauBxCollection > const &l1tCands)
 
void getTightMuons (edm::Handle< reco::MuonCollection > const &muons, edm::Handle< reco::PFMETCollection > const &mets, const reco::Vertex &vertex, edm::Handle< trigger::TriggerEvent > const &trigEvent)
 
bool matchHlt (edm::Handle< trigger::TriggerEvent > const &triggerEvent, const reco::Muon *muon)
 

Private Member Functions

void bookTauHistos (DQMStore::IBooker &)
 
double calcDeltaPhi (double phi1, double phi2)
 
double Distance (const reco::Candidate &c1, const reco::Candidate &c2)
 
double DistancePhi (const reco::Candidate &c1, const reco::Candidate &c2)
 
void normalise2DHistogramsToBinArea ()
 

Private Attributes

edm::EDGetTokenT< reco::PFTauDiscriminatorAntiEleInputTag_
 
edm::EDGetTokenT< reco::PFTauDiscriminatorAntiMuInputTag_
 
edm::EDGetTokenT< reco::BeamSpotBsInputTag_
 
edm::EDGetTokenT< reco::PFTauDiscriminatorcomb3TInputTag_
 
edm::EDGetTokenT< reco::PFTauDiscriminatorDecayModeFindingInputTag_
 
std::string efficiencyFolder_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_total_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_total_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_total_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_total_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_pass_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_total_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_total_
 
MonitorElementh_L1TauEtavsTauEta_
 
MonitorElementh_L1TauETvsTauET_EB_
 
MonitorElementh_L1TauETvsTauET_EB_EE_
 
MonitorElementh_L1TauETvsTauET_EE_
 
MonitorElementh_L1TauPhivsTauPhi_EB_
 
MonitorElementh_L1TauPhivsTauPhi_EB_EE_
 
MonitorElementh_L1TauPhivsTauPhi_EE_
 
MonitorElementh_nVertex_
 
MonitorElementh_resolutionTauET_EB_
 
MonitorElementh_resolutionTauET_EB_EE_
 
MonitorElementh_resolutionTauET_EE_
 
MonitorElementh_resolutionTauEta_
 
MonitorElementh_resolutionTauPhi_EB_
 
MonitorElementh_resolutionTauPhi_EB_EE_
 
MonitorElementh_resolutionTauPhi_EE_
 
MonitorElementh_tagAndProbeMass_
 
dqmoffline::l1t::HistDefinitions histDefinitions_
 
std::string histFolder_
 
edm::ESHandle< MagneticFieldm_BField
 
HLTConfigProvider m_hltConfig
 
BXVector< l1t::Taum_L1tL1tTaus
 
std::vector< int > m_L1tPtCuts
 
std::vector< l1t::TauBxCollectionm_L1tTaus
 
float m_MaxHltTauDR
 
float m_MaxL1tTauDR
 
float m_MaxTauEta
 
std::vector< const reco::PFTau * > m_ProbeTaus
 
edm::ESHandle< Propagatorm_propagatorAlong
 
edm::ESHandle< Propagatorm_propagatorOpposite
 
std::vector< reco::PFTaum_RecoRecoTaus
 
std::vector< reco::PFTauCollectionm_RecoTaus
 
std::vector< TauL1TPairm_TauL1tPairs
 
std::vector< const reco::Muon * > m_TightMuons
 
std::vector< int > m_trigIndices
 
edm::EDGetTokenT< reco::PFMETCollectionMetInputTag_
 
edm::EDGetTokenT< reco::MuonCollectionMuonInputTag_
 
math::XYZPoint PVPoint_
 
edm::EDGetTokenT< l1t::TauBxCollectionstage2CaloLayer2TauToken_
 
std::vector< double > tauEfficiencyBins_
 
std::vector< int > tauEfficiencyThresholds_
 
edm::EDGetTokenT< reco::PFTauCollectiontheTauCollection_
 
edm::EDGetTokenT< trigger::TriggerEventtriggerEvent_
 
std::vector< std::string > triggerPath_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResults_
 
std::string trigProcess_
 
edm::EDGetTokenT< reco::VertexCollectionVtxInputTag_
 

Detailed Description

Definition at line 77 of file L1TTauOffline.h.

Member Enumeration Documentation

Enumerator
nVertex 
ETvsET 
PHIvsPHI 

Definition at line 83 of file L1TTauOffline.h.

Constructor & Destructor Documentation

L1TTauOffline::L1TTauOffline ( const edm::ParameterSet ps)

Definition at line 47 of file L1TTauOffline.cc.

48  : theTauCollection_(consumes<reco::PFTauCollection>(ps.getUntrackedParameter<edm::InputTag>("tauInputTag"))),
49  AntiMuInputTag_(consumes<reco::PFTauDiscriminator>(ps.getUntrackedParameter<edm::InputTag>("antiMuInputTag"))),
50  AntiEleInputTag_(consumes<reco::PFTauDiscriminator>(ps.getUntrackedParameter<edm::InputTag>("antiEleInputTag"))),
52  consumes<reco::PFTauDiscriminator>(ps.getUntrackedParameter<edm::InputTag>("decayModeFindingInputTag"))),
53  comb3TInputTag_(consumes<reco::PFTauDiscriminator>(ps.getUntrackedParameter<edm::InputTag>("comb3TInputTag"))),
54  MuonInputTag_(consumes<reco::MuonCollection>(ps.getUntrackedParameter<edm::InputTag>("muonInputTag"))),
55  MetInputTag_(consumes<reco::PFMETCollection>(ps.getUntrackedParameter<edm::InputTag>("metInputTag"))),
56  VtxInputTag_(consumes<reco::VertexCollection>(ps.getUntrackedParameter<edm::InputTag>("vtxInputTag"))),
57  BsInputTag_(consumes<reco::BeamSpot>(ps.getUntrackedParameter<edm::InputTag>("bsInputTag"))),
58  triggerEvent_(consumes<trigger::TriggerEvent>(ps.getUntrackedParameter<edm::InputTag>("trigInputTag"))),
59  trigProcess_(ps.getUntrackedParameter<string>("trigProcess")),
60  triggerResults_(consumes<edm::TriggerResults>(ps.getUntrackedParameter<edm::InputTag>("trigProcess_token"))),
61  triggerPath_(ps.getUntrackedParameter<vector<std::string>>("triggerNames")),
62  histFolder_(ps.getParameter<std::string>("histFolder")),
63  efficiencyFolder_(histFolder_ + "/efficiency_raw"),
64  stage2CaloLayer2TauToken_(consumes<l1t::TauBxCollection>(ps.getUntrackedParameter<edm::InputTag>("l1tInputTag"))),
65  tauEfficiencyThresholds_(ps.getParameter<std::vector<int>>("tauEfficiencyThresholds")),
66  tauEfficiencyBins_(ps.getParameter<std::vector<double>>("tauEfficiencyBins")),
68  m_TightMuons(),
69  m_ProbeTaus(),
70  m_TauL1tPairs(),
71  m_RecoTaus(),
72  m_L1tTaus(),
74  m_L1tL1tTaus(),
75  m_L1tPtCuts(),
76  m_MaxTauEta(99999),
77  m_MaxL1tTauDR(99999),
78  m_MaxHltTauDR(99999),
79  m_trigIndices(),
80  h_nVertex_(),
108 {
109  edm::LogInfo("L1TTauOffline") << "Constructor "
110  << "L1TTauOffline::L1TTauOffline " << std::endl;
111 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::VertexCollection > VtxInputTag_
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > triggerPath_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
std::vector< int > m_trigIndices
std::vector< l1t::TauBxCollection > m_L1tTaus
std::vector< TauL1TPair > m_TauL1tPairs
MonitorElement * h_L1TauPhivsTauPhi_EB_
edm::EDGetTokenT< reco::PFTauDiscriminator > comb3TInputTag_
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_
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_
std::vector< int > tauEfficiencyThresholds_
std::vector< const reco::PFTau * > m_ProbeTaus
MonitorElement * h_resolutionTauPhi_EB_EE_
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_
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_
HistDefinitions readHistDefinitions(const edm::ParameterSet &ps, const std::map< std::string, unsigned int > &mapping)
std::vector< const reco::Muon * > m_TightMuons
MonitorElement * h_resolutionTauET_EE_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_total_
edm::EDGetTokenT< reco::MuonCollection > MuonInputTag_
std::string trigProcess_
edm::EDGetTokenT< reco::PFTauDiscriminator > DecayModeFindingInputTag_
ParameterSet const & getParameterSet(std::string const &) const
MonitorElement * h_tagAndProbeMass_
BXVector< l1t::Tau > m_L1tL1tTaus
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
edm::EDGetTokenT< reco::PFTauDiscriminator > AntiEleInputTag_
dqmoffline::l1t::HistDefinitions histDefinitions_
edm::EDGetTokenT< reco::PFTauCollection > theTauCollection_
MonitorElement * h_L1TauETvsTauET_EB_EE_
MonitorElement * h_L1TauETvsTauET_EE_
MonitorElement * h_L1TauPhivsTauPhi_EB_EE_
MonitorElement * h_resolutionTauET_EB_
std::vector< reco::PFTauCollection > m_RecoTaus
MonitorElement * h_L1TauETvsTauET_EB_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_pass_
std::vector< reco::PFTau > m_RecoRecoTaus
L1TTauOffline::~L1TTauOffline ( )
override

Definition at line 116 of file L1TTauOffline.cc.

117 {
118  edm::LogInfo("L1TTauOffline") << "Destructor L1TTauOffline::~L1TTauOffline " << std::endl;
119 }

Member Function Documentation

void L1TTauOffline::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 169 of file L1TTauOffline.cc.

References ecalDrivenElectronSeedsParameters_cff::beamSpot, BXVector< T >::begin(), BsInputTag_, counter, BXVector< T >::end(), PVValHelper::eta, MonitorElement::Fill(), edm::EventSetup::get(), edm::Event::getByToken(), getPrimaryVertex(), getProbeTaus(), getTauL1tPairs(), getTightMuons(), h_efficiencyIsoTauET_EB_EE_pass_, h_efficiencyIsoTauET_EB_EE_total_, h_efficiencyIsoTauET_EB_pass_, h_efficiencyIsoTauET_EB_total_, h_efficiencyIsoTauET_EE_pass_, h_efficiencyIsoTauET_EE_total_, h_efficiencyNonIsoTauET_EB_EE_pass_, h_efficiencyNonIsoTauET_EB_EE_total_, h_efficiencyNonIsoTauET_EB_pass_, h_efficiencyNonIsoTauET_EB_total_, h_efficiencyNonIsoTauET_EE_pass_, h_efficiencyNonIsoTauET_EE_total_, h_L1TauEtavsTauEta_, h_L1TauETvsTauET_EB_, h_L1TauETvsTauET_EB_EE_, h_L1TauETvsTauET_EE_, h_L1TauPhivsTauPhi_EB_, h_L1TauPhivsTauPhi_EB_EE_, h_L1TauPhivsTauPhi_EE_, h_resolutionTauET_EB_, h_resolutionTauET_EB_EE_, h_resolutionTauET_EE_, h_resolutionTauEta_, h_resolutionTauPhi_EB_, h_resolutionTauPhi_EB_EE_, h_resolutionTauPhi_EE_, edm::HandleBase::isValid(), m_BField, m_MaxHltTauDR, m_MaxL1tTauDR, m_MaxTauEta, m_TauL1tPairs, MetInputTag_, TtSemiLepSignalSelMVAComputer_cfi::mets, MuonInputTag_, extraflags_cff::muons, phi, impactParameterTagInfos_cfi::primaryVertex, EnergyCorrector::pt, BXVector< T >::size(), stage2CaloLayer2TauToken_, AlCaHLTBitMon_QueryRunRegistry::string, metsig::tau, tauEfficiencyThresholds_, nano_cff::taus, theTauCollection_, electronIdCutBased_cfi::threshold, triggerEvent_, triggerResults_, and VtxInputTag_.

170 {
171  m_MaxTauEta = 2.1;
172  m_MaxL1tTauDR = 0.5;
173  m_MaxHltTauDR = 0.5;
174 
176  e.getByToken(theTauCollection_, taus);
177 
178  if (!taus.isValid()) {
179  edm::LogWarning("L1TTauOffline") << "invalid collection: reco::PFTauCollection " << std::endl;
180  return;
181  }
182 
184  e.getByToken(MuonInputTag_, muons);
185 
186  if (!muons.isValid()) {
187  edm::LogWarning("L1TTauOffline") << "invalid collection: reco::MuonCollection " << std::endl;
188  return;
189  }
190 
192  e.getByToken(BsInputTag_, beamSpot);
193 
194  if (!beamSpot.isValid()) {
195  edm::LogWarning("L1TTauOffline") << "invalid collection: reco::BeamSpot " << std::endl;
196  return;
197  }
198 
200  e.getByToken(VtxInputTag_, vertex);
201 
202  if (!vertex.isValid()) {
203  edm::LogWarning("L1TTauOffline") << "invalid collection: reco::VertexCollection " << std::endl;
204  return;
205  }
206 
208  e.getByToken(stage2CaloLayer2TauToken_, l1tCands);
209 
210  if (!l1tCands.isValid()) {
211  edm::LogWarning("L1TTauOffline") << "invalid collection: l1t::TauBxCollection " << std::endl;
212  return;
213  }
214 
216  e.getByToken(triggerResults_, trigResults);
217 
218  if (!trigResults.isValid()) {
219  edm::LogWarning("L1TTauOffline") << "invalid collection: edm::TriggerResults " << std::endl;
220  return;
221  }
222 
224  e.getByToken(triggerEvent_, trigEvent);
225 
226  if (!trigEvent.isValid()) {
227  edm::LogWarning("L1TTauOffline") << "invalid collection: trigger::TriggerEvent " << std::endl;
228  return;
229  }
230 
232  e.getByToken(MetInputTag_, mets);
233 
234  if (!mets.isValid()) {
235  edm::LogWarning("L1TTauOffline") << "invalid collection: reco::PFMETCollection " << std::endl;
236  return;
237  }
238 
239  eSetup.get<IdealMagneticFieldRecord>().get(m_BField);
240  const reco::Vertex primaryVertex = getPrimaryVertex(vertex, beamSpot);
241 
242  getTightMuons(muons, mets, primaryVertex, trigEvent);
243  getProbeTaus(e, taus, muons, primaryVertex);
244  getTauL1tPairs(l1tCands);
245 
246  vector<l1t::Tau> l1tContainer;
247  l1tContainer.reserve(l1tCands->size() + 1);
248 
249  for (auto tau = l1tCands->begin(0); tau != l1tCands->end(0); ++tau) {
250  l1tContainer.push_back(*tau);
251  }
252 
253  for (auto tauL1tPairsIt = m_TauL1tPairs.begin(); tauL1tPairsIt != m_TauL1tPairs.end(); ++tauL1tPairsIt) {
254  float eta = tauL1tPairsIt->eta();
255  float phi = tauL1tPairsIt->phi();
256  float pt = tauL1tPairsIt->pt();
257 
258  // unmatched gmt cands have l1tPt = -1.
259  float l1tPt = tauL1tPairsIt->l1tPt();
260 
261  int counter = 0;
262 
263  for (auto threshold : tauEfficiencyThresholds_) {
264  std::string str_threshold = std::to_string(threshold);
265 
266  int l1tPtCut = threshold;
267  bool l1tAboveCut = (l1tPt >= l1tPtCut);
268 
269  stringstream ptCutToTag;
270  ptCutToTag << l1tPtCut;
271  string ptTag = ptCutToTag.str();
272 
273  if (fabs(eta) < m_MaxTauEta) {
274  if (counter == 0) {
275  if (fabs(eta) < 1.5) {
276  h_L1TauETvsTauET_EB_->Fill(pt, l1tPt);
277  h_L1TauPhivsTauPhi_EB_->Fill(phi, tauL1tPairsIt->l1tPhi());
278  h_resolutionTauET_EB_->Fill((l1tPt - pt) / pt);
279  h_resolutionTauPhi_EB_->Fill(tauL1tPairsIt->l1tPhi() - phi);
280  } else {
281  h_L1TauETvsTauET_EE_->Fill(pt, l1tPt);
282  h_L1TauPhivsTauPhi_EE_->Fill(phi, tauL1tPairsIt->l1tPhi());
283  h_resolutionTauET_EE_->Fill((l1tPt - pt) / pt);
284  h_resolutionTauPhi_EE_->Fill(tauL1tPairsIt->l1tPhi() - phi);
285  }
286  h_L1TauETvsTauET_EB_EE_->Fill(pt, l1tPt);
287  h_L1TauPhivsTauPhi_EB_EE_->Fill(phi, tauL1tPairsIt->l1tPhi());
288  h_L1TauEtavsTauEta_->Fill(eta, tauL1tPairsIt->l1tEta());
289  h_resolutionTauET_EB_EE_->Fill((l1tPt - pt) / pt);
290  h_resolutionTauPhi_EB_EE_->Fill(tauL1tPairsIt->l1tPhi() - phi);
291  h_resolutionTauEta_->Fill(tauL1tPairsIt->l1tEta() - eta);
292 
293  ++counter;
294  }
295 
296  if (fabs(eta) < 1.5) {
299  } else {
302  }
305 
306  if (l1tAboveCut) {
307  if (fabs(eta) < 1.5)
309  else
312 
313  if (tauL1tPairsIt->l1tIso() > 0.5) {
314  if (fabs(eta) < 1.5)
316  else
319  }
320  }
321  }
322  }
323  } // loop over tau-L1 pairs
324 }
const_iterator end(int bx) const
edm::EDGetTokenT< reco::VertexCollection > VtxInputTag_
unsigned size(int bx) const
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
std::vector< TauL1TPair > m_TauL1tPairs
MonitorElement * h_L1TauPhivsTauPhi_EB_
edm::ESHandle< MagneticField > m_BField
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_pass_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_pass_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_total_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_pass_
void getProbeTaus(const edm::Event &e, edm::Handle< reco::PFTauCollection > const &taus, edm::Handle< reco::MuonCollection > const &muons, const reco::Vertex &vertex)
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_total_
MonitorElement * h_resolutionTauPhi_EB_
void Fill(long long x)
MonitorElement * h_L1TauPhivsTauPhi_EE_
std::vector< int > tauEfficiencyThresholds_
MonitorElement * h_resolutionTauPhi_EB_EE_
const reco::Vertex getPrimaryVertex(edm::Handle< reco::VertexCollection > const &vertex, edm::Handle< reco::BeamSpot > const &beamSpot)
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_
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * h_resolutionTauEta_
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_
MonitorElement * h_resolutionTauET_EE_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_total_
edm::EDGetTokenT< reco::MuonCollection > MuonInputTag_
void getTauL1tPairs(edm::Handle< l1t::TauBxCollection > const &l1tCands)
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
static std::atomic< unsigned int > counter
edm::EDGetTokenT< reco::PFTauCollection > theTauCollection_
MonitorElement * h_L1TauETvsTauET_EB_EE_
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)
const_iterator begin(int bx) const
MonitorElement * h_resolutionTauET_EB_
MonitorElement * h_L1TauETvsTauET_EB_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_pass_
void L1TTauOffline::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotected

Definition at line 136 of file L1TTauOffline.cc.

References bookTauHistos(), runEdmFileComparison::found, createfilelist::int, m_hltConfig, m_trigIndices, HLTConfigProvider::size(), AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::triggerName(), and triggerPath_.

137 {
138  edm::LogInfo("L1TTauOffline") << "L1TTauOffline::bookHistograms" << std::endl;
139 
140  // book at beginRun
141  bookTauHistos(ibooker);
142 
143  for (auto trigNamesIt = triggerPath_.begin(); trigNamesIt != triggerPath_.end(); trigNamesIt++) {
144  std::string tNameTmp = (*trigNamesIt);
145  std::string tNamePattern = "";
146  std::size_t found0 = tNameTmp.find("*");
147  if (found0 != std::string::npos)
148  tNamePattern = tNameTmp.substr(0, tNameTmp.size() - 1);
149  else
150  tNamePattern = tNameTmp;
151 
152  int tIndex = -1;
153 
154  for (unsigned ipath = 0; ipath < m_hltConfig.size(); ++ipath) {
155  std::string tmpName = m_hltConfig.triggerName(ipath);
156 
157  std::size_t found = tmpName.find(tNamePattern);
158  if (found != std::string::npos) {
159  tIndex = int(ipath);
160  m_trigIndices.push_back(tIndex);
161  }
162  }
163  }
164 }
unsigned int size() const
number of trigger paths in trigger table
std::vector< std::string > triggerPath_
const std::string & triggerName(unsigned int triggerIndex) const
std::vector< int > m_trigIndices
void bookTauHistos(DQMStore::IBooker &)
HLTConfigProvider m_hltConfig
void L1TTauOffline::bookTauHistos ( DQMStore::IBooker ibooker)
private

Definition at line 337 of file L1TTauOffline.cc.

References dqmoffline::l1t::HistDefinition::binsX, dqmoffline::l1t::HistDefinition::binsY, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::cd(), efficiencyFolder_, h_efficiencyIsoTauET_EB_EE_pass_, h_efficiencyIsoTauET_EB_EE_total_, h_efficiencyIsoTauET_EB_pass_, h_efficiencyIsoTauET_EB_total_, h_efficiencyIsoTauET_EE_pass_, h_efficiencyIsoTauET_EE_total_, h_efficiencyNonIsoTauET_EB_EE_pass_, h_efficiencyNonIsoTauET_EB_EE_total_, h_efficiencyNonIsoTauET_EB_pass_, h_efficiencyNonIsoTauET_EB_total_, h_efficiencyNonIsoTauET_EE_pass_, h_efficiencyNonIsoTauET_EE_total_, h_L1TauEtavsTauEta_, h_L1TauETvsTauET_EB_, h_L1TauETvsTauET_EB_EE_, h_L1TauETvsTauET_EE_, h_L1TauPhivsTauPhi_EB_, h_L1TauPhivsTauPhi_EB_EE_, h_L1TauPhivsTauPhi_EE_, h_nVertex_, h_resolutionTauET_EB_, h_resolutionTauET_EB_EE_, h_resolutionTauET_EE_, h_resolutionTauEta_, h_resolutionTauPhi_EB_, h_resolutionTauPhi_EB_EE_, h_resolutionTauPhi_EE_, h_tagAndProbeMass_, histDefinitions_, histFolder_, dqmoffline::l1t::HistDefinition::name, dqmoffline::l1t::HistDefinition::nbinsX, dqmoffline::l1t::HistDefinition::nbinsY, DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, tauEfficiencyBins_, tauEfficiencyThresholds_, electronIdCutBased_cfi::threshold, dqmoffline::l1t::HistDefinition::title, dqmoffline::l1t::HistDefinition::xmax, dqmoffline::l1t::HistDefinition::xmin, dqmoffline::l1t::HistDefinition::ymax, and dqmoffline::l1t::HistDefinition::ymin.

Referenced by bookHistograms().

338 {
339  ibooker.cd();
340  ibooker.setCurrentFolder(histFolder_);
341  dqmoffline::l1t::HistDefinition nVertexDef = histDefinitions_[PlotConfig::nVertex];
342  h_nVertex_ = ibooker.book1D(nVertexDef.name, nVertexDef.title, nVertexDef.nbinsX, nVertexDef.xmin, nVertexDef.xmax);
343  h_tagAndProbeMass_ = ibooker.book1D("tagAndProbeMass", "Invariant mass of tag & probe pair", 100, 40, 140);
344 
345  dqmoffline::l1t::HistDefinition templateETvsET = histDefinitions_[PlotConfig::ETvsET];
346  h_L1TauETvsTauET_EB_ = ibooker.book2D(
347  "L1TauETvsTauET_EB", "L1 Tau E_{T} vs PFTau E_{T} (EB); PFTau E_{T} (GeV); L1 Tau E_{T} (GeV)",
348  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
349  h_L1TauETvsTauET_EE_ = ibooker.book2D(
350  "L1TauETvsTauET_EE", "L1 Tau E_{T} vs PFTau E_{T} (EE); PFTau E_{T} (GeV); L1 Tau E_{T} (GeV)",
351  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
353  "L1TauETvsTauET_EB_EE", "L1 Tau E_{T} vs PFTau E_{T} (EB+EE); PFTau E_{T} (GeV); L1 Tau E_{T} (GeV)",
354  templateETvsET.nbinsX, &templateETvsET.binsX[0], templateETvsET.nbinsY, &templateETvsET.binsY[0]);
355 
356  dqmoffline::l1t::HistDefinition templatePHIvsPHI = histDefinitions_[PlotConfig::PHIvsPHI];
357  h_L1TauPhivsTauPhi_EB_ = ibooker.book2D(
358  "L1TauPhivsTauPhi_EB", "#phi_{tau}^{L1} vs #phi_{tau}^{offline} (EB); #phi_{tau}^{offline}; #phi_{tau}^{L1}",
359  templatePHIvsPHI.nbinsX, templatePHIvsPHI.xmin, templatePHIvsPHI.xmax, templatePHIvsPHI.nbinsY,
360  templatePHIvsPHI.ymin, templatePHIvsPHI.ymax);
361  h_L1TauPhivsTauPhi_EE_ = ibooker.book2D(
362  "L1TauPhivsTauPhi_EE", "#phi_{tau}^{L1} vs #phi_{tau}^{offline} (EE); #phi_{tau}^{offline}; #phi_{tau}^{L1}",
363  templatePHIvsPHI.nbinsX, templatePHIvsPHI.xmin, templatePHIvsPHI.xmax, templatePHIvsPHI.nbinsY,
364  templatePHIvsPHI.ymin, templatePHIvsPHI.ymax);
366  ibooker.book2D("L1TauPhivsTauPhi_EB_EE",
367  "#phi_{tau}^{L1} vs #phi_{tau}^{offline} (EB+EE); #phi_{tau}^{offline}; #phi_{tau}^{L1}",
368  templatePHIvsPHI.nbinsX, templatePHIvsPHI.xmin, templatePHIvsPHI.xmax, templatePHIvsPHI.nbinsY,
369  templatePHIvsPHI.ymin, templatePHIvsPHI.ymax);
370 
371  h_L1TauEtavsTauEta_ = ibooker.book2D("L1TauEtavsTauEta", "L1 Tau #eta vs PFTau #eta; PFTau #eta; L1 Tau #eta", 100,
372  -3, 3, 100, -3, 3);
373 
374  // tau resolutions
375  h_resolutionTauET_EB_ = ibooker.book1D(
376  "resolutionTauET_EB", "tau ET resolution (EB); (L1 Tau E_{T} - PFTau E_{T})/PFTau E_{T}; events", 50, -1, 1.5);
377  h_resolutionTauET_EE_ = ibooker.book1D(
378  "resolutionTauET_EE", "tau ET resolution (EE); (L1 Tau E_{T} - PFTau E_{T})/PFTau E_{T}; events", 50, -1, 1.5);
380  ibooker.book1D("resolutionTauET_EB_EE",
381  "tau ET resolution (EB+EE); (L1 Tau E_{T} - PFTau E_{T})/PFTau E_{T}; events", 50, -1, 1.5);
382 
384  ibooker.book1D("resolutionTauPhi_EB",
385  "#phi_{tau} resolution (EB); #phi_{tau}^{L1} - #phi_{tau}^{offline}; events", 120, -0.3, 0.3);
387  ibooker.book1D("resolutionTauPhi_EE",
388  "tau #phi resolution (EE); #phi_{tau}^{L1} - #phi_{tau}^{offline}; events", 120, -0.3, 0.3);
390  ibooker.book1D("resolutionTauPhi_EB_EE",
391  "tau #phi resolution (EB+EE); #phi_{tau}^{L1} - #phi_{tau}^{offline}; events", 120, -0.3, 0.3);
392 
393  h_resolutionTauEta_ = ibooker.book1D("resolutionTauEta",
394  "tau #eta resolution (EB); L1 Tau #eta - PFTau #eta; events", 120, -0.3, 0.3);
395 
396  // tau turn-ons
398  std::vector<float> tauBins(tauEfficiencyBins_.begin(), tauEfficiencyBins_.end());
399  int nBins = tauBins.size() - 1;
400  float* tauBinArray = &(tauBins[0]);
401 
402  for (auto threshold : tauEfficiencyThresholds_) {
403  std::string str_threshold = std::to_string(int(threshold));
405  ibooker.book1D("efficiencyIsoTauET_EB_threshold_" + str_threshold + "_Num",
406  "iso tau efficiency (EB); PFTau E_{T} (GeV); events", nBins, tauBinArray);
408  ibooker.book1D("efficiencyIsoTauET_EE_threshold_" + str_threshold + "_Num",
409  "iso tau efficiency (EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
411  ibooker.book1D("efficiencyIsoTauET_EB_EE_threshold_" + str_threshold + "_Num",
412  "iso tau efficiency (EB+EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
413 
415  ibooker.book1D("efficiencyIsoTauET_EB_threshold_" + str_threshold + "_Den",
416  "iso tau efficiency (EB); PFTau E_{T} (GeV); events", nBins, tauBinArray);
418  ibooker.book1D("efficiencyIsoTauET_EE_threshold_" + str_threshold + "_Den",
419  "iso tau efficiency (EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
421  ibooker.book1D("efficiencyIsoTauET_EB_EE_threshold_" + str_threshold + "_Den",
422  "iso tau efficiency (EB+EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
423 
424  // non iso
426  ibooker.book1D("efficiencyNonIsoTauET_EB_threshold_" + str_threshold + "_Num",
427  "inclusive tau efficiency (EB); PFTau E_{T} (GeV); events", nBins, tauBinArray);
429  ibooker.book1D("efficiencyNonIsoTauET_EE_threshold_" + str_threshold + "_Num",
430  "inclusive tau efficiency (EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
432  ibooker.book1D("efficiencyNonIsoTauET_EB_EE_threshold_" + str_threshold + "_Num",
433  "inclusive tau efficiency (EB+EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
434 
436  ibooker.book1D("efficiencyNonIsoTauET_EB_threshold_" + str_threshold + "_Den",
437  "inclusive tau efficiency (EB); PFTau E_{T} (GeV); events", nBins, tauBinArray);
439  ibooker.book1D("efficiencyNonIsoTauET_EE_threshold_" + str_threshold + "_Den",
440  "inclusive tau efficiency (EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
442  ibooker.book1D("efficiencyNonIsoTauET_EB_EE_threshold_" + str_threshold + "_Den",
443  "inclusive tau efficiency (EB+EE); PFTau E_{T} (GeV); events", nBins, tauBinArray);
444  }
445 
446  ibooker.cd();
447 
448  return;
449 }
std::vector< float > binsX
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_pass_
MonitorElement * h_L1TauPhivsTauPhi_EB_
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_
std::string histFolder_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EB_EE_total_
MonitorElement * h_resolutionTauPhi_EB_
MonitorElement * h_L1TauPhivsTauPhi_EE_
std::vector< int > tauEfficiencyThresholds_
MonitorElement * h_resolutionTauPhi_EB_EE_
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_total_
MonitorElement * h_resolutionTauPhi_EE_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_pass_
MonitorElement * h_L1TauEtavsTauEta_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EB_EE_total_
MonitorElement * h_resolutionTauEta_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_total_
MonitorElement * h_resolutionTauET_EB_EE_
MonitorElement * h_resolutionTauET_EE_
std::map< double, MonitorElement * > h_efficiencyIsoTauET_EE_total_
std::vector< float > binsY
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * h_tagAndProbeMass_
dqmoffline::l1t::HistDefinitions histDefinitions_
MonitorElement * h_L1TauETvsTauET_EB_EE_
MonitorElement * h_L1TauETvsTauET_EE_
MonitorElement * h_L1TauPhivsTauPhi_EB_EE_
MonitorElement * h_resolutionTauET_EB_
MonitorElement * h_L1TauETvsTauET_EB_
std::map< double, MonitorElement * > h_efficiencyNonIsoTauET_EE_pass_
double L1TTauOffline::calcDeltaPhi ( double  phi1,
double  phi2 
)
private
double L1TTauOffline::Distance ( const reco::Candidate c1,
const reco::Candidate c2 
)
private
double L1TTauOffline::DistancePhi ( const reco::Candidate c1,
const reco::Candidate c2 
)
private
void L1TTauOffline::dqmBeginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 124 of file L1TTauOffline.cc.

References HLTConfigProvider::init(), m_hltConfig, and trigProcess_.

126 {
127  bool changed = true;
128  m_hltConfig.init(run, iSetup, trigProcess_, changed);
129 
130  edm::LogInfo("L1TTauOffline") << "L1TTauOffline::beginRun" << std::endl;
131 }
HLTConfigProvider m_hltConfig
std::string trigProcess_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
void L1TTauOffline::endJob ( void  )
overrideprotected

Definition at line 639 of file L1TTauOffline.cc.

References normalise2DHistogramsToBinArea().

639  {
641 }
void normalise2DHistogramsToBinArea()
void L1TTauOffline::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprotected

Definition at line 329 of file L1TTauOffline.cc.

330 {
331  edm::LogInfo("L1TTauOffline") << "L1TTauOffline::endRun" << std::endl;
332 }
const reco::Vertex L1TTauOffline::getPrimaryVertex ( edm::Handle< reco::VertexCollection > const &  vertex,
edm::Handle< reco::BeamSpot > const &  beamSpot 
)
protected

Definition at line 451 of file L1TTauOffline.cc.

References reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), edm::HandleBase::isValid(), reco::BeamSpot::position(), reco::Vertex::position(), impactParameterTagInfos_cfi::primaryVertex, and reco::BeamSpot::sigmaZ().

Referenced by analyze().

453 {
454  reco::Vertex::Point posVtx;
455  reco::Vertex::Error errVtx;
456 
457  bool hasPrimaryVertex = false;
458 
459  if (vertex.isValid()) {
460  for (auto vertexIt = vertex->begin(); vertexIt != vertex->end(); ++vertexIt) {
461  if (vertexIt->isValid() && !vertexIt->isFake()) {
462  posVtx = vertexIt->position();
463  errVtx = vertexIt->error();
464  hasPrimaryVertex = true;
465  break;
466  }
467  }
468  }
469 
470  if (!hasPrimaryVertex) {
471  posVtx = beamSpot->position();
472  errVtx(0, 0) = beamSpot->BeamWidthX();
473  errVtx(1, 1) = beamSpot->BeamWidthY();
474  errVtx(2, 2) = beamSpot->sigmaZ();
475  }
476 
477  const reco::Vertex primaryVertex(posVtx, errVtx);
478 
479  return primaryVertex;
480 }
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
bool isValid() const
Definition: HandleBase.h:74
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:88
const Point & position() const
position
Definition: BeamSpot.h:62
void L1TTauOffline::getProbeTaus ( const edm::Event e,
edm::Handle< reco::PFTauCollection > const &  taus,
edm::Handle< reco::MuonCollection > const &  muons,
const reco::Vertex vertex 
)
protected

Definition at line 583 of file L1TTauOffline.cc.

References AntiEleInputTag_, AntiMuInputTag_, comb3TInputTag_, DecayModeFindingInputTag_, PVValHelper::eta, edm::Event::getByToken(), edm::HandleBase::isValid(), m_ProbeTaus, m_TightMuons, phi, and EnergyCorrector::pt.

Referenced by analyze().

587 {
588  m_ProbeTaus.clear();
589 
591  iEvent.getByToken(AntiMuInputTag_, antimu);
592  if (!antimu.isValid()) {
593  edm::LogWarning("L1TTauOffline") << "invalid collection: reco::PFTauDiscriminator " << std::endl;
594  return;
595  }
596 
598  iEvent.getByToken(DecayModeFindingInputTag_, dmf);
599  if (!dmf.isValid()) {
600  edm::LogWarning("L1TTauOffline") << "invalid collection: reco::PFTauDiscriminator " << std::endl;
601  return;
602  }
603 
605  iEvent.getByToken(AntiEleInputTag_, antiele);
606  if (!antiele.isValid()) {
607  edm::LogWarning("L1TTauOffline") << "invalid collection: reco::PFTauDiscriminator " << std::endl;
608  return;
609  }
610 
612  iEvent.getByToken(comb3TInputTag_, comb3T);
613  if (!comb3T.isValid()) {
614  edm::LogWarning("L1TTauOffline") << "invalid collection: reco::PFTauDiscriminator " << std::endl;
615  return;
616  }
617 
618  if (!m_TightMuons.empty()) {
619  TLorentzVector mymu;
620  mymu.SetPtEtaPhiE(m_TightMuons[0]->pt(), m_TightMuons[0]->eta(), m_TightMuons[0]->phi(),
621  m_TightMuons[0]->energy());
622  int iTau = 0;
623  for (auto tauIt = taus->begin(); tauIt != taus->end(); ++tauIt, ++iTau) {
624  reco::PFTauRef tauCandidate(taus, iTau);
625  TLorentzVector mytau;
626  mytau.SetPtEtaPhiE(tauIt->pt(), tauIt->eta(), tauIt->phi(), tauIt->energy());
627 
628  if (fabs(tauIt->charge()) == 1 && fabs(tauIt->eta()) < 2.1 && tauIt->pt() > 20 &&
629  (*antimu)[tauCandidate] > 0.5 && (*antiele)[tauCandidate] > 0.5 && (*dmf)[tauCandidate] > 0.5 &&
630  (*comb3T)[tauCandidate] > 0.5) {
631  if (mymu.DeltaR(mytau) > 0.5 && (mymu + mytau).M() > 40 && (mymu + mytau).M() < 80 &&
632  m_TightMuons[0]->charge() * tauIt->charge() < 0) {
633  m_ProbeTaus.push_back(&(*tauIt));
634  }
635  }
636  }
637  }
638 }
edm::EDGetTokenT< reco::PFTauDiscriminator > comb3TInputTag_
std::vector< const reco::PFTau * > m_ProbeTaus
int iEvent
Definition: GenABIO.cc:230
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< reco::PFTauDiscriminator > AntiMuInputTag_
std::vector< const reco::Muon * > m_TightMuons
edm::EDGetTokenT< reco::PFTauDiscriminator > DecayModeFindingInputTag_
edm::EDGetTokenT< reco::PFTauDiscriminator > AntiEleInputTag_
void L1TTauOffline::getTauL1tPairs ( edm::Handle< l1t::TauBxCollection > const &  l1tCands)
protected

Definition at line 513 of file L1TTauOffline.cc.

References BXVector< T >::begin(), TauL1TPair::dR(), BXVector< T >::end(), TauL1TPair::l1tPt(), m_MaxL1tTauDR, m_ProbeTaus, m_TauL1tPairs, BXVector< T >::size(), and metsig::tau.

Referenced by analyze().

514 {
515  m_TauL1tPairs.clear();
516 
517  vector<l1t::Tau> l1tContainer;
518  l1tContainer.reserve(l1tCands->size() + 1);
519 
520  for (auto tau = l1tCands->begin(0); tau != l1tCands->end(0); ++tau) {
521  l1tContainer.push_back(*tau);
522  }
523 
524  for (auto probeTauIt = m_ProbeTaus.begin(); probeTauIt != m_ProbeTaus.end(); ++probeTauIt) {
525  TauL1TPair pairBestCand((*probeTauIt), nullptr);
526 
527  for (auto l1tIt = l1tContainer.begin(); l1tIt != l1tContainer.end(); ++l1tIt) {
528  TauL1TPair pairTmpCand((*probeTauIt), &(*l1tIt));
529 
530  if (pairTmpCand.dR() < m_MaxL1tTauDR && pairTmpCand.l1tPt() > pairBestCand.l1tPt())
531  pairBestCand = pairTmpCand;
532  }
533 
534  m_TauL1tPairs.push_back(pairBestCand);
535  }
536 }
const_iterator end(int bx) const
unsigned size(int bx) const
std::vector< TauL1TPair > m_TauL1tPairs
std::vector< const reco::PFTau * > m_ProbeTaus
const_iterator begin(int bx) const
void L1TTauOffline::getTightMuons ( edm::Handle< reco::MuonCollection > const &  muons,
edm::Handle< reco::PFMETCollection > const &  mets,
const reco::Vertex vertex,
edm::Handle< trigger::TriggerEvent > const &  trigEvent 
)
protected

Definition at line 538 of file L1TTauOffline.cc.

References muon::isLooseMuon(), m_TightMuons, matchHlt(), SiStripPI::max, TtSemiLepEvtBuilder_cfi::mt, funct::pow(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), and mathSSE::sqrt().

Referenced by analyze().

542 {
543  m_TightMuons.clear();
544 
545  const reco::PFMET* pfmet = nullptr;
546  pfmet = &(mets->front());
547 
548  int nb_mu = 0;
549 
550  for (auto muonIt2 = muons->begin(); muonIt2 != muons->end(); ++muonIt2) {
551  if (fabs(muonIt2->eta()) < 2.4 && muonIt2->pt() > 10 && muon::isLooseMuon((*muonIt2)) &&
552  (muonIt2->pfIsolationR04().sumChargedHadronPt +
553  max(muonIt2->pfIsolationR04().sumNeutralHadronEt + muonIt2->pfIsolationR04().sumPhotonEt -
554  0.5 * muonIt2->pfIsolationR04().sumPUPt,
555  0.0)) /
556  muonIt2->pt() <
557  0.3) {
558  ++nb_mu;
559  }
560  }
561  bool foundTightMu = false;
562  for (auto muonIt = muons->begin(); muonIt != muons->end(); ++muonIt) {
563  if (!matchHlt(trigEvent, &(*muonIt)))
564  continue;
565  float muiso = (muonIt->pfIsolationR04().sumChargedHadronPt +
566  max(muonIt->pfIsolationR04().sumNeutralHadronEt + muonIt->pfIsolationR04().sumPhotonEt -
567  0.5 * muonIt->pfIsolationR04().sumPUPt,
568  0.0)) /
569  muonIt->pt();
570 
571  if (muiso < 0.1 && nb_mu < 2 && !foundTightMu && fabs(muonIt->eta()) < 2.1 && muonIt->pt() > 24 &&
572  muon::isLooseMuon((*muonIt))) {
573  float mt = sqrt(pow(muonIt->pt() + pfmet->pt(), 2) - pow(muonIt->px() + pfmet->px(), 2) -
574  pow(muonIt->py() + pfmet->py(), 2));
575  if (mt < 30) {
576  m_TightMuons.push_back(&(*muonIt));
577  foundTightMu = true;
578  }
579  }
580  }
581 }
double px() const final
x coordinate of momentum vector
double pt() const final
transverse momentum
bool isLooseMuon(const reco::Muon &)
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< const reco::Muon * > m_TightMuons
double py() const final
y coordinate of momentum vector
bool matchHlt(edm::Handle< trigger::TriggerEvent > const &triggerEvent, const reco::Muon *muon)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
bool L1TTauOffline::matchHlt ( edm::Handle< trigger::TriggerEvent > const &  triggerEvent,
const reco::Muon muon 
)
protected

Definition at line 482 of file L1TTauOffline.cc.

References deltaR(), trigger::TriggerEvent::filterIds(), trigger::TriggerEvent::filterIndex(), trigger::TriggerEvent::filterKeys(), trigger::TriggerEvent::getObjects(), m_hltConfig, m_MaxHltTauDR, m_trigIndices, HLTConfigProvider::moduleLabels(), HLTConfigProvider::size(), TriggerAnalyzer::trigObjs, and trigProcess_.

Referenced by getTightMuons().

483 {
484  double matchDeltaR = 9999;
485 
487 
488  for (auto trigIndexIt = m_trigIndices.begin(); trigIndexIt != m_trigIndices.end(); ++trigIndexIt) {
489  const vector<string> moduleLabels(m_hltConfig.moduleLabels(*trigIndexIt));
490  const unsigned moduleIndex = m_hltConfig.size((*trigIndexIt)) - 2;
491 
492  const unsigned hltFilterIndex =
493  triggerEvent->filterIndex(InputTag(moduleLabels[moduleIndex], "", trigProcess_));
494 
495  if (hltFilterIndex < triggerEvent->sizeFilters()) {
496  const Keys triggerKeys(triggerEvent->filterKeys(hltFilterIndex));
497  const Vids triggerVids(triggerEvent->filterIds(hltFilterIndex));
498 
499  const unsigned nTriggers = triggerVids.size();
500  for (size_t iTrig = 0; iTrig < nTriggers; ++iTrig) {
501  const TriggerObject trigObject = trigObjs[triggerKeys[iTrig]];
502 
503  double dRtmp = deltaR((*muon), trigObject);
504  if (dRtmp < matchDeltaR)
505  matchDeltaR = dRtmp;
506  }
507  }
508  }
509 
510  return (matchDeltaR < m_MaxHltTauDR);
511 }
unsigned int size() const
number of trigger paths in trigger table
std::vector< int > m_trigIndices
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:123
HLTConfigProvider m_hltConfig
const Vids & filterIds(trigger::size_type index) const
Definition: TriggerEvent.h:110
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
std::string trigProcess_
std::vector< size_type > Keys
std::vector< int > Vids
void L1TTauOffline::normalise2DHistogramsToBinArea ( )
private

Definition at line 643 of file L1TTauOffline.cc.

References DEFINE_FWK_MODULE, h, h_L1TauEtavsTauEta_, h_L1TauETvsTauET_EB_, h_L1TauETvsTauET_EB_EE_, h_L1TauETvsTauET_EE_, h_L1TauPhivsTauPhi_EB_, h_L1TauPhivsTauPhi_EB_EE_, h_L1TauPhivsTauPhi_EE_, and LaserDQM_cfi::mon.

Referenced by endJob().

643  {
644  std::vector<MonitorElement*> monElementstoNormalize = {
647 
648  for (auto mon : monElementstoNormalize) {
649  if (mon != nullptr) {
650  auto h = mon->getTH2F();
651  if (h != nullptr) {
652  h->Scale(1, "width");
653  }
654  }
655  }
656 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
MonitorElement * h_L1TauPhivsTauPhi_EB_
MonitorElement * h_L1TauPhivsTauPhi_EE_
MonitorElement * h_L1TauEtavsTauEta_
MonitorElement * h_L1TauETvsTauET_EB_EE_
MonitorElement * h_L1TauETvsTauET_EE_
MonitorElement * h_L1TauPhivsTauPhi_EB_EE_
MonitorElement * h_L1TauETvsTauET_EB_

Member Data Documentation

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TTauOffline::AntiEleInputTag_
private

Definition at line 131 of file L1TTauOffline.h.

Referenced by getProbeTaus().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TTauOffline::AntiMuInputTag_
private

Definition at line 130 of file L1TTauOffline.h.

Referenced by getProbeTaus().

edm::EDGetTokenT<reco::BeamSpot> L1TTauOffline::BsInputTag_
private

Definition at line 137 of file L1TTauOffline.h.

Referenced by analyze().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TTauOffline::comb3TInputTag_
private

Definition at line 133 of file L1TTauOffline.h.

Referenced by getProbeTaus().

edm::EDGetTokenT<reco::PFTauDiscriminator> L1TTauOffline::DecayModeFindingInputTag_
private

Definition at line 132 of file L1TTauOffline.h.

Referenced by getProbeTaus().

std::string L1TTauOffline::efficiencyFolder_
private

Definition at line 143 of file L1TTauOffline.h.

Referenced by bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EB_EE_pass_
private

Definition at line 196 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EB_EE_total_
private

Definition at line 206 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EB_pass_
private

Definition at line 194 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EB_total_
private

Definition at line 204 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EE_pass_
private

Definition at line 195 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyIsoTauET_EE_total_
private

Definition at line 205 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EB_EE_pass_
private

Definition at line 200 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EB_EE_total_
private

Definition at line 210 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EB_pass_
private

Definition at line 198 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EB_total_
private

Definition at line 208 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EE_pass_
private

Definition at line 199 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

std::map<double, MonitorElement*> L1TTauOffline::h_efficiencyNonIsoTauET_EE_total_
private

Definition at line 209 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_L1TauEtavsTauEta_
private

Definition at line 180 of file L1TTauOffline.h.

Referenced by analyze(), bookTauHistos(), and normalise2DHistogramsToBinArea().

MonitorElement* L1TTauOffline::h_L1TauETvsTauET_EB_
private

Definition at line 172 of file L1TTauOffline.h.

Referenced by analyze(), bookTauHistos(), and normalise2DHistogramsToBinArea().

MonitorElement* L1TTauOffline::h_L1TauETvsTauET_EB_EE_
private

Definition at line 174 of file L1TTauOffline.h.

Referenced by analyze(), bookTauHistos(), and normalise2DHistogramsToBinArea().

MonitorElement* L1TTauOffline::h_L1TauETvsTauET_EE_
private

Definition at line 173 of file L1TTauOffline.h.

Referenced by analyze(), bookTauHistos(), and normalise2DHistogramsToBinArea().

MonitorElement* L1TTauOffline::h_L1TauPhivsTauPhi_EB_
private

Definition at line 176 of file L1TTauOffline.h.

Referenced by analyze(), bookTauHistos(), and normalise2DHistogramsToBinArea().

MonitorElement* L1TTauOffline::h_L1TauPhivsTauPhi_EB_EE_
private

Definition at line 178 of file L1TTauOffline.h.

Referenced by analyze(), bookTauHistos(), and normalise2DHistogramsToBinArea().

MonitorElement* L1TTauOffline::h_L1TauPhivsTauPhi_EE_
private

Definition at line 177 of file L1TTauOffline.h.

Referenced by analyze(), bookTauHistos(), and normalise2DHistogramsToBinArea().

MonitorElement* L1TTauOffline::h_nVertex_
private

Definition at line 168 of file L1TTauOffline.h.

Referenced by bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauET_EB_
private

Definition at line 183 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauET_EB_EE_
private

Definition at line 185 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauET_EE_
private

Definition at line 184 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauEta_
private

Definition at line 191 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauPhi_EB_
private

Definition at line 187 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauPhi_EB_EE_
private

Definition at line 189 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_resolutionTauPhi_EE_
private

Definition at line 188 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

MonitorElement* L1TTauOffline::h_tagAndProbeMass_
private

Definition at line 169 of file L1TTauOffline.h.

Referenced by bookTauHistos().

dqmoffline::l1t::HistDefinitions L1TTauOffline::histDefinitions_
private

Definition at line 147 of file L1TTauOffline.h.

Referenced by bookTauHistos().

std::string L1TTauOffline::histFolder_
private

Definition at line 142 of file L1TTauOffline.h.

Referenced by bookTauHistos().

edm::ESHandle<MagneticField> L1TTauOffline::m_BField
private

Definition at line 124 of file L1TTauOffline.h.

Referenced by analyze().

HLTConfigProvider L1TTauOffline::m_hltConfig
private

Definition at line 122 of file L1TTauOffline.h.

Referenced by bookHistograms(), dqmBeginRun(), and matchHlt().

BXVector<l1t::Tau> L1TTauOffline::m_L1tL1tTaus
private

Definition at line 156 of file L1TTauOffline.h.

std::vector<int> L1TTauOffline::m_L1tPtCuts
private

Definition at line 159 of file L1TTauOffline.h.

std::vector<l1t::TauBxCollection> L1TTauOffline::m_L1tTaus
private

Definition at line 154 of file L1TTauOffline.h.

float L1TTauOffline::m_MaxHltTauDR
private

Definition at line 163 of file L1TTauOffline.h.

Referenced by analyze(), and matchHlt().

float L1TTauOffline::m_MaxL1tTauDR
private

Definition at line 162 of file L1TTauOffline.h.

Referenced by analyze(), and getTauL1tPairs().

float L1TTauOffline::m_MaxTauEta
private

Definition at line 161 of file L1TTauOffline.h.

Referenced by analyze().

std::vector<const reco::PFTau*> L1TTauOffline::m_ProbeTaus
private

Definition at line 150 of file L1TTauOffline.h.

Referenced by getProbeTaus(), and getTauL1tPairs().

edm::ESHandle<Propagator> L1TTauOffline::m_propagatorAlong
private

Definition at line 125 of file L1TTauOffline.h.

edm::ESHandle<Propagator> L1TTauOffline::m_propagatorOpposite
private

Definition at line 126 of file L1TTauOffline.h.

std::vector<reco::PFTau> L1TTauOffline::m_RecoRecoTaus
private

Definition at line 155 of file L1TTauOffline.h.

std::vector<reco::PFTauCollection> L1TTauOffline::m_RecoTaus
private

Definition at line 153 of file L1TTauOffline.h.

std::vector<TauL1TPair> L1TTauOffline::m_TauL1tPairs
private

Definition at line 151 of file L1TTauOffline.h.

Referenced by analyze(), and getTauL1tPairs().

std::vector<const reco::Muon*> L1TTauOffline::m_TightMuons
private

Definition at line 149 of file L1TTauOffline.h.

Referenced by getProbeTaus(), and getTightMuons().

std::vector<int> L1TTauOffline::m_trigIndices
private

Definition at line 165 of file L1TTauOffline.h.

Referenced by bookHistograms(), and matchHlt().

edm::EDGetTokenT<reco::PFMETCollection> L1TTauOffline::MetInputTag_
private

Definition at line 135 of file L1TTauOffline.h.

Referenced by analyze().

edm::EDGetTokenT<reco::MuonCollection> L1TTauOffline::MuonInputTag_
private

Definition at line 134 of file L1TTauOffline.h.

Referenced by analyze().

const std::map< std::string, unsigned int > L1TTauOffline::PlotConfigNames
static
Initial value:
= {{"nVertex", PlotConfig::nVertex},
{"ETvsET", PlotConfig::ETvsET},
{"PHIvsPHI", PlotConfig::PHIvsPHI}}

Definition at line 85 of file L1TTauOffline.h.

Referenced by TauL1TPair::dR().

math::XYZPoint L1TTauOffline::PVPoint_
private

Definition at line 120 of file L1TTauOffline.h.

edm::EDGetTokenT<l1t::TauBxCollection> L1TTauOffline::stage2CaloLayer2TauToken_
private

Definition at line 144 of file L1TTauOffline.h.

Referenced by analyze().

std::vector<double> L1TTauOffline::tauEfficiencyBins_
private

Definition at line 146 of file L1TTauOffline.h.

Referenced by bookTauHistos().

std::vector<int> L1TTauOffline::tauEfficiencyThresholds_
private

Definition at line 145 of file L1TTauOffline.h.

Referenced by analyze(), and bookTauHistos().

edm::EDGetTokenT<reco::PFTauCollection> L1TTauOffline::theTauCollection_
private

Definition at line 129 of file L1TTauOffline.h.

Referenced by analyze().

edm::EDGetTokenT<trigger::TriggerEvent> L1TTauOffline::triggerEvent_
private

Definition at line 138 of file L1TTauOffline.h.

Referenced by analyze().

std::vector<std::string> L1TTauOffline::triggerPath_
private

Definition at line 141 of file L1TTauOffline.h.

Referenced by bookHistograms().

edm::EDGetTokenT<edm::TriggerResults> L1TTauOffline::triggerResults_
private

Definition at line 140 of file L1TTauOffline.h.

Referenced by analyze().

std::string L1TTauOffline::trigProcess_
private

Definition at line 139 of file L1TTauOffline.h.

Referenced by dqmBeginRun(), and matchHlt().

edm::EDGetTokenT<reco::VertexCollection> L1TTauOffline::VtxInputTag_
private

Definition at line 136 of file L1TTauOffline.h.

Referenced by analyze().