ATLAS Offline Software
TopoSteering.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 #ifndef L1TopoCoreSim_TopoSteering
6 #define L1TopoCoreSim_TopoSteering
7 
8 
9 
11 
13 
19 
20 // Menu related dependencies
21 #include "TrigConfData/L1Menu.h"
22 #include <bitset>
23 #include <iosfwd>
24 #include <memory>
25 #include <vector>
26 #include <string>
27 
28 namespace TXC {
29  class L1TopoMenu;
30 }
31 
32 class IL1TopoHistSvc;
33 
34 namespace TCS {
35 
36  class InputConnector;
37  class SortingConnector;
38  class DecisionConnector;
39  class CountingConnector;
40  class ConfigurableAlg;
41  class SortingAlg;
42  class Decision;
43  class DecisionAlg;
44  class Count;
45  class CountingAlg;
46 
48  public:
49 
50  // default constructor
51  TopoSteering();
52 
53  const TopoSteeringStructure & structure() const { return m_structure; }
54 
56 
58 
59 
60  // @brief: build the execution structure and parameterspace from
61  // the configuration
62  StatusCode setupFromConfiguration ATLAS_NOT_THREAD_SAFE (const TrigConf::L1Menu& l1menu);
63 
64  void setUseBitwise(bool useBitwise) { m_useBitwise = useBitwise; }
65 
66  // @brief: call the initialize function of the algorithms
67  // will be called after the parameters are set and before the event loop starts
69 
70 
71  // run the topo simulation
73 
74  StatusCode executeTrigger(const std::string & triggerName);
75 
76  // resets the inputEvent, connectors (status, intermediate TOBs,
77  // and decision of algs), and the simulation result
78  StatusCode reset();
79 
80  void printDebugInfo();
81 
82  const TCS::ParameterSpace & parameters(const std::string & algName) const;
83 
84  const std::vector<TCS::Connector*> & connectors() const { return structure().connectors(); } //added
85 
86  void printConfiguration(std::ostream & o) const;
87 
89 
91 
92  void setLegacyMode(bool isLegacyTopo) {m_isLegacyTopo=isLegacyTopo;}
93 
97  StatusCode setHistSvc(std::shared_ptr<IL1TopoHistSvc> histSvc);
98 
100 
101  static const unsigned int numberOfL1TopoBits = 128;
106  void setHardwareBits(const std::bitset<numberOfL1TopoBits> &triggerBits,
107  const std::bitset<numberOfL1TopoBits> &ovrflowBits);
119  void setOutputAlgosFillBasedOnHardware(const bool &value);
127  void setOutputAlgosSkipHistograms(const bool &value);
128  private:
129 
130  // execution
132 
134 
136 
138 
140 
142 
144 
145  StatusCode executeDecisionAlgorithm(TCS::DecisionAlg *alg, const std::vector<Connector*> & inputConnectors, const std::vector<TCS::TOBArray *> & output, Decision & decsion);
146 
148 
149 
150 
151  private:
152  bool m_useBitwise{false}; // Using bitwise algorithms? Disabled by default. Needs a menu global flag.
153 
154  bool m_isLegacyTopo{false};
155 
156  TopoInputEvent m_inputEvent; // the input event
157 
158  TopoCoreSimResult m_simulationResult; // the result of the execution
159 
161 
162  unsigned int m_evtCounter {1};
163 
165 
166  std::shared_ptr<IL1TopoHistSvc> m_histSvc;
167 
168  std::bitset<numberOfL1TopoBits> m_triggerHdwBits;
169  std::bitset<numberOfL1TopoBits> m_ovrflowHdwBits;
170  };
171 
172 
173 }
174 
175 #endif
ParameterSpace.h
TCS::TopoSteering::setHardwareBits
void setHardwareBits(const std::bitset< numberOfL1TopoBits > &triggerBits, const std::bitset< numberOfL1TopoBits > &ovrflowBits)
cache the decision/overflow bits from hardware These bits are propagated to the algorithms with propa...
Definition: TopoSteering.cxx:491
TCS::TopoSteeringStructure::connectors
const std::vector< TCS::Connector * > & connectors() const
Definition: TopoSteeringStructure.h:44
TCS::TopoSteering::m_ovrflowHdwBits
std::bitset< numberOfL1TopoBits > m_ovrflowHdwBits
Definition: TopoSteering.h:169
TCS::TopoSteering::executeDecisionAlgorithm
StatusCode executeDecisionAlgorithm(TCS::DecisionAlg *alg, const std::vector< Connector * > &inputConnectors, const std::vector< TCS::TOBArray * > &output, Decision &decsion)
Definition: TopoSteering.cxx:387
checkCorrelInHIST.conn
conn
Definition: checkCorrelInHIST.py:25
TCS::TopoSteering::saveHist
StatusCode saveHist()
Definition: TopoSteering.cxx:122
SGout2dot.alg
alg
Definition: SGout2dot.py:243
IL1TopoHistSvc
Definition: IL1TopoHistSvc.h:12
TCS::Connector
Definition: Connector.h:22
TCS::TopoSteering::setOutputAlgosFillBasedOnHardware
void setOutputAlgosFillBasedOnHardware(const bool &value)
tell output algos to fill accept/reject histos based on hdw decision.
Definition: TopoSteering.cxx:518
xAOD::JetAlgorithmType::algName
const std::string & algName(ID id)
Converts a JetAlgorithmType::ID into a string.
Definition: JetContainerInfo.cxx:67
TCS::TopoSteering::executeInputConnector
StatusCode executeInputConnector(TCS::InputConnector *conn)
Definition: TopoSteering.cxx:224
TCS::TopoSteering::structure
const TopoSteeringStructure & structure() const
Definition: TopoSteering.h:53
TCS::TopoSteering::m_inputEvent
TopoInputEvent m_inputEvent
Definition: TopoSteering.h:156
TCS::TopoSteering::executeSortingConnector
StatusCode executeSortingConnector(TCS::SortingConnector *conn)
Definition: TopoSteering.cxx:247
TCS::TopoSteering::propagateHardwareBitsToAlgos
void propagateHardwareBitsToAlgos()
propagate the bits from hardware to each simulated decision algo.
Definition: TopoSteering.cxx:498
athena.value
value
Definition: athena.py:124
TCS::CountingConnector
Definition: CountingConnector.h:26
TCS::SortingConnector
Definition: SortingConnector.h:24
TCS::TopoSteering::printConfiguration
void printConfiguration(std::ostream &o) const
Definition: TopoSteering.cxx:457
DecisionAlg
Call through interface to FilteredAlgorithm.
Definition: Control/AthenaServices/src/DecisionAlg.h:17
TrigConf::L1Menu
L1 menu configuration.
Definition: L1Menu.h:28
TCS::TopoSteering::m_triggerHdwBits
std::bitset< numberOfL1TopoBits > m_triggerHdwBits
Definition: TopoSteering.h:168
TCS::TopoSteering::setUseBitwise
void setUseBitwise(bool useBitwise)
Definition: TopoSteering.h:64
TCS::TopoSteering::setLegacyMode
void setLegacyMode(bool isLegacyTopo)
Definition: TopoSteering.h:92
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
TCS::TopoSteering::setAlgMsgLevel
void setAlgMsgLevel(TrigConf::MSGTC::Level lvl)
Definition: TopoSteering.cxx:480
TCS::TopoSteering::inputEvent
TopoInputEvent & inputEvent()
Definition: TopoSteering.h:55
TCS::DecisionAlg
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:22
TCS::TopoSteering::setMsgLevel
void setMsgLevel(TrigConf::MSGTC::Level lvl)
Definition: TopoSteering.cxx:468
TCS::ParameterSpace
Definition: ParameterSpace.h:18
TopoSteeringStructure.h
TCS::TopoSteering::m_AlgMsgLvl
TrigConf::MSGTC::Level m_AlgMsgLvl
Definition: TopoSteering.h:164
TCS::TopoSteering::m_isLegacyTopo
bool m_isLegacyTopo
Definition: TopoSteering.h:154
TopoInputEvent.h
TCS::TopoSteering::printDebugInfo
void printDebugInfo()
Definition: TopoSteering.cxx:443
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
TCS::TopoSteering::executeCountingAlgorithm
StatusCode executeCountingAlgorithm(TCS::CountingAlg *alg, TCS::InputConnector *inputConnector, Count &count)
Definition: TopoSteering.cxx:428
TCS::InputConnector
Definition: InputConnector.h:22
TCS::TopoSteering::parameters
const TCS::ParameterSpace & parameters(const std::string &algName) const
TCS::TopoSteering::m_histSvc
std::shared_ptr< IL1TopoHistSvc > m_histSvc
Definition: TopoSteering.h:166
StatusCode.h
TCS::TopoSteering::executeConnector
StatusCode executeConnector(TCS::Connector *conn)
Definition: TopoSteering.cxx:190
TCS::TopoInputEvent
Definition: TopoInputEvent.h:42
TCS::TopoSteering::executeCountingConnector
StatusCode executeCountingConnector(TCS::CountingConnector *conn)
Definition: TopoSteering.cxx:337
TCS::TopoSteering::executeEvent
StatusCode executeEvent()
Definition: TopoSteering.cxx:133
MuonSegmentReaderConfig.histSvc
histSvc
Definition: MuonSegmentReaderConfig.py:96
TCS::TopoSteering::executeSortingAlgorithm
StatusCode executeSortingAlgorithm(SortingAlg *alg, TCS::InputConnector *inputConnector, TOBArray *&output)
Definition: TopoSteering.cxx:369
TCS::TopoSteering::simulationResult
const TopoCoreSimResult & simulationResult() const
Definition: TopoSteering.h:57
TCS::TopoSteering::initializeAlgorithms
StatusCode initializeAlgorithms()
Definition: TopoSteering.cxx:90
TCS::TopoCoreSimResult
Definition: TopoCoreSimResult.h:36
TCS::TOBArray
Definition: TOBArray.h:24
TCS::Decision
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:19
TCS::TopoSteering::reset
StatusCode reset()
Definition: TopoSteering.cxx:55
TCS::TopoSteering::m_useBitwise
bool m_useBitwise
Definition: TopoSteering.h:152
merge.output
output
Definition: merge.py:17
TXC
Definition: IL1TopoMenuLoader.h:10
TCS::TopoSteering
Definition: TopoSteering.h:47
TCS::ConfigurableAlg
Definition: ConfigurableAlg.h:30
TrigCompositeUtils::Decision
xAOD::TrigComposite Decision
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:20
TCS::TopoSteering::m_simulationResult
TopoCoreSimResult m_simulationResult
Definition: TopoSteering.h:158
TrigConf::TrigConfMessaging
Class to provide easy access to TrigConf::MsgStream for TrigConf classes.
Definition: TrigConfMessaging.h:28
TCS::SortingAlg
Definition: SortingAlg.h:18
TCS::Count
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Count.h:20
TCS::TopoSteering::m_structure
TopoSteeringStructure m_structure
Definition: TopoSteering.h:160
TCS::TopoSteering::numberOfL1TopoBits
static const unsigned int numberOfL1TopoBits
Definition: TopoSteering.h:101
TCS::TopoSteering::ATLAS_NOT_THREAD_SAFE
StatusCode setupFromConfiguration ATLAS_NOT_THREAD_SAFE(const TrigConf::L1Menu &l1menu)
TCS::TopoSteeringStructure
Definition: TopoSteeringStructure.h:32
TopoCoreSimResult.h
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::TopoSteering::executeDecisionConnector
StatusCode executeDecisionConnector(TCS::DecisionConnector *conn)
Definition: TopoSteering.cxx:279
python.XMLReader.l1menu
l1menu
Definition: XMLReader.py:73
TrigConfMessaging.h
Messaging base class for TrigConf code shared with Lvl1 ( AthMessaging)
TCS::TopoSteering::TopoSteering
TopoSteering()
Definition: TopoSteering.cxx:38
TCS::TopoSteering::connectors
const std::vector< TCS::Connector * > & connectors() const
Definition: TopoSteering.h:84
TCS::TopoSteering::executeAlgorithm
StatusCode executeAlgorithm(ConfigurableAlg *alg, Connector *connector)
L1Menu.h
TCS::TopoSteering::executeTrigger
StatusCode executeTrigger(const std::string &triggerName)
Definition: TopoSteering.cxx:171
checker_macros.h
Define macros for attributes used to control the static checker.
TCS::TopoSteering::setOutputAlgosSkipHistograms
void setOutputAlgosSkipHistograms(const bool &value)
skip filling the histos
Definition: TopoSteering.cxx:529
TCS::TopoSteering::setHistSvc
StatusCode setHistSvc(std::shared_ptr< IL1TopoHistSvc > histSvc)
enables the histogramming service
Definition: TopoSteering.cxx:114
TCS::DecisionConnector
Definition: DecisionConnector.h:23
TCS::CountingAlg
Definition: CountingAlg.h:25
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::TopoSteering::m_evtCounter
unsigned int m_evtCounter
Definition: TopoSteering.h:162
TrigConf::MSGTC::WARNING
@ WARNING
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:26