Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ITkPixelClusterErrorData.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ITKPIXELCLUSTERERRORDATA_H
6 #define ITKPIXELCLUSTERERRORDATA_H
7 
9 
10 #include "Identifier/Identifier.h"
13 
14 #include <string>
15 #include <vector>
16 #include <array>
17 #include <utility> //std::pair
18 #include <span>
19 
20 
21 namespace ITk
22 {
23 
25 {
26 
27  public:
28  enum EParam {
37  kNParam
38  };
39 
42 
45  std::pair<double,double> getDelta(IdentifierHash idHash,
46  int sizePhi, double angle,
47  int sizeZ, double eta) const;
48  std::pair<double,double> getDeltaError(IdentifierHash idHash) const {
49  const std::array<float,kNParam> &values = m_constmap.at(idHash);
50  return std::make_pair(values[kError_x],values[kError_y]);
51  }
52  void setDeltaError(IdentifierHash idHash,
53  float period_phi, float period_sinheta,
54  float delta_x_slope, float delta_x_offset, float error_x,
55  float delta_y_slope, float delta_y_offset, float error_y );
56  void setDeltaError(IdentifierHash idHash, const std::array<float, kNParam> &param ) {
57  m_constmap.at(idHash)=param;
58  }
59  void setDeltaError(IdentifierHash idHash, std::span<double> param ) {
60  std::array<float,kNParam> &dest=m_constmap.at(idHash);
61  if (param.size() != dest.size()) throw std::range_error("Parameter sizes do not match");
62  std::copy(param.begin(),param.end(), dest.begin());
63  }
64  void print(const std::string& file) const;
69  unsigned int load(const std::string& file);
70 
73  }
75  return m_pixelID->wafer_id(idHash);
76  }
77 
78  const std::vector< std::array<float, kNParam> > &getConstMap() const { return m_constmap; }
79 
80  private:
81  void initialize();
82  // map to store all ITk Analogue Clustering constants and errors
83  std::vector< std::array<float, kNParam> > m_constmap;
84 
85  const PixelID* m_pixelID{nullptr};
86 
87 };
88 
89 } // namespace ITk
90 
91 #endif
92 
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
ITk::PixelClusterErrorData::kDelta_y_slope
@ kDelta_y_slope
Definition: ITkPixelClusterErrorData.h:34
ITk::PixelClusterErrorData::kPeriod_phi
@ kPeriod_phi
Definition: ITkPixelClusterErrorData.h:29
perfmonmt-printer.dest
dest
Definition: perfmonmt-printer.py:189
ITk::PixelClusterErrorData::PixelClusterErrorData
PixelClusterErrorData()
Definition: ITkPixelClusterErrorData.h:40
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
ITk::PixelClusterErrorData::getIdentifierHash
IdentifierHash getIdentifierHash(Identifier identifier) const
Definition: ITkPixelClusterErrorData.h:71
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:364
python.Bindings.values
values
Definition: Control/AthenaPython/python/Bindings.py:805
ITk::PixelClusterErrorData
Definition: ITkPixelClusterErrorData.h:25
ITk::PixelClusterErrorData::kDelta_x_offset
@ kDelta_x_offset
Definition: ITkPixelClusterErrorData.h:32
ITk::PixelClusterErrorData::getDelta
std::pair< double, double > getDelta(IdentifierHash idHash, int sizePhi, double angle, int sizeZ, double eta) const
Methods to access the calibration data.
Definition: ITkPixelClusterErrorData.cxx:32
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:387
ITk::PixelClusterErrorData::kError_y
@ kError_y
Definition: ITkPixelClusterErrorData.h:36
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
file
TFile * file
Definition: tile_monitor.h:29
ITk::PixelClusterErrorData::getConstMap
const std::vector< std::array< float, kNParam > > & getConstMap() const
Definition: ITkPixelClusterErrorData.h:78
ITk::PixelClusterErrorData::print
void print(const std::string &file) const
Definition: ITkPixelClusterErrorData.cxx:68
ITk::PixelClusterErrorData::kDelta_y_offset
@ kDelta_y_offset
Definition: ITkPixelClusterErrorData.h:35
ITk
Definition: ITkPixelOfflineCalibCondAlg.cxx:13
IdentifierHash.h
ITk::PixelClusterErrorData::setDeltaError
void setDeltaError(IdentifierHash idHash, const std::array< float, kNParam > &param)
Definition: ITkPixelClusterErrorData.h:56
ITk::PixelClusterErrorData::m_pixelID
const PixelID * m_pixelID
Definition: ITkPixelClusterErrorData.h:85
ITk::PixelClusterErrorData::setDeltaError
void setDeltaError(IdentifierHash idHash, std::span< double > param)
Definition: ITkPixelClusterErrorData.h:59
ITk::PixelClusterErrorData::kError_x
@ kError_x
Definition: ITkPixelClusterErrorData.h:33
ITk::PixelClusterErrorData::load
unsigned int load(const std::string &file)
load cluster error data from ascii file
Definition: ITkPixelClusterErrorData.cxx:83
ITk::PixelClusterErrorData::~PixelClusterErrorData
~PixelClusterErrorData()
Definition: ITkPixelClusterErrorData.h:41
ITk::PixelClusterErrorData::kPeriod_sinheta
@ kPeriod_sinheta
Definition: ITkPixelClusterErrorData.h:30
ITk::PixelClusterErrorData::kNParam
@ kNParam
Definition: ITkPixelClusterErrorData.h:37
ITk::PixelClusterErrorData::initialize
void initialize()
Definition: ITkPixelClusterErrorData.cxx:18
ITk::PixelClusterErrorData::kDelta_x_slope
@ kDelta_x_slope
Definition: ITkPixelClusterErrorData.h:31
calibdata.copy
bool copy
Definition: calibdata.py:27
ITk::PixelClusterErrorData::m_constmap
std::vector< std::array< float, kNParam > > m_constmap
Definition: ITkPixelClusterErrorData.h:83
ITk::PixelClusterErrorData::getDeltaError
std::pair< double, double > getDeltaError(IdentifierHash idHash) const
Definition: ITkPixelClusterErrorData.h:48
ITk::PixelClusterErrorData::setDeltaError
void setDeltaError(IdentifierHash idHash, float period_phi, float period_sinheta, float delta_x_slope, float delta_x_offset, float error_x, float delta_y_slope, float delta_y_offset, float error_y)
Definition: ITkPixelClusterErrorData.cxx:56
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
PixelID
Definition: PixelID.h:67
CLASS_DEF.h
macros to associate a CLID to a type
ITk::PixelClusterErrorData::EParam
EParam
Definition: ITkPixelClusterErrorData.h:28
ITk::PixelClusterErrorData::getIdentifier
Identifier getIdentifier(IdentifierHash idHash) const
Definition: ITkPixelClusterErrorData.h:74
Identifier
Definition: IdentifierFieldParser.cxx:14