ATLAS Offline Software
Tau.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 #include "TopEvent/EventTools.h"
7 
8 namespace top {
9  Tau::Tau() : m_tauSelection("TauAnalysisTools::TauSelectionTool"),
10  m_tauSelectionLoose
11  ("TauAnalysisTools::TauSelectionToolLoose") {
12  top::check(m_tauSelection.retrieve(),
13  "Failed to retrieve tau selection tool");
15  "Failed to retrieve loose tau selection tool");
16  }
17 
18  bool Tau::passSelection(const xAOD::TauJet& tau) const {
19  // Get the WP related decisions from TauSelectionTool
20 
21  // HIGG8D1 derivations (and possibly others) skim away
22  // tau tracks with pT<15 GeV. The tau selector tool
23  // returns an exception in this case. These taus should
24  // NOT be selected so return false if an exception is raised.
25  try {
26  return static_cast<bool>(m_tauSelection->accept(tau));
27  } catch (std::runtime_error& e) {
28  // If an exception is raised (possibly due to no tau track)
29  // then return false
30  return false;
31  }
32  }
33 
34  bool Tau::passSelectionLoose(const xAOD::TauJet& tau) const {
35  // get the WP related decisions from TauSelectionTool
36  // For the reasoning behind try/catch see above...
37  try {
38  return static_cast<bool>(m_tauSelectionLoose->accept(tau));
39  } catch (std::runtime_error& e) {
40  return false;
41  }
42  }
43 
44  void Tau::print(std::ostream& os) const {
45  os << "Tau\n";
46  os << " * Taus are now selected using the TauSelectionTool" << "\n";
47  os << " * Either you have supplied a tau configuration file (expert)\n";
48  os << " or set pT, JetIDWP and EleOLR options in your top-xaod\n";
49  os << " configuration file.";
50  }
51 } // namespace top
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::Tau::passSelection
bool passSelection(const xAOD::TauJet &tau) const override
Selection for the main analysis (i.e.
Definition: Tau.cxx:18
top::Tau::print
void print(std::ostream &os) const override
Why would you not want to know what you're running?
Definition: Tau.cxx:44
top::Tau::m_tauSelection
ToolHandle< TauAnalysisTools::TauSelectionTool > m_tauSelection
Definition: Tau.h:49
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
top::check
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
Definition: EventTools.cxx:15
top::Tau::passSelectionLoose
bool passSelectionLoose(const xAOD::TauJet &tau) const override
Selection for the "loose" object definitions (e.g.
Definition: Tau.cxx:34
top::Tau::m_tauSelectionLoose
ToolHandle< TauAnalysisTools::TauSelectionTool > m_tauSelectionLoose
Definition: Tau.h:52
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
Tau.h
top::Tau::Tau
Tau()
Definition: Tau.cxx:9