Belle II Software development
PXDClusterPositionErrorPar Class Reference

The payload class for PXD cluster position error. More...

#include <PXDClusterPositionErrorPar.h>

Inheritance diagram for PXDClusterPositionErrorPar:

Public Member Functions

 PXDClusterPositionErrorPar (unsigned short nBinsU=1, unsigned short nBinsV=3, unsigned short maxSize=8, float defaultValue=0.0, float defaultFactor=1.0)
 Default constructor.
 
unsigned short getBinsU () const
 Get number of bins along sensor u side.
 
unsigned short getBinsV () const
 Get number of bins along sensor v side.
 
unsigned short getMaxClusterSize () const
 Get maximum cluster size that the error is defined.
 
unsigned short getGlobalID (unsigned short uBin, unsigned short vBin, unsigned short size) const
 Get global id from uBin and vBin and cluster size.
 
void setContent (unsigned short sensorID, unsigned short globalID, float value)
 Set map content.
 
void setContent (unsigned short sensorID, unsigned short uBin, unsigned short vBin, unsigned short size, float value)
 Set map content.
 
float getContent (unsigned short sensorID, unsigned short globalID) const
 Get content.
 
float getContent (unsigned short sensorID, unsigned short uBin, unsigned short vBin, unsigned short size) const
 Get content.
 
void setSensorUEdgeFactor (unsigned short sensorID, unsigned short globalID, float factor)
 Set scaling factor at sensor U edge.
 
void setSensorUEdgeFactor (unsigned short sensorID, unsigned short uBin, unsigned short vBin, unsigned short size, float factor)
 Set scaling factor at sensor U edge.
 
void setSensorVEdgeFactor (unsigned short sensorID, unsigned short globalID, float factor)
 Set scaling factor at sensor V edge.
 
void setSensorVEdgeFactor (unsigned short sensorID, unsigned short uBin, unsigned short vBin, unsigned short size, float factor)
 Set scaling factor at sensor V edge.
 
void setDeadNeighbourFactor (unsigned short sensorID, unsigned short globalID, float factor)
 Set scaling factor when neighbouring dead rows/columns.
 
void setDeadNeighbourFactor (unsigned short sensorID, unsigned short uBin, unsigned short vBin, unsigned short size, float factor)
 Set scaling factor when neighbouring dead rows/columns.
 
float getSensorUEdgeFactor (unsigned short sensorID, unsigned short globalID) const
 Get scaling factor at sensor edge in U.
 
float getSensorUEdgeFactor (unsigned short sensorID, unsigned short uBin, unsigned short vBin, unsigned short size) const
 Get scaling factor at sensor edge in U.
 
float getSensorVEdgeFactor (unsigned short sensorID, unsigned short globalID) const
 Get scaling factor at sensor edge in V.
 
float getSensorVEdgeFactor (unsigned short sensorID, unsigned short uBin, unsigned short vBin, unsigned short size) const
 Get scaling factor at sensor edge in V.
 
float getDeadNeighbourFactor (unsigned short sensorID, unsigned short globalID) const
 Get scaling factor when neighbouring dead rows/column.
 
float getDeadNeighbourFactor (unsigned short sensorID, unsigned short uBin, unsigned short vBin, unsigned short size) const
 Get scaling factor when neighbouring dead rows/column.
 
const std::unordered_map< unsigned short, std::vector< float > > & getClusterPositionErrorMap () const
 Return unordered_map with all PXD cluster position errors.
 

Private Member Functions

 ClassDef (PXDClusterPositionErrorPar, 8)
 ClassDef, must be the last term before the closing {}.
 

Private Attributes

unsigned short m_nBinsU
 Number of bins per sensor along u side.
 
unsigned short m_nBinsV
 Number of bins per sensor along v side.
 
unsigned short m_maxSize
 Maximum cluster size.
 
float m_defaultValue
 Default value for map.
 
float m_defaultFactor
 Default value for scale factor map.
 
