<p><head> <link href="web/DD4hepMarkdown.css" rel="stylesheet"></link> </head></p> <p><body></p> <div id="titlearea"> <table class="header"> <tbody> <tr> <td id="projectlogo"><img alt="Logo" src="LaTex/CERN-logo.png" height="72"/></td> <td id="projectlogo"><img alt="Logo" src="LaTex/DD4hep-AIDA-logo.png" height="72"/></td> <td id="projectbrief">DD4hep<br>The AIDA detector description toolkit</br> for high energy physics experiments</br></td> </tr> </tbody> </table> </div> <hr /> <div class="space"></div> <div class="title"> DD4hep <br> <br> Starter's Guide </div> <div class="space"></div> <div class="abstract_title">Abstract</div> <div class="space"></div> <div class="abstract"> This starter's guide contains the basic information about <it>DD4hep</it>. This is the license information, instruction to obtain and build the software as well as suggestions of further reading concerning the various <it>DD4hep</it> subpackages. </div> <div class="space"></div> <div class="space"></div> <p></body></p> <hr /> <h1><em>DD4hep</em> Project Information</h1> <hr /> <h2>The <em>DD4hep</em> Project Web</h2> <p>The project's welcome page can be found under the folling URL: <a href="http://aidasoft.web.cern.ch/DD4hep">http://aidasoft.web.cern.ch/DD4hep</a></p> <p><strong><em>Please note:</em></strong> To access the CERN intranet, to create new bugs in the <em>DD4hep</em> bug tracker etc, you require a CERN account, but you can create an external account very easily following <a href="https://account.cern.ch/account/Externals/RegisterAccount.aspx">these instructions</a>.</p> <h2>The <em>DD4hep</em> Developers Mailing List</h2> <p>Mailing list to contact developers is: <strong>dd4hep-developers@cern.ch</strong>.</p> <p>The mailing list archives can be consulted using the following <a href="https://groups.cern.ch/group/dd4hep-developers/Lists/Archive/100.aspx">URL</a>.</p> <h2>The <em>DD4hep</em> Issue Tracker</h2> <p>Bug tracking and issue solving as well as feature requests may be addressed to the developers using the following <a href="http://sft.its.cern.ch/jira/browse/DDFORHEP">web-portal</a>.</p> <p><strong><em>Please note:</em></strong> Please stay calm if you do not receive a response within the next 25 nano-seconds. Most of the contributors also have other assignments!</p> <h2>License</h2> <p><em>DD4hep</em> is made available under the GPL license. For full details see the file LICENSE in the <em>DD4hep</em> distribution or at the following <a href="http://svnsrv.desy.de/viewvc/aidasoft/DD4hep/trunk/LICENCE?view=markup">URL</a>.</p> <hr /> <h1>Building and Installing <em>DD4hep</em></h1> <hr /> <p>The <em>DD4hep</em> software is distributed for each release in the form of </p> <pre><code>* Precompiled tar-balls, where users only untar the downloaded software. * As source distribution, which may be downloaded from the central repository at Desy. </code></pre> <h2>Release Versioning</h2> <p>Currently <em>DD4hep</em> is released several times a year depending on the importance of new functionality. The versioning schema consists of two digits in the form:</p> <p>vXX-YY,</p> <p>where XX denotes the major release tag and YY the minor release tag. We currently do not support patches, since the project is still quite young and the binary compatibility is broken with each release.</p> <p>Code changes, which require clients to modify existing code are getting rare, since the main package <em>DD4hep</em> is maturing.</p> <h2>Supported Platforms</h2> <p>List of supported platforms (operating system + compiler):</p> <pre><code> - SLC 6 - MacOS (with low priority though) </code></pre> <p>Declined operating systems:</p> <pre><code> - Microsoft Windows. </code></pre> <p>In principle <em>DD4hep</em> does not depend dramatically on specific operating systems. In principle any compiler modern enough to support <strong>C++11</strong> may should be capable of building <em>DD4hep</em>. There are some <strong><em>C++ABI</em></strong> issues, which may have to be sorted out for non-gcc platforms, but most of this work was done for MacOS and it should be feasible to solve these problems for other platforms as well.</p> <h2>README</h2> <p>First glance information may be taken from the readme file at the following <a href="http://svnsrv.desy.de/viewvc/aidasoft/DD4hep/trunk/ReadMe.txt">location</a>.</p> <h2>Prerequisites</h2> <p><em>DD4hep</em> depends on a number of "external" packages. The user will need to install these in his/her system before building and running the examples. Depending on the usage of <em>DD4hep</em> and it's subpackages software of other projects is used. The configuration options are described later in this document.</p> <ul> <li><em>DD4hep</em> uses the <em>CMake</em> build system. A recent version (version 2.8 or higher) of <a href="#bib_cmake"><em>CMake</em></a> must be installed.</li> <li><em>DD4hep</em> itself depends on the <a href="#bib_ROOT-tgeo">ROOT geometry package</a> <strong>Tgeo</strong> and in turn on the basic <a href="#bib_ROOT">ROOT libraries</a>. Version 5.30 or higher is required.</li> <li><em>DD4hep</em> uses the <a href="#bib_boost"><em>Boost-Spirit</em></a> implementation to interprete input and options.</li> <li>Optionally <em>DD4hep</em> can use <a href="#bib_xerces"><em>Xerces-C</em></a> as a parser for XML input. By default it uses <a href="#bib_tinyxml"><em>TinyXML</em></a>, which is included in the <em>DD4hep</em> release.</li> <li>The subpackages for alignment DDAlign, conditions data \DDC and event display <em>DDEve</em> do not require additional external libraries.</li> <li>The simulation extensions extension <em>DDG4</em> in addition depends on a valid <a href="#bib_geant4"><em>Geant4</em></a> installation. Version 9 and 10 of Geant4 is supported.</li> </ul> <p>If <em>DD4hep</em> is not installed in the system name-space (/usr/bin, /usr/lib, etc.) any number of <em>DD4hep</em> versions can exist in parallel.</p> <h2>Package Contents</h2> <p>The <em>DD4hep</em> project consists of several packages. The idea has been to separate the common parts of the detector description toolkit from concrete detector examples. </p> <p><strong>DDCore</strong>: Contains the definition of the basic classes of the toolkit: Handle, DetElement, Volume, PlacedVolume, Shapes, Material, etc. Most of these classes are "handles" to ROOT TGeom classes. The package provides the basic mechanisms for constructing the "Generic Detector Description Model" in memory from XML compact detector definition files.</p> <p><strong>DDG4</strong>: Is the package that contains the conversion of <em>DD4hep</em> geometry into Geant4 geometry to be used for simulation.</p> <p><strong>DDAlign</strong>: The DDAlign toolkit implements a modular and flexible approach to introduce and access the alignment parameters in <em>DD4hep</em> geometry descruptions.</p> <p><strong>DDCond</strong>: Support for conditions data for <em>DD4hep</em>.</p> <p><strong>DDEve</strong>: <em>DDEve</em> provides an event display for detector geometries implemented using <em>DD4hep</em>. <em>DDEve</em> hereby takes advantage of the TEve toolkit naturally provided by the ROOT framework like the ROOT geometry toolkit TGeo. </p> <p><strong>examples</strong>: Contains different detector examples (CLICSiD, AlignDet, ClientTests) together with example applications to illustrate the their usage for simulation, reconstruction and visualization with an emphasis to minimize software dependencies. For instance, the simulation application example will require to compiler and link against Geant4 but not the reconstruction application.</p> <h2>Installing <em>DD4hep</em> from Precompiled Binaries</h2> <p>The binaries are available for downloading from afs under the following location: <strong>to be done, currently not available....</strong>. </p> <p>Once downloaded you need to unzip and de-tar the file. For example, if you have downloaded the debug version of <em>DD4hep</em> v00-13 for Linux-SLC6: <code> % gunzip dd4hep-v00-13-slc6-gcc4.8-dbg.tar.gz % tar xvf dd4hep-v00-13-slc6-gcc4.8-dbg.tar.gz </code></p> <p>This will create the directory root. Before getting started read the file ReadMe.txt. Also, read the Introduction chapter for an explanation of the directory structure.</p> <p><strong>TO BE DONE !!!</strong></p> <h2>Access and Build <em>DD4hep</em> from the Repository</h2> <p>The following sections explain how to obtain a usable binary build of the <em>DD4hep</em> software.</p> <h3>Downloading the Code from the Repository</h3> <p>You can use the Subversion (svn) source code version control system and check out the most recent source. The compressed file is a one time only choice; every time you would like to upgrade you will need to download the entire new version.</p> <p>The <em>DD4hep</em> code is accessible in anonymous read-only mode by anybody from the svn repository at <strong>Desy</strong>: <code> % svn co https://svnsrv.desy.de/basic/aidasoft/DD4hep/trunk % mv trunk DD4hep_src </code></p> <h3>Installing the Source from Subversion</h3> <p>This paragraph describes how to checkout and build <em>DD4hep</em> from a checkout using subversion for Unix-like systems: <code> % mkdir DD4hep_install % mkdir DD4hep_build % export DD4hepINSTALL=<code>pwd</code>/DD4hep_install % cd DD4hep_build % cmake -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=\${DD4hepINSTALL} \ [option [option]] ... % make install </code> Possible additional options for the cmake build system are described in the following section.</p> <p><strong><em>Note:</em></strong> You might have to update your environment beforehand to have all needed libraries in the shared lib search path (this will vary with OS, shell, etc.) e.g: <code> % . /data/ilcsoft/geant4/9.5/bin/geant4.sh % export CLHEP_BASE_DIR="/data/ilcsoft/HEAD/CLHEP/2.1.0.1" % export LD_LIBRARY_PATH="$CLHEP_BASE_DIR/lib:$LD_LIBRARY_PATH" </code></p> <h3>CMake Configuration Options</h3> <p>We describe in the following only options, which are unique to the build of <em>DD4hep</em>. Boolean values are either <strong>ON</strong> or <strong>OFF</strong> to enable or disable a feature.</p> <table class="cmake_var"> <tr><td colspan=2 class="cmake_desc">DD4hep_ROOT=<directory></td></tr> <tr><td class="item">Function: </td><td> Location of the *DD4hep* installation directory.</td></tr> </table> <table class="cmake_var"> <tr><td colspan=2 class="cmake_desc">DD4HEP_USE_GEANT4=<boolean></td></tr> <tr><td class="item">Default: </td><td> OFF </td><tr> <tr><td class="item">Function: </td><td> Steer the building of the Geant4 interface *DDG4*.</td></tr> <tr><td class="item">Optional: </td><td> By default no simulation support is enabled.</td></tr> <tr><td class="item">Remark: </td><td> If enabled the variable <bf>Geant4_ROOT</bf>=<directory></td></tr> <tr><td class="item"> </td><td> must point to a valid Geant4 installation directory.</td></tr> <tr><td class="item">Remark: </td><td> if Geant4 was built with external CLHEP, add: -DCLHEP_DIR=_path_to_CLHEP </table> <table class="cmake_var"> <tr><td colspan=2 class="cmake_desc">DD4HEP_USE_BOOST=<boolean></td></tr> <tr><td class="item">Default: </td><td> OFF </td></tr> <tr><td class="item">Function: </td><td> Steer the usage of <bf>boost::spirit</bf> as option parser for *DDG4*. </td></tr> <tr><td class="item">Optional: </td><td> Optional setting with the following caveat. </td></tr> <tr><td class="item"> </td><td> De-facto mandatory for the python interface to *DDG4* as well as Geant4 interactive </td></tr> <tr><td class="item"> </td><td> use of the of the *DDG4* components. </td></tr> <tr><td class="item">Remark: </td><td> If enabled, boost software must be installed and found within the CMAKE_MODULE_PATH. </td></tr> </table> <table class="cmake_var"> <tr><td colspan=2 class="cmake_desc">DD4HEP_USE_XERCESC=<boolean> </td></tr> <tr><td class="item">Default: </td><td> OFF </td></tr> <tr><td class="item">Function: </td><td> Steer the usage of <bf>Xerces-C</bf> as xml file parser. </td></tr> <tr><td class="item">Optional: </td><td> Default is set to use <bf>TinyXML</bf>. </td></tr> <tr><td class="item">Remark: </td><td> If enabled, the variable XERCESC_ROOT_DIR=<directory> must point to a valid </td></tr> <tr><td class="item"> </td><td> <bf>Xerces-C</bf> installation directory.</td></tr> </table> <table class="cmake_var"> <tr><td colspan=2 class="cmake_desc">DD4HEP_USE_LCIO=<boolean> </td></tr> <tr><td class="item">Default: </td><td> OFF </td></tr> <tr><td class="item">Function: </td><td> Steer the usage of <bf>lcio</bf> I/O engine used by the linear collider community. </td></tr> <tr><td class="item">Optional: </td><td> By default no <bf>lcio</bf> support is enabled. </td></tr> <tr><td class="item">Remark: </td><td> If enabled, the variable LCIO_DIR=<directory> must point to a valid <bf>lcio</bf> installation directory.</td></tr> </table> <table class="cmake_var"> <tr><td colspan=2 class="cmake_desc">BUILD_TESTING=<boolean> </td></tr> <tr><td class="item">Default: </td><td> OFF </td></tr> <tr><td class="item">Function: </td><td> Build *DD4hep* tests. </td></tr> </table> <table class="cmake_var"> <tr><td colspan=2 class="cmake_desc">DD4HEP_USE_CXX11=<boolean> </td></tr> <tr><td class="item">Default: </td><td> OFF </td></tr> <tr><td class="item">Function: </td><td> Steers the compilation to use the <bf>C++11</bf> standard. </td></tr> <tr><td class="item"> </td><td> Otherwise the <bf>C++98</bf> standard is enabled by default. </td></tr> </table> <table class="cmake_var"> <tr><td colspan=2 class="cmake_desc">DD4HEP_USE_PYROOT=<boolean> </td></tr> <tr><td class="item">Default: </td><td> OFF </td></tr> <tr><td class="item">Function: </td><td> Steer the usage of <bf>PyROOT</bf> *DD4hep* detector construction. </td></tr> <tr><td class="item">Remark: </td><td> <bf>DEPRECATED</bf>. Purely historical and unsupported. </td></tr> </table> <h3>Run-time Environment</h3> <p>During the build a shell script is generated and copied to the installation area called "thisdd4hep.(c)sh". To setup the runtime and build environment for layered software using <em>DD4hep</em> this script musty be source'd.</p> <h3>Using <em>DD4hep</em> in Layered Software as a Client</h3> <p>It is necessary to setup the <em>DD4hep</em> runtime environment before the configuration of the client software. In the installation directory the cmake build instructions <strong>DD4hepConfig.cmake</strong> are generated, to be used for the cmake configuration of the client software. Cmake should pick-up the build instructions automatically.</p> <h3>Relocation of the Installation directory</h3> <p>Once build, <em>DD4hep</em> can be tar'ed and/or moved to any other directory. The instructions for the usage by layered client software stay intact.</p> <p><strong>TO BE DONE !!!!!</strong></p> <h3>Example Build Script</h3> <p>The following commands may be used to build <em>DD4hep</em> from the <a href="http://svnsrv.desy.de/viewvc/aidasoft/DD4hep/trunk/doc/example_build_script.sh">script in the svn repository</a>.</p> <pre> #!/bin/bash # # ==== User configuration ========================================= # Set here the proper installation directories of the pre-requisites # ================================================================== SW=~/SW MY_ROOT=${SW}/root_v5.34.25_dbg MY_GEANT4=${SW}/g4_10.01.p02_dbg MY_LCIO=${SW}/lcio/v02-04-03 MY_XERCES=${SW}/xerces-c-3.1.1 MY_DD4HEP=`pwd`/DD4hep_tmp2 # ================================================================== # From here on all should be box-standard # ================================================================== . ${MY_ROOT}/bin/thisroot.sh . ${MY_GEANT4}/bin/geant4.sh # Remove line if no DDG4 mkdir -p ${MY_DD4HEP}/build mkdir -p ${MY_DD4HEP}/install cd ${MY_DD4HEP} svn co https://svnsrv.desy.de/basic/aidasoft/DD4hep/trunk cd build cmake -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=${MY_DD4HEP}/install \ -DCMAKE_MODULE_PATH=${MY_DD4HEP}/install \ -DDD4HEP_USE_XERCESC=ON -DXERCESC_ROOT_DIR=${MY_XERCES} \ -DDD4HEP_USE_BOOST=ON \ -DDD4HEP_USE_GEANT4=ON -DGeant4_ROOT=${MY_GEANT4} \ -DDD4HEP_USE_LCIO=ON -DLCIO_DIR=${MY_LCIO} \ ../trunk # Build and install make -j 6 install # Move to installation and setup runtime environment cd ${MY_DD4HEP}/install . bin/thisdd4hep.sh export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MY_LCIO}/lib # Run Examples.... python examples/DDG4/examples/CLICSidSimu.py </pre> <p><strong>Notes:</strong></p> <ul> <li>If Geant4 is not available or undesired remove lines 8 and 28.</li> <li>If you want to use <strong>TinyXML</strong> instead of <strong>Xerces-C</strong> remove lines 10, and 27.</li> <li>If LCIO I/O is not available or undesired remove lines 9, 29 and 39.</li> </ul> <hr /> <h1><em>DD4hep</em> Documentation</h1> <hr /> <p>General build information is provided by <a href="http://svnsrv.desy.de/viewvc/aidasoft/DD4hep/trunk/doc/DD4hepStarter.pdf">this document</a>: In addition all sub-packages of the <em>DD4hep</em> toolkit provide documentation in the form of manuals.</p> <p>Suggestions (or better improvements) of user documentation of packages being validated are highly welcome. Please contact the developers using the <em>DD4hep</em> mailing list. If a package is under development and not offered to the public, please ignore the package and it's errors unless you are eager to contribute.</p> <h2><em>DD4hep</em> User's Guide</h2> <p>The <em>DD4hep</em> guide is part of the distribution and the <a href="http://svnsrv.desy.de/viewvc/aidasoft/DD4hep/trunk/doc/DD4hepManual.pdf">svn repository</a>. <br>Author: M.Frank</p> <h2><em>DDAlign</em> User's Guide</h2> <p>The DDAlign guide is part of the distribution and the <a href="http://svnsrv.desy.de/viewvc/aidasoft/DD4hep/trunk/doc/DDAlignManual.pdf">svn repository</a>. <br>Author: M.Frank</p> <p><strong>Note:</strong> This package is under development. The guide is very rudimentary.</p> <h2><em>DDCond</em> User's Guide</h2> <p>The <em>DDCond</em> guide is part of the distribution and the <a href="http://svnsrv.desy.de/viewvc/aidasoft/DD4hep/trunk/doc/DDCondManual.pdf">svn repository</a>.</p> <p><strong>Note:</strong> This package is under development. The guide is very rudimentary.</p> <h2><em>DDEve</em> User's Guide</h2> <p>The DDEve guide is part of the distribution and the <a href="http://svnsrv.desy.de/viewvc/aidasoft/DD4hep/trunk/doc/DDEveManual.pdf">svn repository</a>.</p> <p><strong>Note:</strong> This package is not officially part of <em>DD4hep</em> and in addition under development. The guide is very rudimentary.</p> <h2><em>DDG4</em> User's Guide</h2> <p>The <em>DDG4</em> guide is part of the distribution and the <a href="http://svnsrv.desy.de/viewvc/aidasoft/DD4hep/trunk/doc/DDG4Manual.pdf">svn repository</a>. <br>Author: M.Frank</p> <h2><em>DDRec</em> User's Guide</h2> <p>The <em>DDRec</em> guide is part of the distribution and the <a href="http://svnsrv.desy.de/viewvc/aidasoft/DD4hep/trunk/doc/DDRecManual.pdf">svn repository</a>. <br>Author: F.Gaede</p> <h2>Reference Manual</h2> <p>An up to date build of the code documentation compiled using <a href="#bib_doxygen">Doxygen</a> can be found at the <a href="http://test-dd4hep.web.cern.ch/test-dd4hep/doxygen/html/index.html">following URL</a>.</p> <h2>Testing and Nightly builds</h2> <p>A <a href="http://aidasoft.desy.de/CDash/index.php"><em>CDash</em> installation</a> provides daily information about the the current status of the software in the svn trunk.</p> <hr /> <h1>How to contribute</h1> <hr /> <p><em>DD4hep</em> was started by me in the year 2012 in response of the needs of the linear collider community (ILD, CLIC) for a flexible detector geometry usable to develop tracking code. This development relatively quickly emerged into desire to actually obtain a complete description of the entire detector spanning not only the geometrical part, but "everything" required to process the data from particle collisions including provision to support all sorts of conditions data and alignment data. Obviously the simulation of particle collisions should more or less come with it for free and - of course - once simulated, the results want to be visualized.</p> <p>These initial requirement led to a substantial development, which however is not complete and always wants to be improved - and if only to be adapted to new compiler versions. For this reason additional effort from the emerging user community is highly welcome. If you are convinced by the concept, but lack some functionality and are willing to add this as a contribution you are more then welcome. If your changes affect the basic design I would appreciate to be contacted in advance for a brief discussion of your plans.</p> <p><em>DD4hep</em> is supposed to quickly enable users to develop test and simulate the physics response of new detector models and concepts. Although a certain palette of such subdetectors concepts is provided in the <strong>DDDetectors</strong> package, the palette is not complete. I would like to encourage users to contribute missing subdetector designs such e.g. RICH detectors provided the design is modular and flexible so it can be picked up by the community.</p> <p>The same argument obvious applies to the development of new or more detailed sensitive detector concepts for the <em>DDG4</em> package.</p> <h2>Contributors</h2> <p>In the <a href="http://svnsrv.desy.de/viewvc/aidasoft/DD4hep/trunk/doc/CREDITS">CREDITS file</a> the most important contributors to the <em>DD4hep</em> project and a short description of their work can be found. If you think you should be part of this list, but somehow got forgotten, please contact us.</p> <hr /> <h1>Conclusions</h1> <hr /> <p>No a lot to be said: <strong>Good luck! ... and have fun!</strong>.</p> <div class="space"></div> <h2>References</h2> <table> <tr><td>[1]</td><td> <div id="bib_DD4hep"><a href="http://aidasoft.web.cern.ch/DD4hep">DD4hep web page</a>.</div> </td></tr> <tr><td>[2]</td><td> <div id="bib_ROOT-tgeo">R.Brun, A.Gheata, M.Gheata, "The ROOT geometry package",<br> Nuclear Instruments and Methods A 502 (2003) 676-680.</div> </td></tr> <tr><td>[3]</td><td> <div id="bib_ROOT">R.Brun et al., "Root - An object oriented data analysis framework",<br> Nuclear Instruments and Methods A 389 (1997) 81-86.</div> </td></tr> <tr><td>[4]</td><td> <div id="bib_cmake">Welcome to CMake, the cross-platform, open-source build system, <a href="www.cmake.org">www.cmake.org</a>.</div> </td></tr> <tr><td>[5]</td><td> <div id="bib_boost">Boost C++ Libraries, <a href="www.boost.org">www.boost.org</a>.</div> </td></tr> <tr><td>[6]</td><td> <div id="bib_xerces">The Apache Xerces Project, <a href="xerces.apache.org">xerces.apache.org</a>.</div> </td></tr> <tr><td>[7]</td><td> <div id="bib_tinyxml">TinyXML, <A href="http://www.grinninglizard.com/tinyxml">webpage</a>.</div> </td></tr> <tr><td>[8]</td><td> <div id="bib_geant4">S. Agostinelli et al., "Geant4 - A Simulation Toolkit",<br> Nuclear Instruments and Methods A 506 (2003) 250-303.</div> </td></tr> <tr><td>[9]</td><td> <div id="bib_doxygen"></a>Doxygen: Generate documentation from source code. <a href="www.doxygen.org">www.doxygen.org</a>.</div> </td></tr> </table> <div class="space"></div> <hr /> <div class="space"></div> <table class="doc_history"> <tbody> <tr><td colspan="3">Document History</td></tr> <tr class="doc_desc"><td>Document Version</td><td>Date </td><td>Author</td></tr> <tr><td>1.0 </td><td>19/07/2015</td><td> Markus Frank CERN/LHCb</td></tr> <tr><td>1.1 </td><td>31/08/2015</td><td> Markus Frank CERN/LHCb</td></tr> </tbody> </table>