The class for PXD cluster position lookup table payload.
More...
#include <PXDClusterPositionEstimatorPar.h>
|
| PXDClusterPositionEstimatorPar () |
| Default constructor.
|
|
| ~PXDClusterPositionEstimatorPar () |
| Destructor.
|
|
void | addGrid (int clusterkind, const TH2F &grid) |
| Add grid for clusterkind.
|
|
const std::map< int, TH2F > & | getGridMap () const |
| Return grid map.
|
|
void | setShapeClassifier (const PXDClusterShapeClassifierPar &classifier, int uBin, int vBin, int clusterkind) |
| Set shape classifier.
|
|
const PXDClusterShapeClassifierPar & | getShapeClassifier (int uBin, int vBin, int clusterkind) const |
| Returns shape classifier.
|
|
const PXDClusterShapeClassifierPar & | getShapeClassifier (double thetaU, double thetaV, int clusterkind) const |
| Returns shape classifier for incidence angles and clusterkind.
|
|
bool | hasClassifier (double thetaU, double thetaV, int clusterkind) const |
| Returns True if there is a classifier available.
|
|
const PXDClusterOffsetPar * | getOffset (int shape_index, float eta, double thetaU, double thetaV, int clusterkind) const |
| Returns correction (offset) for cluster shape relative to center of pixel (startU/startV) if available, otherwise returns nullptr.
|
|
float | getShapeLikelyhood (int shape_index, double thetaU, double thetaV, int clusterkind) const |
| Returns shape likelihood.
|
|
The class for PXD cluster position lookup table payload.
Definition at line 27 of file PXDClusterPositionEstimatorPar.h.
◆ PXDClusterPositionEstimatorPar()
◆ ~PXDClusterPositionEstimatorPar()
◆ addGrid()
void addGrid |
( |
int | clusterkind, |
|
|
const TH2F & | grid ) |
|
inline |
Add grid for clusterkind.
Definition at line 36 of file PXDClusterPositionEstimatorPar.h.
37 {
38 m_gridmap[clusterkind] = grid;
39 m_shapeClassifiers[clusterkind] = std::vector<PXDClusterShapeClassifierPar>();
40
41 for (auto uBin = 1; uBin <= m_gridmap[clusterkind].GetXaxis()->GetNbins(); uBin++) {
42 for (auto vBin = 1; vBin <= m_gridmap[clusterkind].GetYaxis()->GetNbins(); vBin++) {
43 auto size = m_shapeClassifiers[clusterkind].size();
44 m_gridmap[clusterkind].SetBinContent(uBin, vBin, size);
45 m_shapeClassifiers[clusterkind].push_back(PXDClusterShapeClassifierPar());
46 }
47 }
48 }
◆ getGridMap()
const std::map< int, TH2F > & getGridMap |
( |
| ) |
const |
|
inline |
◆ getOffset()
const PXDClusterOffsetPar * getOffset |
( |
int | shape_index, |
|
|
float | eta, |
|
|
double | thetaU, |
|
|
double | thetaV, |
|
|
int | clusterkind ) const |
|
inline |
Returns correction (offset) for cluster shape relative to center of pixel (startU/startV) if available, otherwise returns nullptr.
Definition at line 102 of file PXDClusterPositionEstimatorPar.h.
103 {
104
105 if (not hasClassifier(thetaU, thetaV, clusterkind)) {
106 return nullptr;
107 }
108 const PXDClusterShapeClassifierPar& classifier = getShapeClassifier(thetaU, thetaV, clusterkind);
109 return classifier.getOffset(shape_index, eta);
110 }
◆ getShapeClassifier() [1/2]
Returns shape classifier for incidence angles and clusterkind.
Definition at line 72 of file PXDClusterPositionEstimatorPar.h.
73 {
74 auto grid = m_gridmap.at(clusterkind);
75 int uBin = grid.GetXaxis()->FindBin(thetaU);
76 int vBin = grid.GetYaxis()->FindBin(thetaV);
77 int key = grid.GetBinContent(uBin, vBin);
78 return m_shapeClassifiers.at(clusterkind)[key];
79 }
◆ getShapeClassifier() [2/2]
Returns shape classifier.
Definition at line 64 of file PXDClusterPositionEstimatorPar.h.
65 {
66 int key = m_gridmap.at(clusterkind).GetBinContent(uBin, vBin);
67 const PXDClusterShapeClassifierPar& classifier = m_shapeClassifiers.at(clusterkind)[key];
68 return classifier;
69 }
◆ getShapeLikelyhood()
float getShapeLikelyhood |
( |
int | shape_index, |
|
|
double | thetaU, |
|
|
double | thetaV, |
|
|
int | clusterkind ) const |
|
inline |
Returns shape likelihood.
Returns zero if shape not known, otherwise positive float
Definition at line 113 of file PXDClusterPositionEstimatorPar.h.
114 {
115
116 if (not hasClassifier(thetaU, thetaV, clusterkind)) {
117 return 0;
118 }
119 auto likelyhoodMap = getShapeClassifier(thetaU, thetaV, clusterkind).getShapeLikelyhoodMap();
120
121
122 auto it = likelyhoodMap.find(shape_index);
123 if (it == likelyhoodMap.end())
124 return 0;
125
126 return it->second;
127 }
◆ hasClassifier()
bool hasClassifier |
( |
double | thetaU, |
|
|
double | thetaV, |
|
|
int | clusterkind ) const |
|
inline |
Returns True if there is a classifier available.
Definition at line 82 of file PXDClusterPositionEstimatorPar.h.
83 {
84
85 if (m_gridmap.find(clusterkind) == m_gridmap.end()) {
86 return false;
87 }
88
89
90 auto grid = m_gridmap.at(clusterkind);
91 int uBin = grid.GetXaxis()->FindBin(thetaU);
92 int vBin = grid.GetYaxis()->FindBin(thetaV);
93 int uBins = grid.GetXaxis()->GetNbins();
94 int vBins = grid.GetYaxis()->GetNbins();
95 if ((uBin < 1) || (uBin > uBins) || (vBin < 1) || (vBin > vBins))
96 return false;
97
98 return true;
99 }
◆ setShapeClassifier()
Set shape classifier.
Definition at line 57 of file PXDClusterPositionEstimatorPar.h.
58 {
59 int key = m_gridmap[clusterkind].GetBinContent(uBin, vBin);
60 m_shapeClassifiers[clusterkind][key] = classifier;
61 }
◆ m_gridmap
std::map<int, TH2F> m_gridmap |
|
private |
◆ m_shapeClassifiers
The documentation for this class was generated from the following file: