22 return StatusCode::FAILURE;
26 ATH_MSG_ERROR(
"ShallowIO set to True while ShallowCopy is False");
28 return StatusCode::FAILURE;
35 return StatusCode::SUCCESS;
39#ifndef XAOD_STANDALONE
48 std::unique_ptr<xAOD::JetContainer> jets(
nullptr);
49 std::unique_ptr<SG::IAuxStore> auxCont(
nullptr);
50 std::tie(jets, auxCont) =
getJets();
52 if(jets.get() ==
nullptr || auxCont.get() ==
nullptr) {
return StatusCode::FAILURE;}
56 ATH_CHECK( jetHandle.
record(std::move(jets), std::move(auxCont_derived)) );
57#ifndef XAOD_STANDALONE
62 std::unique_ptr<xAOD::JetAuxContainer> auxCont_derived(
static_cast<xAOD::JetAuxContainer*
>(auxCont.release()));
63 ATH_CHECK( jetHandle.
record(std::move(jets), std::move(auxCont_derived)) );
64#ifndef XAOD_STANDALONE
68 return StatusCode::SUCCESS;
71std::pair<std::unique_ptr<xAOD::JetContainer>,std::unique_ptr<SG::IAuxStore> >
JetCopier::getJets()
const {
89 return std::make_pair(std::unique_ptr<xAOD::JetContainer>(
nullptr),std::unique_ptr<SG::IAuxStore>(
nullptr));
99 std::unique_ptr<xAOD::JetContainer> outjets(shallowcopy.first);
100 std::unique_ptr<xAOD::ShallowAuxContainer> shallowaux(shallowcopy.second);
105 return std::make_pair(std::move(outjets),std::move(shallowaux));
113 if(inputJetsHandle.
isValid()) {
117 return std::make_pair(std::unique_ptr<xAOD::JetContainer>(
nullptr),std::unique_ptr<SG::IAuxStore>(
nullptr));
122 std::unique_ptr<xAOD::JetContainer> goodJets = std::make_unique<xAOD::JetContainer>();
123 std::unique_ptr<xAOD::JetAuxContainer> goodJetsAux = std::make_unique<xAOD::JetAuxContainer>();
125 goodJets->setStore (goodJetsAux.get());
129 goodJets->push_back (goodJet);
133 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".