ATLAS Offline Software
eFEXDriver.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
7 #include "L1CaloFEXSim/eFEXSim.h"
9 
10 #include "StoreGate/WriteHandle.h"
11 
12 
13 namespace LVL1 {
14 
15  eFEXDriver::eFEXDriver(const std::string& name, ISvcLocator* pSvcLocator)
16  : AthAlgorithm(name, pSvcLocator)//AthReentrantAlgorithm(name, pSvcLocator)
17  {
18 
19  }
20 
21 
23 {
24  ATH_MSG_DEBUG("Destroying " << name() << "...");
25 }
26 
27 
29 {
30  ATH_CHECK( m_eFEXSysSimTool.retrieve() );
31 
32  ATH_CHECK( m_eFEXOutputCollectionSGKey.initialize() );
33 
34  return StatusCode::SUCCESS;
35 }
36 
37 
39 {
40  ATH_MSG_DEBUG("Finalizing " << name() << "...");
41  return StatusCode::SUCCESS;
42 }
43 
44 
45  StatusCode eFEXDriver::execute(/*const EventContext& ctx*/) //const
46 {
47  // STEP 1 - Set up the eFEXSysSim
48  m_eFEXSysSimTool->init();
49 
50  // STEP 2 - Do some monitoring
51  eFEXOutputCollection* my_eFEXOutputCollection = new eFEXOutputCollection();
52  my_eFEXOutputCollection->setdooutput(true);
53 
54  // STEP 3 - Run THE eFEXSysSim
55  ATH_CHECK(m_eFEXSysSimTool->execute(my_eFEXOutputCollection));
56 
57  // STEP 4 - Close and clean the event
58  m_eFEXSysSimTool->cleanup();
59 
60  // STEP 5 - Write the completed eFEXOutputCollection into StoreGate (move the local copy in memory)
61  std::unique_ptr<eFEXOutputCollection> local_eFEXOutputCollection = std::unique_ptr<eFEXOutputCollection>(my_eFEXOutputCollection);
63  ATH_CHECK(eFEXOutputCollectionSG.record(std::move(local_eFEXOutputCollection)));
64 
65  return StatusCode::SUCCESS;
66 }
67 
68 
69 } // end of LVL1 namespace
LVL1::eFEXDriver::execute
virtual StatusCode execute()
Definition: eFEXDriver.cxx:45
eFEXOutputCollection.h
create ntuples output
eFEXSim.h
eFEXDriver.h
LVL1::eFEXDriver::~eFEXDriver
virtual ~eFEXDriver()
Definition: eFEXDriver.cxx:22
LVL1::eFEXDriver::eFEXDriver
eFEXDriver(const std::string &name, ISvcLocator *pSvcLocator)
Definition: eFEXDriver.cxx:15
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
WriteHandle.h
Handle class for recording to StoreGate.
LVL1::eFEXDriver::m_eFEXSysSimTool
ToolHandle< IeFEXSysSim > m_eFEXSysSimTool
Definition: eFEXDriver.h:31
LVL1::eFEXDriver::m_eFEXOutputCollectionSGKey
SG::WriteHandleKey< eFEXOutputCollection > m_eFEXOutputCollectionSGKey
Definition: eFEXDriver.h:29
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LVL1::eFEXOutputCollection::setdooutput
void setdooutput(bool)
setting to true if ntuple output is needed
Definition: eFEXOutputCollection.cxx:98
AthAlgorithm
Definition: AthAlgorithm.h:47
TrigConf::name
Definition: HLTChainList.h:35
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
LVL1::eFEXOutputCollection
Definition: eFEXOutputCollection.h:23
LVL1::eFEXDriver::initialize
virtual StatusCode initialize()
Definition: eFEXDriver.cxx:28
LVL1::eFEXDriver::finalize
StatusCode finalize()
Definition: eFEXDriver.cxx:38