|
EDEpReader
|
In the intall folder, there will be a lib folder, containing the libEDEPTree.so library, and the include folder, containing all the header files.
The library can be imported and used in any project (I think? I tried only with cmake..).
An example of a CMakeLists file is available in the examples folder, where a simple code is also present.
The EDEPTree library provides a wrapper to the edepsim output. It creates a tree structure with a parent-child relation between all the trajectories in each event. Each trajectory stores information on it own hits and trajectory points (see here for more detaild on what those are).
Four classes are available:
Documentation on each class is available here as doxygen documentation. A brief and not complete description is also provided below.
This class is simply a wrapper of the EDepSim's TG4HitSegment class. It provides getters for each member:
This class is simply a wrapper of the EDepSim's TG4TrajectoryPoint class. It provides getters for each member:
This class stores all the information of the hits and points of a trajectory, as well as providing utilities to get other information on the trajectory, such as having hits at certain times or entering/exiting specific subdetectors. It also stores information on the trajectory that generated this one (the parent), and all the trajectories generated by this one (the children).
Here are the available getters:
Details for all the other functions (what they do, the argumens and what they return) are provided as Doxygen comments in the EDEPTrajectory.cpp file.
This class reads the EDepSim file and constructs the tree structure of parents-children trajectories. It uses iterators to help with the navigation of the tree and also provides utilities to select or filter different samples of trajectories in the tree.
The tree must be initialized first:
This will fill all the trajectories with the corresponding quantities, and will create the parent-child connection between all trajectories.
To navigate the tree, filter the trajectories and so on, different functions are available. Details on each function are available both in the header file and in the source file (EDEPTree.h and EDEPTree.cpp) as doxygen comments. Moreover, the EDEPReader.cpp file provides some example on how to use a tree to select some trajectories or extract their information.
Every time a search for trajectories in the tree fails, the end of the tree or the end of the trajectory is returned. Protecting from accessing the end element is a responsability of the user. Failing to do that will crash the code (that's wanted). This could happen in the EDEPReader example too if the example tries to access not existing trajectories.