Skip to content
Snippets Groups Projects
Commit aa0b71ce authored by Teng Jian Khoo's avatar Teng Jian Khoo
Browse files

Add compilation guards to hide ShallowCopyDecorDeps in AnalysisBase

parent 6c3d0c36
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ set( extra_libs ) ...@@ -8,7 +8,7 @@ set( extra_libs )
if( NOT GENERATIONBASE ) if( NOT GENERATIONBASE )
list( APPEND extra_libs xAODPFlow ) list( APPEND extra_libs xAODPFlow )
if( NOT XAOD_STANDALONE ) if( NOT XAOD_STANDALONE )
list( APPEND extra_libs AthenaMonitoringKernelLib ) list( APPEND extra_libs AthenaMonitoringKernelLib StoreGateLib )
endif() endif()
endif() endif()
...@@ -24,7 +24,7 @@ atlas_add_library( JetRecLib ...@@ -24,7 +24,7 @@ atlas_add_library( JetRecLib
JetRec/*.h Root/*.h Root/*.cxx JetRec/*.h Root/*.h Root/*.cxx
PUBLIC_HEADERS JetRec PUBLIC_HEADERS JetRec
INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${FASTJET_INCLUDE_DIRS} ${FASTJETCONTRIB_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${FASTJET_INCLUDE_DIRS} ${FASTJETCONTRIB_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${Boost_LIBRARIES} ${FASTJET_LIBRARIES} ${FASTJETCONTRIB_LIBRARIES} ${ROOT_LIBRARIES} AsgDataHandlesLib AsgTools AthLinks EventShapeInterface JetEDM JetInterface xAODBase xAODCaloEvent xAODCore xAODEventInfo xAODJet xAODMuon StoreGateLib ${extra_libs} LINK_LIBRARIES ${Boost_LIBRARIES} ${FASTJET_LIBRARIES} ${FASTJETCONTRIB_LIBRARIES} ${ROOT_LIBRARIES} AsgDataHandlesLib AsgTools AthLinks EventShapeInterface JetEDM JetInterface xAODBase xAODCaloEvent xAODCore xAODEventInfo xAODJet xAODMuon ${extra_libs}
PRIVATE_LINK_LIBRARIES CxxUtils xAODTracking ) PRIVATE_LINK_LIBRARIES CxxUtils xAODTracking )
if( NOT XAOD_STANDALONE ) if( NOT XAOD_STANDALONE )
......
...@@ -23,7 +23,12 @@ ...@@ -23,7 +23,12 @@
#include "JetInterface/IJetProvider.h" #include "JetInterface/IJetProvider.h"
#include "xAODJet/JetContainer.h" #include "xAODJet/JetContainer.h"
#include "xAODCore/ShallowAuxContainer.h" #include "xAODCore/ShallowAuxContainer.h"
// This class doesn't (yet) exist for AnalysisBase, so in that release
// we will simply have to rerun modifiers if we need them.
#ifndef XAOD_ANALYSIS
#include "StoreGate/ShallowCopyDecorDeps.h" #include "StoreGate/ShallowCopyDecorDeps.h"
#endif
class JetCopier class JetCopier
: public asg::AsgTool, : public asg::AsgTool,
...@@ -55,8 +60,10 @@ class JetCopier ...@@ -55,8 +60,10 @@ class JetCopier
Gaudi::Property<bool> m_shallowCopy {this, "ShallowCopy", true, "True for shallow copy, false for deep copy"}; Gaudi::Property<bool> m_shallowCopy {this, "ShallowCopy", true, "True for shallow copy, false for deep copy"};
Gaudi::Property<bool> m_shallowIO {this, "ShallowIO", false, "True for storing only modified data"}; Gaudi::Property<bool> m_shallowIO {this, "ShallowIO", false, "True for storing only modified data"};
#ifndef XAOD_ANALYSIS
SG::ShallowCopyDecorDeps<xAOD::JetContainer> m_decorDeps { this, "DecorDeps", {}, SG::ShallowCopyDecorDeps<xAOD::JetContainer> m_decorDeps { this, "DecorDeps", {},
"List of decorations to propagate through the shallow copy." }; "List of decorations to propagate through the shallow copy." };
#endif
}; };
#endif #endif
...@@ -38,7 +38,11 @@ StatusCode JetCopier::initialize() { ...@@ -38,7 +38,11 @@ StatusCode JetCopier::initialize() {
// Setup helper to propagate decorations from original to copy // Setup helper to propagate decorations from original to copy
StatusCode JetCopier::initWithOutput(const SG::WriteHandleKey<xAOD::JetContainer>& outputJets) { StatusCode JetCopier::initWithOutput(const SG::WriteHandleKey<xAOD::JetContainer>& outputJets) {
#ifndef XAOD_ANALYSIS
return m_decorDeps.initialize(m_inputJets, outputJets) ; return m_decorDeps.initialize(m_inputJets, outputJets) ;
#else
return StatusCode::SUCCESS;
#endif
} }
...@@ -52,12 +56,16 @@ StatusCode JetCopier::getAndRecordJets(SG::WriteHandle<xAOD::JetContainer>& jetH ...@@ -52,12 +56,16 @@ StatusCode JetCopier::getAndRecordJets(SG::WriteHandle<xAOD::JetContainer>& jetH
if(m_shallowCopy){ if(m_shallowCopy){
std::unique_ptr<xAOD::ShallowAuxContainer> auxCont_derived(static_cast<xAOD::ShallowAuxContainer*>(auxCont.release())); std::unique_ptr<xAOD::ShallowAuxContainer> auxCont_derived(static_cast<xAOD::ShallowAuxContainer*>(auxCont.release()));
ATH_CHECK( jetHandle.record(std::move(jets), std::move(auxCont_derived)) ); ATH_CHECK( jetHandle.record(std::move(jets), std::move(auxCont_derived)) );
#ifndef XAOD_ANALYSIS
ATH_CHECK( m_decorDeps.linkDecors (m_inputJets) ); ATH_CHECK( m_decorDeps.linkDecors (m_inputJets) );
#endif
} }
else{ else{
std::unique_ptr<xAOD::JetAuxContainer> auxCont_derived(static_cast<xAOD::JetAuxContainer*>(auxCont.release())); std::unique_ptr<xAOD::JetAuxContainer> auxCont_derived(static_cast<xAOD::JetAuxContainer*>(auxCont.release()));
ATH_CHECK( jetHandle.record(std::move(jets), std::move(auxCont_derived)) ); ATH_CHECK( jetHandle.record(std::move(jets), std::move(auxCont_derived)) );
#ifndef XAOD_ANALYSIS
ATH_CHECK( m_decorDeps.linkDecors (m_inputJets) ); ATH_CHECK( m_decorDeps.linkDecors (m_inputJets) );
#endif
} }
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment