ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetInterface
JetInterface
IJetProvider.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
#ifndef JETINTERFACE_IJETPROVIDER_H
7
#define JETINTERFACE_IJETPROVIDER_H
8
16
17
#include <utility>
18
#include <memory>
19
#include "
AsgDataHandles/WriteHandle.h
"
20
#include "
AsgTools/IAsgTool.h
"
21
#include "
xAODJet/JetContainer.h
"
22
23
namespace
SG
{
24
class
IAuxStore
;
25
}
26
27
class
IJetProvider
:
virtual
public
asg::IAsgTool
{
28
ASG_TOOL_INTERFACE
(
IJetProvider
)
29
30
public
:
31
33
virtual
~IJetProvider
() { };
34
40
virtual
std::pair<std::unique_ptr<xAOD::JetContainer>,std::unique_ptr<SG::IAuxStore> >
getJets
()
const
= 0;
41
54
virtual
StatusCode
getAndRecordJets
(
SG::WriteHandle<xAOD::JetContainer>
& jetHandle)
const
= 0;
55
65
virtual
StatusCode
initWithOutput
(
const
SG::WriteHandleKey<xAOD::JetContainer>
&) {
return
StatusCode::SUCCESS;};
66
67
};
68
69
75
template
<
typename
CONCRETEAUX>
class
JetProvider
76
:
virtual
public
IJetProvider
77
{
78
79
public
:
80
81
StatusCode
getAndRecordJets
(
SG::WriteHandle<xAOD::JetContainer>
& jetHandle)
const
{
82
std::unique_ptr<xAOD::JetContainer> jets(
nullptr
);
83
std::unique_ptr<SG::IAuxStore> auxCont(
nullptr
);
84
std::tie(jets, auxCont) =
getJets
();
85
if
(jets.get()==
nullptr
|| auxCont.get()==
nullptr
) {
return
StatusCode::FAILURE;}
86
87
// Convert the aux container pointer to the known base class
88
std::unique_ptr<CONCRETEAUX> auxCont_derived(
static_cast<
CONCRETEAUX*
>
(auxCont.release()));
89
90
// Write out JetContainer and JetAuxContainer
91
return
jetHandle.
record
(std::move(jets), std::move(auxCont_derived));
92
}
93
94
};
95
96
97
#endif
ASG_TOOL_INTERFACE
#define ASG_TOOL_INTERFACE(CLASSNAME)
Definition
AsgToolMacros.h:40
WriteHandle.h
Handle class for recording to StoreGate.
IAsgTool.h
JetContainer.h
IJetProvider
Definition
IJetProvider.h:27
IJetProvider::getAndRecordJets
virtual StatusCode getAndRecordJets(SG::WriteHandle< xAOD::JetContainer > &jetHandle) const =0
Method to allow the client to pass in a WriteHandle for the container and aux container to be recorde...
IJetProvider::initWithOutput
virtual StatusCode initWithOutput(const SG::WriteHandleKey< xAOD::JetContainer > &)
Method to allow the client to pass in a WriteHandle during initialisation, in case this is needed for...
Definition
IJetProvider.h:65
IJetProvider::~IJetProvider
virtual ~IJetProvider()
Destructor.
Definition
IJetProvider.h:33
IJetProvider::getJets
virtual std::pair< std::unique_ptr< xAOD::JetContainer >, std::unique_ptr< SG::IAuxStore > > getJets() const =0
Method to build the collection and return it to the caller.
JetProvider
Concrete class that implements the recording of jets & aux container to StoreGate via an externally p...
Definition
IJetProvider.h:77
JetProvider::getAndRecordJets
StatusCode getAndRecordJets(SG::WriteHandle< xAOD::JetContainer > &jetHandle) const
Method to allow the client to pass in a WriteHandle for the container and aux container to be recorde...
Definition
IJetProvider.h:81
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition
IAuxStore.h:51
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition
StoreGate/StoreGate/WriteHandleKey.h:40
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition
IAsgTool.h:41
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
Generated on
for ATLAS Offline Software by
1.17.0