ATLAS Offline Software
Public Member Functions | Private Attributes | Friends | List of all members
TCS::GlobalOutput Class Reference

#include <GlobalOutput.h>

Inheritance diagram for TCS::GlobalOutput:
Collaboration diagram for TCS::GlobalOutput:

Public Member Functions

 GlobalOutput (const std::string &name="L1TopoGlobalOutput")
 
uint64_t decision_field (const std::string &l1connName) const
 
uint32_t decision_field (const std::string &l1connName, unsigned int clock) const
 
bool passed (const std::string &connName, unsigned int bit) const
 
uint64_t overflow_field (const std::string &l1connName) const
 
uint32_t overflow_field (const std::string &l1connName, unsigned int clock) const
 
bool overflowed (const std::string &l1connName, unsigned int bit) const
 
uint64_t ambiguity_field (const std::string &l1connName) const
 
uint32_t ambiguity_field (const std::string &l1connName, unsigned int clock) const
 
std::bitset< 128 > count_field (const std::string &l1connName) const
 
const Decisiondecision (const std::string &algName) const
 
bool isValid () const
 
void setDecisionTriggerLines (const std::vector< TrigConf::TriggerLine > &triggers)
 
void setMultiplicityTriggerLines (const std::vector< TrigConf::TriggerLine > &triggers)
 
StatusCode collectOutput (const std::set< DecisionConnector * > &outConn, const std::set< CountingConnector * > &countConn)
 
StatusCode resetOutput ()
 
void print () const
 
bool msgLvl (const MSGTC::Level lvl) const
 Test the output level. More...
 
MsgStreamTC & msg () const
 The standard message stream. More...
 
MsgStreamTC & msg (const MSGTC::Level lvl) const
 The standard message stream. More...
 

Private Attributes

std::map< std::string, uint64_t > m_decision
 
std::map< std::string, uint64_t > m_overflow
 
std::map< std::string, uint64_t > m_ambiguity
 
std::map< std::string, std::bitset< 128 > > m_count
 
bool m_valid {false}
 
std::vector< TrigConf::TriggerLinem_triggersDec
 
std::vector< TrigConf::TriggerLinem_triggersCount
 
boost::thread_specific_ptr< MsgStreamTC > m_msg_tls
 MsgStreamTC instance (a std::cout like with print-out levels) More...
 
std::string m_name
 

Friends

std::ostream & operator<< (std::ostream &, const TCS::GlobalOutput &)
 

Detailed Description

Definition at line 37 of file GlobalOutput.h.

Constructor & Destructor Documentation

◆ GlobalOutput()

GlobalOutput::GlobalOutput ( const std::string &  name = "L1TopoGlobalOutput")

Definition at line 137 of file GlobalOutput.cxx.

137  :
139 {}

Member Function Documentation

◆ ambiguity_field() [1/2]

uint64_t GlobalOutput::ambiguity_field ( const std::string &  l1connName) const

Definition at line 111 of file GlobalOutput.cxx.

111  {
112  if (m_ambiguity.find(l1connName) != m_ambiguity.end()) {
113  return m_ambiguity.find(l1connName)->second;
114  }else{
115  TRG_MSG_WARNING("Connector name " << l1connName << " unknown");
116  return 0;
117  }
118 }

◆ ambiguity_field() [2/2]

uint32_t GlobalOutput::ambiguity_field ( const std::string &  l1connName,
unsigned int  clock 
) const

Definition at line 121 of file GlobalOutput.cxx.

121  {
122  if (m_ambiguity.find(l1connName) != m_ambiguity.end()) {
123  if(clock==0) {
124  // lower 32 bit
125  return static_cast<uint32_t>(m_ambiguity.find(l1connName)->second & 0xffffffff);
126  } else {
127  // upper 32 bit
128  uint64_t clock1 = m_ambiguity.find(l1connName)->second & 0xffffffff00000000;
129  return static_cast<uint32_t>(clock1 >> 32);
130  }
131  }else{
132  TRG_MSG_WARNING("Connector name " << l1connName << " unknown");
133  return 0;
134  }
135 }

◆ collectOutput()

TCS::StatusCode GlobalOutput::collectOutput ( const std::set< DecisionConnector * > &  outConn,
const std::set< CountingConnector * > &  countConn 
)

Definition at line 150 of file GlobalOutput.cxx.

