Belle II Software development
SVDCalibrationsBase< T > Class Template Reference

base class for calibrations classes More...

#include <SVDCalibrationsBase.h>

Inheritance diagram for SVDCalibrationsBase< T >:

Public Types

enum  E_side {
  Vindex = 0 ,
  Uindex = 1
}
 This enumeration assure the same semantic of the isU methods defined by Peter Kv. More...
 
typedef T t_perSideContainer
 typedef of the container of each side
 

Public Member Functions

 SVDCalibrationsBase (typename T::calibrationType defaultT=typename T::calibrationType(), const TString &uniqueID="")
 The default constructor initialize all the vectors.
 
 ~SVDCalibrationsBase ()
 Simple destructor.
 
T::calibrationType get (unsigned int layer, unsigned int ladder, unsigned int sensor, unsigned int side, unsigned int strip) const
 Return the calibration associated to a given strip.
 
const T::calibrationType & getReference (unsigned int layer, unsigned int ladder, unsigned int sensor, unsigned int side, unsigned int strip) const
 Return a reference to the calibration associated to a given strip.
 
TString get_uniqueID () const
 Get the unique ID of the calibration.
 
void set (unsigned int layer, unsigned int ladder, unsigned int sensor, unsigned int side, unsigned int strip, typename T::calibrationType value)
 Set the calibration associated to a given strip.
 
E_side sideIndex (bool isU) const
 Return the array index of the side.
 

Private Types

typedef std::vector< typename T::payloadContainerType > SVDSensor
 T::payloadContainerType can be a vector whose length is the number of strips per side or a list of defect on a given side This vector will have length 2.
 
typedef std::vector< SVDSensorSVDLadder
 An SVDLadder is a vector of SVDSensors.
 
typedef std::vector< SVDLadderSVDLayer
 An SVDLayer is a vector of SVDLadders.
 
typedef std::vector< SVDLayerSVD
 The SVD is a vector of SVDLayers.
 

Private Attributes

SVD calibrations
 an SVD calibration
 
TString m_uniqueID
 The unique identifier is a private member of SVDCalibrationsBase, whose value is assigned in the constructor.
 

Detailed Description

template<class T>
class Belle2::SVDCalibrationsBase< T >

base class for calibrations classes

Definition at line 24 of file SVDCalibrationsBase.h.

Member Typedef Documentation

◆ SVD

typedef std::vector< SVDLayer > SVD
private

The SVD is a vector of SVDLayers.

Definition at line 43 of file SVDCalibrationsBase.h.

◆ SVDLadder

typedef std::vector< SVDSensor > SVDLadder
private

An SVDLadder is a vector of SVDSensors.

Definition at line 37 of file SVDCalibrationsBase.h.

◆ SVDLayer

typedef std::vector< SVDLadder > SVDLayer
private

An SVDLayer is a vector of SVDLadders.

Definition at line 40 of file SVDCalibrationsBase.h.

◆ SVDSensor

typedef std::vector< typename T::payloadContainerType > SVDSensor
private

T::payloadContainerType can be a vector whose length is the number of strips per side or a list of defect on a given side This vector will have length 2.

Index 0 for the V side, index 1 for the U side Please, please, pleaseeeee use SVDCalibrationBase<...>::UIndex and SVDCalibrationBase<...>::VIndex instead of 1 and 0 for better code readibility

Definition at line 34 of file SVDCalibrationsBase.h.

◆ t_perSideContainer

typedef T t_perSideContainer

typedef of the container of each side

Definition at line 209 of file SVDCalibrationsBase.h.

Member Enumeration Documentation

◆ E_side

enum E_side

This enumeration assure the same semantic of the isU methods defined by Peter Kv.

Definition at line 53 of file SVDCalibrationsBase.h.

53{ Vindex = 0, Uindex = 1 };

Constructor & Destructor Documentation

◆ SVDCalibrationsBase()

SVDCalibrationsBase ( typename T::calibrationType  defaultT = typename T::calibrationType(),
const TString &  uniqueID = "" 
)
inline

The default constructor initialize all the vectors.

Definition at line 57 of file SVDCalibrationsBase.h.

59 : m_uniqueID(uniqueID) // Add a string as unique identifier for a given configuration dataset
60 {
61
62 calibrations.resize(7); // Layers 0 1 2 3 4 5 6
63 int laddersOnLayer[] = { 0, 0, 0, 8, 11, 13, 17 };
64 for (unsigned int layer = 0 ; layer < calibrations.size() ; layer ++) {
65 calibrations[layer].resize(laddersOnLayer[layer]);
66 int sensorsOnLadder[] = {0, 0, 0, 3, 4, 5, 6};
67 for (unsigned int ladder = 1; ladder < calibrations[layer].size(); ladder ++) {
68 calibrations[layer][ladder].resize(sensorsOnLadder[ layer ]);
69 for (unsigned int sensor = 1; sensor < calibrations[layer][ladder].size() ; sensor ++) {
70 calibrations[layer][ladder][sensor].resize(2);
71 T::init(calibrations[layer][ladder][sensor][ Uindex ], layer, ladder, sensor, Uindex,
72 defaultT);
73 T::init(calibrations[layer][ladder][sensor][ Vindex ], layer, ladder, sensor, Vindex,
74 defaultT);
75 }
76 }
77 }
78 }
TString m_uniqueID
The unique identifier is a private member of SVDCalibrationsBase, whose value is assigned in the cons...
SVD calibrations
an SVD calibration

◆ ~SVDCalibrationsBase()

