Skip to content
Snippets Groups Projects
Commit f94a1165 authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'shallow-jet-cont' into 'master'

Shallow Jet aux support in trigger EM

See merge request atlas/athena!38315
parents 300839b9 adfd0c1d
No related branches found
No related tags found
No related merge requests found
...@@ -100,13 +100,19 @@ StatusCode HLTEDMCreator::initialize() ...@@ -100,13 +100,19 @@ StatusCode HLTEDMCreator::initialize()
#undef INIT #undef INIT
#undef INIT_XAOD #undef INIT_XAOD
ATH_CHECK( m_CaloClusterContainerShallowCopy.initialize() ); #define INIT_SHALLOW(__TYPE) \
renounceArray( m_CaloClusterContainerShallowCopy ); ATH_CHECK( m_##__TYPE##ShallowCopy.initialize() ); \
for ( auto k: m_CaloClusterContainerShallowCopy ) renounceArray( m_##__TYPE##ShallowCopy ); \
m_CaloClusterContainerShallowCopyOut.push_back(k.key()); for ( auto k: m_##__TYPE##ShallowCopy ) \
ATH_CHECK( m_CaloClusterContainerShallowCopyOut.initialize() ); m_##__TYPE##ShallowCopyOut.push_back(k.key()); \
renounceArray( m_CaloClusterContainerShallowCopyOut ); ATH_CHECK( m_##__TYPE##ShallowCopyOut.initialize() ); \
renounceArray( m_##__TYPE##ShallowCopyOut )
INIT_SHALLOW( CaloClusterContainer );
INIT_SHALLOW( JetContainer );
#undef INIT_SHALLOW
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -374,19 +380,25 @@ StatusCode HLTEDMCreator::createOutput(const EventContext& context) const { ...@@ -374,19 +380,25 @@ StatusCode HLTEDMCreator::createOutput(const EventContext& context) const {
#undef CREATE_XAOD_NO_MERGE #undef CREATE_XAOD_NO_MERGE
// special cases // special cases
{ #define CREATE_SHALLOW(__TYPE) \
for ( size_t index = 0; index < m_CaloClusterContainerShallowCopy.size(); ++index ){ { \
auto readHandle = SG::makeHandle<xAOD::CaloClusterContainer> ( m_CaloClusterContainerShallowCopy[index], context ); for ( size_t index = 0; index < m_##__TYPE##ShallowCopy.size(); ++index ){ \
if ( not readHandle.isValid() ) { // collection is missing auto readHandle = SG::makeHandle<xAOD::__TYPE> ( m_##__TYPE##ShallowCopy[index], context ); \
ATH_MSG_DEBUG( "Creating missing CaloClusterContainerShallowCopy " << m_CaloClusterContainerShallowCopy[index].key() ); if ( not readHandle.isValid() ) { \
auto writeHandle = SG::makeHandle( m_CaloClusterContainerShallowCopyOut[index], context ); ATH_MSG_DEBUG( "Creating missing "#__TYPE"ShallowCopy " << m_##__TYPE##ShallowCopy[index].key() ); \
ATH_CHECK( writeHandle.record( std::make_unique<xAOD::CaloClusterContainer>(), std::make_unique<xAOD::ShallowAuxContainer>() )); auto writeHandle = SG::makeHandle( m_##__TYPE##ShallowCopyOut[index], context ); \
} else { ATH_CHECK( writeHandle.record( std::make_unique<xAOD::__TYPE>(), std::make_unique<xAOD::ShallowAuxContainer>() )); \
ATH_MSG_DEBUG( "CaloClusterContainerShallowCopy " << m_CaloClusterContainerShallowCopyOut[index].key() << " present in the event, done nothing"); } else { \
} ATH_MSG_DEBUG( #__TYPE"ShallowCopy " << m_##__TYPE##ShallowCopyOut[index].key() << " present in the event, done nothing"); \
} } \
} \
} }
CREATE_SHALLOW( CaloClusterContainer )
CREATE_SHALLOW( JetContainer )
#undef CREATE_SHALLOW
if ( m_dumpSGAfter ) if ( m_dumpSGAfter )
ATH_MSG_DEBUG( evtStore()->dump() ); ATH_MSG_DEBUG( evtStore()->dump() );
......
...@@ -145,10 +145,22 @@ class HLTEDMCreator: public extends<AthAlgTool, IHLTOutputTool> { ...@@ -145,10 +145,22 @@ class HLTEDMCreator: public extends<AthAlgTool, IHLTOutputTool> {
#undef DEF_KEY #undef DEF_KEY
#undef DEF_XAOD_KEY #undef DEF_XAOD_KEY
// special cases with different (ShalowAuxContainer ) (containers not in views)
#define DEF_XAOD_KEY_SHALLOW(__TYPE) \
SG::ReadHandleKeyArray<xAOD::__TYPE> m_##__TYPE##ShallowCopy{ this, #__TYPE"ShallowCopy", {}, "Required collections of wiht Aux of type ShallowAuxContainerxAOD::"#__TYPE}; \
SG::WriteHandleKeyArray<xAOD::__TYPE> m_##__TYPE##ShallowCopyOut
DEF_XAOD_KEY_SHALLOW( JetContainer );
DEF_XAOD_KEY_SHALLOW( CaloClusterContainer );
#undef DEF_XAOD_KEY_SHALLOW
// SG::ReadHandleKeyArray<xAOD::CaloClusterContainer> m_CaloClusterContainerShallowCopy{ this, "CaloClusterContainerShallowCopy", {}, "Required collections of xAOD::CaloClusterContainer wiht Aux of type ShallowAuxContainer"};
// SG::WriteHandleKeyArray<xAOD::CaloClusterContainer> m_CaloClusterContainerShallowCopyOut;
// special cases coded by hand (container not in views
SG::ReadHandleKeyArray<xAOD::CaloClusterContainer> m_CaloClusterContainerShallowCopy{ this, "CaloClusterContainerShallowCopy", {}, "Required collections of xAOD::CaloClusterContainer wiht Aux of type ShallowAuxContainer"};
SG::WriteHandleKeyArray<xAOD::CaloClusterContainer> m_CaloClusterContainerShallowCopyOut;
template<typename T> template<typename T>
struct HandlesGroup { struct HandlesGroup {
......
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