Belle II Software development
ClusterCandidate.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <pxd/reconstruction/Pixel.h>
12#include <vector>
13
14namespace Belle2 {
20 namespace PXD {
21
31 public:
32 enum {
37 };
40 m_merged(0), m_charge(0), m_seed()
41 {
43 }
44
46 void clear()
47 {
48 m_merged = 0;
49 m_charge = 0;
50 m_seed = Pixel();
51 m_pixels.clear();
52 }
53
64
72 void add(const Pixel& pixel);
73
75 float getCharge() const { return m_charge; }
77 float getSeedCharge() const { return m_seed.getCharge(); }
79 const Pixel& getSeed() const { return m_seed; }
81 size_t size() const { return m_pixels.size(); }
83 const std::vector<Pixel>& pixels() const { return m_pixels; }
84
85 protected:
89 float m_charge;
93 std::vector<Pixel> m_pixels;
94 };
95
96 }
97
99}
Class representing a possible cluster during clustering of the PXD It supports merging of different c...
size_t size() const
get the cluster size
const Pixel & getSeed() const
get the seed pixel of the cluster, i.e.
ClusterCandidate()
Constructor to create an empty Cluster.
Pixel m_seed
Seed pixel of the cluster, i.e.
ClusterCandidate * m_merged
Pointer to the cluster this cluster was merged into.
float m_charge
Charge of the cluster.
float getCharge() const
get the charge of the cluster
std::vector< Pixel > m_pixels
List of all pixels in the cluster.
ClusterCandidate * merge(ClusterCandidate &cls)
Merge the given cluster with this one.
float getSeedCharge() const
get the seed charge of the cluster
void clear()
Clear the Cluster information (to reuse the same cluster instance)
void add(const Pixel &pixel)
Add a Pixel to the current cluster.
@ c_defaultCapacity
Reserve space for this number of pixels on construction.
@ c_maxCapacity
If the capacity exceeds this value, shrink the vector back to c_defaultCapacity after clearing.
const std::vector< Pixel > & pixels() const
get a reference to all pixels in the cluster
Class to represent one pixel, used in clustering for fast access.
Definition: Pixel.h:36
float getCharge() const
Return the Charge of the Pixel.
Definition: Pixel.h:70
Abstract base class for different kinds of events.