ATLAS Offline Software
Loading...
Searching...
No Matches
JetCnvAlg.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5*/
6
7// JetCnvAlg.cxx
8// Implementation file for class JetCnvAlg
9// Author: S.Binet<binet@cern.ch>
11
13
16
17// #include "xAOD"
18// #include "Particle/TrackParticleContainer.h"
19
20// xAODJetCnv includes
21#include "JetCnvAlg.h"
22
23// STL includes
24
25// FrameWork includes
26#include "Gaudi/Property.h"
28
29
31// Public methods:
33
34namespace xAODMaker {
35// Constructors
37JetCnvAlg::JetCnvAlg( const std::string& name,
38 ISvcLocator* pSvcLocator ) :
39 ::AthAlgorithm( name, pSvcLocator )
40 , m_inputJetCollectionName("AntiKt4LCTopoJets")
43 , m_cnvTool("xAODMaker::JetCnvTool/JetCnvTool")
44{
45 //
46 // Property declaration
47 //
48 declareProperty( "InputJetCollection", m_inputJetCollectionName );
49 declareProperty( "xAODJetContainer", m_xaodJetCollectionName = "" );
50 declareProperty( "ConstituentContainer", m_constitContainerName = "");
51 declareProperty( "JetCnvTool", m_cnvTool);
52 declareProperty( "ConstitSearch", m_constitSearch = false);
53}
54
55// Destructor
59
60// Athena Algorithm's Hooks
63{
64 ATH_MSG_INFO ("Initializing " << name() << "...");
65
67
68 CHECK( m_cnvTool.retrieve() );
69
70 return StatusCode::SUCCESS;
71}
72
74{
75 ATH_MSG_INFO ("Finalizing " << name() << "...");
76 return StatusCode::SUCCESS;
77}
78
79
80
82{
83 ATH_MSG_DEBUG ("Executing " << name() << "...");
84 ATH_MSG_DEBUG( "Converting " << m_inputJetCollectionName << " into "<< m_xaodJetCollectionName );
85
86 const JetCollection* inputJets=evtStore()->tryConstRetrieve<JetCollection>(m_inputJetCollectionName);
87 if (!inputJets) {
88 ATH_MSG_WARNING("No JetCollection with key " << m_inputJetCollectionName << " found. Do nothing.");
89 return StatusCode::SUCCESS;
90 }
91
92 // Create the xAOD container and its auxiliary store:
93 xAOD::JetContainer* xaodJets = new xAOD::JetContainer();
94 CHECK( evtStore()->record( xaodJets, m_xaodJetCollectionName ) );
96 CHECK( evtStore()->record( auxJets, m_xaodJetCollectionName + "Aux." ) );
97 xaodJets->setStore( auxJets );
98 ATH_MSG_DEBUG( "Recorded xAOD jets with key: "
100
101
103 if( !constitContainer ) ATH_MSG_WARNING("User given jet constituent xAOD container : "<< m_constitContainerName <<" not in SG !");
104
105 return m_cnvTool->convert(inputJets, xaodJets, constitContainer );
106
107
108}
109
110
111}
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode execute()
Definition JetCnvAlg.cxx:81
JetCnvAlg()
Default constructor:
virtual StatusCode finalize()
Definition JetCnvAlg.cxx:73
std::string m_constitContainerName
Definition JetCnvAlg.h:68
ToolHandle< IJetCnvTool > m_cnvTool
Definition JetCnvAlg.h:72
std::string m_inputJetCollectionName
Containers.
Definition JetCnvAlg.h:66
virtual ~JetCnvAlg()
Destructor:
Definition JetCnvAlg.cxx:57
virtual StatusCode initialize()
Definition JetCnvAlg.cxx:62
std::string m_xaodJetCollectionName
Definition JetCnvAlg.h:67
JetAuxContainer_v1 JetAuxContainer
Definition of the current jet auxiliary container.
JetContainer_v1 JetContainer
Definition of the current "jet container version".