ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalDecision.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6#ifndef L1TopoCoreSim_GlobalDecision
7#define L1TopoCoreSim_GlobalDecision
8
10
13
15
16#include <iostream>
17#include <set>
18#include <string>
19#include <vector>
20#include <stdint.h>
21
22namespace TCS {
23 class GlobalDecision;
24}
25
26
27namespace TCS {
28
29 std::ostream& operator<<(std::ostream&, const TCS::GlobalDecision &);
30
31 class Decision;
33
35 public:
36 GlobalDecision(const std::string & name = "L1TopoGlobalDecision");
37
38 uint64_t decision_field(const std::string & connName) const { return m_decision.find(connName)->second; }
39
40 uint32_t decision_field(const std::string& connName, unsigned int clock) const;
41
42 bool passed(const std::string& connName, unsigned int bit) const { return ( ( (uint64_t)0x1 << bit) & m_decision.find(connName)->second) != 0; }
43 uint64_t overflow_field(const std::string& connName) const { return m_overflow.find(connName)->second; }
44 uint32_t overflow_field(const std::string& connName, unsigned int clock) const;
45 bool overflowed(const std::string& connName, unsigned int bit) const { return ( ( (uint64_t)0x1 << bit) & m_overflow.find(connName)->second) != 0; }
46
47 const Decision & decision(const std::string & algName) const;
48
49 bool isValid() const { return m_valid; }
50
51 void setTriggerLines(const std::vector<TrigConf::TriggerLine> & triggers);
52
53 StatusCode collectDecision(const std::set<DecisionConnector*> & outconn);
54
56 void print() const;
57
58 private:
59 friend std::ostream& operator<<(std::ostream&, const TCS::GlobalDecision &);
60
61 // 64 bit decision bit field - map connector name-decision field
62 std::map<std::string,uint64_t> m_decision;
63 // 64 bit overflow bit field - map connector name-overflow field
64 std::map<std::string,uint64_t> m_overflow;
65 // flags if the decision field is up to date
66 // set by @collectDecision(), unset by @resetDecision()
67 bool m_valid {false};
68
69 // trigger lines
70 std::vector<TrigConf::TriggerLine> m_triggers;
71 };
72
73}
74
75#endif
Messaging base class for TrigConf code shared with Lvl1 ( AthMessaging)
uint64_t overflow_field(const std::string &connName) const
void setTriggerLines(const std::vector< TrigConf::TriggerLine > &triggers)
std::map< std::string, uint64_t > m_decision
std::vector< TrigConf::TriggerLine > m_triggers
const Decision & decision(const std::string &algName) const
bool overflowed(const std::string &connName, unsigned int bit) const
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")
friend std::ostream & operator<<(std::ostream &, const TCS::GlobalDecision &)
Class to provide easy access to TrigConf::MsgStream for TrigConf classes.
std::ostream & operator<<(std::ostream &os, const TCS::Bin &bin)