Line | Branch | Exec | Source |
---|---|---|---|
1 | #pragma once | ||
2 | |||
3 | #include "iguana/algorithms/Algorithm.h" | ||
4 | |||
5 | namespace iguana::clas12 { | ||
6 | |||
7 | /// @brief_algo Link particle bank to bank `REC::Traj` | ||
8 | /// | ||
9 | /// @begin_doc_algo{clas12::TrajLinker | Creator} | ||
10 | /// @input_banks{REC::Particle, REC::Traj} | ||
11 | /// @output_banks{%REC::Particle::Traj} | ||
12 | /// @end_doc | ||
13 | /// | ||
14 | /// This algorithm reads `REC::Traj` and produces a new bank, `REC::Particle::Traj`, | ||
15 | /// to make it easier to access commonly used `REC::Traj` information for each particle. | ||
16 | /// | ||
17 | /// If this algorithm does not provide information you need, ask the maintainers or open a pull request. | ||
18 | /// | ||
19 | /// @creator_note | ||
20 | class TrajLinker : public Algorithm | ||
21 | { | ||
22 | |||
23 |
6/14✓ Branch 0 (2→3) taken 3 times.
✗ Branch 1 (2→6) not taken.
✗ Branch 2 (5→7) not taken.
✓ Branch 3 (5→8) taken 3 times.
✓ Branch 4 (9→10) taken 3 times.
✗ Branch 5 (9→32) not taken.
✓ Branch 6 (10→11) taken 3 times.
✗ Branch 7 (10→17) not taken.
✓ Branch 8 (17→18) taken 3 times.
✗ Branch 9 (17→40) not taken.
✓ Branch 10 (24→25) taken 3 times.
✗ Branch 11 (24→40) not taken.
✗ Branch 12 (32→33) not taken.
✗ Branch 13 (32→39) not taken.
|
23 | DEFINE_IGUANA_ALGORITHM(TrajLinker, clas12::TrajLinker) |
24 | |||
25 | public: | ||
26 | |||
27 | void Start(hipo::banklist& banks) override; | ||
28 | void Run(hipo::banklist& banks) const override; | ||
29 | void Stop() override; | ||
30 | |||
31 | /// @returns the DC sector given (x,y,z), or `-1` if failed | ||
32 | /// @param x x-position | ||
33 | /// @param y y-position | ||
34 | /// @param z z-position | ||
35 | int GetSector(float const& x, float const& y, float const& z) const; | ||
36 | |||
37 | private: | ||
38 | |||
39 | /// `hipo::banklist` indices | ||
40 | hipo::banklist::size_type b_particle; | ||
41 | hipo::banklist::size_type b_traj; | ||
42 | hipo::banklist::size_type b_result; | ||
43 | |||
44 | // `b_result` bank item indices | ||
45 | int i_pindex; | ||
46 | int i_sector; | ||
47 | int i_r1_found; | ||
48 | int i_r1_x; | ||
49 | int i_r1_y; | ||
50 | int i_r1_z; | ||
51 | int i_r2_found; | ||
52 | int i_r2_x; | ||
53 | int i_r2_y; | ||
54 | int i_r2_z; | ||
55 | int i_r3_found; | ||
56 | int i_r3_x; | ||
57 | int i_r3_y; | ||
58 | int i_r3_z; | ||
59 | }; | ||
60 | |||
61 | } | ||
62 |