ATLAS Offline Software
TauJetCnvAlg.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // TauJetCnvAlg.cxx
8 // Implementation file for class TauJetCnvAlg
9 // Author: Michel Janus janus@cern.ch
11 
12 
13 // xAODTauJetCnv includes
14 #include "TauJetCnvAlg.h"
15 
16 // Old tau Includes:
18 
19 //New tau
22 
23 // STL includes
24 
25 // FrameWork includes
26 #include "Gaudi/Property.h"
28 
29 
31 // Public methods:
33 
34 namespace xAODMaker {
35 // Constructors
37 TauJetCnvAlg::TauJetCnvAlg( const std::string& name,
38  ISvcLocator* pSvcLocator ) :
39  ::AthAlgorithm( name, pSvcLocator )
40  , m_inputTauJetContainerName("TauRecContainer")
41  , m_xaodTauJetContainerName("TauRecContainer")
42 {
43  //
44  // Property declaration
45  //
46  declareProperty( "InputTauJetContainer", m_inputTauJetContainerName );
47  declareProperty( "xAODTauJetContainer", m_xaodTauJetContainerName );
48  declareProperty("CnvTool", m_cnvTool, "The converter tool for TauJets");
49 }
50 
51 // Destructor
54 {}
55 
56 // Athena Algorithm's Hooks
59 {
60  ATH_MSG_INFO ("Initializing " << name() << "...");
61 
63 
64  CHECK(m_cnvTool.retrieve());
65 
66  return StatusCode::SUCCESS;
67 }
68 
70 {
71  ATH_MSG_INFO ("Finalizing " << name() << "...");
72 
73 
74  return StatusCode::SUCCESS;
75 }
76 
78 {
79  ATH_MSG_DEBUG ("Executing " << name() << "...");
80  ATH_MSG_DEBUG( "Converting " << m_inputTauJetContainerName << " into "<< m_xaodTauJetContainerName );
81 
83  if (!inputTaus) {
84  ATH_MSG_WARNING("No TauJetContainer with key " << m_inputTauJetContainerName << " found. Do nothing.");
85  return StatusCode::SUCCESS;
86  }
87 
88  // Create the xAOD container and its auxiliary store:
89  xAOD::TauJetContainer* xaodTauJets = new xAOD::TauJetContainer();
90  CHECK( evtStore()->record( xaodTauJets, m_xaodTauJetContainerName ) );
92  CHECK( evtStore()->record( auxTauJets, m_xaodTauJetContainerName + "Aux." ) );
93  xaodTauJets->setStore( auxTauJets );
94  ATH_MSG_DEBUG( "Recorded xAOD tau jets with key: "
96 
97  CHECK( m_cnvTool->convert(inputTaus, xaodTauJets) );
98 
99 
100  return StatusCode::SUCCESS;
101 }
102 
103 }
104 
105 
106 // LocalWords: tempfloat
xAODMaker::TauJetCnvAlg::m_inputTauJetContainerName
std::string m_inputTauJetContainerName
Containers.
Definition: TauJetCnvAlg.h:58
xAOD::TauJetAuxContainer_v3
Temporary container used until we have I/O for AuxStoreInternal.
Definition: TauJetAuxContainer_v3.h:39
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAODMaker::TauJetCnvAlg::finalize
virtual StatusCode finalize()
Definition: TauJetCnvAlg.cxx:69
xAOD::TauJetAuxContainer
TauJetAuxContainer_v3 TauJetAuxContainer
Definition of the current taujet auxiliary container.
Definition: TauJetAuxContainer.h:22
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAODMaker::TauJetCnvAlg::execute
virtual StatusCode execute()
Definition: TauJetCnvAlg.cxx:77
Analysis::TauJetContainer
Definition: Reconstruction/tauEvent/tauEvent/TauJetContainer.h:31
xAODMaker
Definition: StoreGateSvc.h:72
TauJetAuxContainer.h
xAODMaker::TauJetCnvAlg::TauJetCnvAlg
TauJetCnvAlg()
Default constructor:
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
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
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TauJetContainer.h
TauJetContainer.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
AthAlgorithm
Definition: AthAlgorithm.h:47
xAODMaker::TauJetCnvAlg::~TauJetCnvAlg
virtual ~TauJetCnvAlg()
Destructor:
Definition: TauJetCnvAlg.cxx:53
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
xAOD::TauJetContainer
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
Definition: Event/xAOD/xAODTau/xAODTau/TauJetContainer.h:17
errorcheck.h
Helpers for checking error return status codes and reporting errors.
xAODMaker::TauJetCnvAlg::initialize
virtual StatusCode initialize()
Definition: TauJetCnvAlg.cxx:58
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAODMaker::TauJetCnvAlg::m_xaodTauJetContainerName
std::string m_xaodTauJetContainerName
Definition: TauJetCnvAlg.h:59
TauJetCnvAlg.h
xAODMaker::TauJetCnvAlg::m_cnvTool
ToolHandle< ITauJetCnvTool > m_cnvTool
Tool to perform taujet container conversion.
Definition: TauJetCnvAlg.h:62