4#ifndef TRIGT1CTP_CTPSIMULATION_H
5#define TRIGT1CTP_CTPSIMULATION_H
10#include "GaudiKernel/ServiceHandle.h"
11#include "GaudiKernel/ToolHandle.h"
12#include "Gaudi/Property.h"
16#include "GaudiKernel/ITHistSvc.h"
49#include "GaudiKernel/LockedHandle.h"
70 CTPSimulation(
const std::string& name, ISvcLocator* pSvcLocator );
75 virtual StatusCode
start()
override;
77 virtual StatusCode
execute(
const EventContext& context )
const override;
79 virtual StatusCode
stop()
override;
88 StatusCode
hbook(
const std::string & path, std::unique_ptr<TH1> hist);
89 StatusCode
hbook(
const std::string & path, std::unique_ptr<TH2> hist);
91 LockedHandle<TH1> &
get1DHist(
const std::string & histName)
const;
92 LockedHandle<TH2> &
get2DHist(
const std::string & histName)
const;
98 StatusCode
extractMultiplicities(std::map<std::string, unsigned int> & thrMultiMap,
const EventContext& context)
const;
100 StatusCode
simulateItems(
const std::map<std::string, unsigned int> & thrMultiMap,
const EventContext& context)
const;
114 ToolHandle<LVL1CTP::ResultBuilder>
m_resultBuilder {
this,
"ResultBuilder",
"LVL1CTP::ResultBuilder/ResultBuilder",
"Builds the CTP result" };
158 Gaudi::Property<bool>
m_isData {
this,
"IsData",
false,
"emulate CTP as part of MC or rerun on data" };
159 Gaudi::Property<std::string>
m_histPath {
this,
"HistPath",
"/EXPERT/L1",
"Booking path for the histogram" };
160 Gaudi::Property<bool>
m_doZDC{
this,
"DoZDC",
false,
"emulate CTP with ZDC included"};
161 Gaudi::Property<bool>
m_doTRT{
this,
"DoTRT",
false,
"emulate CTP with TRT included"};
162 Gaudi::Property<bool>
m_forceBunchGroupPattern {
this,
"ForceBunchGroupPattern",
true,
"When true, ignore the bunchgroups and use the provided BunchGroupPattern" };
163 Gaudi::Property<unsigned int>
m_bunchGroupPattern {
this,
"BunchGroupPattern", 0x0003,
"Bunchgroup pattern applied at every event, useful for simulation. Bit x corresponds to bunchgroup x" };
165 Gaudi::Property<bool>
m_doL1CaloLegacy {
this,
"DoL1CaloLegacy",
false,
"Use L1Calo legacy" };
166 Gaudi::Property<bool>
m_doL1Topo {
this,
"DoL1Topo",
false,
"Use L1Topo" };
167 Gaudi::Property<bool>
m_doL1TopoLegacy {
this,
"DoL1TopoLegacy",
false,
"Use L1Topo Legacy" };
168 Gaudi::Property<bool>
m_muonRun2Format {
this,
"MuonMultiplicityRun2Format",
false,
"Interpret muon multiplicity in Run 2 format (bit 0 unused)" };
170 Gaudi::Property<bool>
m_useEDMxAOD {
this,
"UseEDMxAOD",
false,
"Use EDM based on xAOD class" };
defines an "iterator" over instances of a given type in StoreGateSvc
A wrapper class for event-slot-local random engines.
An algorithm that can be simultaneously executed in multiple threads.
unsigned int calculateJetMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
Gaudi::Property< std::string > m_histPath
SG::ReadHandleKey< xAOD::EnergySumRoI > m_iKeyGFexMETRho
SG::ReadHandleKey< xAOD::JetRoIContainer > m_iKeyJFexLJets
virtual StatusCode stop() override
StatusCode fillInputHistograms(const EventContext &context) const
Gaudi::Property< bool > m_forceBunchGroupPattern
unsigned int calculateTopoMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context, bool UseLegacy) const
Gaudi::Property< bool > m_doL1TopoLegacy
SG::ReadHandleKey< xAOD::JetRoIContainer > m_iKeyJFexJets
Gaudi::Property< bool > m_doL1Topo
unsigned int calculateTopoOptMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
unsigned int calculateTauMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
SG::ReadHandleKey< LVL1::FrontPanelCTP > m_iKeyTopo
SG::ReadHandleKey< LVL1::FrontPanelCTP > m_iKeyLegacyTopo
SG::ReadHandleKey< LVL1::EmTauCTP > m_iKeyCtpinEM
unsigned int calculateMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
SG::WriteHandleKey< xAOD::CTPResult > m_oKeyCTPResult
virtual StatusCode start() override
StatusCode setHistLabels(const TrigConf::L1Menu &l1menu)
LockedHandle< TH2 > & get2DHist(const std::string &histName) const
LockedHandle< TH1 > & get1DHist(const std::string &histName) const
StatusCode simulateItems(const std::map< std::string, unsigned int > &thrMultiMap, const EventContext &context) const
SG::ReadHandleKey< LVL1::EnergyCTP > m_iKeyCtpinXE
unsigned int calculateMETMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
unsigned int calculateEMMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
virtual StatusCode initialize() override
unsigned int calculateMuonMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
SG::WriteHandleKey< CTP_RDO > m_oKeyRDO
std::map< std::string, LockedHandle< TH2 > > m_hist2D
std::map< std::string, LockedHandle< TH1 > > m_hist1D
SG::ReadHandleKey< LVL1::TrtCTP > m_iKeyTRT
SG::ReadHandleKey< xAOD::EnergySumRoI > m_iKeyGFexMETNC
StatusCode setMultiplicityHistLabels(const TrigConf::L1Menu &l1menu, const std::string &type)
Gaudi::Property< bool > m_useEDMxAOD
SG::ReadHandleKey< xAOD::EmTauRoIContainer > m_iKeyEFexTau
virtual StatusCode execute(const EventContext &context) const override
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_bgKey
SG::ReadHandleKey< xAOD::TrigEMClusterContainer > m_iKeyEFexCluster
ATHRNG::RNGWrapper m_RNGEngines
Gaudi::Property< bool > m_muonRun2Format
ServiceHandle< ITHistSvc > m_histSvc
Gaudi::Property< unsigned int > m_bunchGroupPattern
SG::ReadHandleKey< xAOD::JetRoIContainer > m_iKeyGFexJets
Gaudi::Property< bool > m_doL1CaloLegacy
SG::ReadHandleKey< xAOD::EnergySumRoI > m_iKeyGFexMETJwoJ
SG::WriteHandleKey< CTPSLink > m_oKeySLink
StatusCode hbook(const std::string &path, std::unique_ptr< TH1 > hist)
std::string getBaseHistPath() const
StatusCode storeMetadata()
SG::ReadHandleKey< LVL1::MuCTPICTP > m_iKeyMuctpi
SG::ReadHandleKey< LVL1::ZdcCTP > m_iKeyZDC
Gaudi::Property< bool > m_doTRT
Gaudi::Property< bool > m_isData
SG::ReadHandleKey< LVL1::JetCTP > m_iKeyCtpinJet
ToolHandle< LVL1CTP::ResultBuilder > m_resultBuilder
CTPSimulation(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode createMultiplicityHist(const std::string &type, unsigned int maxMult=10)
StatusCode extractMultiplicities(std::map< std::string, unsigned int > &thrMultiMap, const EventContext &context) const
Gaudi::Property< bool > m_doZDC
A level 1 calorimeter trigger conversion service: returns the Coordinate represented by a RoI word.
A level 1 calorimeter trigger conversion service: returns the Coordinate represented by a RoI word.
static const std::string JetCTPLocation
static const std::string EnergyCTPLocation
static const std::string ZdcCTPLocation
static const std::string EmTauCTPLocation
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.
Standard L1 threshold configuration.
static const std::string DEFAULT_CTPSLinkLocation
default StoreGate location for CTPSLink
static const std::string DEFAULT_CTPResultOutputLocation
location of CTPResult output in StoreGate
static const std::string DEFAULT_RDOOutputLocation
location of CTP RDO output in StoreGate
static const std::string DEFAULT_MuonCTPLocation
default StoreGate location for MuCTPI to CTP input
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_TrtCTPLocation
default StoreGate location for TRT to CTP input
static const std::string DEFAULT_L1TopoLegacyCTPLocation
default StoreGate location for Front Panel legacy L1Topo to CTP inputs