ATLAS Offline Software
Loading...
Searching...
No Matches
JetCopier.h
Go to the documentation of this file.
1// this file is -*- C++ -*-
2/*
3 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4*/
5
6#ifndef JETREC_JETCOPIER_H
7#define JETREC_JETCOPIER_H
8
18
20#include "AsgTools/AsgTool.h"
26
27// This class doesn't (yet) exist for AnalysisBase, so in that release
28// we will simply have to rerun modifiers if we need them.
29#ifndef XAOD_STANDALONE
31#endif
32
34 : public asg::AsgTool,
35 virtual public IJetProvider
36{
38
39 public:
41
42 // Called in parent initialize()
43 virtual StatusCode initialize() override;
44
45#ifndef XAOD_STANDALONE
46 // Needed to initialise the ShallowCopyDecorDeps object, which propagates
47 // decorations on the original into the copy in StoreGate.
48 // Override interface implementation in Athena only
49 virtual StatusCode initWithOutput(const SG::WriteHandleKey<xAOD::JetContainer>& outputJets) override;
50#endif
51
52 // Called during execution
53 virtual StatusCode getAndRecordJets(SG::WriteHandle<xAOD::JetContainer>& jetHandle) const override;
54 virtual std::pair<std::unique_ptr<xAOD::JetContainer>, std::unique_ptr<SG::IAuxStore> > getJets() const override;
55
56 private:
57
58 virtual std::pair<std::unique_ptr<xAOD::JetContainer>, std::unique_ptr<SG::IAuxStore> > ShallowCopyJets() const;
59 virtual std::pair<std::unique_ptr<xAOD::JetContainer>, std::unique_ptr<SG::IAuxStore> > DeepCopyJets() const;
60
61 // Handle Input JetContainer
62 SG::ReadHandleKey<xAOD::JetContainer> m_inputJets {this, "InputJets", "", "Jet collection to be copied"};
63
64 Gaudi::Property<bool> m_shallowCopy {this, "ShallowCopy", true, "True for shallow copy, false for deep copy"};
65 Gaudi::Property<bool> m_shallowIO {this, "ShallowIO", false, "True for storing only modified data"};
66
67#ifndef XAOD_STANDALONE
69 "List of decorations to propagate through the shallow copy." };
70#endif
71};
72
73#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Helper to propagate decoration dependencies to a shallow copy.
Creates a new JetContainer by doing a shallow copy of an input JetVector.
Definition JetCopier.h:36
virtual std::pair< std::unique_ptr< xAOD::JetContainer >, std::unique_ptr< SG::IAuxStore > > ShallowCopyJets() const
Definition JetCopier.cxx:80
virtual std::pair< std::unique_ptr< xAOD::JetContainer >, std::unique_ptr< SG::IAuxStore > > DeepCopyJets() const
Gaudi::Property< bool > m_shallowCopy
Definition JetCopier.h:64
virtual StatusCode getAndRecordJets(SG::WriteHandle< xAOD::JetContainer > &jetHandle) const override
Method to allow the client to pass in a WriteHandle for the container and aux container to be recorde...
Definition JetCopier.cxx:47
SG::ShallowCopyDecorDeps< xAOD::JetContainer > m_decorDeps
Definition JetCopier.h:68
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition JetCopier.cxx:15
SG::ReadHandleKey< xAOD::JetContainer > m_inputJets
Definition JetCopier.h:62
virtual std::pair< std::unique_ptr< xAOD::JetContainer >, std::unique_ptr< SG::IAuxStore > > getJets() const override
Method to build the collection and return it to the caller.
Definition JetCopier.cxx:71
Gaudi::Property< bool > m_shallowIO
Definition JetCopier.h:65
virtual StatusCode initWithOutput(const SG::WriteHandleKey< xAOD::JetContainer > &outputJets) override
Method to allow the client to pass in a WriteHandle during initialisation, in case this is needed for...
Definition JetCopier.cxx:41
Property holding a SG store/key/clid from which a ReadHandle is made.
Helper to propagate decoration dependencies to a shallow copy.
Property holding a SG store/key/clid from which a WriteHandle is made.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58