Skip to content

Issues with newer DaVinci/v64r12 vs v64r9 in storing relations for tracking efficiencies lines

Inspired by this AP The code was used to tuple the velo-long tracking efficiencies lines for electrons and muons.

The tupling still run if executed on DaVinci/v64r9 but it segfault in DaVinci/v64r12.

A reproducer of the issue can be found unzipping /afs/cern.ch/user/r/rquaglia/public/dv64r12_vs64r9_crash.zip

lb-run DaVinci/v64r9  lbexec test:main info.yaml
lb-run DaVinci/v64r12 lbexec test:main info.yaml

The culript part of the script is the following :

    probe_particles = ParticleFilter(flattened_input_decay_tree.OutputParticles,
                                    F.FILTER(F.require_all(F.ISBASICPARTICLE, (F.VALUE_OR(-1) @ F.TRACKISVELO @ F.TRACK)==1)))
    ftAlg_Rels = LHCbIDOverlapRelationTable(MatchFrom=probe_particles,
                                            MatchTo=long_particles).OutputRelations    
    PRB_FCN = lambda func: F.CHILD(2, func)    
    MyCollection =FunctorCollection({           
            "Velo2LongMatch_Array_P[nMatchTracks]":             F.MAP_INPUT_ARRAY(Functor=F.P,           Relations=ftAlg_Rels),
            "Velo2LongMatch_Array_ENERGY[nMatchTracks]":        F.MAP_INPUT_ARRAY(Functor=F.ENERGY,      Relations=ftAlg_Rels),
            "Velo2LongMatch_Array_M[nMatchTracks]":             F.MAP_INPUT_ARRAY(Functor=F.MASS,        Relations=ftAlg_Rels),
            "Velo2LongMatch_WEIGHT[nMatchTracks]":              F.MAP_WEIGHT(Relations=ftAlg_Rels),
    })
    match_probe_var = FunctorCollection({ 'Probe_'+k : PRB_FCN(v) for k,v in MyCollection.get_thor_functors().items() })
     
    VARIABLES = {
        "B":  ( 
                Kinematics() + 
                FunctorCollection( {"n_probe_particles" :  F.SIZE( probe_particles)} )
        ),
        "Jpsi": (
            Kinematics() +            
            match_probe_var
        ),
        "K": Kinematics()
    }

In DaVinci/v64r9 , the ntuple produced has :

root [11] DecayTree->GetEntries("nMatchTracks!=0")
(long long) 3144
root [12] DecayTree->GetEntries("nMatchTracks==0")
(long long) 2097

With tree->Show on working setup where the relation table find something to store:

 Jpsi_PZ         = 53028.2
 Jpsi_ENERGY     = 53065.7
 nMatchTracks    = 1
 Jpsi_Probe_Velo2LongMatch_Array_P = 7271.49
 Jpsi_Probe_Velo2LongMatch_Array_ENERGY = 7272.26
 Jpsi_Probe_Velo2LongMatch_Array_M = 105.658
 Jpsi_Probe_Velo2LongMatch_WEIGHT = 1

With tree->Show on working setup where relation table find a null relation ( a velo track did not make a long)

 Jpsi_PZ         = 37282.5
 Jpsi_ENERGY     = 37433.7
 nMatchTracks    = 0
 K_M             = 493.677

suggesting that the array-size of the variables produced , the branches are not even shown ( tree->Show())

Unclear where the issue is coming from.

  • Array-Size =0 variables set the size for any next event?
  • CHILD functors and composition is problematic?

FYI : @graven

Edited by Gerhard Raven