requested to merge kolehman/athena:PMGTruthWeightTool-dont-crash-for-data into 21.2
[POSTPONED] GitLab sender email address for notifications won't be changing effective Monday, March 4th at 17:30h. (ffi: OTG0148869)
In my analysis code, I set up all tools in the beginning and then run over multiple xAODs, both MC and data. I use the PMGTruthWeightTool to retrieve MC event weights (and I obviously don't call the
getWeight(...) method for data events).
The tool causes a crash in the
beginEvent() method, when it tries to retrieve mcEventWeights from the EventInfo object of data events. The additional return statement makes sure that the mcEventWeights are never retrieved for data events.
I tested the changed version locally and it runs fine.