ATLAS Offline Software
TriggerItemNode.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TrigConf_TriggerItemNode
6 #define TrigConf_TriggerItemNode
7 
9 
10 #include <string>
11 extern "C" {
12 # include <stdint.h>
13 }
14 
15 namespace TrigConf {
16 
17  class TriggerThreshold;
18  class TriggerItemNode;
19 
20  std::ostream & operator<<(std::ostream & o, const TrigConf::TriggerItemNode & node);
21 
23  public:
24  enum NodeType {OBJ, NOT, AND, OR, UNDEF};
25  static NodeType typeFromString(const std::string&);
26  static NodeType typeFromChar(const char& c);
27  static std::string typeAsString(NodeType);
28 
30  virtual ~TriggerItemNode();
31 
32  typedef std::pair<L1DataDef::TriggerType,unsigned int> InternalType_t;
33 
34  bool isThreshold() const;
35  bool isInternalTrigger() const;
36 
37  // setters
39  const std::vector<TriggerItemNode*>& children() const { return m_Children; }
40 
41  // setters
42  void setThresholdName(const std::string& thrname) { m_ThresholdName = thrname; }
43  void setPosition(int pos) { m_Position = pos; }
44  void setMultiplicity(int mult) { m_Multiplicity = mult; }
46  void setInternalTrigger(L1DataDef::TriggerType x, unsigned int thresholdNumber);
47  void setInternalTrigger(const std::string& name);
48 
49  // accessors
50  NodeType type() const { return m_NodeType; };
51  const std::string& thresholdName() const { return m_ThresholdName; }
52  int position() const { return m_Position; }
53  int multiplicity() const { return m_Multiplicity; }
54  const TriggerThreshold* triggerThreshold() const { return m_Threshold; }
56  unsigned int internalTriggerNumber() const { return m_InternalTrigger.second; }
57 
58  void getAllFinalNodes(std::vector<const TriggerItemNode*>&) const;
59  void getAllThresholds(std::vector<const TriggerThreshold*>&) const;
60  void getAllBunchGroups(std::vector<bool>&) const; // vector of size 16 that describes the BGRPs used
61  void getBunchGroupsMask(uint16_t & bgmask) const; // uint16 that describes the BGRPs used
62  void getAllBunchGroups(std::vector<unsigned int>&) const;
63  void getAllRandomTriggers(std::vector<unsigned int>&) const;
64  void getAllPrescaledClockTriggers(std::vector<unsigned int>&) const;
65 
66  void print(const std::string& indent="", unsigned int detail=1) const;
67  void writeXML(std::ostream & xmlfile, int indentLevel=0, int indentWidth=2, bool omitDelimiter=false) const;
68  void buildLogic(std::vector<std::string> & conditionList, std::string & logic) const;
69 
70  virtual std::string __str__() const;
71 
72  private:
73  std::ostream & indent(std::ostream& o, int lvl, int size) const;
74 
76 
77  // for AND, OR, NOT
78  std::vector<TriggerItemNode*> m_Children;
79 
80  // for OBJ Threshold
81  std::string m_ThresholdName;
84  TriggerThreshold* m_Threshold; // ownership is with ThresholdConfig object
85 
86  // for OBJ Internal
88  };
89 
90 }
91 
92 #endif
TrigConf::TriggerItemNode::setInternalTrigger
void setInternalTrigger(L1DataDef::TriggerType x, unsigned int thresholdNumber)
Definition: TriggerItemNode.cxx:87
TrigConf::TriggerItemNode::m_ThresholdName
std::string m_ThresholdName
Definition: TriggerItemNode.h:81
TrigConf::TriggerItemNode::print
void print(const std::string &indent="", unsigned int detail=1) const
Definition: TriggerItemNode.cxx:278
TrigConf::TriggerItemNode::m_Position
int m_Position
Definition: TriggerItemNode.h:82
TrigConf::TriggerItemNode::InternalType_t
std::pair< L1DataDef::TriggerType, unsigned int > InternalType_t
Definition: TriggerItemNode.h:32
TrigConf::operator<<
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)
Definition: L1ThresholdBase.cxx:339
TrigConf::TriggerItemNode::indent
std::ostream & indent(std::ostream &o, int lvl, int size) const
Definition: TriggerItemNode.cxx:303
TrigConf::TriggerItemNode::internalTriggerNumber
unsigned int internalTriggerNumber() const
Definition: TriggerItemNode.h:56
TrigConf::TriggerItemNode::OBJ
@ OBJ
Definition: TriggerItemNode.h:24
TrigConf::TriggerItemNode::getAllThresholds
void getAllThresholds(std::vector< const TriggerThreshold * > &) const
Definition: TriggerItemNode.cxx:131
TrigConf::TriggerItemNode::type
NodeType type() const
Definition: TriggerItemNode.h:50
TrigConf::TriggerItemNode::getAllRandomTriggers
void getAllRandomTriggers(std::vector< unsigned int > &) const
Definition: TriggerItemNode.cxx:182
TrigConf::TriggerItemNode::getAllPrescaledClockTriggers
void getAllPrescaledClockTriggers(std::vector< unsigned int > &) const
Definition: TriggerItemNode.cxx:193
TrigConf::TriggerItemNode::setTriggerThreshold
void setTriggerThreshold(TriggerThreshold *thr)
Definition: TriggerItemNode.cxx:74
TrigConf::TriggerItemNode::writeXML
void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2, bool omitDelimiter=false) const
Definition: TriggerItemNode.cxx:205
TrigConf::TriggerItemNode::triggerThreshold
const TriggerThreshold * triggerThreshold() const
Definition: TriggerItemNode.h:54
TrigConf::TriggerItemNode::TriggerItemNode
TriggerItemNode(NodeType)
Definition: TriggerItemNode.cxx:22
detail
Definition: extract_histogram_tag.cxx:14
TrigConf::TriggerItemNode::addChild
void addChild(TriggerItemNode *node)
Definition: TriggerItemNode.cxx:114
TrigConf::TriggerItemNode::OR
@ OR
Definition: TriggerItemNode.h:24
TrigConf::TriggerItemNode
Definition: TriggerItemNode.h:22
TrigConf::TriggerItemNode::getAllFinalNodes
void getAllFinalNodes(std::vector< const TriggerItemNode * > &) const
Definition: TriggerItemNode.cxx:121
x
#define x
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::TriggerItemNode::setPosition
void setPosition(int pos)
Definition: TriggerItemNode.h:43
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TrigConf::TriggerItemNode::~TriggerItemNode
virtual ~TriggerItemNode()
Definition: TriggerItemNode.cxx:32
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TrigConf::TriggerItemNode::m_Multiplicity
int m_Multiplicity
Definition: TriggerItemNode.h:83
TrigConf::TriggerItemNode::isInternalTrigger
bool isInternalTrigger() const
Definition: TriggerItemNode.cxx:69
TrigConf::TriggerItemNode::m_NodeType
NodeType m_NodeType
Definition: TriggerItemNode.h:75
TrigConf::TriggerItemNode::children
const std::vector< TriggerItemNode * > & children() const
Definition: TriggerItemNode.h:39
TrigConf::TriggerItemNode::NodeType
NodeType
Definition: TriggerItemNode.h:24
TrigConf::TriggerItemNode::UNDEF
@ UNDEF
Definition: TriggerItemNode.h:24
TrigConf::TriggerItemNode::AND
@ AND
Definition: TriggerItemNode.h:24
TrigConf::TriggerItemNode::getBunchGroupsMask
void getBunchGroupsMask(uint16_t &bgmask) const
Definition: TriggerItemNode.cxx:158
TrigConf::TriggerItemNode::__str__
virtual std::string __str__() const
Definition: TriggerItemNode.cxx:336
TrigConf::TriggerItemNode::buildLogic
void buildLogic(std::vector< std::string > &conditionList, std::string &logic) const
Definition: TriggerItemNode.cxx:237
TrigConf::name
Definition: HLTChainList.h:35
TrigConf::TriggerItemNode::typeFromChar
static NodeType typeFromChar(const char &c)
Definition: TriggerItemNode.cxx:49
TrigConf::TriggerItemNode::getAllBunchGroups
void getAllBunchGroups(std::vector< bool > &) const
Definition: TriggerItemNode.cxx:144
TrigConf::TriggerItemNode::multiplicity
int multiplicity() const
Definition: TriggerItemNode.h:53
TrigConf::TriggerItemNode::m_Children
std::vector< TriggerItemNode * > m_Children
Definition: TriggerItemNode.h:78
TrigConf::TriggerItemNode::typeAsString
static std::string typeAsString(NodeType)
Definition: TriggerItemNode.cxx:57
TrigConf::TriggerItemNode::setMultiplicity
void setMultiplicity(int mult)
Definition: TriggerItemNode.h:44
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TrigConf::TriggerItemNode::m_InternalTrigger
InternalType_t m_InternalTrigger
Definition: TriggerItemNode.h:87
L1DataDef.h
TrigConf::TriggerItemNode::m_Threshold
TriggerThreshold * m_Threshold
Definition: TriggerItemNode.h:84
TrigConf::TriggerItemNode::position
int position() const
Definition: TriggerItemNode.h:52
TrigConf::L1DataDef::TriggerType
TriggerType
Definition: L1DataDef.h:30
TrigConf::TriggerItemNode::internalTriggerType
L1DataDef::TriggerType internalTriggerType() const
Definition: TriggerItemNode.h:55
TrigConf::TriggerItemNode::typeFromString
static NodeType typeFromString(const std::string &)
Definition: TriggerItemNode.cxx:38
TrigConf::TriggerItemNode::isThreshold
bool isThreshold() const
Definition: TriggerItemNode.cxx:64
TrigConf::TriggerItemNode::setThresholdName
void setThresholdName(const std::string &thrname)
Definition: TriggerItemNode.h:42
TrigConf::TriggerThreshold
Definition: TriggerThreshold.h:20
TrigConf::TriggerItemNode::thresholdName
const std::string & thresholdName() const
Definition: TriggerItemNode.h:51
python.compressB64.c
def c
Definition: compressB64.py:93
node
Definition: memory_hooks-stdcmalloc.h:74
TrigConf::TriggerItemNode::NOT
@ NOT
Definition: TriggerItemNode.h:24