HerdSoftware  0.3.2
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  bool operator!=(const Cluster &right) const { return !(*this == right); }
102 
103 private:
104  float _eDep;
105  size_t _seedHitIndex;
106 
107  void _ComputeEdep();
108 
109 protected:
110  std::vector<Hit> _hits;
111 
112 #ifdef HS_USE_ROOT
113  ClassDef(Cluster, 1)
114 #endif
115 };
116 
117 } // namespace Herd
118 
119 #endif /* HERD_CLUSTER_H_ */
size_t _seedHitIndex
Index of the seed channel in the hits vector.
Definition: Cluster.h:105
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.
bool operator!=(const Cluster &right) const
Definition: Cluster.h:101
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:110
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:104
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