std::unordered_map< unsigned short, std::vector< float > > m_factorSensorUEdgeMap
 Scaling factor at sensor U edge for layers 1 or 2 and FWD/BWD sensors with sensor number 1 or 2.
 
std::unordered_map< unsigned short, std::vector< float > > m_factorSensorVEdgeMap
 Scaling factor at sensor V edge for layers 1 or 2 and FWD/BWD sensors with sensor number 1 or 2.
 
std::unordered_map< unsigned short, std::vector< float > > m_factorDeadNeighbourMap
 Scaling factor when neighbouring dead rows/colums for FWD/BWD sensors by sensor number 1 or 2.
 
std::unordered_map< unsigned short, std::vector< float > > m_clusterPositionErrorMap
 Map for holding the cluster position errors for all PXD sensors by sensor id (unsigned short).
 

Detailed Description

The payload class for PXD cluster position error.

The payload class stores the expected cluster position error in [cm]. (Values are currently obtained from MC reco - true)

In principle, errors depend on cluster dimension and pixel cell size, and not on global position. (const cell size in u, 4 different sizes in v for Layer1/2 and for small/large cell regions) Nonetheless, error values are stored for each sensor in bins of u and v to accommodate the possibility to define errors as a function of position.

Position error is assigned to every cluster in PXDClusterizer module.

Definition at line 34 of file PXDClusterPositionErrorPar.h.

Constructor & Destructor Documentation

◆ PXDClusterPositionErrorPar()

PXDClusterPositionErrorPar ( unsigned short  nBinsU = 1,
unsigned short  nBinsV = 3,
unsigned short  maxSize = 8,
float  defaultValue = 0.0,
float  defaultFactor = 1.0 
)
inline

Default constructor.

Definition at line 38 of file PXDClusterPositionErrorPar.h.

39 :
40 m_nBinsU(nBinsU), m_nBinsV(nBinsV), m_maxSize(maxSize), m_defaultValue(defaultValue), m_defaultFactor(defaultFactor),
std::unordered_map< unsigned short, std::vector< float > > m_clusterPositionErrorMap
Map for holding the cluster position errors for all PXD sensors by sensor id (unsigned short).
unsigned short m_maxSize
Maximum cluster size.
float m_defaultFactor
Default value for scale factor map.
std::unordered_map< unsigned short, std::vector< float > > m_factorSensorUEdgeMap
Scaling factor at sensor U edge for layers 1 or 2 and FWD/BWD sensors with sensor number 1 or 2.
std::unordered_map< unsigned short, std::vector< float > > m_factorSensorVEdgeMap
Scaling factor at sensor V edge for layers 1 or 2 and FWD/BWD sensors with sensor number 1 or 2.
unsigned short m_nBinsU
Number of bins per sensor along u side.
std::unordered_map< unsigned short, std::vector< float > > m_factorDeadNeighbourMap
Scaling factor when neighbouring dead rows/colums for FWD/BWD sensors by sensor number 1 or 2.
unsigned short m_nBinsV
Number of bins per sensor along v side.

Member Function Documentation

◆ getBinsU()

unsigned short getBinsU ( ) const
inline

Get number of bins along sensor u side.

Definition at line 45 of file PXDClusterPositionErrorPar.h.

45{ return m_nBinsU; }

◆ getBinsV()

unsigned short getBinsV ( ) const
inline

Get number of bins along sensor v side.

Definition at line 49 of file PXDClusterPositionErrorPar.h.

49{ return m_nBinsV; }

◆ getClusterPositionErrorMap()

const std::unordered_map< unsigned short, std::vector< float > > & getClusterPositionErrorMap ( ) const
inline

Return unordered_map with all PXD cluster position errors.

Definition at line 316 of file PXDClusterPositionErrorPar.h.

◆ getContent() [1/2]

float getContent ( unsigned short  sensorID,
unsigned short  globalID 
) const
inline

Get content.

Parameters
sensorIDunique ID of the sensor
globalIDunique ID for part of sensor (uBin,vBin)
Returns
value cluster position error value to store

Definition at line 105 of file PXDClusterPositionErrorPar.h.

