key4hep / k4EDM4hep2LcioConv

EDM4hep to LCIO Converter
1 stars 11 forks source link

`lcio2edm4hep` missing collection patching misses PID collections #90

Closed Zehvogel closed 1 week ago

Zehvogel commented 3 weeks ago

Running the conversion on an ILD mini-DST (can be obtained from the grid) crashes because missing PID collections do not get created empty. At least that is what I think what happens from the error message... It was possible to convert these files in the past.

[lreichen@pcphsft121 2023-10-17_edm4hep_rdf]$ lcio2edm4hep rv01-16-p10_250.sv01-14-01-p00.mILD_o1_v05.E250-TDR_ws.I106479.Pe2e2h.eL.pR-00001-ILDminiDST.slcio I106479_new.edm4hep.root colls.txt 
Number of events in file: 17143
Number of runs in file: 1
processing RunHeader: 0
processed amount of events: 0% (event: 0)
LCGenericObject is a collection type for which no known conversion exists.
processed amount of events: 0% (event: 1)
LCGenericObject is a collection type for which no known conversion exists.
processed amount of events: 0% (event: 2)
LCGenericObject is a collection type for which no known conversion exists.
processed amount of events: 0% (event: 3)
LCGenericObject is a collection type for which no known conversion exists.
terminate called after throwing an instance of 'std::runtime_error'
  what():  Collection 'Refined2Jets_PID_RefinedVertex' in category 'events' is not available in Frame
Aborted (core dumped)

where colls.txt was created by

check_missing_cols --minimal rv01-16-p10_250.sv01-14-01-p00.mILD_o1_v05.E250-TDR_ws.I106479.Pe2e2h.eL.pR-00001-ILDminiDST.slcio > colls.txt

and contains:

     Refined6Jets                                       ReconstructedParticle                             
     Refined5Jets                                       ReconstructedParticle                             
     IsolatedElectrons                                  ReconstructedParticle                             
     IsolatedMuons                                      ReconstructedParticle                             
     IsolatedPhotons                                    ReconstructedParticle                             
     PandoraPFOs                                        ReconstructedParticle                             
     Refined2Jets                                       ReconstructedParticle                             
     IsolatedTaus                                       ReconstructedParticle                             
     BCALParticles                                      ReconstructedParticle                             
     PrimaryVertex_RP                                   ReconstructedParticle                             
     Refined4Jets                                       ReconstructedParticle                             
     PandoraPFANewReclusterMonitoring                   LCGenericObject                                   
     PrimaryVertex                                      Vertex                                            
     MCParticlesSkimmed                                 MCParticle                                        
     RecoMCTruthLink                                    LCRelation[ReconstructedParticle,MCParticle]      
     Refined3Jets                                       ReconstructedParticle                             
Zehvogel commented 3 weeks ago

Probably expected as the patching of missing collections is done entirely on the lcio side of things. The empty created collection then has no PID attached and during the actual conversion there is nothing to convert. :(

We could try extend the check_missing_cols tool to also check and write out what kind of PIDs are attached to a collection...

Zehvogel commented 3 weeks ago

:eyes: https://github.com/iLCSoft/LCIO/pull/193

tmadlener commented 3 weeks ago

How large is the DST file in this case? Since our current test file does not run into any issues here, it might be nice to have a new test file that has this issue to avoid regressing here.

Zehvogel commented 3 weeks ago

Its this one from the mini-DST tutorial

https://syncandshare.desy.de/index.php/s/5LmrjGWqziQfMe7

tmadlener commented 1 week ago

Should be fixed with #94. Re-open if not.