Skip to content
Snippets Groups Projects
Commit 92e99d54 authored by Tim Martin's avatar Tim Martin
Browse files

Save probe-leg data to the trigger EDM

parent 6856b7cc
No related branches found
No related tags found
7 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!46548[ATR-24152] Save probe-leg data to the trigger EDM
......@@ -284,11 +284,11 @@ StatusCode HLTEDMCreator::createIfMissing( const EventContext& context, const Co
// What we write will either be a dummy (empty) container, or be populated from N in-View collections.
SG::ReadHandle<T> readHandle( writeHandleKey.key() );
if ( readHandle.isValid() ) {
ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " already present" );
generator.create(false, false);
ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " already present" );
generator.create(false, false);
} else {
ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " was absent, creating it" );
generator.create(true, true);
ATH_MSG_DEBUG( "The " << writeHandleKey.key() << " was absent, creating it" );
generator.create(true, true);
}
} else {
......@@ -302,10 +302,10 @@ StatusCode HLTEDMCreator::createIfMissing( const EventContext& context, const Co
if ( handles.out.size() == 1 ) {
generator.create(true, true);
} else {
const bool doCreate = i == 0 or handles.out.at(i-1).key() != handles.out.at(i).key();
const bool doRecord = i == handles.out.size()-1 or handles.out.at(i+1).key() != handles.out.at(i).key();
ATH_MSG_DEBUG( "Instrucring generator " << (doCreate ? "to" : "NOT TO") << " create collection and " << (doRecord ? "to" : "NOT TO") << " record collection in this iteration");
generator.create(doCreate, doRecord);
const bool doCreate = i == 0 or handles.out.at(i-1).key() != handles.out.at(i).key();
const bool doRecord = i == handles.out.size()-1 or handles.out.at(i+1).key() != handles.out.at(i).key();
ATH_MSG_DEBUG( "Instrucring generator " << (doCreate ? "to" : "NOT TO") << " create collection and " << (doRecord ? "to" : "NOT TO") << " record collection in this iteration");
generator.create(doCreate, doRecord);
}
SG::ReadHandleKey<ViewContainer> viewsReadHandleKey = handles.views.at(i);
......@@ -313,12 +313,33 @@ StatusCode HLTEDMCreator::createIfMissing( const EventContext& context, const Co
auto viewsHandle = SG::makeHandle( viewsReadHandleKey, context );
if ( viewsHandle.isValid() ) {
SG::ReadHandleKey<T> inViewReadHandleKey = handles.in.at(i);
ATH_MSG_DEBUG("Will be merging from " << viewsHandle->size() << " views using in-view key " << inViewReadHandleKey.key() );
ATH_CHECK( (this->*merger)( *viewsHandle, inViewReadHandleKey , context, *generator.data.get() ) );
SG::ReadHandleKey<T> inViewReadHandleKey = handles.in.at(i);
ATH_MSG_DEBUG("Will be merging from " << viewsHandle->size() << " views using in-view key " << inViewReadHandleKey.key() );
ATH_CHECK( (this->*merger)( *viewsHandle, inViewReadHandleKey , context, *generator.data.get() ) );
} else {
ATH_MSG_DEBUG("Views " << viewsReadHandleKey.key() << " are missing. Will leave " << writeHandleKey.key() << " output collection empty.");
ATH_MSG_DEBUG("Views " << viewsReadHandleKey.key() << " are missing. Will leave " << writeHandleKey.key() << " output collection empty.");
}
// Also consider probe variants of each EventView.
// Not every container will have a corresponding set of (typically) lower-pT probe ROIs, but it's safer to always test.
static const std::string probe_suffix = "_probe";
const std::string viewsReadHandleKeyProbe = viewsReadHandleKey.key() + probe_suffix;
ATH_MSG_VERBOSE("Will try to merge from the " << viewsReadHandleKeyProbe << " view container into that output");
// Falling back to direct SG access here to avoid uninitiated key errors. This is safe to do in the context of the Trigger ControlFlow.
// I.e. if this collection is to exist in this event, then it is guaranteed to have been produced prior to this alg executing.
const ViewContainer* viewsContainer_probe = nullptr;
if (evtStore()->contains<ViewContainer>(viewsReadHandleKeyProbe)) {
ATH_CHECK(evtStore()->retrieve(viewsContainer_probe, viewsReadHandleKeyProbe));
}
if ( viewsContainer_probe ) {
SG::ReadHandleKey<T> inViewReadHandleKey = handles.in.at(i);
ATH_MSG_DEBUG("Will be merging from " << viewsContainer_probe->size() << " probe views using in-view key " << inViewReadHandleKey.key() );
ATH_CHECK( (this->*merger)( *viewsContainer_probe, inViewReadHandleKey , context, *generator.data.get() ) );
} else {
ATH_MSG_VERBOSE("Probe views " << viewsReadHandleKeyProbe << " are missing.");
}
}
auto writeHandle = SG::makeHandle( writeHandleKey, context );
......
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