106 {
107 auto mapIter = m_clusterPositionErrorMap.find(sensorID);
108 if (mapIter != m_clusterPositionErrorMap.end()) {
109 // Found sensor, return position error value
110 auto& errVec = mapIter->second;
111 return errVec[globalID];
112 }
113 // Sensor not found, keep low profile and return default position error value
114 return m_defaultValue;
115 }

◆ getContent() [2/2]

float getContent ( unsigned short  sensorID,
unsigned short  uBin,
unsigned short  vBin,
unsigned short  size 
) const
inline

Get content.

Parameters
sensorIDunique ID of the sensor
uBinposition error bin along u side of sensor
vBinposition error bin along v side of sensor
sizecluster size
Returns
value cluster position error value to store

Definition at line 124 of file PXDClusterPositionErrorPar.h.

125 {
126 return getContent(sensorID, getGlobalID(uBin, vBin, size));
127 }
float getContent(unsigned short sensorID, unsigned short globalID) const
Get content.
unsigned short getGlobalID(unsigned short uBin, unsigned short vBin, unsigned short size) const
Get global id from uBin and vBin and cluster size.

◆ getDeadNeighbourFactor() [1/2]

float getDeadNeighbourFactor ( unsigned short  sensorID,
unsigned short  globalID 
) const
inline

Get scaling factor when neighbouring dead rows/column.

Parameters
sensorIDunique ID of the sensor
globalIDunique ID for part of sensor (uBin,vBin,size)
Returns
value scale factor when neighbouring dead rows/column

Definition at line 292 of file PXDClusterPositionErrorPar.h.

293 {
294 auto mapIter = m_factorDeadNeighbourMap.find(sensorID);
295 if (mapIter != m_factorDeadNeighbourMap.end()) {
296 // Found sensor, return scale factor value
297 auto& facVec = mapIter->second;
298 return facVec[globalID];
299 }
300 // Sensor not found, keep low profile and return default scale factor value
301 return m_defaultFactor;
302 }

◆ getDeadNeighbourFactor() [2/2]

float getDeadNeighbourFactor ( unsigned short  sensorID,
unsigned short  uBin,
unsigned short  vBin,
unsigned short  size 
) const
inline

Get scaling factor when neighbouring dead rows/column.

Parameters
sensorIDunique ID of the sensor
uBinposition error bin along u side of sensor
vBinposition error bin along v side of sensor
sizecluster size
Returns
value scale factor when neighbouring dead rows/columns

Definition at line 310 of file PXDClusterPositionErrorPar.h.

311 {
312 return getDeadNeighbourFactor(sensorID, getGlobalID(uBin, vBin, size));
313 }
float getDeadNeighbourFactor(unsigned short sensorID, unsigned short globalID) const
Get scaling factor when neighbouring dead rows/column.

◆ getGlobalID()

unsigned short getGlobalID ( unsigned short  uBin,
unsigned short  vBin,
unsigned short  size 
) const
inline

Get global id from uBin and vBin and cluster size.

Definition at line 59 of file PXDClusterPositionErrorPar.h.

60 {
61 if (size > m_maxSize) size = m_maxSize;
62 return uBin * (m_nBinsV * m_maxSize) + vBin * m_maxSize + size - 1;
63 }

◆ getMaxClusterSize()

unsigned short getMaxClusterSize ( ) const
inline

Get maximum cluster size that the error is defined.

Definition at line 53 of file PXDClusterPositionErrorPar.h.

53{ return m_maxSize; }

◆ getSensorUEdgeFactor() [1/2]

float getSensorUEdgeFactor ( unsigned short  sensorID,
unsigned short  globalID 
) const
inline

Get scaling factor at sensor edge in U.

Parameters
sensorIDunique ID of the sensor
globalIDunique ID for part of sensor (uBin,vBin,size)
Returns
value scale factor at sensor edge in U

Definition at line 236 of file PXDClusterPositionErrorPar.h.

