AIDASoft / DD4hep

Detector Description Toolkit for High Energy Physics
http://dd4hep.cern.ch
GNU Lesser General Public License v3.0
49 stars 97 forks source link

EDM4hep as default output format and run on all events by default #1328

Closed BrieucF closed 6 days ago

BrieucF commented 1 week ago

When running with an inputfile, ddsim still outputs an lcio file as default:

source /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh
ddsim --inputFiles /eos/experiment/fcc/users/b/brfranco/background_files/sr_photons_kevin/SR_photon_v3_fixed.hepevt --compactFile $K4GEO/FCCee/IDEA/compact/IDEA_o1_v03/IDEA_o1_v03.xml -N -1

outputs dummyOutput.slcio.

Another thing that could be nice to improve is to run on all events of the provided input file by default (the expected behavior in most cases). Right now, not providing the -N -1 crashes with

ERROR: Batch mode requested, but did not set number of events
andresailer commented 1 week ago

In mattermost you claimed there was a dependence on whether one uses the particle gun or not and that changes the output format, that is somewhat different from changing the default output format... but that can be considered.

not providing the -N -1 crashes with

It does not crash, it ends execution with a clear error message. The error returns immediately and is clear to understand and fix by the user. Instead running for potentially a long time by default sounds much worse to me.

BrieucF commented 1 week ago

The edm4hep output from the gun was coming from an alias, sorry, changing the title. I also realize that this default behavior depends on how DD4hep is built. What are the flags used for the Key4hep build? I see from Spack:

    variant("lcio", default=False, description="Enable build with lcio")
    variant("edm4hep", default=True, description="Enable build with edm4hep")

which should have edm4hep as default output.

About forcing users to provide the -N arguments, it is a matter of taste, my preference would be to process the full file if nothing is specified but fine.

BrieucF commented 1 week ago

After checking, the request becomes: have edm4hep output format as default when DD4hep is compiled with both edm4hep and lcio flags ON. Opened a PR: https://github.com/AIDASoft/DD4hep/pull/1329