ATLAS Offline Software
Namespaces | Classes | Typedefs | Functions | Variables
ExpressionParsing Namespace Reference

Namespace holding all the expression evaluation code. More...

Namespaces

 ast
 

Classes

class  AccessorFactory
 Class which creates accessors for the specified xAOD object content (singleton). More...
 
class  AccessorHelper
 Auxiliary class to handle xAOD accessor based xAOD object content access. More...
 
class  AccessorKit
 Implementation of an accessor creator which provides accessors for xAOD accessor or decor handle access to content of AuxElement or AuxVectorBase. More...
 
class  AccessorWrapper
 
class  BaseAccessor
 Base class of xAOD object content accessors. More...
 
class  BaseAccessorWrapper
 
class  CollectionMethodHelper
 Auxiliary class to handle method calls of vector containers (AuxVectorBase) More...
 
class  DecorHelper
 Auxiliary class to handle decorator handle based xAOD object content access. More...
 
class  EmptyVectorAccessor
 Special accessor to handle empty containers until the correct accessor can be created. More...
 
struct  EncapsulatedDefault
 
struct  EncapsulatedDefault< IProxyLoader >
 
struct  EncapsulatedDefault< IUnitInterpreter >
 
class  EncapsulatingSingleton
 
class  ExpressionParser
 
class  GenAccessor
 Generic accessor to access xAOD object content. More...
 
class  Helper_and
 
class  Helper_eq
 
class  Helper_gt
 
class  Helper_gte
 
class  Helper_lt
 
class  Helper_lte
 
class  Helper_neq
 
class  Helper_or
 
class  IAccessor
 Interface of auxiliary classes to access xAOD object content. More...
 
class  IAccessorKit
 Interface of a class to create an xAOD object content accessor. More...
 
class  IProxyLoader
 
class  IUnitInterpreter
 
class  MethodAccessorFactory
 Class to create accessor which call methods of an AuxElement of an AuxVectorBase container (singleton). More...
 
class  MethodHelper
 Auxiliary class to handle method calls of "scalar" containers (AuxElement). More...
 
class  MultiParserHelper
 Helper class to handle an array expression parsers to be used in the generic code. More...
 
class  MultipleProxyLoader
 
class  NTUPUnitInterpreter
 
class  PlainAccessorFactory
 
class  PlainValueHelper
 
class  ProxyLoaderSingleton
 
class  ScalarHelper
 Auxiliary class to handle scalar like containers (AuxElement). More...
 
class  SGNTUPProxyLoader
 
class  SGxAODProxyLoader
 Auxiliary class to access content of xAOD objects referred to by variables of an expressions handled by an instance of the ExpressionParser. More...
 
class  SingleParserHelper
 Helper class to handle a single expression parser to be used in the generic code. More...
 
class  Singleton
 
class  SizeHelper
 
class  SizeHelper< SG::AuxElement >
 
class  SizeHelper< SG::AuxVectorBase >
 
class  SizeHelper< std::vector< T > >
 
class  StackElement
 Class describing a single element in a text expression. More...
 
class  StdVectorHelper
 Auxiliary class to handle method calls of "scalar" containers (AuxElement). More...
 
class  TestProxyLoader
 
class  TMethodCollectionWrapper
 
class  TMethodWrapper
 
class  TriggerDecisionProxyLoader
 
class  UnitInterpreterSingleton
 
class  VectorHelper
 Auxiliary class to handle vector like containers (AuxVectorBase). More...
 
class  xAODElementProxyLoader
 
class  xAODProxyLoader
 
class  xAODVectorProxyLoader
 

Typedefs

using AppendLoaderFunc = std::function< StatusCode(ExpressionParsing::MultipleProxyLoader &)>
 
template<unsigned short NUM_PARSER>
using ParserHelper = typename std::conditional< NUM_PARSER==1, class SingleParserHelper, class MultiParserHelper< NUM_PARSER > >::type
 type of a helper class to create n-parser for the given expression or list of expressions. More...
 
template<unsigned short NUM_PARSER>
using SelectionArg = typename std::conditional< NUM_PARSER==1, std::string, std::vector< std::string > >::type
 type to be used for expression string(s) for a single or multiple expression parsers More...
 

Functions

StatusCode NoLoaderFunc (ExpressionParsing::MultipleProxyLoader &)
 
std::ostream & operator<< (std::ostream &os, const StackElement &el)
 Declare an output operator for StackElement objects. More...
 
template<class T_func >
void bin_op (std::vector< StackElement > &stack, T_func a_func)
 
