SND@LHC Software
Loading...
Searching...
No Matches
sndUSPlane.h
Go to the documentation of this file.
1#ifndef SND_USPLANE_H
2#define SND_USPLANE_H
3
4#include <vector>
5
6#include "Math/Point3D.h"
7#include "MuFilter.h"
8#include "MuFilterHit.h"
9#include "sndConfiguration.h"
10
11namespace snd {
12 namespace analysis_tools {
13 class USPlane
14 {
15 public:
16 // small and large SiPMs
17 template <class T>
18 struct sl_pair
19 {
20 T small{};
21 T large{};
22 };
23
24 // right and left side of US bars
25 template <class T>
26 struct rl_pair
27 {
28 T right{};
29 T left{};
30 };
31
32 // hits vector, each hit has info about timestamp, qdc and position
33 struct USHit
34 {
36 int bar;
37
38 double qdc;
39 double timestamp;
40 double x; // position of right or left side of bar
41 double y;
42 double z;
43
46 };
47
48 USPlane(std::vector<MuFilterHit*> snd_hits, Configuration configuration, MuFilter *muon_filter_geometry, int station);
49
50 const sl_pair<int> GetNHits() const;
51 const int GetStation() const { return station_; };
52
53 const sl_pair<double> GetTotQdc() const;
54 const sl_pair<double> GetTotEnergy() const;
55 const rl_pair<double> GetSideQdc() const;
56 const rl_pair<double> GetBarQdc(int bar_to_compute) const;
57 const sl_pair<int> GetBarNHits(int bar_to_compute) const;
58 const std::vector<USHit> GetHits() const { return hits_; };
59 double HasShower() const { return static_cast<int>(hits_.size()) >= configuration_.us_min_n_hits_for_centroid; };
60 // The centroid is the qdc-weighted mean of hit positions, considering only hits with positive qdc
61 void FindCentroid();
62 ROOT::Math::XYZPoint GetCentroid() const { return centroid_; };
63 ROOT::Math::XYZPoint GetCentroidError() const { return centroid_error_; };
64
65 void TimeFilter(double min_timestamp, double max_timestamp);
66
67 private:
68 std::vector<USHit> hits_;
70 ROOT::Math::XYZPoint centroid_;
71 ROOT::Math::XYZPoint centroid_error_;
73 };
74 }
75}
76
77#endif
ROOT::Math::XYZPoint centroid_
Definition sndUSPlane.h:70
const rl_pair< double > GetBarQdc(int bar_to_compute) const
const sl_pair< int > GetBarNHits(int bar_to_compute) const
const rl_pair< double > GetSideQdc() const
const sl_pair< int > GetNHits() const
ROOT::Math::XYZPoint GetCentroidError() const
Definition sndUSPlane.h:63
std::vector< USHit > hits_
Definition sndUSPlane.h:68
const sl_pair< double > GetTotQdc() const
ROOT::Math::XYZPoint centroid_error_
Definition sndUSPlane.h:71
const int GetStation() const
Definition sndUSPlane.h:51
const sl_pair< double > GetTotEnergy() const
const std::vector< USHit > GetHits() const
Definition sndUSPlane.h:58
ROOT::Math::XYZPoint GetCentroid() const
Definition sndUSPlane.h:62
void TimeFilter(double min_timestamp, double max_timestamp)