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
35 ScifiPlane(std::vector<sndScifiHit*> snd_hits, Configuration configuration, Scifi *scifi_geometry, int station);
36
37 const int GetStation() const { return station_; };
38 const std::vector<ScifiHit> GetHits() const { return hits_; };
39 const ROOT::Math::XYZPoint GetCentroid() const { return centroid_; };
40 const ROOT::Math::XYZPoint GetCentroidError() const { return centroid_error_; }
41 const xy_pair<double> GetTotQdc(bool only_positive = false) const;
42 const xy_pair<double> GetTotEnergy(bool only_positive = false) const;
43 const xy_pair<int> GetNHits() const;
44 // Position of larger cluster of consecutive hits, allowing at most max_gap channels with no hit
45 const ROOT::Math::XYZPoint GetCluster(int max_gap) const;
46 // The centroid is the qdc-weighted mean of hit positions, considering only hits with positive qdc
47 void FindCentroid();
48 bool HasShower() const;
49 void TimeFilter(double min_timestamp, double max_timestamp);
50 // qdc from hits within a given point and radius (square, not circle)
51 xy_pair<double> GetPointQdc(const ROOT::Math::XYZPoint &point, double radius) const;
52
53 private:
54 std::vector<ScifiHit> hits_;
56 ROOT::Math::XYZPoint centroid_;
57 ROOT::Math::XYZPoint centroid_error_;
58
60 };
61 }
62}
63
64#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