Skip to content

tauRecTools: simplify tau vertex retrieval

Hello,

This MR simplifies the retrieval of the tau (primary) vertex. Currently, one must check that the tau->vertexLink() is valid, and then retrieve tau->vertex(), because in the TauJet interface we don't check that the link is valid before dereferencing it. Not checking the link beforehand (like here) can cause errors in special setups like cosmics where we have no primary vertex available. I suspect this is responsible for the crash reported in ATLASRECTS-6960. Now, when there is no vertex linked to the tau, tau->vertex() will return nullptr.

Note to ourselves: we should consider generalising such changes in the interface class. Also, to be followed up later:

  • offline, is it possible to have a non-empty PrimaryVertices container, but no vertex of type xAOD::VxType::PriVtx?
  • offline, when PrimaryVertices is empty (extremely rare), don't we want to build an ad-hoc vertex using the beam spot for x,y and the leading track z0, to get a "meaningful" z0*sintheta?

Cheers, Bertrand

Merge request reports