ATLAS Offline Software
Loading...
Searching...
No Matches
TauPID.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
14
15//TauEvent includes
16#include "tauEvent/TauPID.h"
17#include "tauEvent/TauCmp.h"
18//C/C++ includes
19#include <vector>
20
21namespace Analysis {
22 //Comparison predicate for doubles
23 inline bool cmp(double a, double b) {
24 static const double epsilon=1.0e-6;
25 return (std::fabs(a-b)<epsilon);
26 }
27
28 TauPID::TauPID (std::vector<std::pair<TauJetParameters::TauID, double> >&& params,
29 const std::bitset<32>& isTauFlags,
30 const std::bitset<32>& vetoFlags)
31 : m_params( std::move (params) ),
34 {
35
36 }
37
38 TauPID::TauPID(const TauPID& rhs) :
39 m_params( rhs.m_params ),
42 {
43
44 }
45
47 {
48 if(this != &rhs)
49 {
53 }
54 return *this;
55 }
56
58 {
59 if(this != &rhs)
60 {
61 m_params=std::move(rhs.m_params);
62 m_isTauFlags=std::move(rhs.m_isTauFlags);
63 m_vetoFlags=std::move(rhs.m_vetoFlags);
64 }
65 return *this;
66 }
67
68 bool TauPID::operator==( const TauPID& rhs ) const
69 {
70 //Loop over both params and make sure every entry is equal
71 if ( !TauCmp::vcmp(m_params,rhs.m_params) ) return false;
72 // std::vector<std::pair<TauJetParameters::TauID,
73 // double> >::const_iterator iparam, iparamrhs;
74 // for (iparam = m_params.begin(), iparamrhs=rhs.m_params.begin();
75 // (iparam!=m_params.end()) && (iparamrhs!=rhs.m_params.end());
76 // ++iparam,++iparamrhs)
77 // if (cmp((*iparam).second,(*iparamrhs).second))
78 // return false;
79 if ( m_isTauFlags != rhs.m_isTauFlags )
80 return false;
81 if ( m_vetoFlags != rhs.m_vetoFlags )
82 return false;
83 return true;
84 }
85
86 const std::vector<std::pair<TauJetParameters::TauID, double> >& TauPID::params() const
87 {
88 return m_params;
89 }
90 const std::bitset<32>& TauPID::isTauFlags() const
91 {
92 return m_isTauFlags;
93 }
94 const std::bitset<32>& TauPID::vetoFlags() const
95 {
96 return m_vetoFlags;
97 }
98}
static Double_t a
Declaration of Tau comparison predicates.
const std::bitset< 32 > & vetoFlags() const
Definition TauPID.cxx:94
std::bitset< 32 > m_vetoFlags
Definition TauPID.h:112
const std::vector< std::pair< TauJetParameters::TauID, double > > & params() const
Definition TauPID.cxx:86
std::bitset< 32 > m_isTauFlags
Definition TauPID.h:111
TauPID & operator=(const TauPID &rhs)
assignment operator
Definition TauPID.cxx:46
bool operator==(const TauPID &rhs) const
Equality operator.
Definition TauPID.cxx:68
std::vector< std::pair< TauJetParameters::TauID, double > > m_params
Definition TauPID.h:110
const std::bitset< 32 > & isTauFlags() const
Definition TauPID.cxx:90
TauPID()
Constructor.
bool vcmp(const std::vector< T > &a, const std::vector< T > &b)
Compare vectors using cmp predicate.
Definition TauCmp.h:36
The namespace of all packages in PhysicsAnalysis/JetTagging.
bool cmp(double a, double b)
Definition TauPID.cxx:23
STL namespace.