ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConf::TriggerItem Class Reference

#include <TriggerItem.h>

Inheritance diagram for TrigConf::TriggerItem:
Collaboration diagram for TrigConf::TriggerItem:

Public Member Functions

 TriggerItem ()
virtual ~TriggerItem () override
unsigned int complex_deadtime () const
const std::string & definition () const
unsigned int triggerType () const
int ctpId () const
unsigned int partition () const
const TriggerItemNodetopNode () const
unsigned short monitor () const
uint16_t bunchgroupMask () const
void setComplexDeadtime (unsigned int cmpldt)
void setPartition (unsigned int partition)
void setTopNode (TriggerItemNode *ptrnode)
void setTriggerType (unsigned int tt)
void setCtpId (int id)
void setDefinition (const std::string &def)
bool isTriggerTypeBitOn (int ibit) const
virtual void print (const std::string &indent="", unsigned int detail=1) const override
void writeXML (std::ostream &xmlfile, int indentLevel=0, int indentWidth=2) const
void buildLogic (std::string &logic, std::vector< std::string > &conditionList) const
void setCondition (const std::string &logic, const std::vector< std::string > &conditions, const std::vector< TrigConf::TriggerThreshold * > &thrs)
void setMonitor (unsigned short monitor)
bool operator< (const TriggerItem &e) const
DiffStructcompareTo (const TriggerItem *o) const
std::string __str__ () const override
int superMasterTableId () const
unsigned int smk () const
unsigned int id () const
const std::string & name () const
const std::string & comment () const
unsigned int version () const
void setSuperMasterTableId (int id)
void setSMK (int id)
void setId (unsigned int id)
void setName (const std::string &name)
void setVersion (unsigned int version)
void setComment (const std::string &c)
void printNameIdV (const std::string &indent="") const

Protected Member Functions

std::ostream & indent (std::ostream &o, int lvl, int size) const

Private Attributes

unsigned int m_ComplexDeadtime
std::string m_Definition
TriggerItemNodem_TopNode
int m_CtpId
unsigned int m_TriggerType
unsigned int m_Partition
unsigned short m_Monitor
unsigned int m_smk
unsigned int m_id
std::string m_name
unsigned int m_version
std::string m_comment

Friends

std::ostream & operator<< (std::ostream &, const TrigConf::TriggerItem &)

Detailed Description

Definition at line 25 of file TriggerItem.h.

Constructor & Destructor Documentation

◆ TriggerItem()

TriggerItem::TriggerItem ( )

Definition at line 18 of file TriggerItem.cxx.

18 : TrigConfData(),
20 m_Definition( "" ),
21 m_TopNode( nullptr ),
22 m_CtpId( -1 ),
23 m_TriggerType( 0 ),
24 m_Partition( 0 ),
25 m_Monitor( 0 )
26{}
TrigConfData(const std::string &name="")
std::string m_Definition
Definition TriggerItem.h:70
unsigned short m_Monitor
Definition TriggerItem.h:75
unsigned int m_ComplexDeadtime
Definition TriggerItem.h:69
unsigned int m_TriggerType
Definition TriggerItem.h:73
unsigned int m_Partition
Definition TriggerItem.h:74
TriggerItemNode * m_TopNode
Definition TriggerItem.h:71

◆ ~TriggerItem()

TriggerItem::~TriggerItem ( )
overridevirtual

Definition at line 28 of file TriggerItem.cxx.

28 {
29 delete m_TopNode;
30}

Member Function Documentation

◆ __str__()

string TriggerItem::__str__ ( ) const
overridevirtual

Reimplemented from TrigConf::TrigConfData.

Definition at line 172 of file TriggerItem.cxx.

172 {
173 stringstream s;
174 s << *this;
175 return s.str();
176}

◆ buildLogic()

void TriggerItem::buildLogic ( std::string & logic,
std::vector< std::string > & conditionList ) const

Definition at line 109 of file TriggerItem.cxx.

109 {
110 if (m_TopNode)
111 m_TopNode->buildLogic(conditionList, logic);
112}

◆ bunchgroupMask()

uint16_t TrigConf::TriggerItem::bunchgroupMask ( ) const

Definition at line 34 of file TriggerItem.cxx.

34 {
35 uint16_t bgmask(0);
36 if( m_TopNode ) {
37 m_TopNode->getBunchGroupsMask(bgmask);
38 }
39 return bgmask;
40}
setWord1 uint16_t

◆ comment()

const std::string & TrigConf::TrigConfData::comment ( ) const
inlineinherited

Definition at line 23 of file TrigConfData.h.

23{return m_comment;}

◆ compareTo()

TrigConf::DiffStruct * TrigConf::TriggerItem::compareTo ( const TriggerItem * o) const

Definition at line 44 of file TriggerItem.cxx.

44 {
45 DiffStruct * ds = new DiffStruct("TriggerItem");
46 ds->check("ctpid", ctpId(), o->ctpId());
47 ds->check("definition", definition(), o->definition());
48 ds->check("complex_deadtime", complex_deadtime(), o->complex_deadtime());
49 ds->check("triggertype", triggerType(), o->triggerType());
50 if(!ds->empty()) {
51 ds->name = name();
52 } else {
53 delete ds; ds=0;
54 }
55 return ds;
56}
const std::string & name() const
unsigned int complex_deadtime() const
Definition TriggerItem.h:31
const std::string & definition() const
Definition TriggerItem.h:32
unsigned int triggerType() const
Definition TriggerItem.h:33

◆ complex_deadtime()

unsigned int TrigConf::TriggerItem::complex_deadtime ( ) const
inline

Definition at line 31 of file TriggerItem.h.

31{ return m_ComplexDeadtime; }

◆ ctpId()

int TrigConf::TriggerItem::ctpId ( ) const
inline

Definition at line 34 of file TriggerItem.h.

34{ return m_CtpId; }

◆ definition()

const std::string & TrigConf::TriggerItem::definition ( ) const
inline

Definition at line 32 of file TriggerItem.h.

32{ return m_Definition; }

◆ id()

unsigned int TrigConf::TrigConfData::id ( ) const
inlineinherited

Definition at line 21 of file TrigConfData.h.

21{return m_id;}

◆ indent()

std::ostream & TrigConfData::indent ( std::ostream & o,
int lvl,
int size ) const
protectedinherited

Definition at line 23 of file TrigConfData.cxx.

23 {
24 int width = lvl*size;
25 if(width==0) return o;
26 o << setw(lvl*size) << " ";
27 return o;
28}
const double width

◆ isTriggerTypeBitOn()

bool TrigConf::TriggerItem::isTriggerTypeBitOn ( int ibit) const
inline

Definition at line 48 of file TriggerItem.h.

48{ return ( (m_TriggerType & (1<<ibit) )!=0); }

◆ monitor()

unsigned short TrigConf::TriggerItem::monitor ( ) const
inline

Definition at line 37 of file TriggerItem.h.

37{ return m_Monitor; }

◆ name()

const std::string & TrigConf::TrigConfData::name ( ) const
inlineinherited

Definition at line 22 of file TrigConfData.h.

22{return m_name;}

◆ operator<()

bool TrigConf::TriggerItem::operator< ( const TriggerItem & e) const
inline

Definition at line 60 of file TriggerItem.h.

60 {
61 return ctpId() < e.ctpId();
62 }

◆ partition()

unsigned int TrigConf::TriggerItem::partition ( ) const
inline

Definition at line 35 of file TriggerItem.h.

35{ return m_Partition; }

◆ print()

void TriggerItem::print ( const std::string & indent = "",
unsigned int detail = 1 ) const
overridevirtual

Implements TrigConf::TrigConfData.

Definition at line 136 of file TriggerItem.cxx.

136 {
137 if(detail<3) {
138 cout << indent << "TriggerItem ctpid = " << m_CtpId << " ";
139 printNameIdV();
140 } else {
141 cout << indent << "==================================" << endl;
142 cout << indent << "TriggerItem:";
144 cout << indent << "Complex Deadtime: " << m_ComplexDeadtime << endl;
145 cout << indent << "Definition: " << m_Definition << endl;
146 cout << indent << "CTP_id : " << m_CtpId << endl;
147 cout << indent << "TriggerType(hex): 0x" << std::hex << m_TriggerType << std::dec << endl;
148 cout << indent << "Bunchgroup mask : " << uint2bin(bunchgroupMask(), 16) << endl;
149 cout << indent << "Monitor : " << monitor() << endl;
150 if(detail>=4) {
151 if (m_TopNode) m_TopNode->print(indent,detail);
152 else cout << indent << "TopNode is NULL pointer" << endl;
153 }
154 }
155}
std::ostream & indent(std::ostream &o, int lvl, int size) const
void printNameIdV(const std::string &indent="") const
uint16_t bunchgroupMask() const
unsigned short monitor() const
Definition TriggerItem.h:37
std::string uint2bin(uint32_t uinteger, uint16_t width)

