Back to home page

EIC code displayed by LXR

 
 

    


Warning, /irt/README.md is written in an unsupported language. File is not indexed.

0001 Indirect Ray Tracing code for ATHENA event reconstruction
0002 =========================================================
0003 
0004   A C++ ROOT-based software library to peform Cherenkov photon ray 
0005 tracing between a loosely defined emission point (which is typically 
0006 unknown in the experiment) and a detection point on a photosensor
0007 matrix, in a configuration with a pre-defined sequence of refractive 
0008 and reflective surfaces. Provides means to perform detailed microscopic 
0009 simulations of Cherenkov imaging detectors in a pure GEANT4 environment, 
0010 as well as an interface to the ATHENA software framework. Given a track 
0011 parameterization along a charged particle trajectory in a sequence of 
0012 Cherenkov radiators, and a collection of single photon hits, allows one 
0013 to perform probabilistic analysis of particle mass hypotheses. 
0014 
0015   Primary application are proximity focusing and / or mirror-focusing RICH 
0016 detectors, with a configurable combination of aerogel and / or gas radiators, 
0017 as well as a set of spherical and / or flat mirrors.  
0018 
0019  Content:
0020 
0021  * [Introduction](#introduction)
0022  * [Prerequisites and installation](#prerequisites-and-installation)
0023  * [pfRICH example configuration](#pfrich-example-configuration)
0024  * [Simulation pass](#simulation-pass)
0025  * [No-juggler reconstruction pass](#no-juggler-reconstruction-pass)
0026  * [Juggler reconstruction pass](#juggler-reconstruction-pass)
0027  * [DRICH case](#drich-case)
0028  * [HEPMC writer](#hepmc-writer)
0029 
0030 <br/>
0031 
0032 Introduction
0033 ------------
0034 
0035   A typical event reconstruction task in a setup with an imaging Cherenkov 
0036 detector is to associate single photon hits with the charged particle tracks, 
0037 and evaluate the Cherenkov light emission angle, which - provided particle 
0038 momentum is evaluated by other means (for instance via tracking) - gives one a probabilistic 
0039 estimate of a particle mass and therefore allows one to e.g. separate charged
0040 pions and kaon in data analysis.
0041 
0042   Current implementation uses MC truth information to associate photon hits and 
0043 tracks, and does not make an attempt to perform either ring finding or noise 
0044 hit suppression in multi-track configurations. Nowehere in the algorithmic
0045 part it tries to reconstruct either average Cherenkov ring radius or average 
0046 emission angle. Instead of that the algorithm just makes an attempt to associate 
0047 *any* detected photon hit with any track, and perform *mass hypothesis ranking* for 
0048 each track. This procedure is supposed to automatically handle random noise, and 
0049 in a typically low track multiplicity environment at the EIC would only require 
0050 a shared hit resolution procedure in addition, to work in an optimal way in case 
0051 of overlapping rings. Well, this needs to be verified of course.
0052 
0053   The CPU overhead is supposed to scale as [N tracks] x [M photon hits], and in 
0054 general can be substantial. Further optimization like detector partitioning in 
0055 independent sectors will be required.
0056 
0057   Output provides estimated photon count and estimated weights for a set of  mass 
0058 hytheses requested by a user.
0059 
0060 <br/>
0061 
0062 Prerequisites and installation
0063 ------------------------------
0064 
0065   It is assumed that a user ia familiar with the [ATHENA software](https://eic.phy.anl.gov/ip6) 
0066 environment, and a juggler singularity container "jug_xl" is running. It is also assumed 
0067 that dd4hep sources are available either via cvmfs or locally, and athena detector software 
0068 is installed. For the sake of completeness, the following sequence of commands installs all what is needed 
0069 under /tmp, assuming that eic-shell was just started, see [ATHENA software](https://eic.phy.anl.gov/ip6) 
0070 for further details:
0071 
0072 ```
0073 # In the following /tmp/ATHENA is supposed to be a *link* to a safe scratch directory
0074 # <your-safe-scratch-area> somewhere on a (local) filesystem:
0075 
0076 cd /tmp && ln -s <your-safe-scratch-area> ATHENA && cd ATHENA
0077 ```
0078 
0079   The rest of the commands in this README can be grabbed by mouse and executed 
0080 block by block.
0081 
0082 ```
0083 # Do not want to mess up with the initial software installation in the container;
0084 unset ATHENA_PREFIX
0085 
0086 export LD_LIBRARY_PATH=/tmp/ATHENA/lib:${LD_LIBRARY_PATH}
0087 
0088 # Install a particular branch of the EIC data model;
0089 cd /tmp/ATHENA
0090 git clone https://eicweb.phy.anl.gov/EIC/eicd.git --branch irt-init-v01
0091 cd eicd && mkdir build && cd build
0092 cmake -DCMAKE_INSTALL_PREFIX=/tmp/ATHENA ..
0093 make -j2 install
0094 ```
0095 
0096 ```
0097 # Install the IRT library itself;
0098 cd /tmp/ATHENA
0099 git clone https://eicweb.phy.anl.gov/EIC/irt.git --branch irt-init-v01
0100 cd irt && mkdir build && cd build
0101 cmake -DCMAKE_INSTALL_PREFIX=/tmp/ATHENA -DEVALUATION=YES ..
0102 make -j2 install
0103 ```
0104 
0105   This compiles the IRT library codes and the executables to be later on used to read the .root
0106 files with the GEANT hits after *npsim* simulation pass. 
0107 
0108 ```
0109 # Install "athena" detector description;
0110 git clone https://eicweb.phy.anl.gov/EIC/detectors/athena.git --branch irt-init-v01
0111 cd athena && mkdir build && cd build
0112 cmake -DCMAKE_INSTALL_PREFIX=/tmp/ATHENA ..
0113 make -j2 install
0114 
0115 # Install "ip6" description;
0116 cd /tmp/ATHENA
0117 git clone https://eicweb.phy.anl.gov/EIC/detectors/ip6.git
0118 cd ip6 && mkdir build && cd build
0119 cmake -DCMAKE_INSTALL_PREFIX=/tmp/ATHENA ..
0120 make -j2 install
0121 
0122 ```
0123 
0124   The rest of this README builds a minimalistic self-contained example of how to make use of the 
0125 IRT library in application to a basic ATHENA e-endcap proximity focusing aerogel RICH.
0126 
0127 
0128 <br/>
0129 
0130 Simulation pass
0131 ---------------
0132 
0133   Create a separate sandbox directory. Generate a minimal set of necessary links. Run *npsim*.
0134 
0135 ```
0136 cd /tmp/ATHENA && mkdir sandbox && cd sandbox
0137 
0138 # Links to the directories with the "official" .xml files (depend on your installation);
0139 ln -s /tmp/ATHENA/share/ip6/ip6 .
0140 ln -s /tmp/ATHENA/share/athena/compact .
0141 
0142 # These two just to simplify 'npsim' command line:
0143 ln -s /tmp/ATHENA/share/athena/compact/pfrich.xml .
0144 ln -s /tmp/ATHENA/share/athena/compact/subsystem_views/pfrich_only.xml .
0145 
0146 # Eventually run 'npsim' for 100 events with 8 GeV pions, in a pfRICH-only geometry;
0147 npsim --compactFile=./pfrich_only.xml --runType=run -G -N=100 --outputFile=./pfrich-data.root --gun.position "0.0 0.0 0.0" --gun.direction "0.2 0.0 -1.0" --gun.energy 8*GeV --gun.particle="pi+" --part.userParticleHandler='' --random.seed 0x12345678 --random.enableEventSeed
0148 
0149 ```
0150 
0151   A pair of ROOT output files is produced: pfRICH detector optics configuration and 
0152 a file with GEANT tracks and photon hits.
0153 
0154 <br/>
0155 
0156 No-juggler reconstruction pass
0157 ------------------------------
0158 
0159   A simplified executable, using the same IRT engine, but with hardcoded (optional) QE 
0160 and low wavelength cutoff.
0161 
0162 ```
0163 cd /tmp/ATHENA/sandbox
0164 # Loop through the events in the raw GEANT4 hit file. See [reader.cc](evaluation/reader.cc)
0165 /tmp/ATHENA/bin/reader pfrich-data.root pfrich-config.root
0166 
0167 ```
0168 
0169 Juggler reconstruction pass
0170 ---------------------------
0171 
0172   Install Juggler first:
0173 
0174 ```
0175 cd /tmp/ATHENA
0176 git clone https://eicweb.phy.anl.gov/EIC/juggler.git --branch irt-init-v01
0177 cd juggler && mkdir build && cd build
0178 cmake -DCMAKE_INSTALL_PREFIX=/tmp/ATHENA ..
0179 
0180 # Fix an issue with LD_LIBRARY_PATH in jugglerenv.sh; may be required more than once (?);
0181 sed -i.bak 's/\:\/usr\/local\/lib\:/\:/g' jugglerenv.sh && echo "export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/usr/local/lib && export PYTHONPATH=\${PYTHONPATH}:/usr/local/lib" >> jugglerenv.sh
0182 # Compile with a single thread unless have a plenty of memory;
0183 make -j1 install
0184 
0185 ```
0186 
0187 ```
0188 cd /tmp/ATHENA/sandbox
0189 # Run Juggler with a simplified pfrich-testIRT.py options file provided with IRT distribution; 
0190 xenv -x ../Juggler.xenv gaudirun.py ../irt/pfrich-testIRT.py
0191 
0192 # Loop through the events in the reconstructed file. See [evaluation.cc](evaluation/evaluation.cc)
0193 /tmp/ATHENA/bin/evaluation pfrich-reco.root
0194 
0195 ```
0196 
0197 DRICH case
0198 ----------
0199 
0200 It is assumed that 'athena/ip6/compact' links in /tmp/ATHENA/sandbox directory are created already.
0201 The rest is pretty much similar to the pfRICH case, except for perhaps a .C script usage instead 
0202 of a .cc executable:
0203 
0204 ```
0205 cd /tmp/ATHENA/sandbox
0206 ln -s /tmp/ATHENA/share/athena/compact/drich.xml .
0207 ln -s /tmp/ATHENA/share/athena/compact/subsystem_views/drich_only.xml .
0208 ```
0209 
0210 ```
0211 npsim --compactFile=./drich_only.xml --runType=run -G -N=500 --outputFile=./drich-data.root --gun.position "0.0 0.0 0.0" --gun.direction "0.27 0.0 1.0" --gun.energy 12*GeV --gun.particle="pi+" --part.userParticleHandler='' --random.seed 0x12345678 --random.enableEventSeed
0212 ```
0213 ```
0214 xenv -x ../Juggler.xenv gaudirun.py ../irt/drich-testIRT.py
0215 root -l '../irt/scripts/evaluation.C("drich-reco.root")'
0216 ```
0217 
0218 HEPMC writer
0219 ------------
0220 
0221 It is of course way more convenient to create a .hepmc file with a collection of events / tracks, 
0222 than to use a limited in functionality npsim command line interface. Here is an example:
0223 
0224 ```
0225 cd /tmp/ATHENA/sandbox
0226 root -l '../irt/scripts/drich-hepmc-writer.C("drich-data.hepmc", 300)'
0227 
0228 npsim --compactFile=./drich_only.xml --runType=run -G -N=300 --inputFiles ./drich-data.hepmc --outputFile=./drich-data.root --part.userParticleHandler='' --random.seed 0x12345678 --random.enableEventSeed
0229 
0230 xenv -x ../Juggler.xenv gaudirun.py ../irt/drich-testIRT.py
0231 root -l '../irt/scripts/evaluation.C("drich-reco.root")'
0232 ```