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

#include <MultipleProxyLoader.h>

Inheritance diagram for ExpressionParsing::MultipleProxyLoader:
Collaboration diagram for ExpressionParsing::MultipleProxyLoader:

Public Types

enum  VariableType {
  VT_UNK, VT_INT, VT_DOUBLE, VT_VECINT,
  VT_VECDOUBLE, VT_VECEMPTY
}
 

Public Member Functions

 MultipleProxyLoader ()
 
virtual ~MultipleProxyLoader ()
 
void push_back (IProxyLoader *proxyLoader)
 
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 Types

using proxyCache_t = CxxUtils::ConcurrentStrMap< IProxyLoader *, CxxUtils::SimpleUpdater >
 

Private Attributes

std::vector< IProxyLoader * > m_proxyLoaders
 
proxyCache_t m_varnameToProxyLoader ATLAS_THREAD_SAFE
 

Detailed Description

Definition at line 24 of file MultipleProxyLoader.h.

Member Typedef Documentation

◆ proxyCache_t

Definition at line 43 of file MultipleProxyLoader.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

◆ MultipleProxyLoader()

ExpressionParsing::MultipleProxyLoader::MultipleProxyLoader ( )

Definition at line 20 of file MultipleProxyLoader.cxx.

20  :
21  m_varnameToProxyLoader(proxyCache_t::Updater_t())
22  {
23  }

◆ ~MultipleProxyLoader()

ExpressionParsing::MultipleProxyLoader::~MultipleProxyLoader ( )
virtual

Definition at line 25 of file MultipleProxyLoader.cxx.

26  {
27  }

Member Function Documentation

◆ loadDoubleVariableFromString()

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

Implements ExpressionParsing::IProxyLoader.

Definition at line 77 of file MultipleProxyLoader.cxx.

78  {
79  return m_varnameToProxyLoader.at(varname)->loadDoubleVariableFromString(varname);
80  }

◆ loadIntVariableFromString()

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

Implements ExpressionParsing::IProxyLoader.

Definition at line 72 of file MultipleProxyLoader.cxx.

73  {
74  return m_varnameToProxyLoader.at(varname)->loadIntVariableFromString(varname);
75  }

◆ loadVecDoubleVariableFromString()

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

Implements ExpressionParsing::IProxyLoader.

Definition at line 87 of file MultipleProxyLoader.cxx.

88  {
89  return m_varnameToProxyLoader.at(varname)->loadVecDoubleVariableFromString(varname);
90  }

◆ loadVecIntVariableFromString()

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

Implements ExpressionParsing::IProxyLoader.

Definition at line 82 of file MultipleProxyLoader.cxx.

83  {
84  return m_varnameToProxyLoader.at(varname)->loadVecIntVariableFromString(varname);
85  }

◆ push_back()

void ExpressionParsing::MultipleProxyLoader::push_back ( IProxyLoader proxyLoader)

Definition at line 30 of file MultipleProxyLoader.cxx.

31  {
32  m_proxyLoaders.push_back(proxyLoader);
33  }

◆ reset()

void ExpressionParsing::MultipleProxyLoader::reset ( )
virtual

Implements ExpressionParsing::IProxyLoader.

Definition at line 35 of file MultipleProxyLoader.cxx.

36  {
37  for (const auto &proxyLoader : m_proxyLoaders) {
38  proxyLoader->reset();
39  }
40  }

◆ variableTypeFromString()

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

Implements ExpressionParsing::IProxyLoader.

Definition at line 42 of file MultipleProxyLoader.cxx.

43  {
44  auto itr = m_varnameToProxyLoader.find(varname);
45  if (itr != m_varnameToProxyLoader.end()) {
46  return itr->second->variableTypeFromString(varname);
47  }
48 
50  for (const auto &proxyLoader : m_proxyLoaders) {
51  try {
52  result = proxyLoader->variableTypeFromString(varname);
53  if (result == VT_UNK) continue;
54  } catch (const std::runtime_error &) {
55  continue;
56  }
57  m_varnameToProxyLoader.emplace(varname, proxyLoader);
58  return result;
59  }
60  std::stringstream msg;
61  msg << "MultipleProxyLoader: unable to find valid proxy loader for " << varname << "."
62  << " If it is an xAOD element or container which is read from the input file"
63  << " this problem may occur if it is not accessed anywhere in the job via read handles."
64  << " The problem can be mitigated by providing the missing information in the property "
65  << " ExtraDataForDynamicConsumers of the sequence which has the property "
66  << " ProcessDynamicDataDependencies set to True."
67  << " The property takes a list of strings of the form \'type/container-name\' e.g."
68  << " \'xAOD::TrackParticleContainer/InDetTrackParticles\'.";
69  throw std::runtime_error(msg.str());
70  }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

proxyCache_t m_varnameToProxyLoader ExpressionParsing::MultipleProxyLoader::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 44 of file MultipleProxyLoader.h.

◆ m_proxyLoaders

std::vector<IProxyLoader *> ExpressionParsing::MultipleProxyLoader::m_proxyLoaders
private

Definition at line 41 of file MultipleProxyLoader.h.


The documentation for this class was generated from the following files:
ExpressionParsing::IProxyLoader::VT_VECEMPTY
@ VT_VECEMPTY
Definition: IProxyLoader.h:21
get_generator_info.result
result
Definition: get_generator_info.py:21
ExpressionParsing::IProxyLoader::VT_VECDOUBLE
@ VT_VECDOUBLE
Definition: IProxyLoader.h:21
ExpressionParsing::IProxyLoader::VariableType
VariableType
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
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
ExpressionParsing::MultipleProxyLoader::m_proxyLoaders
std::vector< IProxyLoader * > m_proxyLoaders
Definition: MultipleProxyLoader.h:41