ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalOutput.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6#ifndef L1TopoCoreSim_GlobalOutput
7#define L1TopoCoreSim_GlobalOutput
8
10
13
15
16#include <iostream>
17#include <vector>
18#include <set>
19#include <string>
20#include <bitset>
21#include <stdint.h>
22
23namespace TCS {
24 class GlobalOutput;
25}
26
27
28namespace TCS {
29
30 std::ostream& operator<<(std::ostream&, const TCS::GlobalOutput &);
31
32 class Decision;
34 class Count;
36
38 public:
39 GlobalOutput(const std::string & name = "L1TopoGlobalOutput");
40
41 uint64_t decision_field(const std::string & l1connName) const;
42
43 uint32_t decision_field(const std::string& l1connName, unsigned int clock) const;
44
45 bool passed(const std::string& connName, unsigned int bit) const { return ( ( (uint64_t)0x1 << bit) & m_decision.find(connName)->second) != 0; }
46 uint64_t overflow_field(const std::string& l1connName) const;
47 uint32_t overflow_field(const std::string& l1connName, unsigned int clock) const;
48 bool overflowed(const std::string& l1connName, unsigned int bit) const { return ( ( (uint64_t)0x1 << bit) & m_overflow.find(l1connName)->second) != 0; }
49
50 uint64_t ambiguity_field(const std::string& l1connName) const;
51 uint32_t ambiguity_field(const std::string& l1connName, unsigned int clock) const;
52
53 std::bitset<128> count_field(const std::string& l1connName) const;
54
55 const Decision & decision(const std::string & algName) const;
56
57 bool isValid() const { return m_valid; }
58
59 void setDecisionTriggerLines(const std::vector<TrigConf::TriggerLine> & triggers);
60
61 void setMultiplicityTriggerLines(const std::vector<TrigConf::TriggerLine> & triggers);
62
63 StatusCode collectOutput(const std::set<DecisionConnector*> & outConn, const std::set<CountingConnector*> & countConn);
64
66 void print() const;
67
68 private:
69 friend std::ostream& operator<<(std::ostream&, const TCS::GlobalOutput &);
70
71 // 64 bit decision bit field - map L1Connector name-decision field
72 std::map<std::string,uint64_t> m_decision;
73 // 64 bit overflow bit field - map L1Connector name-overflow field
74 std::map<std::string,uint64_t> m_overflow;
75 // 64 bit ambiguity bit field - map L1Connector name-ambiguity field
76 std::map<std::string,uint64_t> m_ambiguity;
77
78 // 128 bit multiplicity bit field - map L1Connector name-multiplicity field
79 std::map<std::string,std::bitset<128>> m_count;
80 // flags if the decision field is up to date
81 // set by @collectDecision(), unset by @reset()
82 bool m_valid {false};
83
84 // trigger lines
85 std::vector<TrigConf::TriggerLine> m_triggersDec;
86 std::vector<TrigConf::TriggerLine> m_triggersCount;
87 };
88
89}
90
91#endif
Messaging base class for TrigConf code shared with Lvl1 ( AthMessaging)
StatusCode resetOutput()
std::map< std::string, uint64_t > m_overflow
bool isValid() const
const Decision & decision(const std::string &algName) const
friend std::ostream & operator<<(std::ostream &, const TCS::GlobalOutput &)
bool overflowed(const std::string &l1connName, unsigned int bit) const
std::map< std::string, std::bitset< 128 > > m_count
std::bitset< 128 > count_field(const std::string &l1connName) const
void setMultiplicityTriggerLines(const std::vector< TrigConf::TriggerLine > &triggers)
uint64_t decision_field(const std::string &l1connName) const
uint64_t ambiguity_field(const std::string &l1connName) const
void setDecisionTriggerLines(const std::vector< TrigConf::TriggerLine > &triggers)
GlobalOutput(const std::string &name="L1TopoGlobalOutput")
StatusCode collectOutput(const std::set< DecisionConnector * > &outConn, const std::set< CountingConnector * > &countConn)
std::map< std::string, uint64_t > m_decision
uint64_t overflow_field(const std::string &l1connName) const
std::map< std::string, uint64_t > m_ambiguity
std::vector< TrigConf::TriggerLine > m_triggersDec
std::vector< TrigConf::TriggerLine > m_triggersCount
bool passed(const std::string &connName, unsigned int bit) const
Class to provide easy access to TrigConf::MsgStream for TrigConf classes.
std::ostream & operator<<(std::ostream &os, const TCS::Bin &bin)