Giter Club home page Giter Club logo

k4lcioreader's Introduction

Key4hep

.. toctree::
    :maxdepth: 3
    :includehidden:
    :caption: Contents:

    setup-and-getting-started/README.md
    how-tos/README.md
    tutorials/README.md
    developing-key4hep-software/README.md
    spack-build-instructions-for-librarians/README.md
    talks-and-presentations/README.md
    call-for-logos/README.md
    CONTRIBUTING.md

.. toctree::
    :maxdepth: 2
    :includehidden:
    :caption: External links:

    FCC software  <https://cern.ch/fccsw>
    CLIC software <https://twiki.cern.ch/twiki/bin/view/CLIC/CLICSoftwareComputing>
    ILC software <https://ilcsoft.desy.de/portal>
    CEPC software <http://cepcsoft.ihep.ac.cn/>
    Muon Collider software <https://mcd-wiki.web.cern.ch/software/>

k4lcioreader's People

Contributors

andresailer avatar fdplacido avatar jmcarcell avatar mirguest avatar tmadlener avatar vvolkl avatar zehvogel avatar zoujh avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

k4lcioreader's Issues

k4LCIOReader crashes when used in standalone application

Our goal is to implement the k4LCIOreader as a standalone application to read and convert LCIO files. We have run into a Segmentation Fault in edm4hep::ReconstructedParticleCollectionData::setReference, when trying this on miniDST files. Below is a list of commands to reproduce the error.

First you clone the github repository with the minimal reproducer and afterwards source the setup file from the nightlies.hsf to get the environment set up.

git clone --branch lcioedmconv https://gitlab.desy.de/ftx-sft-key4hep/edmconverter.git

source /cvmfs/sw-nightlies.hsf.org/spackages5/key4hep-stack/master-2022-08-03/x86_64-centos7-gcc11.2.0-opt/gmz2k/setup.sh

After that is done you build the reproducer.

cd edmconverter

mkdir build

cd build

cmake ..

make

download the miniDST file

cd ..

wget https://desycloud.desy.de/index.php/s/5LmrjGWqziQfMe7/download/rv01-16-p10_250.sv01-14-01-p00.mILD_o1_v05.E250-TDR_ws.I106479.Pe2e2h.eL.pR-00001-ILDminiDST.slcio

The programm is run with gdb to get the seg fault. Without gdb the programm just freezes in our case.

cd build

gdb -ex run --args ./minimalrep "../rv01-16-p10_250.sv01-14-01-p00.mILD_o1_v05.E250-TDR_ws.I106479.Pe2e2h.eL.pR-00001-ILDminiDST.slcio"

We are unsure whether this issue arises because the miniDST format has some Collections dropped. Or also because it has subset Collections. The Collection used in this case is not a subset Collection, but in a test case using a subset Collection the subset flag did not propagate through the program to the point where the references where set and the same seg fault came up.

Linked Collections are not converted

I created a test in k4MarlinWrapper to test conversion of collections from EDM4hep to LCIO to EDM4hep.
When converting Tracks, these can have other Tracks linked to it. I test that these linked Tracks remain in the conversion between EDM4hep to LCIO.
But when converting from LCIO to EDM4hep these linked Tracks are missing in the resulting EDM4hep collection. This is probably true for other collections that have linked collections.

The conversion is done using k4LCIOConverter like so:

podio::CollectionIDTable* id_table = new podio::CollectionIDTable();
k4LCIOConverter* lcio_converter = new k4LCIOConverter(id_table);
lcio_converter->set(the_event);

T* mycoll = dynamic_cast<T*>(lcio_converter->getCollection(lcio_name));

Broken associations caused by k4LCIOConverter being unaware of already existing edm4hep collections

When using edm4hep input the MCParticles collection already exists in edm4hep. Therefore, in the conversion from lcio to edm4hep getCollection() is not called for this collection. When now converting the RecoMCTruthLink collection, the lcio MCParticles collection gets converted temporarily to an edm4hep collection. The entries from this collection are then used as sim particles in the edm4hep association. In the end, when writing the edm4hep output file either PodioOutput crashes complaining about

[ctest] PodioOutput         FATAL  Standard std::exception is caught 
[ctest] PodioOutput         ERROR Trying to persistify untracked object
[ctest] EventLoopMgr        FATAL .executeEvent(): Standard std::exception thrown by PodioOutput
[ctest] EventLoopMgr        ERROR Trying to persistify untracked object

or silently writes out garbage collectionID and index values for this association. (I have not understood yet which configuration changes between those two)

This does not happen for all particles as there is still another "bug" hiding this. As getCorresponding simply returns the particle from the first collection found in the (alphabetically ordered) m_type2cols map, this problem does not occur for charged particles making it into the EfficientMCParticles or InefficientMCParticles collections created by the CLIC reconstruction. The latter can probably be fixed by limiting m_type2cols to non-subset collections.

I will not have time to try to build a fix for this in the next 2-3 weeks, so if anyone wants to have a go at this...

Rename and move repository

@zoujh as a member of the key4hep project you should be able to create new repositories there. So this should mean you could move this repository there already.

Rewrite K4LCIOReader as Gaudi Framework components

K4FWCore already offers some I/O functionality that could be useful here. Unless you think a standalone program has some advantages, I'd propose to rewrite the Reader/Converter as an Algorithm. I'll prepare a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.