HerdSoftware  0.4.0
Cluster.h
Go to the documentation of this file.
1 /*
2  * Cluster.h
3  *
4  * Created on: 5 Nov 2018
5  * Author: Nicola Mori
6  */
7 
10 #ifndef HERD_CLUSTER_H_
11 #define HERD_CLUSTER_H_
12 
15 
16 #ifdef HS_USE_ROOT
17 #include "Rtypes.h"
18 #endif
19 
20 #include <string>
21 #include <vector>
22 
23 namespace Herd {
24 
30 class Cluster {
31 public:
37  Cluster();
38 
47  Cluster(std::vector<Hit> hits, size_t seedIndex);
48 
50  virtual ~Cluster() = default;
51 
56  [[nodiscard]] const std::vector<Hit> &Hits() const { return _hits; }
57 
66  void SetHits(std::vector<Hit> hits, size_t seedIndex);
67 
77  [[nodiscard]] size_t SeedHitIndex() const { return _seedHitIndex; }
78 
86  [[nodiscard]] float EDep() const { return _eDep; }
87 
94  [[nodiscard]] Point COGPosition(const TrackingDetectorGeoParams &geoParams) const;
95 
96  bool operator==(const Cluster &right) const {
97  return (Hits()[SeedHitIndex()].VolumeID() == right.Hits()[right.SeedHitIndex()].VolumeID());
98  }
99  bool operator!=(const Cluster &right) const { return !(*this == right); }
100 
101 private:
102  float _eDep;
103  size_t _seedHitIndex;
104 
105  void _ComputeEdep();
106 
107 protected:
108  std::vector<Hit> _hits;
109 
110 #ifdef HS_USE_ROOT
111  ClassDef(Cluster, 1)
112 #endif
113 };
114 
115 } // namespace Herd
116 
117 #endif /* HERD_CLUSTER_H_ */
TrackingDetectorGeoParams.h
Herd::TrackingDetectorGeoParams
Base data structure for single tracking detector layer geometry parameters.
Definition: TrackingDetectorGeoParams.h:31
Herd::Cluster::EDep
float EDep() const
Gets the deposited energy associated to the cluster.
Definition: Cluster.h:86
Hit.h
Herd::Vec3D
A class describing a vector in 3D space.
Definition: Vec3D.h:33
Herd::Cluster::SeedHitIndex
size_t SeedHitIndex() const
Gets the index of the seed hit within the hits vector.
Definition: Cluster.h:77
Herd::Cluster::_ComputeEdep
void _ComputeEdep()
Update the value of _edep.
Definition: Cluster.cpp:41
Herd::Cluster
Tracker cluster object for transient data model.
Definition: Cluster.h:30
Herd::Cluster::operator!=
bool operator!=(const Cluster &right) const
Definition: Cluster.h:99
Herd
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:22
Herd::Cluster::operator==
bool operator==(const Cluster &right) const
Definition: Cluster.h:96
Herd::Cluster::_hits
std::vector< Hit > _hits
Hits in each channel constituting the cluster.
Definition: Cluster.h:108
Herd::Cluster::Hits
const std::vector< Hit > & Hits() const
Gets the hits forming the cluster.
Definition: Cluster.h:56
Herd::Cluster::_seedHitIndex
size_t _seedHitIndex
Index of the seed channel in the hits vector.
Definition: Cluster.h:103
Herd::Cluster::~Cluster
virtual ~Cluster()=default
Virtual destructor
Herd::Cluster::SetHits
void SetHits(std::vector< Hit > hits, size_t seedIndex)
Sets the hits forming the cluster.
Definition: Cluster.cpp:23
Herd::Cluster::COGPosition
Point COGPosition(const TrackingDetectorGeoParams &geoParams) const
Get the center of gravity position of the cluster.
Definition: Cluster.cpp:29
Herd::Cluster::Cluster
Cluster()
Default constructor.
Definition: Cluster.cpp:16
Herd::Cluster::_eDep
float _eDep
Deposited energy [GeV].
Definition: Cluster.h:102