HerdSoftware  0.4.0
HoughTrackStub.h
Go to the documentation of this file.
1 /*
2  * HoughTrackStub.h
3  *
4  * Created on: 30 Dec 2018
5  * Author: Valerio Formato
6  */
7 
8 #ifndef HOUGHTRACKSTUB_H_
9 #define HOUGHTRACKSTUB_H_
10 
13 
14 namespace Herd {
15 
17 public:
18  HoughTrackStub(const HFCluster &cl1, const HFCluster &cl2, RefFrame::Axis dir1, RefFrame::Axis dir2);
19 
20  friend bool operator==(const HoughTrackStub &lhs, const HoughTrackStub &rhs);
21 
22  [[nodiscard]] float Theta() const { return m_theta; };
23  [[nodiscard]] float R() const { return m_r; };
24 
25  unsigned int cl1ID() { return m_cl1ID; };
26  unsigned int cl2ID() { return m_cl2ID; };
27 
28  [[nodiscard]] bool ContainsCluster(const Cluster &cluster) const {
29  return (cluster.Hits()[cluster.SeedHitIndex()].VolumeID() == m_cl1ID ||
30  cluster.Hits()[cluster.SeedHitIndex()].VolumeID() == m_cl2ID);
31  };
32 
33 private:
34  unsigned int m_cl1ID;
35  unsigned int m_cl2ID;
36 
37  float m_theta;
38  float m_r;
39 };
40 
41 inline bool operator==(const HoughTrackStub &lhs, const HoughTrackStub &rhs) {
42  return ((lhs.m_cl1ID == rhs.m_cl1ID && lhs.m_cl2ID == rhs.m_cl2ID) ||
43  (lhs.m_cl1ID == rhs.m_cl2ID && lhs.m_cl2ID == rhs.m_cl1ID));
44 }
45 
46 } // namespace Herd
47 
48 #endif
HFCluster.h
Herd::HoughTrackStub::operator==
friend bool operator==(const HoughTrackStub &lhs, const HoughTrackStub &rhs)
Definition: HoughTrackStub.h:41
Herd::HoughTrackStub::m_r
float m_r
Definition: HoughTrackStub.h:38
Herd::Cluster::SeedHitIndex
size_t SeedHitIndex() const
Gets the index of the seed hit within the hits vector.
Definition: Cluster.h:77
Herd::operator==
bool operator==(const HoughTrackStub &lhs, const HoughTrackStub &rhs)
Definition: HoughTrackStub.h:41
Herd::HoughTrackStub
Definition: HoughTrackStub.h:16
Herd::HoughTrackStub::m_theta
float m_theta
Definition: HoughTrackStub.h:37
Herd::Cluster
Tracker cluster object for transient data model.
Definition: Cluster.h:30
Herd::HoughTrackStub::R
float R() const
Definition: HoughTrackStub.h:23
Herd
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:22
Herd::HoughTrackStub::Theta
float Theta() const
Definition: HoughTrackStub.h:22
Herd::HoughTrackStub::cl1ID
unsigned int cl1ID()
Definition: HoughTrackStub.h:25
RefFrame.h
Herd::HoughTrackStub::HoughTrackStub
HoughTrackStub(const HFCluster &cl1, const HFCluster &cl2, RefFrame::Axis dir1, RefFrame::Axis dir2)
Definition: HoughTrackStub.cpp:14
Herd::Cluster::Hits
const std::vector< Hit > & Hits() const
Gets the hits forming the cluster.
Definition: Cluster.h:56
Herd::HoughTrackStub::m_cl2ID
unsigned int m_cl2ID
Definition: HoughTrackStub.h:35
Herd::HoughTrackStub::m_cl1ID
unsigned int m_cl1ID
Definition: HoughTrackStub.h:31
Herd::RefFrame::Axis
Axis
Aliases for the axes.
Definition: RefFrame.h:34
Herd::HoughTrackStub::cl2ID
unsigned int cl2ID()
Definition: HoughTrackStub.h:26
Herd::HFCluster
Definition: HFCluster.h:21
Herd::HoughTrackStub::ContainsCluster
bool ContainsCluster(const Cluster &cluster) const
Definition: HoughTrackStub.h:28