150  {
151  resetOutput();
152 
153  for( const DecisionConnector * conn : outConn ) {
154 
155  const Decision& dec = conn->decision();
156 
157  unsigned int pos = 0; // for multi-output algorithms pos is the output index
158  for(const TrigConf::TriggerLine & trigger : conn->triggers() ) {
159  unsigned int position = trigger.flatindex();
160 
161  uint64_t & l1connectorDec = m_decision[trigger.connName()];
162  uint64_t & l1connectorOvf = m_overflow[trigger.connName()];
163  uint64_t & l1connectorAmb = m_ambiguity[trigger.connName()];
164  uint64_t mask(0x1);
165 
166  if( dec.bit(pos++) ) // bit set?
167  l1connectorDec |= (mask << position);
168  if( dec.overflow())
169  l1connectorOvf |= (mask << position);
170  if( dec.ambiguity())
171  l1connectorAmb |= (mask << position);
172  }
173 
174  }
175 
176  for (const CountingConnector * conn : countConn) {
177 
178  const Count& count = conn->count();
179 
180  const TrigConf::TriggerLine & trigger = conn->triggers().at(0); // counting connectors only have one trigger line
181 
182  std::bitset<128> & l1connectorCount = m_count[trigger.connName()];
183 
184  l1connectorCount |= count.getCountBits();
185 
186  }
187 
188  m_valid = true;
190 }

◆ count_field()

std::bitset< 128 > GlobalOutput::count_field ( const std::string &  l1connName) const

Definition at line 74 of file GlobalOutput.cxx.

74  {
75  if (m_count.find(l1connName) != m_count.end()) {
76  return m_count.find(l1connName)->second;
77  }else{
78  TRG_MSG_WARNING("Connector name " << l1connName << " unknown");
79  return 0;
80  }
81 }

◆ decision()

const Decision& TCS::GlobalOutput::decision ( const std::string &  algName) const

◆ decision_field() [1/2]

uint64_t GlobalOutput::decision_field ( const std::string &  l1connName) const

Definition at line 47 of file GlobalOutput.cxx.

47  {
48  if (m_decision.find(l1connName) != m_decision.end()) {
49  return m_decision.find(l1connName)->second;
50  }else{
51  TRG_MSG_WARNING("Connector name " << l1connName << " unknown");
52  return 0;
53  }
54 }

◆ decision_field() [2/2]

uint32_t GlobalOutput::decision_field ( const std::string &  l1connName,
unsigned int  clock 
) const

Definition at line 57 of file GlobalOutput.cxx.

57  {
58  if (m_decision.find(l1connName) != m_decision.end()) {
59  if(clock==0) {
60  // lower 32 bit
61  return static_cast<uint32_t>(m_decision.at(l1connName) & 0xffffffff);
62  } else {
63  // upper 32 bit
64  uint64_t clock1 = m_decision.at(l1connName) & 0xffffffff00000000;
65  return static_cast<uint32_t>(clock1 >> 32);
66  }
67  }else{
68  TRG_MSG_WARNING("Connector name " << l1connName << " unknown");
69  return 0;
70  }
71 }

◆ isValid()

bool TCS::GlobalOutput::isValid ( ) const
inline

Definition at line 57 of file GlobalOutput.h.

57 { return m_valid; }

◆ msg() [1/2]

MsgStreamTC & TrigConf::TrigConfMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 81 of file TrigConfMessaging.h.

82  {
83  MsgStreamTC* ms = m_msg_tls.get();
84  if (!ms) {
85  ms = new MsgStreamTC(m_name);
86  m_msg_tls.reset(ms);
87  }
88  return *ms;
89  }

◆ msg() [2/2]

