ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Types | List of all members
PanTau::TauFeature Class Reference

#include <TauFeature.h>

Collaboration diagram for PanTau::TauFeature:

Public Member Functions

 TauFeature ()
 Default constructor. More...
 
virtual ~TauFeature ()
 Destructor. More...
 
double value (const std::string &name, bool &isValid) const
 returns the value of the feature given by its name More...
 
const std::vector< double > & vecValue (const std::string &name) const
 returns the value of a vector feature given by its name More...
 
bool addFeature (const std::string &name, const double value)
 adds a new feature More...
 
bool addVecFeature (const std::string &name, const std::vector< double > &value)
 adds a new vector feature More...
 
int nValues () const
 returns the size of the m_featureMap More...
 
int nVecValues () const
 returns the size of the m_vecFeatureMap More...
 
void add (PanTau::TauFeature *otherFeatures)
 

Protected Attributes

FeatureMap m_featureMap
 The map containg all features. More...
 
VectorFeatureMap m_vecFeatureMap
 The map containg all features. More...
 

Private Types

typedef std::map< std::string, double > FeatureMap
 
typedef FeatureMap::iterator FeatureMapIter
 
typedef FeatureMap::const_iterator FeatureMapConstIter
 
typedef std::map< std::string, const std::vector< double > > VectorFeatureMap
 
typedef VectorFeatureMap::iterator VectorFeatureMapIter
 
typedef VectorFeatureMap::const_iterator VectorFeatureMapConstIter
 

Detailed Description

Class containing features of a tau seed.

Author
Sebas.nosp@m.tian.nosp@m..Flei.nosp@m.schm.nosp@m.ann@c.nosp@m.ern..nosp@m.ch

Definition at line 19 of file TauFeature.h.

Member Typedef Documentation

◆ FeatureMap

typedef std::map<std::string, double> PanTau::TauFeature::FeatureMap
private

Definition at line 21 of file TauFeature.h.

◆ FeatureMapConstIter

typedef FeatureMap::const_iterator PanTau::TauFeature::FeatureMapConstIter
private

Definition at line 23 of file TauFeature.h.

◆ FeatureMapIter

typedef FeatureMap::iterator PanTau::TauFeature::FeatureMapIter
private

Definition at line 22 of file TauFeature.h.

◆ VectorFeatureMap

typedef std::map<std::string, const std::vector<double> > PanTau::TauFeature::VectorFeatureMap
private

Definition at line 24 of file TauFeature.h.

◆ VectorFeatureMapConstIter

typedef VectorFeatureMap::const_iterator PanTau::TauFeature::VectorFeatureMapConstIter
private

Definition at line 26 of file TauFeature.h.

◆ VectorFeatureMapIter

typedef VectorFeatureMap::iterator PanTau::TauFeature::VectorFeatureMapIter
private

Definition at line 25 of file TauFeature.h.

Constructor & Destructor Documentation

◆ TauFeature()

PanTau::TauFeature::TauFeature ( )

Default constructor.

Definition at line 12 of file TauFeature.cxx.

12  :
13  m_featureMap(),
15 {
16 }

◆ ~TauFeature()

PanTau::TauFeature::~TauFeature ( )
virtualdefault

Destructor.

Member Function Documentation

◆ add()

void PanTau::TauFeature::add ( PanTau::TauFeature otherFeatures)

Definition at line 74 of file TauFeature.cxx.

74  {
75 
76  //add the scalar features
77  for (const auto& p : otherFeatures->m_featureMap) {
78  if (!(this->addFeature(p.first, p.second))) {
79  throw std::runtime_error("PanTau::TauFeature::add( PanTau::TauFeature* ): Error when adding scalar feature " + p.first);
80  }
81  }
82 
83  //add the vector features
84  for (const auto& p : otherFeatures->m_vecFeatureMap) {
85  if (!(this->addVecFeature(p.first, p.second))) {
86  throw std::runtime_error("PanTau::TauFeature::add( PanTau::TauFeature* ): Error when adding vector feature " + p.first);
87  }
88  }
89 }

