ATLAS Offline Software
Loading...
Searching...
No Matches
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
28namespace TXC {
29 class L1TopoMenu;
30}
31
32class IL1TopoHistSvc;
33
34namespace TCS {
35
36 class InputConnector;
37 class SortingConnector;
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
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
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
Messaging base class for TrigConf code shared with Lvl1 ( AthMessaging)
Define macros for attributes used to control the static checker.
const std::vector< TCS::Connector * > & connectors() const
StatusCode executeSortingAlgorithm(SortingAlg *alg, TCS::InputConnector *inputConnector, TOBArray *&output)
StatusCode saveHist()
const TopoCoreSimResult & simulationResult() const
void setOutputAlgosFillBasedOnHardware(const bool &value)
tell output algos to fill accept/reject histos based on hdw decision.
void printConfiguration(std::ostream &o) const
const std::vector< TCS::Connector * > & connectors() const
std::bitset< numberOfL1TopoBits > m_ovrflowHdwBits
TopoInputEvent m_inputEvent
StatusCode executeEvent()
StatusCode reset()
std::bitset< numberOfL1TopoBits > m_triggerHdwBits
StatusCode executeSortingConnector(TCS::SortingConnector *conn)
void setMsgLevel(TrigConf::MSGTC::Level lvl)
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...
std::shared_ptr< IL1TopoHistSvc > m_histSvc
TopoSteeringStructure m_structure
void setOutputAlgosSkipHistograms(const bool &value)
skip filling the histos
StatusCode executeDecisionConnector(TCS::DecisionConnector *conn)
StatusCode executeAlgorithm(ConfigurableAlg *alg, Connector *connector)
const TopoSteeringStructure & structure() const
const TCS::ParameterSpace & parameters(const std::string &algName) const
TopoInputEvent & inputEvent()
unsigned int m_evtCounter
StatusCode executeInputConnector(TCS::InputConnector *conn)
void propagateHardwareBitsToAlgos()
propagate the bits from hardware to each simulated decision algo.
StatusCode setupFromConfiguration ATLAS_NOT_THREAD_SAFE(const TrigConf::L1Menu &l1menu)
void setLegacyMode(bool isLegacyTopo)
void setUseBitwise(bool useBitwise)
StatusCode executeTrigger(const std::string &triggerName)
StatusCode setHistSvc(std::shared_ptr< IL1TopoHistSvc > histSvc)
enables the histogramming service
StatusCode executeConnector(TCS::Connector *conn)
static const unsigned int numberOfL1TopoBits
StatusCode executeCountingConnector(TCS::CountingConnector *conn)
TopoCoreSimResult m_simulationResult
StatusCode executeCountingAlgorithm(TCS::CountingAlg *alg, TCS::InputConnector *inputConnector, Count &count)
TrigConf::MSGTC::Level m_AlgMsgLvl
StatusCode executeDecisionAlgorithm(TCS::DecisionAlg *alg, const std::vector< Connector * > &inputConnectors, const std::vector< TCS::TOBArray * > &output, Decision &decsion)
StatusCode initializeAlgorithms()
void setAlgMsgLevel(TrigConf::MSGTC::Level lvl)
L1 menu configuration.
Definition L1Menu.h:28
Class to provide easy access to TrigConf::MsgStream for TrigConf classes.
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146