16 struct ios_state_guard {
18 std::ios::fmtflags flags;
20 std::streamsize width;
22 explicit ios_state_guard(std::ostream& o)
23 : os(o), flags(o.flags()), fill(o.fill()), width(o.width()) {}
37 vector<string> connNames = {};
39 auto it =
find(connNames.begin(), connNames.end(), trigger.connName());
40 if (it == connNames.end()){
41 connNames.push_back(trigger.connName());
52 return (uint32_t) (
m_decision.at(connName) & 0xffffffff);
55 uint64_t clock1 =
m_decision.at(connName) & 0xffffffff00000000;
56 return (uint32_t) (clock1 >> 32);
59 catch(std::exception &) {
69 return (uint32_t) (
m_overflow.find(connName)->second & 0xffffffff);
72 uint64_t clock1 =
m_overflow.find(connName)->second & 0xffffffff00000000;
73 return (uint32_t) (clock1 >> 32);
96 const Decision& dec = conn->decision();
100 unsigned int position = trigger.flatindex();
102 uint64_t & connectorDec =
m_decision[trigger.connName()];
103 uint64_t & connectorOvf =
m_overflow[trigger.connName()];
107 connectorDec |= (mask << position);
109 connectorOvf |= (mask << position);
134 ios_state_guard guard{o};
136 o <<
"Note that the overall decision has not been calculated" << endl;
139 o <<
"Overall decision for connector " << itdec.first <<
": 0x" << right << hex << setfill(
'0') << setw(16) << dec.
decision_field(itdec.first) << std::dec << setfill(
' ') << endl;
143 unsigned int position = trigger.
flatindex();
144 o <<
" " << setw(30) << left << trigger.
name() <<
" " << (dec.
passed(trigger.
connName(), position) ?
"pass" :
"fail") << endl;}
147 o <<
" " << setw(30) << left << trigger.
name() <<
" unset" << endl;
156 TRG_MSG_INFO(
"Note that the overall decision has not been calculated");
159 TRG_MSG_INFO(
"Overall decision from connector " << dec.first <<
": 0x" << right << hex << setfill(
'0') << setw(16) <<
decision_field(dec.first) << std::dec << setfill(
' '));
163 unsigned int position = trigger.flatindex();
164 TRG_MSG_INFO(
" " << setw(30) << left << trigger.name() <<
" " << (
passed(trigger.connName(), position) ?
"pass" :
"fail") );}
167 TRG_MSG_INFO(
" " << setw(30) << left << trigger.name() <<
" unset" );
bool bit(unsigned int index) const
uint64_t overflow_field(const std::string &connName) const
void setTriggerLines(const std::vector< TrigConf::TriggerLine > &triggers)
StatusCode resetDecision()
std::map< std::string, uint64_t > m_decision
std::vector< TrigConf::TriggerLine > m_triggers
bool passed(const std::string &connName, unsigned int bit) const
uint64_t decision_field(const std::string &connName) const
std::map< std::string, uint64_t > m_overflow
StatusCode collectDecision(const std::set< DecisionConnector * > &outconn)
GlobalDecision(const std::string &name="L1TopoGlobalDecision")
TrigConfMessaging(const std::string &name)
Constructor with parameters.
a TriggerLine entry describes the location of a threshold multiplicity on a cable (connector)
unsigned int flatindex() const
const std::string & connName() const
const std::string & name() const
std::string find(const std::string &s)
return a remapped string
std::ostream & operator<<(std::ostream &os, const TCS::Bin &bin)