Tupling from Hlt2 packed reco objects

Test for checking the correct processing of Hlt2 .dst file where packed reco objects are persisted by means of a pass through line.

from PyConf.reading import get_particles
from FunTuple import FunTuple_Particles as Funtuple
import FunTuple.functorcollections as FC
from DaVinci import Options, make_config
from DaVinci.algorithms import create_lines_filter


def main(options: Options):
    bs2jpsiphi_line = "Hlt2B2CC_BsToJpsiPhi_Detached"
    bs2jpsiphi_data = get_particles(f"/Event/HLT2/{bs2jpsiphi_line}/Particles")
    fields = {
        "Bs": "[B_s0 -> (J/psi(1S) -> mu+ mu-) (phi(1020) -> K+ K-)]CC",
        "Jpsi": "[B_s0 -> ^(J/psi(1S) -> mu+ mu-) (phi(1020) -> K+ K-)]CC",
        "Phi": "[B_s0 -> (J/psi(1S) -> mu+ mu-) ^(phi(1020) -> K+ K-)]CC",
    }

    # FunTuple: make functor collection from the imported functor library Kinematic
    variables_all = FC.Kinematics()
    # FunTuple: associate functor collections to branch name
    variables = {
        "ALL": variables_all,  # adds variables to all branches
    }

    filter_bs = create_lines_filter(
        name="HDRFilter_Bs2JpsiPhi", lines=[f"{bs2jpsiphi_line}"]
    )

    tuple_bs = Funtuple(
        name="Bs2JpsiPhi_Tuple",
        tuple_name="DecayTree",
        fields=fields,
        variables=variables,
        inputs=bs2jpsiphi_data,
    )

    algs = {
        "Bs2JpsiPhi": [filter_bs, tuple_bs],
    }

    return make_config(options, algs)

To run the example:

lbexec DaVinciExamples.tupling.option_davinci_tupling_from_passthrough:main $DAVINCIEXAMPLESROOT/example_data/test_passthrough_thor_lines.yaml

For reference, these are the options of this example

input_files:
- root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/logs/spruce_bsjpsiphi_passthrough_with_pv_pointer..dst
input_manifest_file: root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/tests/logs/spruce_bsjpsiphi_passthrough_with_pv_pointer.tck.json
input_type: ROOT
simulation: true
conddb_tag: sim-20180530-vc-md100
dddb_tag: dddb-20180815
conditions_version: master
geometry_version: run3/trunk
histo_file: passthrough_histos.root
ntuple_file: passthrough_tuple.root
input_process: TurboPass
print_freq: 1000
persistreco_version: 0.0
lumi: False
write_fsr: False