ATLAS Offline Software
Loading...
Searching...
No Matches
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>
11extern "C" {
12# include <stdint.h>
13}
14
15namespace 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; }
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
#define x
static NodeType typeFromChar(const char &c)
std::ostream & indent(std::ostream &o, int lvl, int size) const
const std::vector< TriggerItemNode * > & children() const
const TriggerThreshold * triggerThreshold() const
std::pair< L1DataDef::TriggerType, unsigned int > InternalType_t
static NodeType typeFromString(const std::string &)
std::vector< TriggerItemNode * > m_Children
L1DataDef::TriggerType internalTriggerType() const
void getAllPrescaledClockTriggers(std::vector< unsigned int > &) const
unsigned int internalTriggerNumber() const
const std::string & thresholdName() const
void getAllBunchGroups(std::vector< bool > &) const
static std::string typeAsString(NodeType)
void setInternalTrigger(L1DataDef::TriggerType x, unsigned int thresholdNumber)
void getAllRandomTriggers(std::vector< unsigned int > &) const
virtual std::string __str__() const
void getAllFinalNodes(std::vector< const TriggerItemNode * > &) const
InternalType_t m_InternalTrigger
void getBunchGroupsMask(uint16_t &bgmask) const
void addChild(TriggerItemNode *node)
TriggerThreshold * m_Threshold
void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2, bool omitDelimiter=false) const
void buildLogic(std::vector< std::string > &conditionList, std::string &logic) const
void getAllThresholds(std::vector< const TriggerThreshold * > &) const
void setTriggerThreshold(TriggerThreshold *thr)
void setThresholdName(const std::string &thrname)
void print(const std::string &indent="", unsigned int detail=1) const
Definition node.h:24
static std::vector< std::string > xmlfile
Definition iLumiCalc.h:29
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)