237 {
238 auto mapIter = m_factorSensorUEdgeMap.find(sensorID);
239 if (mapIter != m_factorSensorUEdgeMap.end()) {
240 // Found sensor, return scale factor value
241 auto& facVec = mapIter->second;
242 return facVec[globalID];
243 }
244 // Sensor not found, keep low profile and return default scale factor value
245 return m_defaultFactor;
246 }

◆ getSensorUEdgeFactor() [2/2]

float getSensorUEdgeFactor ( unsigned short  sensorID,
unsigned short  uBin,
unsigned short  vBin,
unsigned short  size 
) const
inline

Get scaling factor at sensor edge in U.

Parameters
sensorIDunique ID of the sensor
uBinposition error bin along u side of sensor
vBinposition error bin along v side of sensor
sizecluster size
Returns
value scale factor at sensor edge in U

Definition at line 254 of file PXDClusterPositionErrorPar.h.

255 {
256 return getSensorUEdgeFactor(sensorID, getGlobalID(uBin, vBin, size));
257 }
float getSensorUEdgeFactor(unsigned short sensorID, unsigned short globalID) const
Get scaling factor at sensor edge in U.

◆ getSensorVEdgeFactor() [1/2]

float getSensorVEdgeFactor ( unsigned short  sensorID,
unsigned short  globalID 
) const
inline

Get scaling factor at sensor edge in V.

Parameters
sensorIDunique ID of the sensor
globalIDunique ID for part of sensor (uBin,vBin,size)
Returns
value scale factor at sensor edge in V

Definition at line 264 of file PXDClusterPositionErrorPar.h.

265 {
266 auto mapIter = m_factorSensorVEdgeMap.find(sensorID);
267 if (mapIter != m_factorSensorVEdgeMap.end()) {
268 // Found sensor, return scale factor value
269 auto& facVec = mapIter->second;
270 return facVec[globalID];
271 }
272 // Sensor not found, keep low profile and return default scale factor value
273 return m_defaultFactor;
274 }

◆ getSensorVEdgeFactor() [2/2]

float getSensorVEdgeFactor ( unsigned short  sensorID,
unsigned short  uBin,
unsigned short  vBin,
unsigned short  size 
) const
inline

Get scaling factor at sensor edge in V.

Parameters
sensorIDunique ID of the sensor
uBinposition error bin along u side of sensor
vBinposition error bin along v side of sensor
sizecluster size
Returns
value scale factor at sensor edge in V

Definition at line 282 of file PXDClusterPositionErrorPar.h.

283 {
284 return getSensorVEdgeFactor(sensorID, getGlobalID(uBin, vBin, size));
285 }
float getSensorVEdgeFactor(unsigned short sensorID, unsigned short globalID) const
Get scaling factor at sensor edge in V.

◆ setContent() [1/2]

void setContent ( unsigned short  sensorID,
unsigned short  globalID,
float  value 
)
inline

Set map content.

Parameters
sensorIDunique ID of the sensor
globalIDunique ID for part of sensor (uBin,vBin) and cluser size
valuecluster position error value to store

Definition at line 70 of file PXDClusterPositionErrorPar.h.

71 {
72 auto mapIter = m_clusterPositionErrorMap.find(sensorID);
73 if (mapIter != m_clusterPositionErrorMap.end()) {
74 // Already some values stored
75 auto& errVec = mapIter->second;
76 // Set the value
77 errVec[globalID] = value;
78 } else {
79 // Create a fresh position error vector
80 std::vector<float> errVec(m_nBinsU * m_nBinsV * m_maxSize, m_defaultValue);
81 // Set the value
82 errVec[globalID] = value;
83 // Add vector to map
84 m_clusterPositionErrorMap[sensorID] = errVec;
85 }
86 }

◆ setContent() [2/2]

void setContent ( unsigned short  sensorID,
unsigned short  uBin,
unsigned short  vBin,
unsigned short  size,
float  value 
)
inline

Set map content.

Parameters
sensorIDunique ID of the sensor
uBinposition error bin along u side of sensor
vBinposition error bin along v side of sensor
sizecluster size
valuecluster position error value to store

Definition at line 95 of file PXDClusterPositionErrorPar.h.

96 {
97 setContent(sensorID, getGlobalID(uBin, vBin, size), value);
98 }
void setContent(unsigned short sensorID, unsigned short globalID, float value)
Set map content.

◆ setDeadNeighbourFactor() [1/2]

void setDeadNeighbourFactor ( unsigned short  sensorID,
unsigned short  globalID,
float  factor 
)
inline

Set scaling factor when neighbouring dead rows/columns.

Parameters
sensorIDunique ID of the sensor
globalIDunique ID for part of sensor (uBin,vBin) and cluser size
factorscale factor value to store

Definition at line 202 of file PXDClusterPositionErrorPar.h.

203 {
204 auto mapIter = m_factorDeadNeighbourMap.find(sensorID);
205 if (mapIter != m_factorDeadNeighbourMap.end()) {
206 // Already some values stored
207 auto& facVec = mapIter->second;
208 // Set the value
209 facVec[globalID] = factor;
210 } else {
211 // Create a fresh scale factor vector
212 std::vector<float> facVec(m_nBinsU * m_nBinsV * m_maxSize, m_defaultFactor);
213 // Set the value
214 facVec[globalID] = factor;
215 // Add vector to map
216 m_factorDeadNeighbourMap[sensorID] = facVec;
217 }
218 }

◆ setDeadNeighbourFactor() [2/2]

void setDeadNeighbourFactor ( unsigned short  sensorID,
unsigned short  uBin,
unsigned short  vBin,
unsigned short  size,
float  factor 
)
inline

Set scaling factor when neighbouring dead rows/columns.

Parameters
sensorIDunique ID of the sensor
uBinposition error bin along u side of sensor
vBinposition error bin along v side of sensor
sizecluster size
factorscale factor value to store

Definition at line 226 of file PXDClusterPositionErrorPar.h.

227 {
228 setDeadNeighbourFactor(sensorID, getGlobalID(uBin, vBin, size), factor);
229 }
void setDeadNeighbourFactor(unsigned short sensorID, unsigned short globalID, float factor)
Set scaling factor when neighbouring dead rows/columns.

◆ setSensorUEdgeFactor() [1/2]

void setSensorUEdgeFactor ( unsigned short  sensorID,
unsigned short  globalID,
float  factor 
)
inline

Set scaling factor at sensor U edge.

Parameters
sensorIDunique ID of the sensor
globalIDunique ID for part of sensor (uBin,vBin) and cluser size
factorscale factor value to store

Definition at line 134 of file PXDClusterPositionErrorPar.h.

135 {
136 auto mapIter = m_factorSensorUEdgeMap.find(sensorID);
137 if (mapIter != m_factorSensorUEdgeMap.end()) {
138 // Already some values stored
139 auto& facVec = mapIter->second;
140 // Set the value
141 facVec[globalID] = factor;
142 } else {
143 // Create a fresh scale factor vector
144 std::vector<float> facVec(m_nBinsU * m_nBinsV * m_maxSize, m_defaultFactor);
145 // Set the value
146 facVec[globalID] = factor;
147 // Add vector to map
148 m_factorSensorUEdgeMap[sensorID] = facVec;
149 }
150 }

◆ setSensorUEdgeFactor() [2/2]

void setSensorUEdgeFactor ( unsigned short  sensorID,
unsigned short  uBin,
unsigned short  vBin,
unsigned short  size,
float  factor 
)
inline

Set scaling factor at sensor U edge.

Parameters
sensorIDunique ID of the sensor
uBinposition error bin along u side of sensor
vBinposition error bin along v side of sensor
sizecluster size
factorscale factor value to store

Definition at line 158 of file PXDClusterPositionErrorPar.h.

159 {
160 setSensorUEdgeFactor(sensorID, getGlobalID(uBin, vBin, size), factor);
161 }
void setSensorUEdgeFactor(unsigned short sensorID, unsigned short globalID, float factor)
Set scaling factor at sensor U edge.

