ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
ExpressionParsing::SGNTUPProxyLoader Class Reference

#include <SGNTUPProxyLoader.h>

Inheritance diagram for ExpressionParsing::SGNTUPProxyLoader:
Collaboration diagram for ExpressionParsing::SGNTUPProxyLoader:

Public Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 
enum  VariableType {
  VT_UNK, VT_INT, VT_DOUBLE, VT_VECINT,
  VT_VECDOUBLE, VT_VECEMPTY
}
 

Public Member Functions

 SGNTUPProxyLoader (StoreGateSvc_t &evtStore)
 
virtual ~SGNTUPProxyLoader ()
 
virtual void reset ()
 
virtual IProxyLoader::VariableType variableTypeFromString (const std::string &varname) const
 
virtual int loadIntVariableFromString (const std::string &varname) const
 
virtual double loadDoubleVariableFromString (const std::string &varname) const
 
virtual std::vector< int > loadVecIntVariableFromString (const std::string &varname) const
 
virtual std::vector< double > loadVecDoubleVariableFromString (const std::string &varname) const
 

Private Attributes

StoreGateSvc_t m_evtStore
 

Detailed Description

Definition at line 23 of file SGNTUPProxyLoader.h.

Member Typedef Documentation

◆ StoreGateSvc_t

Definition at line 25 of file SGNTUPProxyLoader.h.

Member Enumeration Documentation

◆ VariableType

Enumerator
VT_UNK 
VT_INT 
VT_DOUBLE 
VT_VECINT 
VT_VECDOUBLE 
VT_VECEMPTY 

Definition at line 21 of file IProxyLoader.h.

Constructor & Destructor Documentation

◆ SGNTUPProxyLoader()

ExpressionParsing::SGNTUPProxyLoader::SGNTUPProxyLoader ( StoreGateSvc_t evtStore)
inline

Definition at line 27 of file SGNTUPProxyLoader.h.

27 : m_evtStore(evtStore) { }

◆ ~SGNTUPProxyLoader()

ExpressionParsing::SGNTUPProxyLoader::~SGNTUPProxyLoader ( )
virtual

Definition at line 37 of file SGNTUPProxyLoader.cxx.

38  {
39  }

Member Function Documentation

◆ loadDoubleVariableFromString()

double ExpressionParsing::SGNTUPProxyLoader::loadDoubleVariableFromString ( const std::string &  varname) const
virtual

Implements ExpressionParsing::IProxyLoader.

Definition at line 68 of file SGNTUPProxyLoader.cxx.

69  {
70  SG_GET_SCALAR(double, float);
71  SG_GET_SCALAR(double, double);
72  throw std::runtime_error("Unknown double-like proxy: " + varname);
73  }

◆ loadIntVariableFromString()

int ExpressionParsing::SGNTUPProxyLoader::loadIntVariableFromString ( const std::string &  varname) const
virtual

Implements ExpressionParsing::IProxyLoader.

Definition at line 60 of file SGNTUPProxyLoader.cxx.

61  {
62  SG_GET_SCALAR(int, int);
63  SG_GET_SCALAR(int, bool);
64  SG_GET_SCALAR(int, unsigned int);
65  throw std::runtime_error("Unknown int-like proxy: " + varname);
66  }

◆ loadVecDoubleVariableFromString()

std::vector< double > ExpressionParsing::SGNTUPProxyLoader::loadVecDoubleVariableFromString ( const std::string &  varname) const
virtual

Implements ExpressionParsing::IProxyLoader.

Definition at line 83 of file SGNTUPProxyLoader.cxx.

84  {
85  SG_GET_VECTOR(double, float);
86  SG_GET_VECTOR(double, double);
87  throw std::runtime_error("Unknown vector<double>-like proxy: " + varname);
88  }

◆ loadVecIntVariableFromString()

std::vector< int > ExpressionParsing::SGNTUPProxyLoader::loadVecIntVariableFromString ( const std::string &  varname) const
virtual

Implements ExpressionParsing::IProxyLoader.

Definition at line 75 of file SGNTUPProxyLoader.cxx.

76  {
77  SG_GET_VECTOR(int, int);
78  SG_GET_VECTOR(int, bool);
79  SG_GET_VECTOR(int, unsigned int);
80  throw std::runtime_error("Unknown vector<int>-like proxy: " + varname);
81  }

◆ reset()

void ExpressionParsing::SGNTUPProxyLoader::reset ( )
virtual

Implements ExpressionParsing::IProxyLoader.

Definition at line 41 of file SGNTUPProxyLoader.cxx.

42  {
43  }

◆ variableTypeFromString()

IProxyLoader::VariableType ExpressionParsing::SGNTUPProxyLoader::variableTypeFromString ( const std::string &  varname) const
virtual

Implements ExpressionParsing::IProxyLoader.

Definition at line 45 of file SGNTUPProxyLoader.cxx.

46  {
47  if (m_evtStore->contains<int>(varname)) return VT_INT;
48  else if (m_evtStore->contains<bool>(varname)) return VT_INT;
49  else if (m_evtStore->contains<unsigned int>(varname)) return VT_INT;
50  else if (m_evtStore->contains<float>(varname)) return VT_DOUBLE;
51  else if (m_evtStore->contains<double>(varname)) return VT_DOUBLE;
52  else if (m_evtStore->contains<std::vector<int> >(varname)) return VT_VECINT;
53  else if (m_evtStore->contains<std::vector<bool> >(varname)) return VT_VECINT;
54  else if (m_evtStore->contains<std::vector<unsigned int> >(varname)) return VT_VECINT;
55  else if (m_evtStore->contains<std::vector<float> >(varname)) return VT_VECDOUBLE;
56  else if (m_evtStore->contains<std::vector<double> >(varname)) return VT_VECDOUBLE;
57  else return VT_UNK;
58  }

Member Data Documentation

◆ m_evtStore

StoreGateSvc_t ExpressionParsing::SGNTUPProxyLoader::m_evtStore
private

Definition at line 40 of file SGNTUPProxyLoader.h.


The documentation for this class was generated from the following files:
ExpressionParsing::IProxyLoader::VT_VECEMPTY
@ VT_VECEMPTY
Definition: IProxyLoader.h:21
ExpressionParsing::IProxyLoader::VT_VECDOUBLE
@ VT_VECDOUBLE
Definition: IProxyLoader.h:21
ExpressionParsing::IProxyLoader::VT_DOUBLE
@ VT_DOUBLE
Definition: IProxyLoader.h:21
ExpressionParsing::IProxyLoader::VT_UNK
@ VT_UNK
Definition: IProxyLoader.h:21
ExpressionParsing::IProxyLoader::VT_VECINT
@ VT_VECINT
Definition: IProxyLoader.h:21
ExpressionParsing::IProxyLoader::VT_INT
@ VT_INT
Definition: IProxyLoader.h:21
LArG4AODNtuplePlotter.varname
def varname(hname)
Definition: LArG4AODNtuplePlotter.py:37
ExpressionParsing::SGNTUPProxyLoader::m_evtStore
StoreGateSvc_t m_evtStore
Definition: SGNTUPProxyLoader.h:40
SG_GET_SCALAR
#define SG_GET_SCALAR(RETTYPE, TRYTYPE)
Definition: SGNTUPProxyLoader.cxx:14
SG_GET_VECTOR
#define SG_GET_VECTOR(RETTYPE, TRYTYPE)
Definition: SGNTUPProxyLoader.cxx:23