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 "TVector3.h"
7#include "TClonesArray.h"
8#include "MuFilter.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(TClonesArray *snd_hits, Configuration configuration, MuFilter *muon_filter_geometry, int index_begin, int index_end, 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 // The centroid is the qdc-weighted mean of hit positions, considering only hits with positive qdc
60 void FindCentroid();
61 const TVector3 GetCentroid() const { return centroid_; };
62 const TVector3 GetCentroidError() const { return centroid_error_; };
63
64 void TimeFilter(double min_timestamp, double max_timestamp);
65
66 private:
67 std::vector<USHit> hits_;
69 TVector3 centroid_;
72 };
73 }
74}
75
76#endif
const rl_pair< double > GetBarQdc(int bar_to_compute) const
const sl_pair< int > GetBarNHits(int bar_to_compute) const
const TVector3 GetCentroid() const
Definition sndUSPlane.h:61
const rl_pair< double > GetSideQdc() const
const sl_pair< int > GetNHits() const
std::vector< USHit > hits_
Definition sndUSPlane.h:67
const sl_pair< double > GetTotQdc() const
const int GetStation() const
Definition sndUSPlane.h:51
const sl_pair< double > GetTotEnergy() const
const std::vector< USHit > GetHits() const
Definition sndUSPlane.h:58
const TVector3 GetCentroidError() const
Definition sndUSPlane.h:62
void TimeFilter(double min_timestamp, double max_timestamp)