9#include <pxd/reconstruction/PXDClusterShape.h>
11#include <pxd/geometry/SensorInfo.h>
12#include <pxd/reconstruction/ClusterProjection.h>
14#include <vxd/geometry/GeoCache.h>
27 {pxdClusterShapeType::no_shape_set,
"pxd cluster shape: no shape setting"},
29 {pxdClusterShapeType::shape_1,
"pxd cluster shape: cluster 1x1 (single) pixel"},
30 {pxdClusterShapeType::shape_2_u,
"pxd cluster shape: cluster 2x1 (u,v) pixels"},
31 {pxdClusterShapeType::shape_2_v,
"pxd cluster shape: cluster 1x2 (u,v) pixels"},
32 {pxdClusterShapeType::shape_2_uv_diag,
"pxd cluster shape: cluster 2x2 diagonal (u,v) pixels"},
33 {pxdClusterShapeType::shape_2_uv_antidiag,
"pxd cluster shape: cluster 2x2 anti-diagonal (u,v) pixels"},
34 {pxdClusterShapeType::shape_N1,
"pxd cluster shape: cluster Nx1 (u,v) pixels, N > 2"},
35 {pxdClusterShapeType::shape_1M,
"pxd cluster shape: cluster 1xM (u,v) pixels, M > 2"},
36 {pxdClusterShapeType::shape_N2,
"pxd cluster shape: cluster Nx2 (u,v) pixels, N > 2"},
37 {pxdClusterShapeType::shape_2M,
"pxd cluster shape: cluster 2xM (u,v) pixels, M > 2"},
38 {pxdClusterShapeType::shape_4,
"pxd cluster shape: cluster 2x2 (u,v) four pixels"},
39 {pxdClusterShapeType::shape_3_L,
"pxd cluster shape: cluster 2x2 (u,v) three pixels: (L)"},
40 {pxdClusterShapeType::shape_3_L_mirr_u,
"pxd cluster shape: cluster 2x2 (u,v) three pixels: (mirror_u_L)"},
41 {pxdClusterShapeType::shape_3_L_mirr_v,
"pxd cluster shape: cluster 2x2 (u,v) three pixels: (mirror_v_L)"},
42 {pxdClusterShapeType::shape_3_L_mirr_uv,
"pxd cluster shape: cluster 2x2 (u,v) three pixels: (mirror_u+v_L)"},
43 {pxdClusterShapeType::shape_large,
"pxd cluster shape: larger cluster over 2 pixels in u and v"}
55 clsShape = pxdClusterShapeType::no_shape_set;
72 projU.
add(px.getU(), info.getUCellPosition(px.getU()), px.getCharge());
73 projV.
add(px.getV(), info.getVCellPosition(px.getV()), px.getCharge());
81 clsShape = pxdClusterShapeType::shape_1;
82 }
else if (CSFull == 2) {
84 clsShape = pxdClusterShapeType::shape_2_u;
86 clsShape = pxdClusterShapeType::shape_2_v;
87 }
else if ((fDiagU < (fCategU / 2.0)) && (fDiagV < (fCategV / 2.0))) {
88 clsShape = pxdClusterShapeType::shape_2_uv_diag;
90 clsShape = pxdClusterShapeType::shape_2_uv_antidiag;
92 }
else if (CSFull == 3) {
98 if ((fCategU - (
int)fCategU) < 0.5) {
101 if ((fCategV - (
int)fCategV) < 0.5) {
104 if ((MisU == 1) && (MisV == 1)) {
105 clsShape = pxdClusterShapeType::shape_3_L;
107 }
else if ((MisU == 0) && (MisV == 1)) {
108 clsShape = pxdClusterShapeType::shape_3_L_mirr_u;
110 }
else if ((MisU == 1) && (MisV == 0)) {
111 clsShape = pxdClusterShapeType::shape_3_L_mirr_v;
113 }
else if ((MisU == 0) && (MisV == 0)) {
114 clsShape = pxdClusterShapeType::shape_3_L_mirr_uv;
117 }
else if (projV.
getSize() == 1) {
118 clsShape = pxdClusterShapeType::shape_N1;
119 }
else if (projU.
getSize() == 1) {
120 clsShape = pxdClusterShapeType::shape_1M;
121 }
else if (projV.
getSize() == 2) {
122 clsShape = pxdClusterShapeType::shape_N2;
123 }
else if (projU.
getSize() == 2) {
124 clsShape = pxdClusterShapeType::shape_2M;
126 clsShape = pxdClusterShapeType::shape_large;
128 }
else if (CSFull == 4) {
130 clsShape = pxdClusterShapeType::shape_4;
131 }
else if (projV.
getSize() == 1) {
132 clsShape = pxdClusterShapeType::shape_N1;
133 }
else if (projU.
getSize() == 1) {
134 clsShape = pxdClusterShapeType::shape_1M;
135 }
else if (projV.
getSize() == 2) {
136 clsShape = pxdClusterShapeType::shape_N2;
137 }
else if (projU.
getSize() == 2) {
138 clsShape = pxdClusterShapeType::shape_2M;
140 clsShape = pxdClusterShapeType::shape_large;
142 }
else if (CSFull >= 5) {
144 clsShape = pxdClusterShapeType::shape_N1;
145 }
else if (projU.
getSize() == 1) {
146 clsShape = pxdClusterShapeType::shape_1M;
147 }
else if (projV.
getSize() == 2) {
148 clsShape = pxdClusterShapeType::shape_N2;
149 }
else if (projU.
getSize() == 2) {
150 clsShape = pxdClusterShapeType::shape_2M;
152 clsShape = pxdClusterShapeType::shape_large;
Class representing a possible cluster during clustering of the PXD It supports merging of different c...
const std::vector< Pixel > & pixels() const
get a reference to all pixels in the cluster
Helper struct to collect information about the 1D projection of a Pixel cluster.
void add(unsigned int cell, float position, float charge)
Add Pixel information to the projection.
void finalize()
Finish calculation of center of gravity and set correct cluster size.
unsigned int getSize() const
Return the projected size of the cluster.
pxdClusterShapeType setClsShape(const ClusterCandidate &cls, VxdID sensorID)
Set cluster shape ID.
~PXDClusterShape()
Delete the cache and free the memory.
static pxdClusterShapeDescr pxdClusterShapeDescription
Create detail description of cluster shape.
Class to represent one pixel, used in clustering for fast access.
Specific implementation of SensorInfo for PXD Sensors which provides additional pixel specific inform...
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
Class to uniquely identify a any structure of the PXD and SVD.
std::map< pxdClusterShapeType, std::string > pxdClusterShapeDescr
Type specifies cluster shape type description.
pxdClusterShapeType
Type specifies cluster shape type.
Abstract base class for different kinds of events.