ATLAS Offline Software
MUCTPI_AthTool.h
Go to the documentation of this file.
1 // This file is really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef TRIGT1MUCTPIPHASE1_MUCTPI_ATHTOOL_H
8 #define TRIGT1MUCTPIPHASE1_MUCTPI_ATHTOOL_H
9 
10 /*
11  Tool to perform simulation of PhaseI MUCTPI board
12 */
13 
14 #include "SimController.h"
15 #include "MUCTPIResults.h"
16 
22 
24 
26 #include "GaudiKernel/IIncidentListener.h"
27 #include "StoreGate/DataHandle.h"
28 #include "Gaudi/Property.h"
29 
30 #include <optional>
31 #include <functional>
32 
33 namespace LVL1 {
34  class TrigThresholdDecisionTool;
35 }
36 
37 namespace LVL1MUCTPIPHASE1 {
38 
39  class MUCTPI_AthTool : public AthAlgTool
40  {
41 
42  public:
43 
44  MUCTPI_AthTool(const std::string& type, const std::string& name,
45  const IInterface* parent);
46 
47  virtual ~MUCTPI_AthTool() override = default;
48 
49  virtual StatusCode initialize() override;
50  virtual StatusCode start() override;
51  StatusCode execute() const;
52 
53  private:
54 
58  StatusCode executeFromAOD() const;
60  StatusCode executeFromRDO() const;
62  StatusCode saveOutput(std::optional<std::reference_wrapper<MUCTPIResults>> results, int bcidOffset = 0) const;
63 
64 
65  static constexpr std::array<int,4> m_bcidOffsetList{-2,-1,1,2};
66 
67 
68  SG::ReadHandleKey<LVL1MUONIF::Lvl1MuCTPIInputPhase1> m_muctpiPhase1KeyRPC{this, "MuctpiPhase1LocationRPC", "L1MuctpiStoreRPC", "Location of muctpiPhase1 for Rpc"};
69  SG::ReadHandleKey<LVL1MUONIF::Lvl1MuCTPIInputPhase1> m_muctpiPhase1KeyTGC{this, "MuctpiPhase1LocationTGC", "L1MuctpiStoreTGC", "Location of muctpiPhase1 for Tgc"};
70  SG::WriteHandleKey<LVL1::MuCTPICTP> m_MuCTPICTPWriteKey{this, "MuCTPICTPLocation", LVL1MUCTPI::DEFAULT_MuonCTPLocation, "Location of MuCTPICTP"};
72  this, "MUCTPI_xAODLocation", {
73  "LVL1MuonRoIsBCm2", "LVL1MuonRoIsBCm1",
74  "LVL1MuonRoIs",
75  "LVL1MuonRoIsBCp1", "LVL1MuonRoIsBCp2"
76  },
77  "Output keys for xAOD::MuonRoIContainer, one per time slice"
78  };
80  this, "L1TopoOutputLocID", {
81  LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"-2", LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"-1",
82  LVL1MUCTPI::DEFAULT_MuonL1TopoLocation,
83  LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"1", LVL1MUCTPI::DEFAULT_MuonL1TopoLocation+"2"
84  },
85  "Output keys for MuCTPItoL1Topo, one per time slice"
86  };
87 
88 
89  // Locations of the inputs and outputs of the simulation in StoreGate:
90  static const std::string m_DEFAULT_locationMuCTPItoCTP;
91  static const std::string m_DEFAULT_locationMuCTPItoRoIB;
92  static const std::string m_DEFAULT_L1MuctpiStoreLocationRPC;
93  static const std::string m_DEFAULT_L1MuctpiStoreLocationTGC;
94  static const std::string m_DEFAULT_AODLocID;
95  static const std::string m_DEFAULT_RDOLocID;
96  static const std::string m_DEFAULT_barrelRoIFile;
97  static const std::string m_DEFAULT_ecfRoIFile;
98  static const std::string m_DEFAULT_side0LUTFile;
99  static const std::string m_DEFAULT_side1LUTFile;
100 
102  // Gaudy properties
104 
105  // Properties for the overlap treatment
106  Gaudi::Property<std::string> m_overlapStrategyName { this, "OverlapStrategyName", "LUT", "Overlap strategy for the MUCTPI. Options: \"LUT\" or \"NULL\" " };
107  Gaudi::Property<std::string> m_lutXMLFile { this, "LUTXMLFile", "TrigConfMuctpi/overlapRun3_20201214.xml", "xml file with the overlap handling for the MUCTPI. Default file for Run3: \"TrigConfMuctpi/overlapRun3_20201214.xml\" " };
108 
109  // Properties for the output generation for L1Topo
110  Gaudi::Property<std::string> m_barrelRoIFile { this, "BarrelRoIFile", m_DEFAULT_barrelRoIFile, "" };
111  Gaudi::Property<std::string> m_ecfRoIFile { this, "EndcapForwardRoIFile", m_DEFAULT_ecfRoIFile, "" };
112  Gaudi::Property<std::string> m_side0LUTFile { this, "Side0LUTFile", m_DEFAULT_side0LUTFile, "" };
113  Gaudi::Property<std::string> m_side1LUTFile { this, "Side1LUTFile", m_DEFAULT_side1LUTFile, "" };
114 
115  // Properties for the input selection
116  Gaudi::Property<std::string> m_inputSource { this, "InputSource", "DIGITIZATION", "" };
117  Gaudi::Property<std::string> m_aodLocId { this, "AODLocID", m_DEFAULT_AODLocID, "" };
118  Gaudi::Property<std::string> m_rdoLocId { this, "RDOLocID", m_DEFAULT_RDOLocID, "" };
119  Gaudi::Property<std::string> m_rdoOutputLocId { this, "RDOOutputLocID", m_DEFAULT_RDOLocID, "" };
120  Gaudi::Property<std::string> m_roiOutputLocId { this, "RoIOutputLocID", m_DEFAULT_locationMuCTPItoRoIB, "" };
121  Gaudi::Property<std::string> m_ctpOutputLocId { this, "CTPOutputLocID", m_DEFAULT_locationMuCTPItoCTP, "" };
122 
123  // These are just here for flexibility, normally they should not be changed:
124  Gaudi::Property<std::string> m_tgcLocId { this, "TGCLocID", m_DEFAULT_L1MuctpiStoreLocationTGC, "" };
125  Gaudi::Property<std::string> m_rpcLocId { this, "RPCLocID", m_DEFAULT_L1MuctpiStoreLocationRPC, "" };
126 
127  ServiceHandle<StoreGateSvc> m_detStore { this, "DetectorStore", "StoreGateSvc/DetectorStore", "Detector store to get the menu" };
128 
130  ToolHandle<LVL1::ITrigT1MuonRecRoiTool> m_rpcTool{this, "RPCRecRoiTool", "LVL1::TrigT1RPCRecRoiTool/LVL1__TrigT1RPCRecRoiTool", "Tool to get the eta/phi coordinates in the RPC"};
131  ToolHandle<LVL1::ITrigT1MuonRecRoiTool> m_tgcTool{this, "TGCRecRoiTool", "LVL1::TrigT1TGCRecRoiTool/LVL1__TrigT1TGCRecRoiTool", "Tool to get the eta/phi coordinates in the TGC"};
132  ToolHandle<LVL1::TrigThresholdDecisionTool> m_trigThresholdDecisionTool{this, "TrigThresholdDecisionTool", "LVL1::TrigThresholdDecisionTool/LVL1__TrigThresholdDecisionTool", "Tool to get pass/fail of each trigger threshold"};
133 
136 
137  };
138 }
139 
140 #endif // TRIGT1MUCTPIPHASE1_MUCTPI_ATHTOOL_H
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_barrelRoIFile
Gaudi::Property< std::string > m_barrelRoIFile
Definition: MUCTPI_AthTool.h:110
LVL1MUCTPIPHASE1::MUCTPI_AthTool::executeFromRDO
StatusCode executeFromRDO() const
Event loop method for running on an RDO file.
Definition: MUCTPI_AthTool.cxx:346
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_DEFAULT_AODLocID
static const std::string m_DEFAULT_AODLocID
Definition: MUCTPI_AthTool.h:94
LVL1MUCTPIPHASE1::MUCTPI_AthTool::initialize
virtual StatusCode initialize() override
Definition: MUCTPI_AthTool.cxx:63
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_side1LUTFile
Gaudi::Property< std::string > m_side1LUTFile
Definition: MUCTPI_AthTool.h:113
LVL1MUCTPIPHASE1::MUCTPI_AthTool::~MUCTPI_AthTool
virtual ~MUCTPI_AthTool() override=default
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_DEFAULT_barrelRoIFile
static const std::string m_DEFAULT_barrelRoIFile
Definition: MUCTPI_AthTool.h:96
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_roiOutputLocId
Gaudi::Property< std::string > m_roiOutputLocId
Definition: MUCTPI_AthTool.h:120
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_DEFAULT_side0LUTFile
static const std::string m_DEFAULT_side0LUTFile
Definition: MUCTPI_AthTool.h:98
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_executeFunction
StatusCode(LVL1MUCTPIPHASE1::MUCTPI_AthTool::* m_executeFunction)(void) const
Function pointer to the execute function we want to use:
Definition: MUCTPI_AthTool.h:135
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_ecfRoIFile
Gaudi::Property< std::string > m_ecfRoIFile
Definition: MUCTPI_AthTool.h:111
MuonRoIContainer.h
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_DEFAULT_L1MuctpiStoreLocationTGC
static const std::string m_DEFAULT_L1MuctpiStoreLocationTGC
Definition: MUCTPI_AthTool.h:93
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_side0LUTFile
Gaudi::Property< std::string > m_side0LUTFile
Definition: MUCTPI_AthTool.h:112
LVL1MUCTPIPHASE1::MUCTPI_AthTool::execute
StatusCode execute() const
Definition: MUCTPI_AthTool.cxx:195
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_ctpOutputLocId
Gaudi::Property< std::string > m_ctpOutputLocId
Definition: MUCTPI_AthTool.h:121
SG::ReadHandleKey< LVL1MUONIF::Lvl1MuCTPIInputPhase1 >
MuCTPICTP.h
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_aodLocId
Gaudi::Property< std::string > m_aodLocId
Definition: MUCTPI_AthTool.h:117
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
DataHandle.h
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_rpcLocId
Gaudi::Property< std::string > m_rpcLocId
Definition: MUCTPI_AthTool.h:125
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_muctpiPhase1KeyTGC
SG::ReadHandleKey< LVL1MUONIF::Lvl1MuCTPIInputPhase1 > m_muctpiPhase1KeyTGC
Definition: MUCTPI_AthTool.h:69
TrigT1StoreGateKeys.h
Lvl1MuCTPIInputPhase1.h
LVL1MUCTPIPHASE1::MUCTPI_AthTool::saveOutput
StatusCode saveOutput(std::optional< std::reference_wrapper< MUCTPIResults >> results, int bcidOffset=0) const
Save the outputs of the simulation into StoreGate.
Definition: MUCTPI_AthTool.cxx:377
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_DEFAULT_locationMuCTPItoRoIB
static const std::string m_DEFAULT_locationMuCTPItoRoIB
Definition: MUCTPI_AthTool.h:91
SG::WriteHandleKey< LVL1::MuCTPICTP >
LVL1MUCTPIPHASE1
Definition: Configuration.h:11
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LVL1MUCTPIPHASE1::MUCTPI_AthTool::start
virtual StatusCode start() override
Definition: MUCTPI_AthTool.cxx:167
AthAlgTool.h
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_trigThresholdDecisionTool
ToolHandle< LVL1::TrigThresholdDecisionTool > m_trigThresholdDecisionTool
Definition: MUCTPI_AthTool.h:132
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_bcidOffsetList
static constexpr std::array< int, 4 > m_bcidOffsetList
Definition: MUCTPI_AthTool.h:65
test_pyathena.parent
parent
Definition: test_pyathena.py:15
LVL1MUCTPIPHASE1::MUCTPI_AthTool::executeFromAOD
StatusCode executeFromAOD() const
Event loop method for running on an AOD file.
Definition: MUCTPI_AthTool.cxx:303
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_rdoOutputLocId
Gaudi::Property< std::string > m_rdoOutputLocId
Definition: MUCTPI_AthTool.h:119
ITrigT1MuonRecRoiTool.h
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_DEFAULT_side1LUTFile
static const std::string m_DEFAULT_side1LUTFile
Definition: MUCTPI_AthTool.h:99
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_detStore
ServiceHandle< StoreGateSvc > m_detStore
Definition: MUCTPI_AthTool.h:127
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_tgcTool
ToolHandle< LVL1::ITrigT1MuonRecRoiTool > m_tgcTool
Definition: MUCTPI_AthTool.h:131
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_DEFAULT_L1MuctpiStoreLocationRPC
static const std::string m_DEFAULT_L1MuctpiStoreLocationRPC
Definition: MUCTPI_AthTool.h:92
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_inputSource
Gaudi::Property< std::string > m_inputSource
Definition: MUCTPI_AthTool.h:116
LVL1MUCTPIPHASE1::MUCTPI_AthTool
Definition: MUCTPI_AthTool.h:40
LVL1MUCTPIPHASE1::MUCTPI_AthTool::MUCTPI_AthTool
MUCTPI_AthTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MUCTPI_AthTool.cxx:52
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_lutXMLFile
Gaudi::Property< std::string > m_lutXMLFile
Definition: MUCTPI_AthTool.h:107
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_MuCTPI_xAODWriteKeys
SG::WriteHandleKeyArray< xAOD::MuonRoIContainer > m_MuCTPI_xAODWriteKeys
Definition: MUCTPI_AthTool.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
python.ami.results
def results
Definition: ami.py:386
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_overlapStrategyName
Gaudi::Property< std::string > m_overlapStrategyName
Definition: MUCTPI_AthTool.h:106
MUCTPIResults.h
LVL1MUCTPIPHASE1::MUCTPI_AthTool::executeFromDigi
StatusCode executeFromDigi() const
Event loop method for running as part of digitization.
Definition: MUCTPI_AthTool.cxx:212
MuCTPIL1Topo.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_tgcLocId
Gaudi::Property< std::string > m_tgcLocId
Definition: MUCTPI_AthTool.h:124
LVL1MUCTPIPHASE1::SimController
Definition: SimController.h:29
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_rpcTool
ToolHandle< LVL1::ITrigT1MuonRecRoiTool > m_rpcTool
Definition: MUCTPI_AthTool.h:130
AthAlgTool
Definition: AthAlgTool.h:26
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_theMuctpi
SimController m_theMuctpi
Definition: MUCTPI_AthTool.h:129
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_DEFAULT_RDOLocID
static const std::string m_DEFAULT_RDOLocID
Definition: MUCTPI_AthTool.h:95
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_DEFAULT_locationMuCTPItoCTP
static const std::string m_DEFAULT_locationMuCTPItoCTP
Definition: MUCTPI_AthTool.h:90
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_rdoLocId
Gaudi::Property< std::string > m_rdoLocId
Definition: MUCTPI_AthTool.h:118
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_MuCTPIL1TopoKeys
SG::WriteHandleKeyArray< LVL1::MuCTPIL1Topo > m_MuCTPIL1TopoKeys
Definition: MUCTPI_AthTool.h:79
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_DEFAULT_ecfRoIFile
static const std::string m_DEFAULT_ecfRoIFile
Definition: MUCTPI_AthTool.h:97
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_muctpiPhase1KeyRPC
SG::ReadHandleKey< LVL1MUONIF::Lvl1MuCTPIInputPhase1 > m_muctpiPhase1KeyRPC
Definition: MUCTPI_AthTool.h:68
SimController.h
ServiceHandle< StoreGateSvc >
LVL1MUCTPIPHASE1::MUCTPI_AthTool::m_MuCTPICTPWriteKey
SG::WriteHandleKey< LVL1::MuCTPICTP > m_MuCTPICTPWriteKey
Definition: MUCTPI_AthTool.h:70