Getting Started with SiD DD4HEP

At the moment, our code is committed to the DESY SVN repository, where the core DD4hep software and the CLIC and ILD models are stored as well. This is to make it easier to include SiD in the standard tests. The latest/work version is labelled SiD_o1_v03. The XML configuration is located in lcgeo/SiD/compact/SiD_o1_v01 and the C++ drivers are located in lcgeo/detector/

Browse or check out the code via

If needed for read access, a new basic account can be registered for anyone, by anyone else who has a grid certificate, at

Important version notes

We are running on SL6 machines and haven't tried other architectures. Note that you must have cvmfs installed (ask your local sysadmin). Latest update was on 5 Sept 16, using the latest ilcsoft release v01-17-10 for everything.

Building the detector model (lcgeo)

Download the code and remove some unneeded ILD drivers (these first five steps are to be done one time only):

svn co lcgeo
rm lcgeo/detector/calorimeter/SHcal*
rm lcgeo/detector/calorimeter/SEcal*
rm lcgeo/detector/CaloTB/CaloPrototype*
mkdir lcgeo/build

Setup the environment (these steps will have to be repeated at the beginning of every session):

source /cvmfs/
source /cvmfs/
cd lcgeo/build/

Prepare the build environment (note the ending double-dots!):

cmake -DCMAKE_CXX_COMPILER=`which g++` -DCMAKE_C_COMPILER=`which gcc` -C /cvmfs/ ..

Build the code with

make -j4
make install

You will now have to update your environment to include the newly created apps

source ../bin/

Modifying the code

If you modify the detector model, lcgeo needs to be rebuilt.

If you add, remove, or move files from the directories, you have to rerun cmake as above (note the double-dots .. at the end)

cmake -DCMAKE_CXX_COMPILER=`which g++` -DCMAKE_C_COMPILER=`which gcc` -C /cvmfs/ ..
If you edit files (source code) you need re-run make:
make -j4
make install
(or simply make -j4 install)

Running simulation and reconstruction

To run the code, you have to initialise your environment at the beginning of your work session (i.e. when starting a new shell, after ssh). Remember that you also have to rebuild the code in case you modify any of the source files. If you've just built lcgeo as above, you've already initialised your environment, so you can skip the next subsection.

Session initialisation

You must run these commands at the beginning of every session:

source /cvmfs/
source /cvmfs/
source bin/

Depending on your system, you might have to type the following 7 commands

export LCGRELEASES=/cvmfs/
export PYTHONDIR=/cvmfs/
export PATH=/cvmfs/$PATH
export PYTOOLSDIR=/cvmfs/

Running simulation

Assuming you are in the lcgeo directory, and that you have initialised your session as above, do

python example/
ddsim --compactFile=SiD/compact/SiD_o1_v01/SiD_o1_v03.xml --runType=batch --inputFile mcparticles.slcio -N=1 --outputFile=testSiD_o1_v03.slcio

Then to inspect the output use:

dumpevent testSiD_o1_v03.slcio 1
anajob testSiD_o1_v03.slcio

Running reconstruction

Use the latest SiDReconstruction.xml attached to this twiki page, after you have edited the LCIOInputFiles and DD4hepXMLFile parameters for your local area. You also need to have the basic gear_sid.xml file (attached to this twiki page as well) in your directory. Assuming you are in the lcgeo directory, and you have initialised your session as above, run

Marlin SiDReconstruction_v03_160711.xml

Visualizing the output using CED

Note that for the event display to work I had to ask my local sysadmin to install freeglut (e.g. for SLC6, freeglut-2.6.0-1.el6.x86_64) so that the library was available. Point to a CED installation with glced:

export PATH=/cvmfs/$PATH

This needs a few extra parameters that were missing from the SiD_o1_v03.xml in v01-17-10, so put the modified SiD_o1_v03a.xml attached to this page in your local lcgeo/SiD/compact/SiD_o1_v01/ directory. You may need to make the following environment modification, depending on your local machine and how you connect to it:


Then run, assuming you are still in the lcgeo directory:

ced2go -d SiD/compact/SiD_o1_v01/SiD_o1_v03.xml sitracks.slcio

Analysing the output

We could run a simple analysis and draw a few plots. For this let us re-run ddsim and ddreco with a few more events

ddsim --compactFile=SiD/compact/SiD_o1_v01/SiD_o1_v03.xml --runType=batch --inputFile mcparticles.slcio -N=1000 --outputFile=SiD_o1_v03.slcio
Marlin SiDReconstruction_v03_160711.xml
Now the files SiD_o1_v03.slcio contains 1000 events.

Our example analysis code can be found here, and it will contain

Assuming you are in the lcgeo directory, and you have initialised your session as above, let us compile the example with:
cd Tracking
mkdir build lib
cd build
cmake -DCMAKE_CXX_COMPILER=`which g++` -DCMAKE_C_COMPILER=`which gcc` \
  -DILCUTIL_DIR=/cvmfs/ -C $ILCSOFT/ILCSoft.cmake ..
make -j4 install

Now we run processor with

cd ../
export MARLIN_DLL=$MARLIN_DLL:./lib/
Marlin HitResiduals.xml
This will produce a file named hitresiduals.root which contains the results.
Topic attachments
I Attachment History Action Size Date Who Comment
XMLxml SiDReconstruction_v03_160711.xml r1 manage 38.1 K 2016-07-11 - 15:16 AidanRobson  
XMLxml SiD_o1_v03a.xml r1 manage 8.4 K 2016-09-07 - 11:27 AidanRobson minor modified SiD_o1_v03.xml for ced event display
XMLxml gear_sid.xml r1 manage 0.3 K 2016-09-05 - 13:47 AidanRobson basic gear file to satisfy reconstruction
Edit | Attach | Print version | History: r28 | r12 < r11 < r10 < r9 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r10 - 2016-09-19 - DanProtopopescu
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback