10#include <framework/logging/Logger.h>
34 typedef std::vector< typename T::payloadContainerType >
SVDSensor;
43 typedef std::vector< SVDLayer >
SVD;
53 enum E_side { Vindex = 0, Uindex = 1 };
58 typename T::calibrationType(),
59 const TString& uniqueID =
""):
m_uniqueID(uniqueID)
63 int laddersOnLayer[] = { 0, 0, 0, 8, 11, 13, 17 };
64 for (
unsigned int layer = 0 ; layer <
calibrations.size() ; 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 ++) {
71 T::init(
calibrations[layer][ladder][sensor][ Uindex ], layer, ladder, sensor, Uindex,
73 T::init(
calibrations[layer][ladder][sensor][ Vindex ], layer, ladder, sensor, Vindex,
94 typename T::calibrationType
get(
unsigned int layer,
98 unsigned int strip)
const
101 B2FATAL(
"Layers vector is smaller than " << layer);
104 if (ladders.size() <= ladder) {
105 B2FATAL(
"Ladders vector is smaller than " << ladder);
107 const auto& sensors = ladders[ladder];
108 if (sensors.size() <= sensor) {
109 B2FATAL(
"Sensors vector is smaller than " << sensor);
111 const auto& sides = sensors[sensor];
112 if (sides.size() <= side) {
113 B2FATAL(
"Sides vector is smaller than " << side);
116 return T::get(sides[side], strip);
133 unsigned int strip)
const
136 B2FATAL(
"Layers vector is smaller than " << layer);
139 if (ladders.size() <= ladder) {
140 B2FATAL(
"Ladders vector is smaller than " << ladder);
142 const auto& sensors = ladders[ladder];
143 if (sensors.size() <= sensor) {
144 B2FATAL(
"Sensors vector is smaller than " << sensor);
146 const auto& sides = sensors[sensor];
147 if (sides.size() <= side) {
148 B2FATAL(
"Sides vector is smaller than " << side);
151 return T::getReference(sides[side], strip);
170 void set(
unsigned int layer,
175 typename T::calibrationType value)
178 B2FATAL(
"Layers vector is smaller than " << layer);
181 if (ladders.size() <= ladder) {
182 B2FATAL(
"Ladders vector is smaller than " << ladder);
184 auto& sensors = ladders[ladder];
185 if (sensors.size() <= sensor) {
186 B2FATAL(
"Sensors vector is smaller than " << sensor);
188 auto& sides = sensors[sensor];
189 if (sides.size() <= side) {
190 B2FATAL(
"Sides vector is smaller than " << side);
193 return T::set(sides[side], strip, value);
base class for calibrations classes
TString m_uniqueID
The unique identifier is a private member of SVDCalibrationsBase, whose value is assigned in the cons...
SVD calibrations
an SVD calibration
std::vector< SVDLadder > SVDLayer
An SVDLayer is a vector of SVDLadders.
~SVDCalibrationsBase()
Simple destructor.
E_side sideIndex(bool isU) const
Return the array index of the side.
T t_perSideContainer
typedef of the container of each side
std::vector< SVDLayer > SVD
The SVD is a vector of SVDLayers.
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.
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.
SVDCalibrationsBase(typename T::calibrationType defaultT=typename T::calibrationType(), const TString &uniqueID="")
The default constructor initialize all the vectors.
E_side
This enumeration assure the same semantic of the isU methods defined by Peter Kv.
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 de...
std::vector< SVDSensor > SVDLadder
An SVDLadder is a vector of SVDSensors.
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.
Abstract base class for different kinds of events.