ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
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(),
19  m_ComplexDeadtime( 0 ),
20  m_Definition( "" ),
21  m_TopNode( nullptr ),
22  m_CtpId( -1 ),
23  m_TriggerType( 0 ),
24  m_Partition( 0 ),
25  m_Monitor( 0 )
26 {}

◆ ~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 ) {
38  }
39  return bgmask;
40 }

◆ 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 }

◆ 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 }

◆ 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) {
152  else cout << indent << "TopNode is NULL pointer" << endl;
153  }
154  }
155 }

◆ 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 }

◆ setComment()

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

Definition at line 32 of file TrigConfData.h.

32 { m_comment = c;}

◆ 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 }

◆ 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.

◆ 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.

44 { m_TriggerType = (tt & 0xff); }

◆ setVersion()

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

Definition at line 31 of file TrigConfData.h.

31 { m_version = version;}

◆ 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 }

Friends And Related Function Documentation

◆ 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:
TrigConf::TrigConfData::m_id
unsigned int m_id
Definition: TrigConfData.h:45
TrigConf::TriggerItem::m_ComplexDeadtime
unsigned int m_ComplexDeadtime
Definition: TriggerItem.h:69
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TrigConf::TriggerItemNode::print
void print(const std::string &indent="", unsigned int detail=1) const
Definition: TriggerItemNode.cxx:278
checkxAOD.ds
ds
Definition: Tools/PyUtils/bin/checkxAOD.py:260
TrigConf::TrigConfData::m_name
std::string m_name
Definition: TrigConfData.h:46
TrigConf::TrigConfData::TrigConfData
TrigConfData(const std::string &name="")
Definition: TrigConfData.cxx:14
TrigConf::TriggerItem::ctpId
int ctpId() const
Definition: TriggerItem.h:34
TrigConf::TrigConfData::name
const std::string & name() const
Definition: TrigConfData.h:22
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrigConf::TriggerItem::triggerType
unsigned int triggerType() const
Definition: TriggerItem.h:33
TrigConf::parse
std::vector< std::string > parse(std::string names)
Definition: TrigConfHLTData/Root/HLTChain.cxx:117
TrigConf::TrigConfData::comment
const std::string & comment() const
Definition: TrigConfData.h:23
index
Definition: index.py:1
TrigConf::TriggerItem::complex_deadtime
unsigned int complex_deadtime() const
Definition: TriggerItem.h:31
TrigConf::DiffStruct
Definition: DiffStruct.h:14
TrigConf::TriggerItemNode::writeXML
void writeXML(std::ostream &xmlfile, int indentLevel=0, int indentWidth=2, bool omitDelimiter=false) const
Definition: TriggerItemNode.cxx:205
detail
Definition: extract_histogram_tag.cxx:14
TrigConf::TriggerItem::partition
unsigned int partition() const
Definition: TriggerItem.h:35
TrigConf::TrigConfData::m_version
unsigned int m_version
Definition: TrigConfData.h:47
python.XMLReader.xmlfile
xmlfile
Definition: XMLReader.py:72
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TrigConf::TriggerItem::m_Monitor
unsigned short m_Monitor
Definition: TriggerItem.h:75
TrigConf::TrigConfData::m_comment
std::string m_comment
Definition: TrigConfData.h:48
TrigConf::TriggerItem::m_TopNode
TriggerItemNode * m_TopNode
Definition: TriggerItem.h:71
TrigConf::TrigConfData::version
unsigned int version() const
Definition: TrigConfData.h:24
TrigConf::TriggerItem::m_TriggerType
unsigned int m_TriggerType
Definition: TriggerItem.h:73
calibdata.exception
exception
Definition: calibdata.py:496
TrigConf::TriggerItemNode::getBunchGroupsMask
void getBunchGroupsMask(uint16_t &bgmask) const
Definition: TriggerItemNode.cxx:158
TrigConf::TriggerItemNode::buildLogic
void buildLogic(std::vector< std::string > &conditionList, std::string &logic) const
Definition: TriggerItemNode.cxx:237
TrigConf::uint2bin
std::string uint2bin(uint32_t uinteger, uint16_t width)
Definition: Trigger/TrigConfiguration/TrigConfL1Data/Root/HelperFunctions.cxx:332
TrigConf::TriggerItem::m_Definition
std::string m_Definition
Definition: TriggerItem.h:70
TrigConf::TrigConfData::id
unsigned int id() const
Definition: TrigConfData.h:21
TrigConf::TriggerItem::bunchgroupMask
uint16_t bunchgroupMask() const
Definition: TriggerItem.cxx:34
TrigConf::TrigConfData::m_smk
unsigned int m_smk
Definition: TrigConfData.h:44
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TrigConf::TriggerItem::monitor
unsigned short monitor() const
Definition: TriggerItem.h:37
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
TrigConf::TriggerItem::m_Partition
unsigned int m_Partition
Definition: TriggerItem.h:74
TrigConf::TriggerItem::definition
const std::string & definition() const
Definition: TriggerItem.h:32
TrigConf::TriggerItem::m_CtpId
int m_CtpId
Definition: TriggerItem.h:72
TrigConf::TrigConfData::indent
std::ostream & indent(std::ostream &o, int lvl, int size) const
Definition: TrigConfData.cxx:23
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874
python.compressB64.c
def c
Definition: compressB64.py:93
TrigConf::TrigConfData::printNameIdV
void printNameIdV(const std::string &indent="") const
Definition: TrigConfData.cxx:31