◆ printNameIdV()

void TrigConfData::printNameIdV ( const std::string & indent = "") const
inherited

Definition at line 31 of file TrigConfData.cxx.

31 {
32 cout << indent << name();
33 if(id()>0 || version()>0)
34 cout << " (id=" << id() << "/v=" << version() << ")";
35 cout << endl;
36 if(comment()!="")
37 cout << indent << "Comment: " << comment() << endl;
38}
unsigned int id() const
const std::string & comment() const
unsigned int version() const

◆ setComment()

void TrigConf::TrigConfData::setComment ( const std::string & c)
inlineinherited

Definition at line 32 of file TrigConfData.h.

◆ setComplexDeadtime()

void TrigConf::TriggerItem::setComplexDeadtime ( unsigned int cmpldt)
inline

Definition at line 41 of file TriggerItem.h.

41{ m_ComplexDeadtime = cmpldt; }

◆ setCondition()

void TriggerItem::setCondition ( const std::string & logic,
const std::vector< std::string > & conditions,
const std::vector< TrigConf::TriggerThreshold * > & thrs )

Definition at line 116 of file TriggerItem.cxx.

118 {
119 // logic is a string like "!(1|2)&(3|4)"
120 // vector of conditions of length equal the largest number in logic string (e.g 4)
121 // a condition can be either a single name for internal triggers or a komma separated list of multiplicity, conditions name and threshold name
122 // thrs is a list of thresholds
123
124 m_Definition = "("+logic+")";
125
126 try {
127 m_TopNode = TrigConf::parse(logic, conditions, thrs);
128 }
129 catch(const exception& e) {
130 cout << "WARNING: Could not set condition of triggeritem " << name() << " because: " << e.what() << endl;
131 }
132}
std::vector< std::string > parse(std::string names)

◆ setCtpId()

void TrigConf::TriggerItem::setCtpId ( int id)
inline

Definition at line 45 of file TriggerItem.h.

45{ m_CtpId = id; }

◆ setDefinition()

void TrigConf::TriggerItem::setDefinition ( const std::string & def)
inline

Definition at line 46 of file TriggerItem.h.

46{ m_Definition = def; }

◆ setId()

void TrigConf::TrigConfData::setId ( unsigned int id)
inlineinherited

Definition at line 29 of file TrigConfData.h.

29{ m_id=id; }

◆ setMonitor()

void TrigConf::TriggerItem::setMonitor ( unsigned short monitor)
inline

Definition at line 58 of file TriggerItem.h.

58{ m_Monitor = monitor; }

◆ setName()

void TrigConf::TrigConfData::setName ( const std::string & name)
inlineinherited

Definition at line 30 of file TrigConfData.h.

30{ m_name = name;}

◆ setPartition()

void TrigConf::TriggerItem::setPartition ( unsigned int partition)
inline

Definition at line 42 of file TriggerItem.h.

unsigned int partition() const
Definition TriggerItem.h:35

◆ setSMK()

void TrigConf::TrigConfData::setSMK ( int id)
inlineinherited

Definition at line 28 of file TrigConfData.h.

28{m_smk=id;}

◆ setSuperMasterTableId()

void TrigConf::TrigConfData::setSuperMasterTableId ( int id)
inlineinherited

Definition at line 27 of file TrigConfData.h.

27{m_smk=id;}

◆ setTopNode()

void TrigConf::TriggerItem::setTopNode ( TriggerItemNode * ptrnode)
inline

Definition at line 43 of file TriggerItem.h.

43{ m_TopNode = ptrnode; }

◆ setTriggerType()

void TrigConf::TriggerItem::setTriggerType ( unsigned int tt)
inline

Definition at line 44 of file TriggerItem.h.

◆ setVersion()

void TrigConf::TrigConfData::setVersion ( unsigned int version)
inlineinherited

Definition at line 31 of file TrigConfData.h.

◆ smk()

unsigned int TrigConf::TrigConfData::smk ( ) const
inlineinherited

Definition at line 20 of file TrigConfData.h.

20{return m_smk;}

◆ superMasterTableId()

int TrigConf::TrigConfData::superMasterTableId ( ) const
inlineinherited

Definition at line 19 of file TrigConfData.h.

19{return (int)m_smk;}

◆ topNode()