template<class T_CompHelper , class T >
std::vector< int > compareVector (std::vector< T > &&a, std::vector< T > &&b, T_CompHelper helper)
 
template<class T_CompHelper , class T >
std::vector< int > compareVectorAlt (const std::vector< T > &&a, std::vector< T > &&b, T_CompHelper helper)
 
template<class T_CompHelper >
std::vector< int > compareVector (std::vector< int > &&a, const std::vector< int > &&b, T_CompHelper helper)
 
template<class T_CompHelper >
std::vector< int > compareVectorAlt (const std::vector< int > &&a, std::vector< int > &&b, T_CompHelper helper)
 
template<class T >
void dumpAuxId (const T &cont, SG::auxid_t method_id)
 Method for debugging to dump information for the given aux member. More...
 
template<class T >
void dumpAux (const T &cont, SG::auxid_t method_id)
 Method for debugging to dump information of all aux member of the given container and the specific aux "member". More...
 
template<class T >
void dumpDeclare (const T *key)
 Function for debugging which dumps information about newly declared data handles. More...
 
template<class T_Key >
void initializeHandle (T_Key *key, std::vector< Gaudi::DataHandle * > &new_input_handles)
 Auxiliary function to initialize newly create data handles. More...
 
template<class T_Aux >
bool isAvailable (const T_Aux &cont, SG::auxid_t auxid)
 
template<>
bool isAvailable< SG::AuxVectorBase > (const SG::AuxVectorBase &cont, SG::auxid_t auxid)
 
template<>
bool isAvailable< SG::AuxElement > (const SG::AuxElement &cont, SG::auxid_t auxid)
 
template<class T >
std::size_t getContainerSize (const T &cont)
 
template<class T >
const SG::AuxVectorDatagetVectorData (const T &cont)
 
template<>
const SG::AuxVectorDatagetVectorData< SG::AuxElement > (const SG::AuxElement &cont)
 

Variables

template<class T_Derived >
CxxUtils::CachedUniquePtrT< T_Derived > Singleton< T_Derived >::s_instance ATLAS_THREAD_SAFE
 

Detailed Description

Namespace holding all the expression evaluation code.

For convenience reasons all the code of the package is put into this namespace.

Author
Thomas Gillam (thoma.nosp@m.s.gi.nosp@m.llam@.nosp@m.cern.nosp@m..ch)

$Revision$ $Date$

Typedef Documentation

◆ AppendLoaderFunc

Definition at line 25 of file ExpressionParserUser.h.

◆ ParserHelper

template<unsigned short NUM_PARSER>
using ExpressionParsing::ParserHelper = typedef typename std::conditional< NUM_PARSER == 1, class SingleParserHelper, class MultiParserHelper<NUM_PARSER> >::type

type of a helper class to create n-parser for the given expression or list of expressions.

Definition at line 62 of file ExpressionParserUser.h.

◆ SelectionArg

template<unsigned short NUM_PARSER>
using ExpressionParsing::SelectionArg = typedef typename std::conditional< NUM_PARSER == 1, std::string, std::vector< std::string > >::type

type to be used for expression string(s) for a single or multiple expression parsers

Definition at line 66 of file ExpressionParserUser.h.

Function Documentation

◆ bin_op()

template<class T_func >
void ExpressionParsing::bin_op ( std::vector< StackElement > &  stack,
T_func  a_func 
)

Definition at line 26 of file ParsingInternals.cxx.

26  {
27  assert( stack.size() >= 2);
29  std::vector<ExpressionParsing::StackElement>::iterator second_last_elm = stack.end()-2;
30  a_func(*second_last_elm, *last_elm);
31  stack.pop_back();
32  }

◆ compareVector() [1/2]

template<class T_CompHelper >
std::vector<int> ExpressionParsing::compareVector ( std::vector< int > &&  a,
const std::vector< int > &&  b,
T_CompHelper  helper 
)

Definition at line 446 of file StackElement.cxx.

447  {
448  assert( a.size() == b.size() );
449  for (std::size_t idx=0; idx < a.size(); ++idx) {
450  a[idx] = helper.compare(a[idx],b[idx]);
451  }
452  return std::vector<int>(std::move(a));
453  }

◆ compareVector() [2/2]

template<class T_CompHelper , class T >
std::vector<int> ExpressionParsing::compareVector ( std::vector< T > &&  a,
std::vector< T > &&  b,
T_CompHelper  helper 
)

Definition at line 429 of file StackElement.cxx.

