ATLAS Offline Software
Loading...
Searching...
No Matches
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
21namespace ITk
22{
23
25{
26
27 public:
39
42
44
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
72 return m_pixelID->wafer_hash(identifier);
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
Scalar eta() const
pseudorapidity method
macros to associate a CLID to a type
This is an Identifier helper class for the Pixel subdetector.
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
std::pair< double, double > getDeltaError(IdentifierHash idHash) const
void setDeltaError(IdentifierHash idHash, std::span< double > param)
void print(const std::string &file) const
IdentifierHash getIdentifierHash(Identifier identifier) const
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)
Identifier getIdentifier(IdentifierHash idHash) const
unsigned int load(const std::string &file)
load cluster error data from ascii file
std::pair< double, double > getDelta(IdentifierHash idHash, int sizePhi, double angle, int sizeZ, double eta) const
Methods to access the calibration data.
const std::vector< std::array< float, kNParam > > & getConstMap() const
std::vector< std::array< float, kNParam > > m_constmap
void setDeltaError(IdentifierHash idHash, const std::array< float, kNParam > &param)
This is a "hash" representation of an Identifier.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
TFile * file