const TriggerItemNode * TrigConf::TriggerItem::topNode ( ) const
inline

Definition at line 36 of file TriggerItem.h.

36{ return m_TopNode; }

◆ triggerType()

unsigned int TrigConf::TriggerItem::triggerType ( ) const
inline

Definition at line 33 of file TriggerItem.h.

33{ return m_TriggerType; }

◆ version()

unsigned int TrigConf::TrigConfData::version ( ) const
inlineinherited

Definition at line 24 of file TrigConfData.h.

24{return m_version;}

◆ writeXML()

void TriggerItem::writeXML ( std::ostream & xmlfile,
int indentLevel = 0,
int indentWidth = 2 ) const

Definition at line 60 of file TriggerItem.cxx.

60 {
61
62
63
64
65 string final_def = m_Definition;
66 bool end=false;
67 string::size_type index=0;
68 while(!end){
69 std::string::size_type pos=final_def.find('&',index);
70 if(pos!= std::string::npos){
71 end=false;
72 index = pos+1;
73 //do the replace
74 final_def.replace(pos, 1, "&amp;");
75 }else{
76 end=true;
77 index=0;
78 }
79 }
80
81 indent(xmlfile, indentLevel, indentWidth)
82 << "<TriggerItem ctpid=\"" << m_CtpId
83 << "\" partition=\"" << partition()
84 << "\" name=\"" << name()
85 << "\" complex_deadtime=\"" << complex_deadtime()
86 << "\" definition=\"" << final_def
87 << "\" trigger_type=\"" << TrigConf::uint2bin(m_TriggerType, partition()==1 ? 8 : 4) << "\"";
88 if(monitor()!=0) {
89 string s("LF:");
90 s += (monitor() & 0x04 ? '1' : '0');
91 s += (monitor() & 0x02 ? '1' : '0');
92 s += (monitor() & 0x01 ? '1' : '0');
93 s += "|HF:";
94 s += (monitor() & 0x20 ? '1' : '0');
95 s += (monitor() & 0x10 ? '1' : '0');
96 s += (monitor() & 0x08 ? '1' : '0');
97 xmlfile << " monitor=\"" << s << "\"";
98 }
99 xmlfile << ">" << endl;
100
101 if (m_TopNode)
102 m_TopNode->writeXML(xmlfile, indentLevel+1, indentWidth);
103
104 indent(xmlfile, indentLevel, indentWidth) << "</TriggerItem>" << endl;
105}
static std::vector< std::string > xmlfile
Definition iLumiCalc.h:29
str index
Definition DeMoScan.py:362

◆ operator<<

std::ostream & operator<< ( std::ostream & ,
const TrigConf::TriggerItem &  )
friend

Member Data Documentation

◆ m_comment

std::string TrigConf::TrigConfData::m_comment
privateinherited

Definition at line 48 of file TrigConfData.h.

◆ m_ComplexDeadtime

unsigned int TrigConf::TriggerItem::m_ComplexDeadtime
private

Definition at line 69 of file TriggerItem.h.

◆ m_CtpId

int TrigConf::TriggerItem::m_CtpId
private

Definition at line 72 of file TriggerItem.h.

◆ m_Definition

std::string TrigConf::TriggerItem::m_Definition
private

Definition at line 70 of file TriggerItem.h.

◆ m_id

unsigned int TrigConf::TrigConfData::m_id
privateinherited

Definition at line 45 of file TrigConfData.h.

◆ m_Monitor

unsigned short TrigConf::TriggerItem::m_Monitor
private

Definition at line 75 of file TriggerItem.h.

◆ m_name

std::string TrigConf::TrigConfData::m_name
privateinherited

Definition at line 46 of file TrigConfData.h.

◆ m_Partition

unsigned int TrigConf::TriggerItem::m_Partition
private

Definition at line 74 of file TriggerItem.h.

◆ m_smk

unsigned int TrigConf::TrigConfData::m_smk
privateinherited

Definition at line 44 of file TrigConfData.h.

◆ m_TopNode

TriggerItemNode* TrigConf::TriggerItem::m_TopNode
private

Definition at line 71 of file TriggerItem.h.

◆ m_TriggerType

unsigned int TrigConf::TriggerItem::m_TriggerType
private

Definition at line 73 of file TriggerItem.h.

◆ m_version

unsigned int TrigConf::TrigConfData::m_version
privateinherited

Definition at line 47 of file TrigConfData.h.


The documentation for this class was generated from the following files: