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

#include <GlobalDecision.h>

Inheritance diagram for TCS::GlobalDecision:
Collaboration diagram for TCS::GlobalDecision:

Public Member Functions

 GlobalDecision (const std::string &name="L1TopoGlobalDecision")
 
uint64_t decision_field (const std::string &connName) const
 
uint32_t decision_field (const std::string &connName, unsigned int clock) const
 
bool passed (const std::string &connName, unsigned int bit) const
 
uint64_t overflow_field (const std::string &connName) const
 
uint32_t overflow_field (const std::string &connName, unsigned int clock) const
 
bool overflowed (const std::string &connName, unsigned int bit) const
 
const Decisiondecision (const std::string &algName) const
 
bool isValid () const
 
void setTriggerLines (const std::vector< TrigConf::TriggerLine > &triggers)
 
StatusCode collectDecision (const std::set< DecisionConnector * > &outconn)
 
StatusCode resetDecision ()
 
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
 
bool m_valid {false}
 
std::vector< TrigConf::TriggerLinem_triggers
 
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::GlobalDecision &)
 

Detailed Description

Definition at line 34 of file GlobalDecision.h.

Constructor & Destructor Documentation

◆ GlobalDecision()

GlobalDecision::GlobalDecision ( const std::string &  name = "L1TopoGlobalDecision")

Definition at line 60 of file GlobalDecision.cxx.

60  :
62 {}

Member Function Documentation

◆ collectDecision()

TCS::StatusCode GlobalDecision::collectDecision ( const std::set< DecisionConnector * > &  outconn)

Definition at line 73 of file GlobalDecision.cxx.

73  {
74  resetDecision();
75 
76  for( const DecisionConnector * conn : outconn ) {
77 
78  const Decision& dec = conn->decision();
79 
80  unsigned int pos = 0; // for multi-output algorithms pos is the output index
81  for(const TrigConf::TriggerLine & trigger : conn->triggers() ) {
82  unsigned int position = trigger.flatindex();
83 
84  uint64_t & connectorDec = m_decision[trigger.connName()];
85  uint64_t & connectorOvf = m_overflow[trigger.connName()];
86  uint64_t mask(0x1);
87 
88  if( dec.bit(pos++) ) // bit set?
89  connectorDec |= (mask << position);
90  if( dec.overflow())
91  connectorOvf |= (mask << position);
92  }
93 
94  }
95  m_valid = true;
97 }

◆ decision()

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

◆ decision_field() [1/2]

uint64_t TCS::GlobalDecision::decision_field ( const std::string &  connName) const
inline

Definition at line 38 of file GlobalDecision.h.

38 { return m_decision.find(connName)->second; }

◆ decision_field() [2/2]

uint32_t GlobalDecision::decision_field ( const std::string &  connName,
unsigned int  clock 
) const

Definition at line 30 of file GlobalDecision.cxx.

30  {
31  try {
32  if(clock==0) {
33  // lower 32 bit
34  return (uint32_t) (m_decision.at(connName) & 0xffffffff);
35  } else {
36  // upper 32 bit
37  uint64_t clock1 = m_decision.at(connName) & 0xffffffff00000000;
38  return (uint32_t) (clock1 >> 32);
39  }
40  }
41  catch(std::exception &) {
42  TRG_MSG_ERROR("Connector name " << connName << " unknown");
43  throw;
44  }
45 }

◆ isValid()

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

Definition at line 49 of file GlobalDecision.h.

49 { 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 TCS::GlobalDecision::overflow_field ( const std::string &  connName) const
inline

Definition at line 43 of file GlobalDecision.h.

43 { return m_overflow.find(connName)->second; }

◆ overflow_field() [2/2]

uint32_t GlobalDecision::overflow_field ( const std::string &  connName,
unsigned int  clock 
) const

Definition at line 48 of file GlobalDecision.cxx.

48  {
49  if(clock==0) {
50  // lower 32 bit
51  return (uint32_t) (m_overflow.find(connName)->second & 0xffffffff);
52  } else {
53  // upper 32 bit
54  uint64_t clock1 = m_overflow.find(connName)->second & 0xffffffff00000000;
55  return (uint32_t) (clock1 >> 32);
56  }
57 }

◆ overflowed()

bool TCS::GlobalDecision::overflowed ( const std::string &  connName,
unsigned int  bit 
) const
inline

Definition at line 45 of file GlobalDecision.h.

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

◆ passed()

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

Definition at line 42 of file GlobalDecision.h.

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

◆ print()

void TCS::GlobalDecision::print ( ) const

Definition at line 135 of file GlobalDecision.cxx.

135  {
136 
137  if(!isValid())
138  TRG_MSG_INFO("Note that the overall decision has not been calculated");
139 
140  for(auto const& dec : m_decision)
141  TRG_MSG_INFO("Overall decision from connector " << dec.first << ": 0x" << right << hex << setfill('0') << setw(16) << decision_field(dec.first) << std::dec << setfill(' '));
142 
143  if(isValid()) {
144  for(const TrigConf::TriggerLine & trigger : m_triggers){
145  unsigned int position = trigger.flatindex();
146  TRG_MSG_INFO(" " << setw(30) << left << trigger.name() << " " << (passed(trigger.connName(), position) ? "pass" : "fail") );}
147  } else {
148  for(const TrigConf::TriggerLine & trigger : m_triggers)
149  TRG_MSG_INFO(" " << setw(30) << left << trigger.name() << " unset" );
150  }
151 }

◆ resetDecision()

TCS::StatusCode GlobalDecision::resetDecision ( )

Definition at line 101 of file GlobalDecision.cxx.

101  {
102  for(auto const& dec : m_decision)
103  m_decision[dec.first] = 0;
104  for(auto const& ovf : m_overflow)
105  m_overflow[ovf.first] = 0;
106  m_valid = false;
108 }

◆ setTriggerLines()

void GlobalDecision::setTriggerLines ( const std::vector< TrigConf::TriggerLine > &  triggers)

Definition at line 16 of file GlobalDecision.cxx.

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

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 114 of file GlobalDecision.cxx.

115  {
116 
117  if(!dec.isValid())
118  o << "Note that the overall decision has not been calculated" << endl;
119 
120  for(auto const& itdec : dec.m_decision)
121  o << "Overall decision for connector " << itdec.first << ": 0x" << right << hex << setfill('0') << setw(16) << dec.decision_field(itdec.first) << std::dec << setfill(' ') << endl;
122 
123  if(dec.isValid()) {
124  for(const TrigConf::TriggerLine & trigger : dec.m_triggers){
125  unsigned int position = trigger.flatindex();
126  o << " " << setw(30) << left << trigger.name() << " " << (dec.passed(trigger.connName(), position) ? "pass" : "fail") << endl;}
127  } else {
128  for(const TrigConf::TriggerLine & trigger : dec.m_triggers)
129  o << " " << setw(30) << left << trigger.name() << " unset" << endl;
130  }
131  return o;
132 }

Member Data Documentation

◆ m_decision

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

Definition at line 62 of file GlobalDecision.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::GlobalDecision::m_overflow
private

Definition at line 64 of file GlobalDecision.h.

◆ m_triggers

std::vector<TrigConf::TriggerLine> TCS::GlobalDecision::m_triggers
private

Definition at line 70 of file GlobalDecision.h.

◆ m_valid

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

Definition at line 67 of file GlobalDecision.h.


The documentation for this class was generated from the following files:
TrigConf::TriggerLine::flatindex
unsigned int flatindex() const
Definition: L1Connector.h:28
TRG_MSG_ERROR
#define TRG_MSG_ERROR(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:29
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
TCS::GlobalDecision::decision_field
uint64_t decision_field(const std::string &connName) const
Definition: GlobalDecision.h:38
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::GlobalDecision::passed
bool passed(const std::string &connName, unsigned int bit) const
Definition: GlobalDecision.h:42
TCS::Decision::overflow
bool overflow() const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:45
TCS::GlobalDecision::resetDecision
StatusCode resetDecision()
Definition: GlobalDecision.cxx:101
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TCS::GlobalDecision::m_triggers
std::vector< TrigConf::TriggerLine > m_triggers
Definition: GlobalDecision.h:70
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TrigConf::TriggerLine
a TriggerLine entry describes the location of a threshold multiplicity on a cable (connector)
Definition: L1Connector.h:21
TCS::GlobalDecision::isValid
bool isValid() const
Definition: GlobalDecision.h:49
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
calibdata.exception
exception
Definition: calibdata.py:496
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TCS::GlobalDecision::m_valid
bool m_valid
Definition: GlobalDecision.h:67
TCS::GlobalDecision::m_overflow
std::map< std::string, uint64_t > m_overflow
Definition: GlobalDecision.h:64
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TCS::Decision::bit
bool bit(unsigned int index) const
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:40
TCS::DecisionConnector
Definition: DecisionConnector.h:23
TCS::GlobalDecision::m_decision
std::map< std::string, uint64_t > m_decision
Definition: GlobalDecision.h:62