ATLAS Offline Software
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 
22 namespace TCS {
23  class GlobalDecision;
24 }
25 
26 
27 namespace TCS {
28 
29  std::ostream& operator<<(std::ostream&, const TCS::GlobalDecision &);
30 
31  class Decision;
32  class DecisionConnector;
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
TCS::GlobalDecision::print
void print() const
Definition: GlobalDecision.cxx:135
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
TCS::GlobalDecision::collectDecision
StatusCode collectDecision(const std::set< DecisionConnector * > &outconn)
Definition: GlobalDecision.cxx:73
TCS::GlobalDecision::decision_field
uint64_t decision_field(const std::string &connName) const
Definition: GlobalDecision.h:38
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD::JetAlgorithmType::algName
const std::string & algName(ID id)
Converts a JetAlgorithmType::ID into a string.
Definition: JetContainerInfo.cxx:67
TCS::GlobalDecision::passed
bool passed(const std::string &connName, unsigned int bit) const
Definition: GlobalDecision.h:42
TCS::GlobalDecision::resetDecision
StatusCode resetDecision()
Definition: GlobalDecision.cxx:101
TCS::GlobalDecision::decision
const Decision & decision(const std::string &algName) const
TCS::GlobalDecision::m_triggers
std::vector< TrigConf::TriggerLine > m_triggers
Definition: GlobalDecision.h:70
python.TrigTLAMonitorAlgorithm.triggers
triggers
Definition: TrigTLAMonitorAlgorithm.py:196
TCS::GlobalDecision::isValid
bool isValid() const
Definition: GlobalDecision.h:49
StatusCode.h
TCS::GlobalDecision::setTriggerLines
void setTriggerLines(const std::vector< TrigConf::TriggerLine > &triggers)
Definition: GlobalDecision.cxx:16
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
L1Connector.h
TCS::Decision
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:19
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TrigCompositeUtils::Decision
xAOD::TrigComposite Decision
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:20
TCS::GlobalDecision::operator<<
friend std::ostream & operator<<(std::ostream &, const TCS::GlobalDecision &)
Definition: GlobalDecision.cxx:115
TCS::GlobalDecision::m_valid
bool m_valid
Definition: GlobalDecision.h:67
TrigConf::TrigConfMessaging
Class to provide easy access to TrigConf::MsgStream for TrigConf classes.
Definition: TrigConfMessaging.h:28
TCS::GlobalDecision::overflowed
bool overflowed(const std::string &connName, unsigned int bit) const
Definition: GlobalDecision.h:45
TCS::GlobalDecision::m_overflow
std::map< std::string, uint64_t > m_overflow
Definition: GlobalDecision.h:64
L1TopoConfigOutputList.h
TCS::GlobalDecision::overflow_field
uint64_t overflow_field(const std::string &connName) const
Definition: GlobalDecision.h:43
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TrigConfMessaging.h
Messaging base class for TrigConf code shared with Lvl1 ( AthMessaging)
TCS::GlobalDecision::GlobalDecision
GlobalDecision(const std::string &name="L1TopoGlobalDecision")
Definition: GlobalDecision.cxx:60
TCS::operator<<
std::ostream & operator<<(std::ostream &, const TCS::CountingConnector &)
Definition: CountingConnector.cxx:93
TCS::GlobalDecision
Definition: GlobalDecision.h:34
TCS::GlobalDecision::m_decision
std::map< std::string, uint64_t > m_decision
Definition: GlobalDecision.h:62
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15