HerdSoftware  0.1.1
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 
13 #include "dataobjects/Hit.h"
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 
45  Cluster(std::vector<Hit> hits, size_t seedIndex);
46 
48  virtual ~Cluster() = default;
49 
54  const std::vector<Hit> &Hits() const { return _hits; }
55 
60  void SetHits(std::vector<Hit> hits, size_t seedIndex);
61 
71  size_t SeedHitIndex() const { return _seedHitIndex; }
72 
80  float EDep() const { return _eDep; }
81 
88  Point COGPosition(const TrackingDetectorGeoParams &geoParams) const;
89 
90  // /**
91  // * @brief Get the center of gravity position of the fit cluster
92  // *
93  // * @param The geoparams associated to this cluster
94  // * @return The center of gravity
95  // */
96  // Point COGPosition(const FitGeoParams &geoParams) const;
97 
98  bool operator==(const Cluster &right) const {
99  return (Hits()[SeedHitIndex()].VolumeID() == right.Hits()[right.SeedHitIndex()].VolumeID());
100  }
101 
102 private:
103  float _eDep;
104  size_t _seedHitIndex;
105 
106  void _ComputeEdep();
107 
108 protected:
109  std::vector<Hit> _hits;
110 
111 #ifdef HS_USE_ROOT
112  ClassDef(Cluster, 1)
113 #endif
114 };
115 
116 } // namespace Herd
117 
118 #endif /* HERD_CLUSTER_H_ */
size_t _seedHitIndex
Index of the seed channel in the hits vector.
Definition: Cluster.h:104
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
const std::vector< Hit > & Hits() const
Gets the hits forming the cluster.
Definition: Cluster.h:54
Tracker cluster object for transient data model.
Definition: Cluster.h:30
virtual ~Cluster()=default
Virtual destructor.
size_t SeedHitIndex() const
Gets the index of the seed hit within the hits vector.
Definition: Cluster.h:71
A class describing a vector in 3D space.
Definition: Vec3D.h:33
Cluster()
Default constructor.
Definition: Cluster.cpp:16
void SetHits(std::vector< Hit > hits, size_t seedIndex)
Sets the hits forming the cluster.
Definition: Cluster.cpp:23
Point COGPosition(const TrackingDetectorGeoParams &geoParams) const
Get the center of gravity position of the cluster.
Definition: Cluster.cpp:29
std::vector< Hit > _hits
Hits in each channel constituting the cluster.
Definition: Cluster.h:109
void _ComputeEdep()
Update the value of _edep.
Definition: Cluster.cpp:53
bool operator==(const Cluster &right) const
Get the center of gravity position of the fit cluster.
Definition: Cluster.h:98
float _eDep
Deposited energy [GeV].
Definition: Cluster.h:103
Base data structure for single tracking detector layer geometry parameters.
Definition: TrackingDetectorGeoParams.h:28
float EDep() const
Gets the deposited energy associated to the cluster.
Definition: Cluster.h:80