ATLAS Offline Software
Loading...
Searching...
No Matches
L1TopoSimulation.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#ifndef L1Topo_L1TopoSimulation
6#define L1Topo_L1TopoSimulation
7
11
12#include "PeriodicScaler.h"
15#include "TrigConfData/L1Menu.h"
17
20
24
25#include "GaudiKernel/ServiceHandle.h"
26#include "GaudiKernel/ToolHandle.h"
27#include "GaudiKernel/ITHistSvc.h"
28
29#include "TH1F.h"
30#include <memory>
31
32namespace LVL1 {
33
35 public:
36 L1TopoSimulation(const std::string &name, ISvcLocator *pSvcLocator);
37
38 virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override;
39 virtual StatusCode start() override;
40 virtual StatusCode execute() override;
41 virtual StatusCode finalize() override;
42
43 // make algorithm is clonable
44 virtual bool isClonable() const override;
45
46
47 private:
55 StatusCode retrieveHardwareDecision(bool isLegacy, const EventContext& ctx);
56
57 StatusCode hardwareDecisionPhase1(const EventContext& ctx);
58 StatusCode hardwareDecisionLegacy();
59
60 void WriteEDM(SG::WriteHandle<xAOD::L1TopoSimResultsContainer> &handle, const std::string &name, unsigned int clock, uint32_t word);
61 void WriteEDM_Overflow(SG::WriteHandle<xAOD::L1TopoSimResultsContainer> &handle, const std::string &name, unsigned int clock, uint32_t word);
62 void WriteEDM(SG::WriteHandle<xAOD::L1TopoSimResultsContainer> &handle, const std::string &name, unsigned int clock, uint64_t word);
63 void WriteEDM_Overflow(SG::WriteHandle<xAOD::L1TopoSimResultsContainer> &handle, const std::string &name, unsigned int clock, uint64_t word);
64
65 std::unique_ptr<TCS::TopoSteering> m_topoSteering;
66 std::unique_ptr<LVL1::PeriodicScaler> m_scaler {nullptr};
67
68 // Services and input tools
69 ServiceHandle<ITHistSvc> m_histSvc { this, "HistSvc", "THistSvc/THistSvc", "Histogramming service for L1Topo algorithms" };
70
71 ToolHandle<IInputTOBConverter> m_emtauInputProvider { this, "EMTAUInputProvider", "LVL1::EMTauInputProvider/EMTauInputProvider", "Tool to fill the EMTAU TOBs of the topo input event" };
72 ToolHandle<IInputTOBConverter> m_jetInputProvider { this, "JetInputProvider", "LVL1::JetInputProvider/JetInputProvider", "Tool to fill the Jet TOBs of the topo input event" };
73 ToolHandle<IInputTOBConverter> m_energyInputProvider { this, "EnergyInputProvider", "LVL1::EnergyInputProvider/EnergyInputProvider", "Tool to fill the energy and MET TOBs of the topo input event"};
74 ToolHandle<IInputTOBConverter> m_muonInputProvider { this, "MuonInputProvider", "LVL1::MuonInputProvider/MuonInputProvider", "Tool to fill the muon TOBs of the topo input event" };
75
76 ToolHandle<IControlHistSvc> m_ControlHistSvc { this, "ControlHistSvc", "LVL1::ControlHistSvc/ControlHistSvc", "Tool to change the histogramming service when needed." };
77
78
79 // outputs
80 SG::WriteHandleKey<LVL1::FrontPanelCTP> m_topoCTPLocation { this, "TopoCTPLocation", LVL1::DEFAULT_L1TopoCTPLocation, "StoreGate key of topo decision output for CTP"};
81 SG::WriteHandleKey<LVL1::FrontPanelCTP> m_topoOverflowCTPLocation { this, "TopoOverflowCTPLocation", LVL1::DEFAULT_L1TopoOverflowCTPLocation, "StoreGate key of topo overflow output for CTP"};
82
83 SG::WriteHandleKey<LVL1::FrontPanelCTP> m_legacyTopoCTPLocation { this, "LegacyTopoCTPLocation", LVL1::DEFAULT_L1TopoLegacyCTPLocation, "StoreGate key of topo decision output for CTP"};
84 SG::WriteHandleKey<LVL1::FrontPanelCTP> m_legacyTopoOverflowCTPLocation { this, "LegacyTopoOverflowCTPLocation", LVL1::DEFAULT_L1TopoLegacyOverflowCTPLocation, "StoreGate key of topo overflow output for CTP"};
85
86 // Writing L1Topo EDMs
87 SG::WriteHandleKey< xAOD::L1TopoSimResultsContainer > m_legacyL1topoKey {this,"Key_LegacyL1TopoSimContainer","L1_LegacyTopoSimResults","Output legacy l1topo container"};
88 SG::WriteHandleKey< xAOD::L1TopoSimResultsContainer > m_l1topoKey {this,"Key_L1TopoSimContainer","L1_TopoSimResults","Output l1topo container"};
89
90 SG::ReadHandleKey<xAOD::L1TopoRawDataContainer> m_l1topoRawDataKey {this, "L1_TopoRawDataKey", "L1_Phase1L1TopoRAWData", "l1topo Raw Data"};
91
92
93 Gaudi::Property<bool> m_doMonitoring { this, "doMonitoring", false, "Do Monitoring of L1Topo Algorithms" };
94 Gaudi::Property<bool> m_isLegacyTopo { this, "IsLegacyTopo", false, "Simulation of Legacy L1Topo boards" };
95 Gaudi::Property<bool> m_enableInputDump { this, "EnableInputDump", false, "Enable writing of input data for standalone running" };
96 Gaudi::Property<bool> m_enableBitwise { this, "UseBitwise", true, "Boolean to enable the bitwise version of software algorithms"};
97 Gaudi::Property<std::string> m_inputDumpFile { this, "InputDumpFile", "inputdump.txt", "File name for dumping input data" };
98 Gaudi::Property<int> m_topoOutputLevel { this, "TopoOutputLevel", TrigConf::MSGTC::WARNING, "OutputLevel for L1Topo algorithms"};
99 Gaudi::Property<int> m_topoSteeringOutputLevel { this, "TopoSteeringOutputLevel", TrigConf::MSGTC::WARNING, "OutputLevel for L1Topo steering"};
100
101 // Properties for hardware monitoring
102 Gaudi::Property<bool> m_fillHistogramsBasedOnHardwareDecision { this, "FillHistoBasedOnHardware", false, "Fill accept/reject histograms based on hdw; default based on sim" };
103 Gaudi::Property<unsigned int> m_prescaleForDAQROBAccess { this, "PrescaleDAQROBAccess", 4, "Prescale factor for requests for DAQ ROBs: can be used to avoid overloading ROS. Zero means disabled, 1 means always, N means sample only 1 in N events"};
104 Gaudi::Property<unsigned int> m_prescale { this, "Prescale", 1, "Internal prescale factor for this algorithm, implemented with a periodic scaler: so 1 means run every time, N means run every 1 in N times it is called; the other times it will exit without doing anything"};
105 Gaudi::Property<std::string> m_histBaseDir { this, "MonHistBaseDir", "L1/L1TopoAlgorithms", "Base directory for monitoring histograms will be /EXPERT/<MonHistBaseDir>"};
106 };
107
108}
109#endif
Property holding a SG store/key/clid from which a ReadHandle is made.
MsgStream for TrigConf classes.
Define macros for attributes used to control the static checker.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ToolHandle< IControlHistSvc > m_ControlHistSvc
Gaudi::Property< unsigned int > m_prescale
virtual StatusCode start() override
StatusCode hardwareDecisionPhase1(const EventContext &ctx)
Gaudi::Property< bool > m_enableInputDump
SG::WriteHandleKey< xAOD::L1TopoSimResultsContainer > m_l1topoKey
SG::WriteHandleKey< LVL1::FrontPanelCTP > m_legacyTopoOverflowCTPLocation
SG key of overflow bits for CTP.
StatusCode retrieveHardwareDecision(bool isLegacy, const EventContext &ctx)
Retrieve the L1Topo hardware bits from the DAQ RODs.
std::unique_ptr< TCS::TopoSteering > m_topoSteering
the topo steering
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE() override
ToolHandle< IInputTOBConverter > m_energyInputProvider
SG::WriteHandleKey< xAOD::L1TopoSimResultsContainer > m_legacyL1topoKey
Gaudi::Property< bool > m_isLegacyTopo
Gaudi::Property< int > m_topoOutputLevel
SG::ReadHandleKey< xAOD::L1TopoRawDataContainer > m_l1topoRawDataKey
ServiceHandle< ITHistSvc > m_histSvc
prescale decision tool
virtual StatusCode finalize() override
Gaudi::Property< int > m_topoSteeringOutputLevel
void WriteEDM(SG::WriteHandle< xAOD::L1TopoSimResultsContainer > &handle, const std::string &name, unsigned int clock, uint32_t word)
Gaudi::Property< bool > m_enableBitwise
SG::WriteHandleKey< LVL1::FrontPanelCTP > m_topoOverflowCTPLocation
SG key of overflow bits for CTP.
virtual StatusCode execute() override
Gaudi::Property< unsigned int > m_prescaleForDAQROBAccess
void WriteEDM_Overflow(SG::WriteHandle< xAOD::L1TopoSimResultsContainer > &handle, const std::string &name, unsigned int clock, uint32_t word)
Gaudi::Property< bool > m_doMonitoring
L1TopoSimulation(const std::string &name, ISvcLocator *pSvcLocator)
virtual bool isClonable() const override
SG::WriteHandleKey< LVL1::FrontPanelCTP > m_topoCTPLocation
SG key of decision bits for CTP.
ToolHandle< IInputTOBConverter > m_muonInputProvider
Gaudi::Property< std::string > m_inputDumpFile
ToolHandle< IInputTOBConverter > m_emtauInputProvider
Gaudi::Property< bool > m_fillHistogramsBasedOnHardwareDecision
SG::WriteHandleKey< LVL1::FrontPanelCTP > m_legacyTopoCTPLocation
SG key of decision bits for CTP.
Gaudi::Property< std::string > m_histBaseDir
std::unique_ptr< LVL1::PeriodicScaler > m_scaler
ToolHandle< IInputTOBConverter > m_jetInputProvider
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
static const std::string DEFAULT_L1TopoCTPLocation
XXX default StoreGate location for Front Panel CTP inputs.
static const std::string DEFAULT_L1TopoOverflowCTPLocation
default StoreGate location for Front Panel CTP inputs of l1topo overflow bits
static const std::string DEFAULT_L1TopoLegacyCTPLocation
default StoreGate location for Front Panel legacy L1Topo to CTP inputs
static const std::string DEFAULT_L1TopoLegacyOverflowCTPLocation
default StoreGate location for CTP inputs of legacy l1topo overflow bits
void initialize()