DD4hep-based Simulation and Reconstruction

Current version of the ILCSOFT installation

Local build areas with the last working version of DD4hep and lcgeo are provided. Due to the intense development activity in DD4hep and to interface all simulation and reconstruction packages with DD4hep, new build areas with ILCSOFT installations are often updated and old build directories are canceled.

Current path to the ILCSOFT installation (hereafter: _path_to_ilcsoft):

  • /cvmfs/clicdp.cern.ch/iLCSoft/builds/2016-11-22/x86_64-slc6-gcc48-opt/

Current CLIC detector model (hereafter: _clic_model):

  • CLIC_o2_v04_p1 (old tracker and calo to finalise tracking studies)
  • CLIC_o3_v07 (40L ECal + engineering tracker model)

Getting Started

ALERT! Note: CVMFS is now a prerequisite to use releases provided by CERN or DESY. On lxplus it should be accessible. On your desktop make sure you have CVMFS installed by following the procedure outlined here.

If you are using a full ILCSoft release (either provided by CERN/DESY or built by yourself), it is sufficient to do:

source _path_to_ilcsoft/init_ilcsoft.sh
By default in this case the environment variables $DD4HEP, $DD4hepINSTALL and $lcgeo_DIR should point to the relevant packages.

Running the simulation

After initializing the ILCSOFT, the simulation program is accessible from everywhere as an executable named ddsim. For simulating particles one needs to provide: input file (e.g. mcparticles.slcio/.stdhep) / number of events / compact.xml file . Many more additional options available (physics list, etc), use ddsim --help to see all of them.

  • Use:

# init ilc software
source _path_to_ilcsoft/init_ilcsoft.sh

# run simulation using a stdhep/lcio generator file
ddsim --compactFile $ILCSOFT/lcgeo/HEAD/CLIC/compact/_clic_model/_clic_model.xml --inputFile input.stdhep --numberOfEvents 1

# run generation and simulation using a particle gun of single muons

ddsim  --compactFile $ILCSOFT/lcgeo/HEAD/CLIC/compact/_clic_model/_clic_model.xml --enableGun --gun.particle mu- --gun.energy 10*GeV  --gun.distribution uniform --outputFile output.slcio --numberOfEvents 1

  • See DDSimTips for use cases and tips on running ddsim, including instructions on material scan.

TIP Expert Tip: command line argument and parameter tab completion! (A. Sailer)

  • You will need argcomplete (install it by running sudo pip install argcomplete) and have to be running bash (or zsh) with bash-completion (e.g install by doing sudo yum install bash-completion).
  • Execute this on every new session (or put it in your .bashrc): eval "$(register-python-argcomplete ddsim)"
  • Enjoy listing and completion of all ddsim options by starting with ddsim - < press tab >
  • Also supports listing of possible options to arguments:
    • For example typing ddsim --runType < press tab > will list " batch  run    shell  vis " as options.

Running the Reconstruction with or without performance monitoring

The reconstruction is performed using Marlin and an associated steering xml file in a way similar to the previous Mokka/Gear based simulation and reconstruction chain. An example steering file is being implemented in a new package called ClicPerformance in iLCSoft:

$ILCSOFT/ClicPerformance/HEAD/examples/clicReconstruction.xml 

The package includes code used for performance studies, but crucially includes example xml files to run the full reconstruction chain using DD4hep: tracking (full tracking or with cheated pattern recognition) and PandoraPFA (via a bridging package and Marlin processor called DDMarlinPandora ). The steering file instantiates the Geometry using DD4hep and calls the relevant processors to run the reconstruction and any higher level processing. The examples may also include some performance processors which the user can comment out. The steering files (e.g. clicReconstruction.xml) have hard-coded references to DD4hep compact file (the geometry) and the input LCIO files. All are either included in the package or accessible over AFS. Feel free to edit your local xml copy or overwrite the parameters via the Marlin command line arguments:

Marlin --InitDD4hep.DD4hepXMLFile="$lcgeo_DIR/CLIC/compact/CLIC_o2_v03/CLIC_o2_v03.xml"  clicReconstruction.xml
You can also modify the input file or other parameters. Please consult Marlin -h for more options.

Files location:

  • Generator files (stdhep):
    • ttbar 3 TeV: LFN:/ilc/user/s/simoniel/stdhep_files/ttbar_3TeV/
    • ee --> bb 3 TeV (no ISR, no luminosity spectrum): LFN:/ilc/user/s/simoniel/stdhep_files/bb_3TeV/
  • Simulated events: COMING SOON - SIMULATION WITH NEW RELEASE ON-GOING

Using CED viewer with DD4hep to create publication-quality event displays Work in progress, under construction

The CED event display can now visualize the geometry using the DD4hep instead of GEAR. You can use it to visualize the detector geometry with less detail (faster) and draw the event data on top of it. The simplest way to use it is the following:

ced2go -d $lcgeo_DIR/CLIC/compact/CLIC_o2_v03/CLIC_o2_v03.xml <input_file.slcio>
A template can be provided with more specific drawing options. In addition, several options are available within the application window.

Some hints and tips:

  • Press "Enter" to move to the next event
  • Double click on a drawn event object (Hit, PFO, MC Particle, ...) to dump some relevant information in the console.
  • Press "h" to overlay the several keyboard shortcuts to toggle options on and off
  • Go to the "Graphics" menu to chose between "Graphics low" (wireframe) and "Graphics high" (nicer views with transparency).
  • Press "`" (backtick) to toggle between showing all or none of the LCIO collections
  • Press "~" (tilde) to show/hide the geometry

Convert DD4hep geometry to gear file

For backward compatibility and validation tests. Use in case you want to use older GEAR-based reconstruction software. In the future, all new reconstruction code should not depend or use GEAR.

  • Use and example:
convertToGear   plugin    dd4hep_compact_file   name_of_output_gear_file
convertToGear   GearForCLIC   $ILCSOFT/lcgeo/[HEAD]/CLIC/compact/_clic_model/_clic_model.xml   gear_name.xml

  • If the command is not working, probably DDh4hep has been compiled with the option "DD4HEP_USE_GEAR" OFF. In this case:
    • check out the DDh4hep package
    • in file CMakeLists.txt, modify OFF in ON for line: option(DD4HEP_USE_GEAR "Build gear wrapper for backward compatibility" OFF)
    • recompile: cd build/ ; cmake -C $ILCSOFT/ILCSoft.cmake .. ; make install ; cd ../ ;
    • use: path_to_your_local_DDh4ep/bin/convertToGear

Access geometry information

  • Code snapshots for accessing geometry information like B field or subdetector/layer/module information associated to a hit are available at this page: GeoInfo

Installing local copies of DD4hep and LCGeo

ALERT! More Advanced! It is suggested to use one of the provided releases (see next section).

1.) Install the CLICCvmfs

2.) There is a build with geant4 10.1, CLHEP 2.1.4.1 here: _path_to_ilcsoft

If you just need dd4hep you can source: source _path_to_ilcsoft/init_ilcsoft.sh

3.) If you are building your own DD4hep or LCGEO adapt the init script, so it points to your own dd4hep or lcgeo

Then to install for the first time:

svn co https://svnsrv.desy.de/public/aidasoft/DD4hep/trunk dd4hep
svn co https://svnsrv.desy.de/public/ddsim/lcgeo/trunk lcgeo
cd dd4hep; mkdir build; cd build;
cmake \
-D DD4HEP_USE_GEANT4=1 \
-D DD4HEP_USE_BOOST=ON \
-DBoost_NO_BOOST_CMAKE=ON \
-D DD4HEP_USE_LCIO=ON \
-D BUILD_TESTING=On \
-D CLHEP_DIR=$CLHEP \
-D DD4HEP_USE_GEAR=1 \
-DCMAKE_C_COMPILER=`which gcc` \ 
-DCMAKE_CXX_COMPILER=`which g++` ..
# optional flags:
# If you want to use xerces-c add above: -D DD4HEP_USE_XERCESC=ON 
# If you want to specify the Geant4 version: -D Geant4_DIR=$G4INSTALL/lib[64]/Geant4-<VERSION> \ ## this needs to be CHANGED BY HAND
###cmake -DDD4HEP_USE_BOOST=True -DDD4HEP_USE_GEANT4=True -DDD4HEP_USE_LCIO=True -DGeant4_DIR=$G4LIB -DCLHEP_DIR=$CLHEP_BASE_DIR -DLCIO_DIR=$LCIO -DDD4HEP_USE_GEAR=True -DBoost_NO_BOOST_CMAKE=ON ..
make -j3 install; source ../bin/thisdd4hep.sh
cd ../../lcgeo; mkdir build; cd build; cmake -DBoost_NO_BOOST_CMAKE=ON ..;
make install; source ../bin/thislcgeo.sh

After dd4hep was installed once only the environment files need to be sourced.

source yourDD4hepConfig.sh 
#which should include 
source $DD4HEP/bin/thisdd4hep.sh
source $LCGEO/bin/thislcgeo.sh
The DD4HEP or LCGEO variables are not set, they have to be replaced with the proper path.

-- AndreSailer - 2014-11-25

Edit | Attach | Watch | Print version | History: r33 | r31 < r30 < r29 < r28 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r29 - 2016-11-22 - RosaSimoniello
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CLIC All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback