Belle II Software  release-08-01-10
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 <pxd/dataobjects/PXDCluster.h>
14 #include <vxd/dataobjects/VxdID.h>
15 #include <framework/database/DBObjPtr.h>
16 #include <set>
17 #include <vector>
18 #include <pxd/reconstruction/Pixel.h>
19 #include <memory>
20 
21 namespace Belle2 {
27  namespace PXD {
34 
35  public:
36 
38  void initialize();
39 
41  void setShapeIndexFromDB();
42 
45 
48 
51 
53  const PXDClusterOffsetPar* getClusterOffset(const PXDCluster& cluster, double tu, double tv) const;
54 
56  float getShapeLikelyhood(const PXDCluster& cluster, double tu, double tv) const;
57 
60 
62  float computeEta(const std::set<Pixel>& pixels, int vStart, int vSize, double thetaU, double thetaV) const;
63 
65  int computeShapeIndex(const std::set<Pixel>& pixels, int uStart, int vStart, int vSize, double thetaU,
66  double thetaV) const;
67 
69  const std::string getShortName(const std::set<Pixel>& pixels, int uStart, int vStart, int vSize, double thetaU,
70  double thetaV) const;
71 
73  const std::string getMirroredShortName(const std::set<Pixel>& pixels, int uStart, int vStart, int vSize, double thetaU,
74  double thetaV) const;
75 
77  const std::string getFullName(const std::set<Pixel>& pixels, int uStart, int vStart) const;
78 
80  int getClusterkind(const PXDCluster& cluster) const;
81 
83  int getClusterkind(const std::vector<Belle2::PXD::Pixel>& pixels, const Belle2::VxdID& sensorID) const;
84 
86  int getSectorIndex(double thetaU, double thetaV) const;
87 
88  private:
89 
91  const Pixel& getHeadPixel(const std::set<Pixel>& pixels, int vStart, int vSize, double thetaU, double thetaV) const;
92 
94  const Pixel& getTailPixel(const std::set<Pixel>& pixels, int vStart, int vSize, double thetaU, double thetaV) const;
95 
97  const Pixel& getLastPixelWithVOffset(const std::set<Pixel>& pixels, int vStart, int vOffset) const;
98 
100  const Pixel& getFirstPixelWithVOffset(const std::set<Pixel>& pixels, int vStart, int vOffset) const;
101 
108 
110  std::unique_ptr<DBObjPtr<PXDClusterShapeIndexPar>> m_shapeIndexFromDB;
112  std::unique_ptr<DBObjPtr<PXDClusterPositionEstimatorPar>> m_positionEstimatorFromDB;
113 
118  };
119  }
121 } //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 PXDClusterPositionEstimatorPar & getPositionEstimatorParameters() const
Return cluster position estimator parameters from Database.
void initialize()
Initialize PXDClusterPositionEstimator from DB.
PXDClusterPositionEstimatorPar m_positionEstimatorPar
Currrent valid PXDClusterPositionEstimatorPar.
const std::string getFullName(const std::set< Pixel > &pixels, int uStart, int vStart) const
Return a name for the pixel set.
static PXDClusterPositionEstimator & getInstance()
Main (and only) way to access the PXDClusterPositionEstimator.
int getSectorIndex(double thetaU, double thetaV) const
Get sector index from angles.
const Pixel & getTailPixel(const std::set< Pixel > &pixels, int vStart, int vSize, double thetaU, double thetaV) const
Return reference to the tail pixel in pixel set.
const std::string getMirroredShortName(const std::set< Pixel > &pixels, int uStart, int vStart, int vSize, double thetaU, double thetaV) const
Return the mirrored name for the pixel set.
const Pixel & getLastPixelWithVOffset(const std::set< Pixel > &pixels, int vStart, int vOffset) const
Return reference to the last pixel in pixel set with given vOffset from vStart.
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.
const PXDClusterShapeIndexPar & getShapeIndexParameters() const
Return shape index parameters from Database.
PXDClusterShapeIndexPar m_shapeIndexPar
Current valid PXDClusterShapeIndex.
float computeEta(const std::set< Pixel > &pixels, int vStart, int vSize, double thetaU, double thetaV) const
Return the normed charge ratio between head and tail pixels (size>=2) or the charge of the seed (size...
float getShapeLikelyhood(const PXDCluster &cluster, double tu, double tv) const
Return cluster shape likelyhood.
std::unique_ptr< DBObjPtr< PXDClusterPositionEstimatorPar > > m_positionEstimatorFromDB
PXDClusterPositionEstimatorPar retrieved from DB.
PXDClusterPositionEstimator()
Singleton class, hidden constructor.
PXDClusterPositionEstimator & operator=(const PXDClusterPositionEstimator &)=delete
Singleton class, forbidden assignment operator.
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.
void setPositionEstimatorFromDB()
Set PositionEstimator from DB.
const std::string getShortName(const std::set< Pixel > &pixels, int uStart, int vStart, int vSize, double thetaU, double thetaV) const
Return the name for the pixel set.
int getClusterkind(const PXDCluster &cluster) const
Return kind of cluster needed to find cluster position correction.
const Pixel & getFirstPixelWithVOffset(const std::set< Pixel > &pixels, int vStart, int vOffset) const
Return reference to the first pixel in pixel set with given vOffset from vStart.
const Pixel & getHeadPixel(const std::set< Pixel > &pixels, int vStart, int vSize, double thetaU, double thetaV) const
Return reference to the head 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:33
Abstract base class for different kinds of events.