Repository navigation
forked from TomasKrizak/TKEvent
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
WARNING!: on 19.12. I uploaded "uncertainty update" which changed the strucutre of data a bit. do not use the updated library on data converted using the old library! WARNING!: on 31.10. I uploaded "ambiguity update" which changed the strucutre of data a bit. do not use the updated library on data converted using the old library! In case this README is missing some important information or is unclear do not hesitate to contact me (Tomáš Křižák) on slack or email - tomas.krizak@cvut.cz =============================================================================== DATA STRUCTURE: =============================================================================== TKEvent is a library made specifically as a tool for development of tracking algorithm however it can do more than that. Class TKEvent extracts most important information about given event and stores them in vectors of smaller objects: - vector of OM hits (TKOHhit), - vector of tracker cell hits (TKTrhit), - vector of tracks (TKtrack). In constrast to RED format these classes can contain some processed information like: - x,y,z coordinates of tracker cell hits (calculated from timestamps and cell number) - radii of tracker cell hits (you can switch drift models) - x,y,z coordinates of OM hits These values however might be improved in the future and are not in their final state yet. It also contains information about geometry of the detector given by a series of constants which might differ from reality - must be taken with caution (work in progress) =============================================================================== TRACK RECONSTRUCTION: =============================================================================== At the moment there are several different versions: 1. reconstruct_single(): This algorithm finds one best possible track for each side of the tracker based on Legendre transform of tracker hits (if the side has at least 3 usable hits - usable means not missing timestamp t0 and has a radius smaller than 35mm). The search invovles uncertainties (Gauss distribution with sigma = 2mm by default). 2. reconstruct_multi(): multi_track version of 1. It is a bit slower but searches for more possible candidates for tracks. 3. reconstruct_ML(): (RECOMMENDED ALGORITHM) Implementation of Maximum likelihood method for tracking. Uses a basic pre-clustering algorithm which filters obvious noise and other noise tracks. Then uses maximum likelihood method on the cluster, providing the most probable solution. In addition it detects all ambiguities and analyticaly computes the mirror track The track is described by four parameters a,b,c,d in form: y = ax + b z = cx + d (x,y,z coordinates corespond to Falaise, origin in center of detector) And equivalently in the form: x(t) = cos(phi)*cos(theta)*t + r*sin(phi) y(t) = sin(phi)*cos(theta)*t - r*cos(phi) z(t) = sin(theta)*t + h Both parametrizations are calculated during the tracking and are convenient for different purposes. If needed, here is the set of transformations: a = tan(phi) b = -r/cos(phi) c = tan(theta)/cos(phi) d = h - r*tan(phi)*tan(theta) phi = atan(a) r = -b/sqrt(a*a+1.0) theta = atan(c/sqrt(a*a+1.0)) h = d - a*b*c/(a*a+1.0) =============================================================================== VISUALIZATION: =============================================================================== TKEvent has two visualization options: 1. Top projection - calling a function 'make_top_projection(int option)' on obejct TKEvent (given event) creates and saves png picture (in '/ANAlYSIS_MACROS/Events_visu/' by default) of the detector from above with highlighted OM hits and tracker cells hits. If tracks were calculated in this event then it depicts them too. 2. 3D visualization - calling a function 'build_event()' on obejct TKEvent creates and saves a root file called 'Run-XXX_event-XXX_3D.root' in '/ANAlYSIS_MACROS/Events_visu/' folder. This stores all basic detector geometry as root geometry objects. Can be then visualized using provided 'visu.cpp' skript in 'ANALASIS_MACROS'. =============================================================================== USAGE OPTIONS: =============================================================================== Class TKEvent can be used in two ways: 1. online on cluster (installation bellow) a) you can use TKEvent objects and functions in your RED scripts (similat as in provided 'red_to_tk' script) b) you can use the 'red_to_tk' script to convert necessary data to root and then simply write root scripts (similar to provided 'load_ev' script in 'ANALYSIS_MACROS' folder) 2. offline on your device (optional but very practical) - requires: installing TKEvent library and RED to TKEvent converter on cluster, installing TKEvent library on your device, converted data on your device - installation: use installation bellow but skip steps 2. and 4. =============================================================================== INSTALLATION: =============================================================================== 1. git clone TKEvent on your cluster environment: $ git clone https://github.com/TomasKrizak/TKEvent.git $ cd TKEvent/ 2. source environment: $ cd RED_to_TK/ for old runs use $ source load_environment.sh for runs 813 and newer use $ source load_environment_new.sh 3. install TKEvent libraby on your cluster: $ cd ../TKEvent/ $ chmod 755 install.sh $ ./install.sh 4. install RED to TKEvent converter: $ cd ../RED_to_TK/ $ chmod 755 install.sh $ ./install.sh (depending on what runs you want to use (0-812 or 813 and higher) keep ".cxx" only in those scripts you will be using) =============================================================================== Mathematical derivation of the maximum likelihood method: =============================================================================== https://www.overleaf.com/read/qpccqmvqfbby#c4c822