Back to home page

EIC code displayed by LXR

 
 

    


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

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