7#include "GaudiKernel/ISvcLocator.h"
20 SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore")};
22 throw std::runtime_error(
"Could not retrieve DetectorStore");
24 StatusCode
sc = detStore->retrieve(
m_pixelID,
"PixelID");
26 throw std::runtime_error(
"Could not retrieve PixelID");
33 int sizePhi,
double angle,
34 int sizeZ,
double eta)
const
37 const std::array<float,kNParam> &value =
m_constmap.at(idHash);
45 double delta_x = delta_x_slope * std::fabs(
angle - period_phi*(sizePhi-2)) + delta_x_offset;
46 double delta_y = delta_y_slope * std::fabs(std::sinh(std::fabs(
eta)) - period_sinheta*(sizeZ-2)) + delta_y_offset;
47 return std::make_pair(delta_x,delta_y);
57 float period_phi,
float period_sinheta,
58 float delta_x_slope,
float delta_x_offset,
float error_x,
59 float delta_y_slope,
float delta_y_offset,
float error_y)
61 setDeltaError(idHash, std::array<float, kNParam>{period_phi, period_sinheta,
62 delta_x_slope, delta_x_offset, error_x,
63 delta_y_slope, delta_y_offset, error_y});
70 std::ofstream outfile(
file.c_str());
71 for(
unsigned int id_hash=0;
const std::array<float, kNParam> &values :
m_constmap){
73 for (
double a_val : values ) {
74 outfile <<
" " << a_val;
85 std::ifstream infile(
file.c_str() );
86 unsigned int n_entries=0;
96 double period_sinheta;
98 double delta_x_offset;
100 double delta_y_slope;
101 double delta_y_offset;
102 double delta_error_y;
104 while(!infile.eof()){
106 infile >> waferID_hash_int >> period_phi >> period_sinheta >> delta_x_slope >> delta_x_offset >> delta_error_x >> delta_y_slope >> delta_y_offset >> delta_error_y;
110 period_phi, period_sinheta,
111 delta_x_slope, delta_x_offset, delta_error_x,
112 delta_y_slope, delta_y_offset, delta_error_y);
120 throw std::runtime_error(
"ITkAnalogueClusteringConstantsFile \"" +
file +
"\" can not be read. Unable to proceed.");
Scalar eta() const
pseudorapidity method
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
void print(const std::string &file) 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)
const PixelID * m_pixelID
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.
std::vector< std::array< float, kNParam > > m_constmap
This is a "hash" representation of an Identifier.