◆ setSensorVEdgeFactor() [1/2]

void setSensorVEdgeFactor ( unsigned short  sensorID,
unsigned short  globalID,
float  factor 
)
inline

Set scaling factor at sensor V edge.

Parameters
sensorIDunique ID of the sensor
globalIDunique ID for part of sensor (uBin,vBin) and cluser size
factorscale factor value to store

Definition at line 168 of file PXDClusterPositionErrorPar.h.

169 {
170 auto mapIter = m_factorSensorVEdgeMap.find(sensorID);
171 if (mapIter != m_factorSensorVEdgeMap.end()) {
172 // Already some values stored
173 auto& facVec = mapIter->second;
174 // Set the value
175 facVec[globalID] = factor;
176 } else {
177 // Create a fresh scale factor vector
178 std::vector<float> facVec(m_nBinsU * m_nBinsV * m_maxSize, m_defaultFactor);
179 // Set the value
180 facVec[globalID] = factor;
181 // Add vector to map
182 m_factorSensorVEdgeMap[sensorID] = facVec;
183 }
184 }

◆ setSensorVEdgeFactor() [2/2]

void setSensorVEdgeFactor ( unsigned short  sensorID,
unsigned short  uBin,
unsigned short  vBin,
unsigned short  size,
float  factor 
)
inline

Set scaling factor at sensor V edge.

Parameters
sensorIDunique ID of the sensor
uBinposition error bin along u side of sensor
vBinposition error bin along v side of sensor
sizecluster size
factorscale factor value to store

Definition at line 192 of file PXDClusterPositionErrorPar.h.

193 {
194 setSensorVEdgeFactor(sensorID, getGlobalID(uBin, vBin, size), factor);
195 }
void setSensorVEdgeFactor(unsigned short sensorID, unsigned short globalID, float factor)
Set scaling factor at sensor V edge.

Member Data Documentation

◆ m_clusterPositionErrorMap

std::unordered_map<unsigned short, std::vector<float> > m_clusterPositionErrorMap
private

Map for holding the cluster position errors for all PXD sensors by sensor id (unsigned short).

Definition at line 345 of file PXDClusterPositionErrorPar.h.

◆ m_defaultFactor

float m_defaultFactor
private

Default value for scale factor map.

Definition at line 333 of file PXDClusterPositionErrorPar.h.

◆ m_defaultValue

float m_defaultValue
private

Default value for map.

Definition at line 330 of file PXDClusterPositionErrorPar.h.

◆ m_factorDeadNeighbourMap

std::unordered_map<unsigned short, std::vector<float> > m_factorDeadNeighbourMap
private

Scaling factor when neighbouring dead rows/colums for FWD/BWD sensors by sensor number 1 or 2.

Definition at line 342 of file PXDClusterPositionErrorPar.h.

◆ m_factorSensorUEdgeMap

std::unordered_map<unsigned short, std::vector<float> > m_factorSensorUEdgeMap
private

Scaling factor at sensor U edge for layers 1 or 2 and FWD/BWD sensors with sensor number 1 or 2.

Definition at line 336 of file PXDClusterPositionErrorPar.h.

◆ m_factorSensorVEdgeMap

std::unordered_map<unsigned short, std::vector<float> > m_factorSensorVEdgeMap
private

Scaling factor at sensor V edge for layers 1 or 2 and FWD/BWD sensors with sensor number 1 or 2.

Definition at line 339 of file PXDClusterPositionErrorPar.h.

◆ m_maxSize

unsigned short m_maxSize
private

Maximum cluster size.

Definition at line 327 of file PXDClusterPositionErrorPar.h.

◆ m_nBinsU

unsigned short m_nBinsU
private

Number of bins per sensor along u side.

Definition at line 321 of file PXDClusterPositionErrorPar.h.

◆ m_nBinsV

unsigned short m_nBinsV
private

Number of bins per sensor along v side.

Definition at line 324 of file PXDClusterPositionErrorPar.h.


The documentation for this class was generated from the following file: