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 "TVector3.h"
7#include "TClonesArray.h"
8#include "Scifi.h"
9#include "sndConfiguration.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{};
28 double x{};
29 double y{};
30 double z{};
32 bool is_x{};
33 };
34
35 ScifiPlane(TClonesArray *snd_hits, Configuration configuration, Scifi *scifi_geometry, int index_begin, int index_end, int station);
36
37 const int GetStation() const { return station_; };
38 const std::vector<ScifiHit> GetHits() const { return hits_; };
39 const TVector3 GetCentroid() const { return centroid_; };
40 const TVector3 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 TVector3 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 IsShower() 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 TVector3 &point, double radius) const;
52
53 private:
54 std::vector<ScifiHit> hits_;
56 TVector3 centroid_;
58
60 };
61 }
62}
63
64#endif
Definition Scifi.h:20
const xy_pair< int > GetNHits() const
const TVector3 GetCentroidError() const
const xy_pair< double > GetTotQdc(bool only_positive=false) const
const TVector3 GetCentroid() const
std::vector< ScifiHit > hits_
const std::vector< ScifiHit > GetHits() const
void TimeFilter(double min_timestamp, double max_timestamp)
const xy_pair< double > GetTotEnergy(bool only_positive=false) const
xy_pair< double > GetPointQdc(const TVector3 &point, double radius) const
const TVector3 GetCluster(int max_gap) const