Belle II Software  release-05-01-25
PXDClusterPositionEstimator.h
1 /**************************************************************************
2 * BASF2 (Belle Analysis Framework 2) *
3 * Copyright(C) 2010 - Belle II Collaboration *
4 * *
5 * Author: The Belle II Collaboration *
6 * Contributors: Benjamin Schwenker *
7 * *
8 * This software is provided "as is" without any warranty. *
9 **************************************************************************/
10 
11 #pragma once
12 
13 #include <pxd/dbobjects/PXDClusterPositionEstimatorPar.h>
14 #include <pxd/dbobjects/PXDClusterShapeIndexPar.h>
15 #include <pxd/dataobjects/PXDCluster.h>
16 #include <vxd/dataobjects/VxdID.h>
17 #include <framework/database/DBObjPtr.h>
18 #include <set>
19 #include <vector>
20 #include <pxd/reconstruction/Pixel.h>
21 #include <memory>
22 
23 namespace Belle2 {
29  namespace PXD {
35  class PXDClusterPositionEstimator {
36 
37  public:
38 
40  void initialize();
41 
44 
47 
50 
53 
55  const PXDClusterOffsetPar* getClusterOffset(const PXDCluster& cluster, double tu, double tv) const;
56 
58  float getShapeLikelyhood(const PXDCluster& cluster, double tu, double tv) const;
59 
62 
64  float computeEta(const std::set<Pixel>& pixels, int vStart, int vSize, double thetaU, double thetaV) const;
65 
67  int computeShapeIndex(const std::set<Pixel>& pixels, int uStart, int vStart, int vSize, double thetaU,
68  double thetaV) const;
69 
71  const std::string getShortName(const std::set<Pixel>& pixels, int uStart, int vStart, int vSize, double thetaU,
72  double thetaV) const;
73 
75  const std::string getMirroredShortName(const std::set<Pixel>& pixels, int uStart, int vStart, int vSize, double thetaU,
76  double thetaV) const;
77 
79  const std::string getFullName(const std::set<Pixel>& pixels, int uStart, int vStart) const;
80 
82  int getClusterkind(const PXDCluster& cluster) const;
83 
85  int getClusterkind(const std::vector<Pixel>& pixels, const VxdID& sensorID) const;
86 
88  int getSectorIndex(double thetaU, double thetaV) const;
89 
90  private:
91 
93  const Pixel& getHeadPixel(const std::set<Pixel>& pixels, int vStart, int vSize, double thetaU, double thetaV) const;
94 
96  const Pixel& getTailPixel(const std::set<Pixel>& pixels, int vStart, int vSize, double thetaU, double thetaV) const;
97 
99  const Pixel& getLastPixelWithVOffset(const std::set<Pixel>& pixels, int vStart, int vOffset) const;
100 
102  const Pixel& getFirstPixelWithVOffset(const std::set<Pixel>& pixels, int vStart, int vOffset) const;
103 
110 
112  std::unique_ptr<DBObjPtr<PXDClusterShapeIndexPar>> m_shapeIndexFromDB;
114  std::unique_ptr<DBObjPtr<PXDClusterPositionEstimatorPar>> m_positionEstimatorFromDB;
115 
117  PXDClusterShapeIndexPar m_shapeIndexPar;
119  PXDClusterPositionEstimatorPar m_positionEstimatorPar;
120  };
121  }
123 } //Belle2 namespace
Belle2::PXD::PXDClusterPositionEstimator::getHeadPixel
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.
Definition: PXDClusterPositionEstimator.cc:99
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::PXDClusterOffsetPar
The class for PXD cluster position offset payload.
Definition: PXDClusterOffsetPar.h:32
Belle2::PXD::PXDClusterPositionEstimator::m_positionEstimatorPar
PXDClusterPositionEstimatorPar m_positionEstimatorPar
Currrent valid PXDClusterPositionEstimatorPar.
Definition: PXDClusterPositionEstimator.h:127
Belle2::PXD::PXDClusterPositionEstimator::getLastPixelWithVOffset
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.
Definition: PXDClusterPositionEstimator.cc:137
Belle2::PXD::PXDClusterPositionEstimator::computeShapeIndex
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.
Definition: PXDClusterPositionEstimator.cc:190
Belle2::PXD::Pixel
Class to represent one pixel, used in clustering for fast access.
Definition: Pixel.h:47
Belle2::PXD::PXDClusterPositionEstimator::getFirstPixelWithVOffset
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.
Definition: PXDClusterPositionEstimator.cc:158
Belle2::PXDClusterPositionEstimatorPar
The class for PXD cluster position lookup table payload.
Definition: PXDClusterPositionEstimatorPar.h:37
Belle2::PXDClusterShapeIndexPar
The class for PXD cluster shape index payload.
Definition: PXDClusterShapeIndexPar.h:34
Belle2::PXD::PXDClusterPositionEstimator::getShortName
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.
Definition: PXDClusterPositionEstimator.cc:174
Belle2::PXD::PXDClusterPositionEstimator::getSectorIndex
int getSectorIndex(double thetaU, double thetaV) const
Get sector index from angles.
Definition: PXDClusterPositionEstimator.cc:292
Belle2::PXD::PXDClusterPositionEstimator::getInstance
static PXDClusterPositionEstimator & getInstance()
Main (and only) way to access the PXDClusterPositionEstimator.
Definition: PXDClusterPositionEstimator.cc:51
Belle2::PXD::PXDClusterPositionEstimator::getMirroredShortName
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.
Definition: PXDClusterPositionEstimator.cc:201
Belle2::PXD::PXDClusterPositionEstimator::getShapeIndexParameters
const PXDClusterShapeIndexPar & getShapeIndexParameters() const
Return shape index parameters from Database.
Definition: PXDClusterPositionEstimator.h:60
Belle2::PXD::PXDClusterPositionEstimator::m_shapeIndexPar
PXDClusterShapeIndexPar m_shapeIndexPar
Current valid PXDClusterShapeIndex.
Definition: PXDClusterPositionEstimator.h:125
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::PXD::PXDClusterPositionEstimator::getClusterkind
int getClusterkind(const PXDCluster &cluster) const
Return kind of cluster needed to find cluster position correction.
Definition: PXDClusterPositionEstimator.cc:228
Belle2::PXD::PXDClusterPositionEstimator::setPositionEstimatorFromDB
void setPositionEstimatorFromDB()
Set PositionEstimator from DB.
Definition: PXDClusterPositionEstimator.cc:46
Belle2::PXD::PXDClusterPositionEstimator::getShapeLikelyhood
float getShapeLikelyhood(const PXDCluster &cluster, double tu, double tv) const
Return cluster shape likelyhood.
Definition: PXDClusterPositionEstimator.cc:73
Belle2::PXD::PXDClusterPositionEstimator::getClusterOffset
const PXDClusterOffsetPar * getClusterOffset(const PXDCluster &cluster, double tu, double tv) const
Return pointer to cluster offsets, can be nullptr.
Definition: PXDClusterPositionEstimator.cc:58
Belle2::PXD::PXDClusterPositionEstimator::m_positionEstimatorFromDB
std::unique_ptr< DBObjPtr< PXDClusterPositionEstimatorPar > > m_positionEstimatorFromDB
PXDClusterPositionEstimatorPar retrieved from DB.
Definition: PXDClusterPositionEstimator.h:122
Belle2::PXDCluster
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Definition: PXDCluster.h:41
Belle2::PXD::PXDClusterPositionEstimator::setShapeIndexFromDB
void setShapeIndexFromDB()
Set ShapeIndex from DB.
Definition: PXDClusterPositionEstimator.cc:41
Belle2::PXD::PXDClusterPositionEstimator::PXDClusterPositionEstimator
PXDClusterPositionEstimator()
Singleton class, hidden constructor.
Definition: PXDClusterPositionEstimator.h:113
Belle2::PXD::PXDClusterPositionEstimator::computeEta
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...
Definition: PXDClusterPositionEstimator.cc:84
Belle2::PXD::PXDClusterPositionEstimator::getFullName
const std::string getFullName(const std::set< Pixel > &pixels, int uStart, int vStart) const
Return a name for the pixel set.
Definition: PXDClusterPositionEstimator.cc:219
Belle2::PXD::PXDClusterPositionEstimator::getTailPixel
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.
Definition: PXDClusterPositionEstimator.cc:118
Belle2::PXD::PXDClusterPositionEstimator
Singleton class that estimates cluster positions taking into account the estimated track incidence an...
Definition: PXDClusterPositionEstimator.h:43
Belle2::PXD::PXDClusterPositionEstimator::operator=
PXDClusterPositionEstimator & operator=(const PXDClusterPositionEstimator &)=delete
Singleton class, forbidden assignment operator.
Belle2::PXD::PXDClusterPositionEstimator::m_shapeIndexFromDB
std::unique_ptr< DBObjPtr< PXDClusterShapeIndexPar > > m_shapeIndexFromDB
PXDClusterShapeIndex retrieved from DB.
Definition: PXDClusterPositionEstimator.h:120
Belle2::PXD::PXDClusterPositionEstimator::initialize
void initialize()
Initialize PXDClusterPositionEstimator from DB.
Definition: PXDClusterPositionEstimator.cc:25
Belle2::PXD::PXDClusterPositionEstimator::getPositionEstimatorParameters
const PXDClusterPositionEstimatorPar & getPositionEstimatorParameters() const
Return cluster position estimator parameters from Database.
Definition: PXDClusterPositionEstimator.h:57