Belle II Software development
PXDClusterPositionEstimator.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/dbobjects/PXDClusterPositionEstimatorPar.h>
12#include <pxd/dbobjects/PXDClusterShapeIndexPar.h>
13#include <framework/database/DBObjPtr.h>
14#include <set>
15#include <vector>
16#include <memory>
17
18namespace Belle2 {
23 class PXDCluster;
24 class VxdID;
25
26 namespace PXD {
27 class Pixel;
28
35
36 public:
37
39 void initialize();
40
43
46
49
52
54 const PXDClusterOffsetPar* getClusterOffset(const PXDCluster& cluster, double tu, double tv) const;
55
57 float getShapeLikelyhood(const PXDCluster& cluster, double tu, double tv) const;
58
61
63 static float computeEta(const std::set<Pixel>& pixels, int vStart, int vSize, double thetaU, double thetaV);
64
66 int computeShapeIndex(const std::set<Pixel>& pixels, int uStart, int vStart, int vSize, double thetaU,
67 double thetaV) const;
68
70 static const std::string getShortName(const std::set<Pixel>& pixels, int uStart, int vStart, int vSize, double thetaU,
71 double thetaV);
72
74 static const std::string getMirroredShortName(const std::set<Pixel>& pixels, int uStart, int vStart, int vSize, double thetaU,
75 double thetaV);
76
78 static const std::string getFullName(const std::set<Pixel>& pixels, int uStart, int vStart);
79
81 int getClusterkind(const PXDCluster& cluster) const;
82
84 int getClusterkind(const std::vector<Belle2::PXD::Pixel>& pixels, const Belle2::VxdID& sensorID) const;
85
87 static int getSectorIndex(double thetaU, double thetaV);
88
89 private:
90
92 static const Pixel& getHeadPixel(const std::set<Pixel>& pixels, int vStart, int vSize, double thetaU, double thetaV);
93
95 static const Pixel& getTailPixel(const std::set<Pixel>& pixels, int vStart, int vSize, double thetaU, double thetaV);
96
98 static const Pixel& getLastPixelWithVOffset(const std::set<Pixel>& pixels, int vStart, int vOffset);
99
101 static const Pixel& getFirstPixelWithVOffset(const std::set<Pixel>& pixels, int vStart, int vOffset);
102
109
111 std::unique_ptr<DBObjPtr<PXDClusterShapeIndexPar>> m_shapeIndexFromDB;
113 std::unique_ptr<DBObjPtr<PXDClusterPositionEstimatorPar>> m_positionEstimatorFromDB;
114
119 };
120 }
122} //Belle2 namespace
The class for PXD cluster position offset payload.
The class for PXD cluster position lookup table payload.
The class for PXD cluster shape index payload.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Definition PXDCluster.h:30
Singleton class that estimates cluster positions taking into account the estimated track incidence an...
const PXDClusterShapeIndexPar & getShapeIndexParameters() const
Return shape index parameters from Database.
static int getSectorIndex(double thetaU, double thetaV)
Get sector index from angles.
static const Pixel & getHeadPixel(const std::set< Pixel > &pixels, int vStart, int vSize, double thetaU, double thetaV)
Return reference to the head pixel in pixel set.
void initialize()
Initialize PXDClusterPositionEstimator from DB.
PXDClusterPositionEstimatorPar m_positionEstimatorPar
Current valid PXDClusterPositionEstimatorPar.
static PXDClusterPositionEstimator & getInstance()
Main (and only) way to access the PXDClusterPositionEstimator.
PXDClusterPositionEstimator & operator=(const PXDClusterPositionEstimator &)=delete
Singleton class, forbidden assignment operator.
PXDClusterPositionEstimator(const PXDClusterPositionEstimator &)=delete
Singleton class, forbidden copy constructor.
const PXDClusterOffsetPar * getClusterOffset(const PXDCluster &cluster, double tu, double tv) const
Return pointer to cluster offsets, can be nullptr.
static const Pixel & getFirstPixelWithVOffset(const std::set< Pixel > &pixels, int vStart, int vOffset)
Return reference to the first pixel in pixel set with given vOffset from vStart.
PXDClusterShapeIndexPar m_shapeIndexPar
Current valid PXDClusterShapeIndex.
float getShapeLikelyhood(const PXDCluster &cluster, double tu, double tv) const
Return cluster shape likelihood.
static const Pixel & getLastPixelWithVOffset(const std::set< Pixel > &pixels, int vStart, int vOffset)
Return reference to the last pixel in pixel set with given vOffset from vStart.
const PXDClusterPositionEstimatorPar & getPositionEstimatorParameters() const
Return cluster position estimator parameters from Database.
std::unique_ptr< DBObjPtr< PXDClusterPositionEstimatorPar > > m_positionEstimatorFromDB
PXDClusterPositionEstimatorPar retrieved from DB.
PXDClusterPositionEstimator()
Singleton class, hidden constructor.
static float computeEta(const std::set< Pixel > &pixels, int vStart, int vSize, double thetaU, double thetaV)
Return the normed charge ratio between head and tail pixels (size>=2) or the charge of the seed (size...
int computeShapeIndex(const std::set< Pixel > &pixels, int uStart, int vStart, int vSize, double thetaU, double thetaV) const
Return the shape index of the pixels.
std::unique_ptr< DBObjPtr< PXDClusterShapeIndexPar > > m_shapeIndexFromDB
PXDClusterShapeIndex retrieved from DB.
static const std::string getFullName(const std::set< Pixel > &pixels, int uStart, int vStart)
Return a name for the pixel set.
void setPositionEstimatorFromDB()
Set PositionEstimator from DB.
static const std::string getShortName(const std::set< Pixel > &pixels, int uStart, int vStart, int vSize, double thetaU, double thetaV)
Return the name for the pixel set.
static const std::string getMirroredShortName(const std::set< Pixel > &pixels, int uStart, int vStart, int vSize, double thetaU, double thetaV)
Return the mirrored name for the pixel set.
int getClusterkind(const PXDCluster &cluster) const
Return kind of cluster needed to find cluster position correction.
static const Pixel & getTailPixel(const std::set< Pixel > &pixels, int vStart, int vSize, double thetaU, double thetaV)
Return reference to the tail pixel in pixel set.
Class to represent one pixel, used in clustering for fast access.
Definition Pixel.h:36
Class to uniquely identify a any structure of the PXD and SVD.
Definition VxdID.h:32
Namespace to encapsulate code needed for simulation and reconstrucion of the PXD.
Abstract base class for different kinds of events.