◆ addFeature()

bool PanTau::TauFeature::addFeature ( const std::string &  name,
const double  value 
)

adds a new feature

Definition at line 44 of file TauFeature.cxx.

44  {
45 
46  if (std::isnan(value)) {
47  throw std::runtime_error("TauFeature::addFeature: Given " + name + " value is NaN!");
48  }
49  if (std::isinf(value)){
50  throw std::runtime_error("TauFeature::addFeature: Given " + name + " value is inf!");
51  }
52  std::pair<FeatureMapConstIter, bool> result = m_featureMap.insert(make_pair(name, value));
53  return result.second;
54 }

◆ addVecFeature()

bool PanTau::TauFeature::addVecFeature ( const std::string &  name,
const std::vector< double > &  value 
)

adds a new vector feature

Definition at line 57 of file TauFeature.cxx.

58  {
59  std::pair<VectorFeatureMapConstIter, bool> result = m_vecFeatureMap.insert(make_pair(name, value));
60  return result.second;
61 }

◆ nValues()

int PanTau::TauFeature::nValues ( ) const

returns the size of the m_featureMap

Definition at line 64 of file TauFeature.cxx.

64  {
65  return m_featureMap.size();
66 }

◆ nVecValues()

int PanTau::TauFeature::nVecValues ( ) const

returns the size of the m_vecFeatureMap

Definition at line 69 of file TauFeature.cxx.

69  {
70  return m_vecFeatureMap.size();
71 }

◆ value()

double PanTau::TauFeature::value ( const std::string &  name,
bool &  isValid 
) const

returns the value of the feature given by its name

Definition at line 23 of file TauFeature.cxx.

24 {
26  if (m_featureMap.end() == iter) {
27  isValid=false;
28  return -999999.;
29  }
30  isValid=true;
31  return (*iter).second;
32 }

◆ vecValue()

const std::vector< double > & PanTau::TauFeature::vecValue ( const std::string &  name) const

returns the value of a vector feature given by its name

Definition at line 35 of file TauFeature.cxx.

35  {
37  if (m_vecFeatureMap.end() == iter) {
38  return s_defaultVec;
39  }
40  return (*iter).second;
41 }

Member Data Documentation

◆ m_featureMap

FeatureMap PanTau::TauFeature::m_featureMap
protected

The map containg all features.

Definition at line 61 of file TauFeature.h.

◆ m_vecFeatureMap

VectorFeatureMap PanTau::TauFeature::m_vecFeatureMap
protected

The map containg all features.

Definition at line 63 of file TauFeature.h.


The documentation for this class was generated from the following files:
get_generator_info.result
result
Definition: get_generator_info.py:21
PanTau::TauFeature::VectorFeatureMapConstIter
VectorFeatureMap::const_iterator VectorFeatureMapConstIter
Definition: TauFeature.h:26
PanTau::TauFeature::addFeature
bool addFeature(const std::string &name, const double value)
adds a new feature
Definition: TauFeature.cxx:44
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:620
PanTau::TauFeature::m_featureMap
FeatureMap m_featureMap
The map containg all features.
Definition: TauFeature.h:61
PanTau::TauFeature::FeatureMapConstIter
FeatureMap::const_iterator FeatureMapConstIter
Definition: TauFeature.h:23
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
PanTau::TauFeature::value
double value(const std::string &name, bool &isValid) const
returns the value of the feature given by its name
Definition: TauFeature.cxx:23
PanTau::TauFeature::m_vecFeatureMap
VectorFeatureMap m_vecFeatureMap
The map containg all features.
Definition: TauFeature.h:63
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
PanTau::TauFeature::addVecFeature
bool addVecFeature(const std::string &name, const std::vector< double > &value)
adds a new vector feature
Definition: TauFeature.cxx:57