430  {
431  std::vector<int> ret;
432  ret.resize(a.size());
433  assert( a.size() == b.size() );
434  for (std::size_t idx=0; idx < a.size(); ++idx) {
435  ret[idx] = helper.compare(a[idx],b[idx]);
436  }
437  return ret;
438  }

◆ compareVectorAlt() [1/2]

template<class T_CompHelper >
std::vector<int> ExpressionParsing::compareVectorAlt ( const std::vector< int > &&  a,
std::vector< int > &&  b,
T_CompHelper  helper 
)

Definition at line 456 of file StackElement.cxx.

457  {
458  assert( a.size() == b.size() );
459  for (std::size_t idx=0; idx < a.size(); ++idx) {
460  b[idx] = helper.compare(a[idx],b[idx]);
461  }
462  return std::vector<int>(std::move(b));
463  }

◆ compareVectorAlt() [2/2]

template<class T_CompHelper , class T >
std::vector<int> ExpressionParsing::compareVectorAlt ( const std::vector< T > &&  a,
std::vector< T > &&  b,
T_CompHelper  helper 
)

Definition at line 440 of file StackElement.cxx.

441  {
442  return compareVectorAlt(a,b,helper);
443  }

◆ dumpAux()

template<class T >
void ExpressionParsing::dumpAux ( const T &  cont,
SG::auxid_t  method_id 
)

Method for debugging to dump information of all aux member of the given container and the specific aux "member".

Definition at line 55 of file DebugUtils.h.

55  {
56  dumpAuxId(cont, method_id);
57  for ( auto id : cont.getAuxIDs()) {
58  dumpAuxId(cont,id);
59  }
60  }

◆ dumpAuxId()

template<class T >
void ExpressionParsing::dumpAuxId ( const T &  cont,
SG::auxid_t  method_id 
)

Method for debugging to dump information for the given aux member.

Definition at line 14 of file DebugUtils.h.

14  {
15  std::string name;
16  std::string class_name;
17  std::string type_name;
18  std::string vec_name;
19  bool is_avaail=false;
20  try {
21  is_avaail=isAvailable (cont, method_id);
22  }
23  catch (...) {
24  }
25  try {
27  }
28  catch (...) {
29  }
30  try {
32  }
33  catch (...) {
34  }
35  try {
36  type_name = SG::AuxTypeRegistry::instance().getTypeName(method_id);
37  }
38  catch (...) {
39  }
40  try {
41  vec_name = SG::AuxTypeRegistry::instance().getVecTypeName(method_id);
42  }
43  catch (...) {
44  }
45  std::cout << "DEBUG SGxAODProxyLoader aux " << method_id << " : " << name << " -> "
46  << " class=" << class_name
47  << " type=" << type_name
48  << " type=" << vec_name
49  << " avail=" << is_avaail
50  << std::endl;
51  }

◆ dumpDeclare()

template<class T >
void ExpressionParsing::dumpDeclare ( const T *  key)

Function for debugging which dumps information about newly declared data handles.

Definition at line 65 of file DebugUtils.h.

65  {
66  if (key) {
67  std::string type_name;
68  const SG::BaseInfoBase* base_info = SG::BaseInfoBase::find (key->clid());
69  if (base_info) {
70  type_name =base_info->typeinfo().name();
71  }
72  std::cout << "DEBUG SGxAODProxyLoader declare " << key->key() << " -> " << type_name << std::endl;
73  }
74  }

◆ getContainerSize()

template<class T >
std::size_t ExpressionParsing::getContainerSize ( const T &  cont)

Definition at line 73 of file PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/Utils.h.

73  {
74  return SizeHelper<T>::getSize(cont);
75  }

◆ getVectorData()

template<class T >
const SG::AuxVectorData* ExpressionParsing::getVectorData ( const T &  cont)

Definition at line 78 of file PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/Utils.h.

78  {
79  return &cont;
80  }

◆ getVectorData< SG::AuxElement >()

Definition at line 83 of file PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/Utils.h.

83  {
84  return cont.container();
85  }

◆ initializeHandle()

template<class T_Key >
void ExpressionParsing::initializeHandle ( T_Key *  key,
std::vector< Gaudi::DataHandle * > &  new_input_handles 
)

Auxiliary function to initialize newly create data handles.

Definition at line 17 of file PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/Utils.h.

17  {
18  if (key) {
19  if (key->initialize().isFailure()) {
20  std::stringstream msg;
21  msg << "Failed to initialize read handle " << key->key();
22  throw std::runtime_error( msg.str());
23  }
24  key->init();
25  new_input_handles.push_back( key);
26  }
27  }

◆ isAvailable()

