The [edep-sim](https://github.com/ClarkMcGrew/edep-sim/blob/master/README.md) output format is summarized [here](uploads/9a5d48ec15fb723145d08ec485a62149/Edep-sim_output.pdf).
The [edep-sim](https://github.com/ClarkMcGrew/edep-sim/blob/master/README.md) output format is summarized [here](uploads/9a5d48ec15fb723145d08ec485a62149/Edep-sim_output.pdf). The units used by edep-sim are mm for space position, ns for time and MeV for enegy.
***STT***
------------------------------------------------
**Hit**
The hit struct represent the segment along which a particle's energy deposit occurs inside the sensible volume (i.e. the gas) of the STT detector. It has one-to-one relation with objects of the class *[TG4HitSegment](https://github.com/ClarkMcGrew/edep-sim/blob/master/README.md#the-energy-deposition-class-and-friends)* corresponding to the STT hit collection.
| type | name | description |
| Type | Name | Description |
| ------ | ------ | ------ |
| std::string | det | Name of the volume where the energy deposit occurs. The reference geoemtry is *EDepSimGeometry* in the input edep-sim file |
| double | x1 | X cordinate of the start point of the segment |
| double | y1 | Y cordinate of the start point of the segment |
| double | z1 | Z cordinate of the start point of the segment |
| double | t1 | time cordinate of the start point of the segment |
| double | x2 | X cordinate of the end point of the segment |
| double | y2 | Y cordinate of the end point of the segment |
| double | z2 | Z cordinate of the end point of the segmen |
| double | t2 | Time cordinate of the end point of the segment |
| double | de | Energy deposit |
| int | pid | Index of the particle producing the hit. It corresponds to `TG4HitSegment::PrimaryId` |
| int | index | Hit index. It corresponds to the position of the corresponding TG4HitSegment in the `vector<TG4HitSegment>` corresponding to the STT hit collection |
**Digit**
The digit represents (or at least should) the real response of the straw tube. It has a many-to-one relation with the hit. Hits produced by the same particle on the same sensible detector are *merged*. All the hits produced by the same particle in the same sansible detector are time ordered.
* The space position of the digit is the mean point of the segment joining the start point of the first hit with the end point of the last hit.
* The time of the digit is the time of the start point of the first hit.
* The energy deposit is the sum of the energy deposits of the hits.
| Type | Name | Description |
| ------ | ------ | ------ |
| std::string | det | Name of the volume where the energy deposit occurs. The reference geoemtry is *EDepSimGeometry* in the input edep-sim file. |
| double | x1 | X cordinate of the start point of the segment in mm |
| double | y1 | Y cordinate of the start point of the segment in mm |
| double | z1 | Z cordinate of the start point of the segment in mm |
| double | t1 | time cordinate of the start point of the segment in s |
| double | x2 | X cordinate of the end point of the segment in mm |
| double | y2 | Y cordinate of the end point of the segment in mm |
| double | z2 | Z cordinate of the end point of the segment in mm |
| double | t2 | Time cordinate of the end point of the segment in s |
| double | de | Energy deposit in MeV |
| int | pid | Index of the particle producing the hit. It corresponds to `TG4HitSegment::PrimaryId`. |
| int | index | Hit index. It corresponds to the position of the corresponding TG4HitSegment in the `vector<TG4HitSegment>` corresponding to the STT hit collection. |
\ No newline at end of file
| std::string | det | Name of the volume where the energy deposit occurs. The reference geoemtry is *EDepSimGeometry* in the input edep-sim file |
| double | x | X position of the digit evaluated as explained above |
| double | y | Y position of the digit evaluated as explained above |
| double | z | Z position of the digit evaluated as explained above |
| double | t | time coordinate of the digit evaluated as explained above |
| double | de | Energy deposit |
| bool| hor| Flag to identified straw tube orientation. `hor == true` means horizontal, `hor == false` means vertical |
| std::vector<int> | hindex | vector of the hit indeces contributing to the digit |
**Track**
All digits produced by the same particle are grouped and fitted. No pattern recognition is used; the grouping is performed exploting MC truth information. The track model is a circle in the Y-Z plane and straight line in the rho-X plane as suggested [here](http://www2.fisica.unimi.it/andreazz/AA_TrackingSystems.pdf). Two variables (`ret_cr` and `ret_ln` for circular and linear fit respectively) provide the return value of the function preforming the fit. A good fit has occured if `ret_cr==0 && ret_ln==0`. A rough measurement of the quality of the fits can be checked from the variables: `chi2_cr` and `chi2_ln`. The circular fit provides:
* The coordinates of the center of the circle: `yc`, `zc`
* The radius of the circle: `r`
* The starting point of the track: `y0`, `z0`, `t0`
* The direction of the trajectory: `h`
The linear fit provides:
* The intercept and slope: `a`, `b` (respectively)
* The starting point of the track: `x0`
| Type | Name | Description |
| ------ | ------ | ------ |
| int | tid | Index of the track. It corresponds to `TG4Trajectory::TrackId` |
| double | yc | Y position of the center of the circle |
| double | zc | Z position of the center of the circle |
| double | r | Radius of the circle |
| double | h | Direction of the trajectory |
| double | a | intercept of the linear fit |
| double | b | slope of the linear fit |
| double | x0 | X position of the starting point of the track |
| double | y0 | Y position of the starting point of the track |
| double | z0 | Z position of the starting point of the track |
| double | t0 | time coordinate of the starting point of the track |
| int | ret_ln | return value of the linear fit |
| double | chi2_ln | Rough measurement of the quality of the linear fit |
| int | ret_cr | return value of the circular fit |
| double | chi2_cr | Rough measurement of the quality of the circular fit |
| std::vector<digit> | digits | vector of the digits belonging to the track |
***EM Calorimeter***
------------------------------------------------
**Cell**
A cell represents the real responce of a cell of the e.m. calorimeter. It has one-to-many relation with objects of the class *[TG4HitSegment](https://github.com/ClarkMcGrew/edep-sim/blob/master/README.md#the-energy-deposition-class-and-friends)* corresponding to the EM Calo hit collection.