GCC Code Coverage Report


Directory: ./
File: src/iguana/algorithms/clas12/FiducialFilter/Algorithm.h
Date: 2025-01-05 09:03:17
Exec Total Coverage
Lines: 2 2 100.0%
Functions: 3 4 75.0%
Branches: 5 12 41.7%

Line Branch Exec Source
1 #pragma once
2
3 #include "iguana/algorithms/Algorithm.h"
4
5 namespace iguana::clas12 {
6
7 /// @brief_algo Filter the `REC::Particle` bank by applying DC (drift chamber) fiducial cuts
8 ///
9 /// @begin_doc_algo{clas12::FiducialFilter | Filter}
10 /// @input_banks{REC::Particle, REC::Traj, RUN::config}
11 /// @output_banks{REC::Particle}
12 /// @end_doc
13 ///
14 /// @begin_doc_config
15 /// @config_param{pass | int | cook type to use for assigning fiducial cuts}
16 /// @end_doc
17 class FiducialFilter : public Algorithm
18 {
19
20
5/12
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
14 DEFINE_IGUANA_ALGORITHM(FiducialFilter, clas12::FiducialFilter)
21
22 public:
23
24 void Start(hipo::banklist& banks) override;
25 void Run(hipo::banklist& banks) const override;
26 void Stop() override;
27
28 /// structure to hold `REC::Traj` data
29 8295 struct traj_row_data {
30 /// @doxygen_off
31 double x1 = -999;
32 double x2 = -999;
33 double x3 = -999;
34 double y1 = -999;
35 double y2 = -999;
36 double y3 = -999;
37 double z1 = -999;
38 double z2 = -999;
39 double z3 = -999;
40 int sector= -1;
41 /// @doxygen_on
42 };
43
44 /// **Method**: Gets trajectory data for particles in the event
45 /// @param bank the bank to get data from
46 /// @returns a map with keys as particle indices (pindex) and values as traj_row_data structs
47 static std::map<int, FiducialFilter::traj_row_data> GetTrajMap(hipo::bank const &bank);
48
49 /// **Method**: Gets trajectory data for particles in the event
50 /// @param x Drift Chamber x coord
51 /// @param y Drift Chamber y coord
52 /// @param z Drift Chamber z coord
53 /// @returns sector number in DC
54 static int determineSectorDC(float x, float y, float z);
55
56 private:
57
58 /// **Method**: checks if the particle passes fiducial cuts
59 /// @param traj_row data struct of the particle in REC::Traj
60 /// @param torus toroidal magnetic field sign
61 /// @param pid pid of the particle
62 /// @returns `true` if passes fiducial cuts
63 bool Filter(FiducialFilter::traj_row_data const traj_row, float const torus, int const pid) const;
64
65
66 /// **Method**: Examines XY fiducial cut for pass1
67 /// @param traj_row data struct of the particle in REC::Traj
68 /// @param torus toroidal magnetic field sign
69 /// @param pid pid of the particle
70 /// @returns `true` if passes fiducial cuts
71 bool DC_fiducial_cut_XY_pass1(FiducialFilter::traj_row_data const traj_row, float const torus, int const pid) const;
72
73
74 /// **Method**: Examines Theta Phi fiducial cut for pass1
75 /// @param traj_row data struct of the particle in REC::Traj
76 /// @param torus toroidal magnetic field sign
77 /// @param pid pid of the particle
78 /// @returns `true` if passes fiducial cuts
79 bool DC_fiducial_cut_theta_phi_pass1(FiducialFilter::traj_row_data const traj_row, float const torus, int const pid) const;
80
81 /// `hipo::banklist`
82 hipo::banklist::size_type b_particle;
83 hipo::banklist::size_type b_traj;
84 hipo::banklist::size_type b_config;
85
86 /// Pass Reconstruction
87 int o_pass = 1;
88
89 };
90
91 }
92