ATLAS Offline Software
TrigMissingETCnvAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: TrigMissingETCnvAlg.cxx 592539 2014-04-11 10:17:29Z krasznaa $
6 
7 // Gaudi/Athena include(s):
9 
10 // EDM include(s):
14 
15 // Local include(s):
16 #include "TrigMissingETCnvAlg.h"
17 
18 namespace xAODMaker {
19 
21  ISvcLocator* svcLoc )
22  : AthAlgorithm( name, svcLoc ),
23  m_cnvTool( "xAODMaker::TrigMissingETCnvTool/TrigMissingETCnvTool", this ) {
24 
25  declareProperty( "AODKey", m_aodKey = "HLT_TrigEFMissingET" );
26  declareProperty( "xAODKey", m_xaodKey = "HLT_TrigEFMissingET" );
27  declareProperty( "CnvTool", m_cnvTool );
28  }
29 
31 
32  // Greet the user:
33  ATH_MSG_INFO( "Initializing" );
34  ATH_MSG_DEBUG( " AOD Key: " << m_aodKey );
35  ATH_MSG_DEBUG( "xAOD Key: " << m_xaodKey );
36 
37  // Retrieve the converter tool:
38  CHECK( m_cnvTool.retrieve() );
39 
40  // Return gracefully:
41  return StatusCode::SUCCESS;
42  }
43 
45 
46  // Check if the input is available:
47  if( ! evtStore()->contains< TrigMissingETContainer >( m_aodKey ) ) {
48  ATH_MSG_WARNING( "No TrigMissingETContainer with key \""
49  << m_aodKey << "\" available" );
50  return StatusCode::SUCCESS;
51  }
52 
53  // Retrieve the AOD container:
54  const TrigMissingETContainer* aod = nullptr;
55  CHECK( evtStore()->retrieve( aod, m_aodKey ) );
56 
57  // Create the xAOD container and its auxiliary store:
60  xaod->setStore( aux );
61 
62  // Fill the xAOD container:
63  CHECK( m_cnvTool->convert( aod, xaod ) );
64 
65  // Record the xAOD containers:
66  CHECK( evtStore()->record( aux, m_xaodKey + "Aux." ) );
67  CHECK( evtStore()->record( xaod, m_xaodKey ) );
68 
69  // Return gracefully:
70  return StatusCode::SUCCESS;
71  }
72 
73 } // namespace xAODMaker
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAODMaker::TrigMissingETCnvAlg::m_cnvTool
ToolHandle< ITrigMissingETCnvTool > m_cnvTool
Handle to the converter tool.
Definition: TrigMissingETCnvAlg.h:48
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::TrigMissingETContainer
TrigMissingETContainer_v1 TrigMissingETContainer
DataVector of TrigMissingET - the current version.
Definition: Event/xAOD/xAODTrigMissingET/xAODTrigMissingET/TrigMissingETContainer.h:13
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAODMaker::TrigMissingETCnvAlg::m_xaodKey
std::string m_xaodKey
StoreGate key for the output container.
Definition: TrigMissingETCnvAlg.h:45
TrigMissingETContainer
Definition: Trigger/TrigEvent/TrigMissingEtEvent/TrigMissingEtEvent/TrigMissingETContainer.h:12
xAODMaker::TrigMissingETCnvAlg::TrigMissingETCnvAlg
TrigMissingETCnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition: TrigMissingETCnvAlg.cxx:20
xAODMaker
Definition: StoreGateSvc.h:72
xAODMaker::TrigMissingETCnvAlg::initialize
virtual StatusCode initialize()
Function initialising the algorithm.
Definition: TrigMissingETCnvAlg.cxx:30
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TrigMissingETCnvAlg.h
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
TrigMissingETContainer.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
xAOD::TrigMissingETAuxContainer
TrigMissingETAuxContainer_v1 TrigMissingETAuxContainer
Define the most recent version of the AuxContainer for the TrigMissingET object(s).
Definition: TrigMissingETAuxContainer.h:12
xAODMaker::TrigMissingETCnvAlg::m_aodKey
std::string m_aodKey
StoreGate key of the input container.
Definition: TrigMissingETCnvAlg.h:43
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
errorcheck.h
Helpers for checking error return status codes and reporting errors.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TrigMissingETContainer.h
TrigMissingETAuxContainer.h
xAOD::TrigMissingETAuxContainer_v1
AuxContainer for TrigMissingET classes.
Definition: TrigMissingETAuxContainer_v1.h:32
xAODMaker::TrigMissingETCnvAlg::execute
virtual StatusCode execute()
Function executing the algorithm.
Definition: TrigMissingETCnvAlg.cxx:44