MsgStreamTC & TrigConf::TrigConfMessaging::msg ( const MSGTC::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 91 of file TrigConfMessaging.h.

92  {
93  return msg() << lvl;
94  }

◆ msgLvl()

bool TrigConf::TrigConfMessaging::msgLvl ( const MSGTC::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 70 of file TrigConfMessaging.h.

71  {
72  if (msg().level() <= lvl) {
73  msg() << lvl;
74  return true;
75  }
76  else {
77  return false;
78  }
79  }

◆ overflow_field() [1/2]

uint64_t GlobalOutput::overflow_field ( const std::string &  l1connName) const

Definition at line 84 of file GlobalOutput.cxx.

84  {
85  if (m_overflow.find(l1connName) != m_overflow.end()) {
86  return m_overflow.find(l1connName)->second;
87  }else{
88  TRG_MSG_WARNING("Connector name " << l1connName << " unknown");
89  return 0;
90  }
91 }

◆ overflow_field() [2/2]

uint32_t GlobalOutput::overflow_field ( const std::string &  l1connName,
unsigned int  clock 
) const

Definition at line 94 of file GlobalOutput.cxx.

94  {
95  if (m_overflow.find(l1connName) != m_overflow.end()) {
96  if(clock==0) {
97  // lower 32 bit
98  return static_cast<uint32_t>(m_overflow.find(l1connName)->second & 0xffffffff);
99  } else {
100  // upper 32 bit
101  uint64_t clock1 = m_overflow.find(l1connName)->second & 0xffffffff00000000;
102  return static_cast<uint32_t>(clock1 >> 32);
103  }
104  }else{
105  TRG_MSG_WARNING("Connector name " << l1connName << " unknown");
106  return 0;
107  }
108 }

◆ overflowed()

bool TCS::GlobalOutput::overflowed ( const std::string &  l1connName,
unsigned int  bit 
) const
inline

Definition at line 48 of file GlobalOutput.h.

48 { return ( ( (uint64_t)0x1 << bit) & m_overflow.find(l1connName)->second) != 0; }

◆ passed()

bool TCS::GlobalOutput::passed ( const std::string &  connName,
unsigned int  bit 
) const
inline

Definition at line 45 of file GlobalOutput.h.

45 { return ( ( (uint64_t)0x1 << bit) & m_decision.find(connName)->second) != 0; }

◆ print()

void TCS::GlobalOutput::print ( ) const

Definition at line 229 of file GlobalOutput.cxx.

229  {
230 
231  if(!isValid())
232  TRG_MSG_INFO("Note that the overall decision has not been calculated");
233 
234  for(auto const& dec : m_decision)
235  TRG_MSG_INFO("Overall decision from connector " << dec.first << ": 0x" << right << hex << setfill('0') << setw(16) << decision_field(dec.first) << std::dec << setfill(' '));
236 
237  if(isValid()) {
238  for(const TrigConf::TriggerLine & trigger : m_triggersDec){
239  unsigned int position = trigger.flatindex();
240  TRG_MSG_INFO(" " << setw(30) << left << trigger.name() << " " << (passed(trigger.connName(), position) ? "pass" : "fail") );}
241  } else {
242  for(const TrigConf::TriggerLine & trigger : m_triggersDec)
243  TRG_MSG_INFO(" " << setw(30) << left << trigger.name() << " unset" );
244  }
245 }

◆ resetOutput()

TCS::StatusCode GlobalOutput::resetOutput ( )

Definition at line 194 of file GlobalOutput.cxx.

194  {
195  m_decision.clear();
196  m_overflow.clear();
197  m_ambiguity.clear();
198  m_count.clear();
199 
200  m_valid = false;
202 }

◆ setDecisionTriggerLines()

void GlobalOutput::setDecisionTriggerLines ( const std::vector< TrigConf::TriggerLine > &  triggers)

Definition at line 19 of file GlobalOutput.cxx.

19  {
20 
22  vector<string> l1connNames = {};
23  for (const TrigConf::TriggerLine & trigger : triggers){
24  auto it = find(l1connNames.begin(), l1connNames.end(), trigger.connName());
25  if (it == l1connNames.end()){
26  l1connNames.push_back(trigger.connName());
27  m_decision[trigger.connName()] = 0;
28  }
29  }
30 }

◆ setMultiplicityTriggerLines()

void GlobalOutput::setMultiplicityTriggerLines ( const std::vector< TrigConf::TriggerLine > &  triggers)

Definition at line 33 of file GlobalOutput.cxx.

33  {
34 
36  vector<string> l1connNames = {};
37  for (const TrigConf::TriggerLine & trigger : triggers){
38  auto it = find(l1connNames.begin(), l1connNames.end(), trigger.connName());
39  if (it == l1connNames.end()){
40  l1connNames.push_back(trigger.connName());
41  m_count[trigger.connName()] = 0;
42  }
43  }
44 }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  o,
const TCS::GlobalOutput dec 
)
friend

Definition at line 208 of file GlobalOutput.cxx.

209  {
210 
211  if(!dec.isValid())
212  o << "Note that the overall decision has not been calculated" << endl;
213 
214  for(auto const& itdec : dec.m_decision)
215  o << "Overall decision for connector " << itdec.first << ": 0x" << right << hex << setfill('0') << setw(16) << dec.decision_field(itdec.first) << std::dec << setfill(' ') << endl;
216 
217  if(dec.isValid()) {
218  for(const TrigConf::TriggerLine & trigger : dec.m_triggersDec){
219  unsigned int position = trigger.flatindex();
220  o << " " << setw(30) << left << trigger.name() << " " << (dec.passed(trigger.connName(), position) ? "pass" : "fail") << endl;}
221  } else {
222  for(const TrigConf::TriggerLine & trigger : dec.m_triggersDec)
223  o << " " << setw(30) << left << trigger.name() << " unset" << endl;
224  }
225  return o;
226 }

Member Data Documentation

◆ m_ambiguity

std::map<std::string,uint64_t> TCS::GlobalOutput::m_ambiguity
private

Definition at line 76 of file GlobalOutput.h.

◆ m_count

std::map<std::string,std::bitset<128> > TCS::GlobalOutput::m_count
private

Definition at line 79 of file GlobalOutput.h.

◆ m_decision

std::map<std::string,uint64_t> TCS::GlobalOutput::m_decision
private

Definition at line 72 of file GlobalOutput.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStreamTC> TrigConf::TrigConfMessaging::m_msg_tls
mutableprivateinherited

MsgStreamTC instance (a std::cout like with print-out levels)

Definition at line 66 of file TrigConfMessaging.h.

◆ m_name

std::string TrigConf::TrigConfMessaging::m_name
privateinherited

Definition at line 67 of file TrigConfMessaging.h.

◆ m_overflow

std::map<std::string,uint64_t> TCS::GlobalOutput::m_overflow
private

Definition at line 74 of file GlobalOutput.h.

◆ m_triggersCount

std::vector<TrigConf::TriggerLine> TCS::GlobalOutput::m_triggersCount
private

Definition at line 86 of file GlobalOutput.h.

◆ m_triggersDec

std::vector<TrigConf::TriggerLine> TCS::GlobalOutput::m_triggersDec
private

Definition at line 85 of file GlobalOutput.h.

◆ m_valid

bool TCS::GlobalOutput::m_valid {false}
private

Definition at line 82 of file GlobalOutput.h.


The documentation for this class was generated from the following files:
TrigConf::TriggerLine::flatindex
unsigned int flatindex() const
Definition: L1Connector.h:28
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
checkCorrelInHIST.conn
conn
Definition: checkCorrelInHIST.py:25
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TrigConf::TrigConfMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStreamTC > m_msg_tls
MsgStreamTC instance (a std::cout like with print-out levels)
Definition: TrigConfMessaging.h:66
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TCS::GlobalOutput::m_decision
std::map< std::string, uint64_t > m_decision
Definition: GlobalOutput.h:72
TCS::GlobalOutput::resetOutput
StatusCode resetOutput()
Definition: GlobalOutput.cxx:194
TCS::GlobalOutput::m_overflow
std::map< std::string, uint64_t > m_overflow
Definition: GlobalOutput.h:74
TCS::Decision::ambiguity
bool ambiguity() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:46
TCS::Decision::overflow
bool overflow() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:45
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TCS::GlobalOutput::m_valid
bool m_valid
Definition: GlobalOutput.h:82
TCS::CountingConnector
Definition: CountingConnector.h:26
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
TCS::GlobalOutput::m_ambiguity
std::map< std::string, uint64_t > m_ambiguity
Definition: GlobalOutput.h:76
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TCS::GlobalOutput::m_triggersDec
std::vector< TrigConf::TriggerLine > m_triggersDec
Definition: GlobalOutput.h:85
TrigConf::TriggerLine
a TriggerLine entry describes the location of a threshold multiplicity on a cable (connector)
Definition: L1Connector.h:21
TrigConf::TrigConfMessaging::m_name
std::string m_name
Definition: TrigConfMessaging.h:67
TrigConf::TrigConfMessaging::msg
MsgStreamTC & msg() const
The standard message stream.
Definition: TrigConfMessaging.h:81
TrigConf::TriggerLine::connName
const std::string & connName() const
Definition: L1Connector.h:33
TrigConf::TrigConfMessaging::TrigConfMessaging
TrigConfMessaging()=delete
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
TCS::GlobalOutput::m_count
std::map< std::string, std::bitset< 128 > > m_count
Definition: GlobalOutput.h:79
TCS::Decision
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:19
TRG_MSG_INFO
#define TRG_MSG_INFO(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:27
TrigConf::TriggerLine::name
const std::string & name() const
Definition: L1Connector.h:26
TRG_MSG_WARNING
#define TRG_MSG_WARNING(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:28
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TCS::GlobalOutput::isValid
bool isValid() const
Definition: GlobalOutput.h:57
TCS::GlobalOutput::decision_field
uint64_t decision_field(const std::string &l1connName) const
Definition: GlobalOutput.cxx:47
TCS::Count
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:20
TCS::GlobalOutput::passed
bool passed(const std::string &connName, unsigned int bit) const
Definition: GlobalOutput.h:45
TCS::Decision::bit
bool bit(unsigned int index) const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:40
TCS::DecisionConnector
Definition: DecisionConnector.h:23
TCS::GlobalOutput::m_triggersCount
std::vector< TrigConf::TriggerLine > m_triggersCount
Definition: GlobalOutput.h:86