Skip to content
Snippets Groups Projects
Verified Commit 9e86ea23 authored by Tadej Novak's avatar Tadej Novak
Browse files

Fix ability to filter-out object systematics on writing output

parent 790812c4
No related branches found
No related tags found
5 merge requests!76035Updated rel21 number,!63304adding missing electron iso WPs (Tight_VarRad, Loose_VarRad, TightTrackOnly_VarRad),!61521fix maxPVrefit,!59663fixed a typo in HIGG8D1 format (followup of https://gitlab.cern.ch/atlas/athena/-/merge_requests/59575),!55085Fix ability to filter-out object systematics on writing output
...@@ -466,7 +466,31 @@ namespace CP { ...@@ -466,7 +466,31 @@ namespace CP {
if( auxName.find( "%SYS%" ) != std::string::npos ) if( auxName.find( "%SYS%" ) != std::string::npos )
{ {
systematicsDecoration = true; systematicsDecoration = true;
const CP::SystematicSet affecting = m_systematicsService->getDecorSystematics( match[ 1 ], auxName ); CP::SystematicSet affecting = m_systematicsService->getDecorSystematics( match[ 1 ], auxName );
if( affecting.empty() )
{
// Sometimes while object systematics were applied we are not interested in them,
// NOSYS will then be used on the container name.
// Decoration systematics however will only be aware of containers with %SYS% included.
// Some special handling is needed to translate from NOSYS back to %SYS%.
const auto nosysInKey = key.find( "NOSYS" );
if( nosysInKey != std::string::npos )
{
std::string sysKey = key;
sysKey.replace (nosysInKey, 5, "%SYS%");
// these will be all systematics (object+decor)
const CP::SystematicSet affectingDecor = m_systematicsService->getDecorSystematics( sysKey, auxName );
// we now need to filter-out object systematics
const CP::SystematicSet affectingObject = m_systematicsService->getObjectSystematics( sysKey );
for( const CP::SystematicVariation &variation : affectingDecor )
{
if( affectingObject.find( variation ) == affectingObject.end() )
{
affecting.insert( variation );
}
}
}
}
CP::SystematicSet matching; CP::SystematicSet matching;
ANA_CHECK( SystematicSet::filterForAffectingSystematics( sys, affecting, matching ) ); ANA_CHECK( SystematicSet::filterForAffectingSystematics( sys, affecting, matching ) );
if( !nominal && matching.empty() ) { if( !nominal && matching.empty() ) {
......
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