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;
41 double y;
42 double z;
43
46
47 void Print() const;
48 };
49
50 USPlane(std::vector<MuFilterHit*> snd_hits, const Configuration &configuration, MuFilter *muon_filter_geometry, int station, bool use_small_sipms=false);
51
52 const sl_pair<int> GetNHits() const;
53 const int GetStation() const { return station_; }
54
55 const sl_pair<double> GetTotQdc() const;
56 const sl_pair<double> GetTotEnergy() const;
57 const rl_pair<double> GetSideQdc() const;
58 const rl_pair<double> GetBarQdc(int bar_to_compute) const;
59 const sl_pair<int> GetBarNHits(int bar_to_compute) const;
60 const std::vector<USHit> GetHits() const { return hits_; };
61 double HasShower() const { return GetNHits().large >= configuration_.us_min_n_hits_for_centroid; }
62 // The centroid is the qdc-weighted mean of hit positions, considering only hits with positive qdc
63 void FindCentroid();
64 ROOT::Math::XYZPoint GetCentroid() const { return centroid_; }
65 ROOT::Math::XYZPoint GetCentroidError() const { return centroid_error_; }
66 const int GetNHitBars() const;
67
68
69 void TimeFilter(double min_timestamp, double max_timestamp);
70
71 private:
72 std::vector<USHit> hits_;
74 ROOT::Math::XYZPoint centroid_;
75 ROOT::Math::XYZPoint centroid_error_;
77 };
78 }
79}
80
81#endif
ROOT::Math::XYZPoint centroid_
Definition sndUSPlane.h:74
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:65
const int GetNHitBars() const
std::vector< USHit > hits_
Definition sndUSPlane.h:72
const sl_pair< double > GetTotQdc() const
ROOT::Math::XYZPoint centroid_error_
Definition sndUSPlane.h:75
const int GetStation() const
Definition sndUSPlane.h:53
const sl_pair< double > GetTotEnergy() const
const std::vector< USHit > GetHits() const
Definition sndUSPlane.h:60
ROOT::Math::XYZPoint GetCentroid() const
Definition sndUSPlane.h:64
void TimeFilter(double min_timestamp, double max_timestamp)