Skip to content

AsgAnalysisConfig: Change PileupReweightingBlock if no files specified

Filip Nechansky requested to merge ATLAS-EGamma/athena:main-change-pu-block into main

If one does not specify files in the block configuration and calls the block for prw, config blocks lead to crash with following settings:

    configSeq.setOptionValue('.useDefaultConfig', False)

It crashes here because the dsid is not determined: https://gitlab.cern.ch/atlas/athena/-/blob/main/PhysicsAnalysis/AnalysisCommon/PileupReweighting/python/AutoconfigurePRW.py#L152

Here I fix it based on how it was done in the old prw sequence, simply skipping the part of the code https://gitlab.cern.ch/atlas/athena/-/blob/main/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/python/PileupAnalysisSequence.py?ref_type=heads#L38 so toolConfigFiles are not specified and prw is disabled. I am not sure that this is the best way to go about it, it could also just throw an error that such configuration is not valid (and locally I would just not call the block if no user prw is specified).

FYI I am not specifying files+flags because it would not be compatible with GridDriver ASAIK, so I just setup the config accumulator properties directly as is done e.g. here: https://gitlab.cern.ch/atlas-analysis-sw-tutorial/MyAnalysis/-/blob/master/python/MyAnalysisAlgorithms.py?ref_type=heads#L29

Merge request reports