template<class T_Aux >
bool ExpressionParsing::isAvailable ( const T_Aux &  cont,
SG::auxid_t  auxid 
)

◆ isAvailable< SG::AuxElement >()

Definition at line 40 of file PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/Utils.h.

40  {
41  return cont.container() && cont.container()->isAvailable(auxid);
42  }

◆ isAvailable< SG::AuxVectorBase >()

Definition at line 35 of file PhysicsAnalysis/CommonTools/ExpressionEvaluation/src/Utils.h.

35  {
36  return cont.isAvailable(auxid);
37  }

◆ NoLoaderFunc()

StatusCode ExpressionParsing::NoLoaderFunc ( ExpressionParsing::MultipleProxyLoader )
inline

Definition at line 26 of file ExpressionParserUser.h.

26 { return StatusCode::SUCCESS;}

◆ operator<<()

std::ostream & ExpressionParsing::operator<< ( std::ostream &  os,
const StackElement el 
)

Declare an output operator for StackElement objects.

Declare the print operator as a friend of the class.

Definition at line 775 of file StackElement.cxx.

776  {
777 
778  switch( el.m_type ) {
779 
780  case StackElement::SE_INT:
781  os << "(int)" << el.m_intVal;
782  break;
783 
784  case StackElement::SE_DOUBLE:
785  os << "(double)" << el.m_doubleVal;
786  break;
787 
788  case StackElement::SE_VECINT:
789  os << "(vec<int>)" << el.m_vecIntVal;
790  break;
791 
792  case StackElement::SE_VECDOUBLE:
793  os << "(vec<double>)" << el.m_vecDoubleVal;
794  break;
795 
796  case StackElement::SE_UNK:
797  os << "SE_UNK";
798  break;
799 
800  default:
801  break;
802  }
803 
804  return os;
805  }

Variable Documentation

◆ ATLAS_THREAD_SAFE

template<class T_Derived >
CxxUtils::CachedUniquePtrT<T_Derived> Singleton<T_Derived>::s_instance ExpressionParsing::ATLAS_THREAD_SAFE
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
SG::AuxTypeRegistry::instance
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Definition: AuxTypeRegistry.cxx:639
ExpressionParsing::compareVectorAlt
std::vector< int > compareVectorAlt(const std::vector< int > &&a, std::vector< int > &&b, T_CompHelper helper)
Definition: StackElement.cxx:456
SG::AuxTypeRegistry::getName
std::string getName(SG::auxid_t auxid) const
Return the name of an aux data item.
Definition: AuxTypeRegistry.cxx:881
SG::AuxTypeRegistry::getVecTypeName
std::string getVecTypeName(SG::auxid_t auxid) const
Return the type of the STL vector used to hold an aux data item.
Definition: AuxTypeRegistry.cxx:951
ExpressionParsing::isAvailable
bool isAvailable(const T_Aux &cont, SG::auxid_t auxid)
SG::AuxVectorData::isAvailable
bool isAvailable(auxid_t id) const
Test to see if a variable exists in the store.
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
getSize
int getSize(std::map< std::string, std::vector< std::string >> &collection, const std::string &object)
Definition: SUSYToolsAlg.cxx:1578
SG::AuxTypeRegistry::getTypeName
std::string getTypeName(SG::auxid_t auxid) const
Return the type name of an aux data item.
Definition: AuxTypeRegistry.cxx:923
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
SG::AuxTypeRegistry::getClassName
std::string getClassName(SG::auxid_t auxid) const
Return the class name associated with an aux data item (may be blank).
Definition: AuxTypeRegistry.cxx:895
ExpressionParsing::dumpAuxId
void dumpAuxId(const T &cont, SG::auxid_t method_id)
Method for debugging to dump information for the given aux member.
Definition: DebugUtils.h:14
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
SG::BaseInfoBase::find
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition: BaseInfo.cxx:569
SG::AuxVectorBase::isAvailable
bool isAvailable(const std::string &name, const std::string &clsname="") const
Test to see if a variable exists in the store.
a
TList * a
Definition: liststreamerinfos.cxx:10
SG::BaseInfoBase
The non-template portion of the BaseInfo implementation.
Definition: Control/AthenaKernel/AthenaKernel/BaseInfo.h:451
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
SG::AuxElement::container
const SG::AuxVectorData * container() const
Return the container holding this element.
SG::BaseInfoBase::typeinfo
const std::type_info & typeinfo() const
Return the std::type_info for this class.
Definition: BaseInfo.cxx:151
python.DetectStreamerInfoChanges.class_name
class_name
Definition: DetectStreamerInfoChanges.py:60
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37