SND@LHC Software
Loading...
Searching...
No Matches
sndScifiPlane.h
Go to the documentation of this file.
1#ifndef SND_SCIFIPLANE_H
2#define SND_SCIFIPLANE_H
3
4#include <vector>
5
6#include "Scifi.h"
7#include "sndConfiguration.h"
8#include "sndScifiHit.h"
9#include "Math/Point3D.h"
10
11namespace snd {
12 namespace analysis_tools {
14 {
15 public:
16 // x and y planes
17 template <class T>
18 struct xy_pair
19 {
20 T x{};
21 T y{};
22 };
23
24 struct ScifiHit
25 {
26 double qdc{};
27 double timestamp{}; // timestamp is in clock cycles
28 double x{};
29 double y{};
30 double z{};
32 bool is_x{};
33
34 void Print() const;
35 };
36
37 ScifiPlane(std::vector<sndScifiHit*> snd_hits, const Configuration &configuration, Scifi *scifi_geometry, int station);
38
39 const int GetStation() const { return station_; }
40 const std::vector<ScifiHit> GetHits() const { return hits_; }
41 const ROOT::Math::XYZPoint GetCentroid() const { return centroid_; }
42 const ROOT::Math::XYZPoint GetCentroidError() const { return centroid_error_; }
43 const xy_pair<double> GetTotQdc(bool only_positive = false) const;
44 const xy_pair<double> GetTotEnergy(bool only_positive = false) const;
45 const xy_pair<int> GetNHits() const;
46 // Position of larger cluster of consecutive hits, allowing at most max_gap channels with no hit
47 const ROOT::Math::XYZPoint GetCluster(int max_gap) const;
48 // The centroid is the qdc-weighted mean of hit positions, considering only hits with positive qdc
49 void FindCentroid();
50 bool HasShower() const;
51 void TimeFilter(double min_timestamp, double max_timestamp);
52 // qdc from hits within a given point and radius (square, not circle)
53 xy_pair<double> GetPointQdc(const ROOT::Math::XYZPoint &point, double radius) const;
54
55 private:
56 std::vector<ScifiHit> hits_;
58 ROOT::Math::XYZPoint centroid_;
59 ROOT::Math::XYZPoint centroid_error_;
60
62 };
63 }
64}
65
66#endif
Definition Scifi.h:20
ROOT::Math::XYZPoint centroid_error_
const xy_pair< int > GetNHits() const
const ROOT::Math::XYZPoint GetCluster(int max_gap) const
const xy_pair< double > GetTotQdc(bool only_positive=false) const
std::vector< ScifiHit > hits_
const std::vector< ScifiHit > GetHits() const
ROOT::Math::XYZPoint centroid_
void TimeFilter(double min_timestamp, double max_timestamp)
xy_pair< double > GetPointQdc(const ROOT::Math::XYZPoint &point, double radius) const
const xy_pair< double > GetTotEnergy(bool only_positive=false) const
const ROOT::Math::XYZPoint GetCentroid() const
const ROOT::Math::XYZPoint GetCentroidError() const