Skip to content

Ability to run AnalysisTop on samples with broken metadata

Oliver Majersky requested to merge omajersk/athena:AT-metadata-workaround into 21.2

For samples that had broken TruthMetaData, after recent updates it was impossible to run such samples in AnalysisTop due to hard dependency on PMGTruthWeighTool to determine nominal MC weight and proper MC weight names from metadata.

In this MR, we add protection for samples that have broken metadata -- we avoid using PMGTruthWeighTool in such case and fallback to using particular index of MC weight in a sample. If a sample has more than one MC generator weight, we crash and alert the user to determine and specify the index via a new configuration option NominalWeightFallbackIndex.

It may also be necessary for people to turn the UseAodMetaData flag to False, as if the FileMetaData is also wrong, we will obtain incorrect for instance wrong DSID or parameters about the type of simulation used, etc.

Fixes ANALYSISTO-923

NOTE: I realize I again introduce some new cout/cerr calls in the code instead of using ATH_MSG macros -- a full migration of AnalysisTop to ATH_MSG macros is worked on in parallel to this.

Edited by Oliver Majersky

Merge request reports