~SVDCalibrationsBase ( )
inline

Simple destructor.

Definition at line 82 of file SVDCalibrationsBase.h.

82{ };

Member Function Documentation

◆ get()

T::calibrationType get ( unsigned int  layer,
unsigned int  ladder,
unsigned int  sensor,
unsigned int  side,
unsigned int  strip 
) const
inline

Return the calibration associated to a given strip.

Return the calibration associated to a given strip identified by:

Parameters
layeris the layer number (2 to 6 in the present geometry)
ladderis the ladder number ( 1 to 7 for layer 3, 1 to 10 for layer 4 etc...)
sensoris the sensor number ( 1 to 2 for layer 3, 1 to 3 for layer 4 etc...)
sideis the sensor view: 1 for Side U ( Side P ), 0 for side V (Side N)
stripis the strip number: from 1 to 512 or 768 depending on the sensor it throws std::out_of_range if the strip is unknown

Definition at line 94 of file SVDCalibrationsBase.h.

99 {
100 if (calibrations.size() <= layer) {
101 B2FATAL("Layers vector is smaller than " << layer);
102 }
103 const auto& ladders = calibrations[layer];
104 if (ladders.size() <= ladder) {
105 B2FATAL("Ladders vector is smaller than " << ladder);
106 }
107 const auto& sensors = ladders[ladder];
108 if (sensors.size() <= sensor) {
109 B2FATAL("Sensors vector is smaller than " << sensor);
110 }
111 const auto& sides = sensors[sensor];
112 if (sides.size() <= side) {
113 B2FATAL("Sides vector is smaller than " << side);
114 }
115
116 return T::get(sides[side], strip);
117 }

◆ get_uniqueID()

TString get_uniqueID ( ) const
inline

Get the unique ID of the calibration.

Definition at line 157 of file SVDCalibrationsBase.h.

157{return m_uniqueID;}

◆ getReference()

const T::calibrationType & getReference ( unsigned int  layer,
unsigned int  ladder,
unsigned int  sensor,
unsigned int  side,
unsigned int  strip 
) const
inline

Return a reference to the calibration associated to a given strip.

Return a reference to the calibration associated to a given strip identified by:

Parameters
layeris the layer number (2 to 6 in the present geometry)
ladderis the ladder number ( 1 to 7 for layer 3, 1 to 10 for layer 4 etc...)
sensoris the sensor number ( 1 to 2 for layer 3, 1 to 3 for layer 4 etc...)
sideis the sensor view: 1 for Side U ( Side P ), 0 for side V (Side N)
stripis the strip number: from 1 to 512 or 768 depending on the sensor it throws std::out_of_range if the strip is unknown

Definition at line 129 of file SVDCalibrationsBase.h.

134 {
135 if (calibrations.size() <= layer) {
136 B2FATAL("Layers vector is smaller than " << layer);
137 }
138 const auto& ladders = calibrations[layer];
139 if (ladders.size() <= ladder) {
140 B2FATAL("Ladders vector is smaller than " << ladder);
141 }
142 const auto& sensors = ladders[ladder];
143 if (sensors.size() <= sensor) {
144 B2FATAL("Sensors vector is smaller than " << sensor);
145 }
146 const auto& sides = sensors[sensor];
147 if (sides.size() <= side) {
148 B2FATAL("Sides vector is smaller than " << side);
149 }
150
151 return T::getReference(sides[side], strip);
152 }

◆ set()

void set ( unsigned int  layer,
unsigned int  ladder,
unsigned int  sensor,
unsigned int  side,
unsigned int  strip,
typename T::calibrationType  value 
)
inline

Set the calibration associated to a given strip.

Return the calibration associated to a given strip identified by:

Parameters
layeris the layer number (2 to 6 in the present geometry)
ladderis the ladder number ( 1 to 7 for layer 3, 1 to 10 for layer 4 etc...)
sensoris the sensor number ( 1 to 2 for layer 3, 1 to 3 for layer 4 etc...)
sideis the sensor view: 1 for Side U ( Side P ), 0 for side V (Side N)
stripis the strip number: from 1 to 512 or 768 depending on the sensor
valueit throws std::out_of_range if the strip is unknown

Definition at line 170 of file SVDCalibrationsBase.h.

176 {
177 if (calibrations.size() <= layer) {
178 B2FATAL("Layers vector is smaller than " << layer);
179 }
180 auto& ladders = calibrations[layer];
181 if (ladders.size() <= ladder) {
182 B2FATAL("Ladders vector is smaller than " << ladder);
183 }
184 auto& sensors = ladders[ladder];
185 if (sensors.size() <= sensor) {
186 B2FATAL("Sensors vector is smaller than " << sensor);
187 }
188 auto& sides = sensors[sensor];
189 if (sides.size() <= side) {
190 B2FATAL("Sides vector is smaller than " << side);
191 }
192
193 return T::set(sides[side], strip, value);
194 }

◆ sideIndex()

E_side sideIndex ( bool  isU) const
inline

Return the array index of the side.

Parameters
isU

Definition at line 201 of file SVDCalibrationsBase.h.

202 {
203 if (isU)
204 return Uindex;
205 return Vindex;
206 // tertium non datur
207 }

Member Data Documentation

◆ calibrations

SVD calibrations
private

an SVD calibration

Definition at line 46 of file SVDCalibrationsBase.h.

◆ m_uniqueID

TString m_uniqueID
private

The unique identifier is a private member of SVDCalibrationsBase, whose value is assigned in the constructor.

Definition at line 212 of file SVDCalibrationsBase.h.


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