Belle II Software  release-05-02-19
ClusterCandidate.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Ritter *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef PXD_CLUSTERCANDIDATE_H
12 #define PXD_CLUSTERCANDIDATE_H
13 
14 #include <pxd/reconstruction/Pixel.h>
15 #include <vector>
16 
17 namespace Belle2 {
23  namespace PXD {
24 
33  class ClusterCandidate {
34  public:
35  enum {
37  c_defaultCapacity = 10,
40  };
43  m_merged(0), m_charge(0), m_seed()
44  {
46  }
47 
49  void clear()
50  {
51  m_merged = 0;
52  m_charge = 0;
53  m_seed = Pixel();
54  m_pixels.clear();
55  }
56 
67 
75  void add(const Pixel& pixel);
76 
78  float getCharge() const { return m_charge; }
80  float getSeedCharge() const { return m_seed.getCharge(); }
82  const Pixel& getSeed() const { return m_seed; }
84  size_t size() const { return m_pixels.size(); }
86  const std::vector<Pixel>& pixels() const { return m_pixels; }
87 
88  protected:
92  float m_charge;
96  std::vector<Pixel> m_pixels;
97  };
98 
99  }
100 
102 }
103 
104 #endif //PXD_CLUSTERCANDIDATE_H
Belle2::PXD::ClusterCandidate::clear
void clear()
Clear the Cluster information (to reuse the same cluster instance)
Definition: ClusterCandidate.h:57
Belle2::PXD::ClusterCandidate::m_merged
ClusterCandidate * m_merged
Pointer to the cluster this cluster was merged into.
Definition: ClusterCandidate.h:98
Belle2::PXD::ClusterCandidate::pixels
const std::vector< Pixel > & pixels() const
get a reference to all pixels in the cluster
Definition: ClusterCandidate.h:94
Belle2::PXD::Pixel::getCharge
float getCharge() const
Return the Charge of the Pixel.
Definition: Pixel.h:81
Belle2::PXD::ClusterCandidate
Class representing a possible cluster during clustering of the PXD It supports merging of different c...
Definition: ClusterCandidate.h:41
Belle2::PXD::ClusterCandidate::getSeedCharge
float getSeedCharge() const
get the seed charge of the cluster
Definition: ClusterCandidate.h:88
Belle2::PXD::Pixel
Class to represent one pixel, used in clustering for fast access.
Definition: Pixel.h:47
Belle2::PXD::ClusterCandidate::c_defaultCapacity
@ c_defaultCapacity
Reserve space for this number of pixels on construction.
Definition: ClusterCandidate.h:45
Belle2::PXD::ClusterCandidate::getSeed
const Pixel & getSeed() const
get the seed pixel of the cluster, i.e.
Definition: ClusterCandidate.h:90
Belle2::PXD::ClusterCandidate::ClusterCandidate
ClusterCandidate()
Constructor to create an empty Cluster.
Definition: ClusterCandidate.h:50
Belle2::PXD::ClusterCandidate::m_pixels
std::vector< Pixel > m_pixels
List of all pixels in the cluster.
Definition: ClusterCandidate.h:104
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PXD::ClusterCandidate::merge
ClusterCandidate * merge(ClusterCandidate &cls)
Merge the given cluster with this one.
Definition: ClusterCandidate.cc:23
Belle2::PXD::ClusterCandidate::m_seed
Pixel m_seed
Seed pixel of the cluster, i.e.
Definition: ClusterCandidate.h:102
Belle2::PXD::ClusterCandidate::c_maxCapacity
@ c_maxCapacity
If the capacity exceeds this value, shrink the vector back to c_defaultCapacity after clearing.
Definition: ClusterCandidate.h:47
Belle2::PXD::ClusterCandidate::m_charge
float m_charge
Charge of the cluster.
Definition: ClusterCandidate.h:100
Belle2::PXD::ClusterCandidate::size
size_t size() const
get the cluster size
Definition: ClusterCandidate.h:92
Belle2::PXD::ClusterCandidate::getCharge
float getCharge() const
get the charge of the cluster
Definition: ClusterCandidate.h:86
Belle2::PXD::ClusterCandidate::add
void add(const Pixel &pixel)
Add a Pixel to the current cluster.
Definition: ClusterCandidate.cc:59