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

#include <TriggerDecisionProxyLoader.h>

Inheritance diagram for ExpressionParsing::TriggerDecisionProxyLoader:
Collaboration diagram for ExpressionParsing::TriggerDecisionProxyLoader:

Public Types

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

Public Member Functions

 TriggerDecisionProxyLoader (ToolHandle< Trig::TrigDecisionTool > &trigDecTool)
 
virtual ~TriggerDecisionProxyLoader ()
 
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

ToolHandle< Trig::TrigDecisionToolm_trigDec
 

Detailed Description

Definition at line 22 of file TriggerDecisionProxyLoader.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

◆ TriggerDecisionProxyLoader()

ExpressionParsing::TriggerDecisionProxyLoader::TriggerDecisionProxyLoader ( ToolHandle< Trig::TrigDecisionTool > &  trigDecTool)
inline

Definition at line 25 of file TriggerDecisionProxyLoader.h.

25 : m_trigDec(trigDecTool) { }

◆ ~TriggerDecisionProxyLoader()

ExpressionParsing::TriggerDecisionProxyLoader::~TriggerDecisionProxyLoader ( )
virtual

Definition at line 18 of file TriggerDecisionProxyLoader.cxx.

19  {
20  }

Member Function Documentation

◆ loadDoubleVariableFromString()

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

Implements ExpressionParsing::IProxyLoader.

Definition at line 48 of file TriggerDecisionProxyLoader.cxx.

49  {
50  throw std::runtime_error("Trigger decision can't be a double: check " + varname);
51  }

◆ loadIntVariableFromString()

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

Implements ExpressionParsing::IProxyLoader.

Definition at line 38 of file TriggerDecisionProxyLoader.cxx.

39  {
40  bool passed(false);
41  if ( varname == "" ) return(0); // no name => ?
42  // trigger decision
43  passed = m_trigDec->isPassed(varname);
44  if (passed) return(1);
45  else return(0);
46  }

◆ loadVecDoubleVariableFromString()

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

Implements ExpressionParsing::IProxyLoader.

Definition at line 58 of file TriggerDecisionProxyLoader.cxx.

59  {
60  throw std::runtime_error("Trigger decision can't be vector<double>: check " + varname);
61  }

◆ loadVecIntVariableFromString()

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

Implements ExpressionParsing::IProxyLoader.

Definition at line 53 of file TriggerDecisionProxyLoader.cxx.

54  {
55  throw std::runtime_error("Trigger decision can't be vector<int>: check " + varname);
56  }

◆ reset()

void ExpressionParsing::TriggerDecisionProxyLoader::reset ( )
virtual

Implements ExpressionParsing::IProxyLoader.

Definition at line 22 of file TriggerDecisionProxyLoader.cxx.

23  {
24  }

◆ variableTypeFromString()

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

Implements ExpressionParsing::IProxyLoader.

Definition at line 26 of file TriggerDecisionProxyLoader.cxx.

27  {
28  static const std::set<std::string> knownPrefixes{"L1", "L2", "EF", "HLT"};
29 
30  std::size_t location = varname.find('_');
31  if (location == std::string::npos) return VT_UNK;
32  std::string prefix(varname.begin(), varname.begin()+location);
33 
34  if (std::find(knownPrefixes.begin(), knownPrefixes.end(), prefix) != knownPrefixes.end()) return VT_INT;
35  else return VT_UNK;
36  }

Member Data Documentation

◆ m_trigDec

ToolHandle<Trig::TrigDecisionTool> ExpressionParsing::TriggerDecisionProxyLoader::m_trigDec
private

Definition at line 35 of file TriggerDecisionProxyLoader.h.


The documentation for this class was generated from the following files:
ExpressionParsing::IProxyLoader::VT_VECEMPTY
@ VT_VECEMPTY
Definition: IProxyLoader.h:21
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
ExpressionParsing::IProxyLoader::VT_VECDOUBLE
@ VT_VECDOUBLE
Definition: IProxyLoader.h:21
ExpressionParsing::TriggerDecisionProxyLoader::m_trigDec
ToolHandle< Trig::TrigDecisionTool > m_trigDec
Definition: TriggerDecisionProxyLoader.h:35
ExpressionParsing::IProxyLoader::VT_DOUBLE
@ VT_DOUBLE
Definition: IProxyLoader.h:21
ExpressionParsing::IProxyLoader::VT_UNK
@ VT_UNK
Definition: IProxyLoader.h:21
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
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