Function returning DataHandle for v2 RecVertices missing for usage in ThOr functors

ThOr functors such as BPVDIRA, BPVDFCHI2 ... need v2 RecVertices. There seems to be no functionality to get these when creating a tuple using FunTuple. A workaround is to do something similar to make_pvs_v2 in Moore, but getting the necessary data from TES locations:

from PyConf.application import make_data_with_FetchDataFromFile
from PyConf.Algorithms import (
    LHCb__Converters__RecVertices__LHCbRecVerticesToVectorV2RecVertex,
    LHCb__Converters__Track__v2__fromV1TrackV2Track,
    UnpackRecVertex,
    UnpackTrack
)
def make_pvs_v2():
    tracks_v2 = LHCb__Converters__Track__v2__fromV1TrackV2Track(
        InputTracksName=UnpackTrack(InputName=make_data_with_FetchDataFromFile(
            "/Event/HLT2/pRec/Track/Best")).OutputName).OutputTracksName
    return LHCb__Converters__RecVertices__LHCbRecVerticesToVectorV2RecVertex(
        InputVertices=UnpackRecVertex(InputName=make_data_with_FetchDataFromFile(
            "/Event/HLT2/pRec/Vertex/Primary")).OutputName,
        InputTracks=tracks_v2,
    ).OutputVertices

v2_pvs = make_pvs_v2()

d0_variables = FunctorCollection({
    "BPVDIRA": F.BPVDIRA(v2_pvs),
    "BPVFDCHI2": F.BPVFDCHI2(v2_pvs),
    "BPVIPCHI2": F.BPVIPCHI2(v2_pvs)
})

...

def alg_config():
    return {"UserAlgs" : [v2_pvs, my_tuple]}, []

Ideally this function finds it's way into DaVinci and handles the hardcoded TES locations programmatically. Apparently there's also nothing testing these functors in DaVinci at the moment. FYI @dfazzini /cc @sstahl @graven

https://gitlab.cern.ch/lhcb-dpa/project/-/issues/121

Edited by Andre Gunther