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 (std::unique_ptr< 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
std::unique_ptr< 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 26 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_CtpId( -1 ),
22 m_TriggerType( 0 ),
23 m_Partition( 0 ),
24 m_Monitor( 0 )
25{}
TrigConfData(const std::string &name="")
std::string m_Definition
Definition TriggerItem.h:71
unsigned short m_Monitor
Definition TriggerItem.h:76
unsigned int m_ComplexDeadtime
Definition TriggerItem.h:70
unsigned int m_TriggerType
Definition TriggerItem.h:74
unsigned int m_Partition
Definition TriggerItem.h:75

◆ ~TriggerItem()

TriggerItem::~TriggerItem ( )
overridevirtual

Definition at line 27 of file TriggerItem.cxx.

27 {
28}

Member Function Documentation

◆ __str__()

string TriggerItem::__str__ ( ) const
overridevirtual

Reimplemented from TrigConf::TrigConfData.

Definition at line 170 of file TriggerItem.cxx.

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

◆ buildLogic()

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

Definition at line 107 of file TriggerItem.cxx.

107 {
108 if (m_TopNode)
109 m_TopNode->buildLogic(conditionList, logic);
110}
std::unique_ptr< TriggerItemNode > m_TopNode
Definition TriggerItem.h:72

◆ bunchgroupMask()

uint16_t TrigConf::TriggerItem::bunchgroupMask ( ) const

Definition at line 32 of file TriggerItem.cxx.

32 {
33 uint16_t bgmask(0);
34 if( m_TopNode ) {
35 m_TopNode->getBunchGroupsMask(bgmask);
36 }
37 return bgmask;
38}
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 42 of file TriggerItem.cxx.

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

◆ complex_deadtime()

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

Definition at line 32 of file TriggerItem.h.

32{ return m_ComplexDeadtime; }

◆ ctpId()

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

Definition at line 35 of file TriggerItem.h.

35{ return m_CtpId; }

◆ definition()

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

Definition at line 33 of file TriggerItem.h.

33{ 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 49 of file TriggerItem.h.

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

◆ monitor()

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

Definition at line 38 of file TriggerItem.h.

38{ 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 61 of file TriggerItem.h.

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

◆ partition()

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

Definition at line 36 of file TriggerItem.h.

36{ return m_Partition; }

◆ print()

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

Implements TrigConf::TrigConfData.

Definition at line 134 of file TriggerItem.cxx.

134 {
135 if(detail<3) {
136 cout << indent << "TriggerItem ctpid = " << m_CtpId << " ";
137 printNameIdV();
138 } else {
139 cout << indent << "==================================" << endl;
140 cout << indent << "TriggerItem:";
142 cout << indent << "Complex Deadtime: " << m_ComplexDeadtime << endl;
143 cout << indent << "Definition: " << m_Definition << endl;
144 cout << indent << "CTP_id : " << m_CtpId << endl;
145 cout << indent << "TriggerType(hex): 0x" << std::hex << m_TriggerType << std::dec << endl;
146 cout << indent << "Bunchgroup mask : " << uint2bin(bunchgroupMask(), 16) << endl;
147 cout << indent << "Monitor : " << monitor() << endl;
148 if(detail>=4) {
149 if (m_TopNode) m_TopNode->print(indent,detail);
150 else cout << indent << "TopNode is NULL pointer" << endl;
151 }
152 }
153}
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:38
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 42 of file TriggerItem.h.

42{ 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 114 of file TriggerItem.cxx.

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

◆ setCtpId()

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

Definition at line 46 of file TriggerItem.h.

46{ m_CtpId = id; }

◆ setDefinition()

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

Definition at line 47 of file TriggerItem.h.

47{ 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 59 of file TriggerItem.h.

59{ 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 43 of file TriggerItem.h.

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

◆ 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 ( std::unique_ptr< TriggerItemNode > ptrnode)
inline

Definition at line 44 of file TriggerItem.h.

44{ m_TopNode = std::move(ptrnode); }

◆ setTriggerType()

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

Definition at line 45 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 37 of file TriggerItem.h.

37{ return m_TopNode.get(); }

◆ triggerType()

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

Definition at line 34 of file TriggerItem.h.

34{ 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 58 of file TriggerItem.cxx.

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

◆ m_CtpId

int TrigConf::TriggerItem::m_CtpId
private

Definition at line 73 of file TriggerItem.h.

◆ m_Definition

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

Definition at line 71 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 76 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 75 of file TriggerItem.h.

◆ m_smk

unsigned int TrigConf::TrigConfData::m_smk
privateinherited

Definition at line 44 of file TrigConfData.h.

◆ m_TopNode

std::unique_ptr<TriggerItemNode> TrigConf::TriggerItem::m_TopNode
private

Definition at line 72 of file TriggerItem.h.

◆ m_TriggerType

unsigned int TrigConf::TriggerItem::m_TriggerType
private

Definition at line 74 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: