23 return StatusCode::FAILURE;
27 ATH_MSG_ERROR(
"ShallowIO set to True while ShallowCopy is False");
29 return StatusCode::FAILURE;
36 return StatusCode::SUCCESS;
40#ifndef XAOD_STANDALONE
49 std::unique_ptr<xAOD::JetContainer> jets(
nullptr);
50 std::unique_ptr<SG::IAuxStore> auxCont(
nullptr);
51 std::tie(jets, auxCont) =
getJets();
53 if(jets.get() ==
nullptr || auxCont.get() ==
nullptr) {
return StatusCode::FAILURE;}
57 ATH_CHECK( jetHandle.
record(std::move(jets), std::move(auxCont_derived)) );
58#ifndef XAOD_STANDALONE
63 std::unique_ptr<xAOD::JetAuxContainer> auxCont_derived(
static_cast<xAOD::JetAuxContainer*
>(auxCont.release()));
64 ATH_CHECK( jetHandle.
record(std::move(jets), std::move(auxCont_derived)) );
65#ifndef XAOD_STANDALONE
69 return StatusCode::SUCCESS;
72std::pair<std::unique_ptr<xAOD::JetContainer>,std::unique_ptr<SG::IAuxStore> >
JetCopier::getJets()
const {
90 return std::make_pair(std::unique_ptr<xAOD::JetContainer>(
nullptr),std::unique_ptr<SG::IAuxStore>(
nullptr));
95 std::pair<std::unique_ptr<xAOD::JetContainer>,
96 std::unique_ptr<xAOD::ShallowAuxContainer> > shallowcopy =
112 if(inputJetsHandle.
isValid()) {
116 return std::make_pair(std::unique_ptr<xAOD::JetContainer>(
nullptr),std::unique_ptr<SG::IAuxStore>(
nullptr));
121 std::unique_ptr<xAOD::JetContainer> goodJets = std::make_unique<xAOD::JetContainer>();
122 std::unique_ptr<xAOD::JetAuxContainer> goodJetsAux = std::make_unique<xAOD::JetAuxContainer>();
124 goodJets->setStore (goodJetsAux.get());
128 goodJets->push_back (goodJet);
132 return std::make_pair(std::move(goodJets),std::move(goodJetsAux));
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual std::pair< std::unique_ptr< xAOD::JetContainer >, std::unique_ptr< SG::IAuxStore > > ShallowCopyJets() const
virtual std::pair< std::unique_ptr< xAOD::JetContainer >, std::unique_ptr< SG::IAuxStore > > DeepCopyJets() const
Gaudi::Property< bool > m_shallowCopy
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...
SG::ShallowCopyDecorDeps< xAOD::JetContainer > m_decorDeps
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
SG::ReadHandleKey< xAOD::JetContainer > m_inputJets
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.
Gaudi::Property< bool > m_shallowIO
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...
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Property holding a SG store/key/clid from which a WriteHandle is made.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Class creating a shallow copy of an existing auxiliary container.
Jet_v1 Jet
Definition of the current "jet version".
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, const EventContext &ctx)
Function making a shallow copy of a constant container.
JetAuxContainer_v1 JetAuxContainer
Definition of the current jet auxiliary container.
bool setOriginalObjectLink(const IParticle &original, IParticle ©)
This function should be used by CP tools when they make a deep copy of an object in their correctedCo...
JetContainer_v1 JetContainer
Definition of the current "jet container version".