ATLAS Offline Software
TauPID.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 ///@file TauCommonDetails.icc
6 ///
7 /// Inline function implementations for tau PID details class
8 ///
9 ///Package: Reconstruction/TauEvent
10 ///
11 ///@author Thomas Burgess
12 ///
13 /// Created by Thomas Burgess on 2008-10-28.
14 ///
15 /// $Id: TauPID.icc,v 1.2 2009-01-21 12:22:11 tburgess Exp $
16 
17 #include <cmath>
18 
19 namespace Analysis {
20  inline TauPID::TauPID()
21  {
22  }
23 
24  inline TauPID::~TauPID()
25  {
26  }
27 
28  inline bool TauPID::operator!=( const TauPID& rhs ) const
29  {
30  return !((*this)==rhs);
31  }
32 
33  //-------------------------------------------------------------------------
34  // Has discriminant
35  //-------------------------------------------------------------------------
36  inline bool TauPID::hasDiscriminant(
37  TauJetParameters::TauID discID ) const
38  {
39  using namespace std;
40  vector<pair<TauJetParameters::TauID, double> >::const_iterator it =
41  m_params.begin();
42  for( ; it != m_params.end() && (*it).first != discID; ++it )
43  ;
44  return it != m_params.end();
45  }
46 
47  //-------------------------------------------------------------------------
48  // Get discriminant
49  //-------------------------------------------------------------------------
50  inline double TauPID::discriminant(
51  TauJetParameters::TauID discID ) const
52  {
53  using namespace std;
54  vector<pair<TauJetParameters::TauID, double> >::const_iterator it =
55  m_params.begin();
56  for( ; it != m_params.end() && (*it).first != discID; ++it )
57  ;
58  return (it != m_params.end()) ? (*it).second : TauDetails::DEFAULT;
59  }
60 
61  //-------------------------------------------------------------------------
62  // Set discriminant
63  //-------------------------------------------------------------------------
64  inline void TauPID::setDiscriminant(
65  TauJetParameters::TauID discID,
66  double disc )
67  {
68  using namespace std;
69  vector<pair<TauJetParameters::TauID, double> >::iterator it =
70  m_params.begin();
71  for( ; it != m_params.end() && (*it).first != discID; ++it )
72  ;
73  if( it != m_params.end() )
74  (*it).second = disc;
75  else
76  m_params.push_back( make_pair( discID, disc ) );
77  }
78 
79  //-------------------------------------------------------------------------
80  // Accept
81  //-------------------------------------------------------------------------
82  inline bool TauPID::isTau(
83  TauJetParameters::IsTauFlag flag ) const
84  {
85  return m_isTauFlags[flag];
86  }
87 
88  inline void TauPID::setIsTau(
89  TauJetParameters::IsTauFlag flag, bool value )
90  {
91  m_isTauFlags[flag] = value;
92  }
93 
94  //-------------------------------------------------------------------------
95  // Veto flags accessors
96  //-------------------------------------------------------------------------
97  inline void TauPID::setFlag(
98  TauJetParameters::VetoFlags flag, bool value )
99  {
100  m_vetoFlags[flag] = value;
101  }
102 
103  inline bool TauPID::flag(
104  TauJetParameters::VetoFlags flag ) const
105  {
106  return m_vetoFlags[flag];
107  }
108 }