ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ITk::PixelOfflineCalibData Class Reference

#include <ITkPixelOfflineCalibData.h>

Collaboration diagram for ITk::PixelOfflineCalibData:

Public Member Functions

 PixelOfflineCalibData ()
 Constructor: More...
 
 PixelOfflineCalibData (const PixelOfflineCalibData &rhs)
 
PixelOfflineCalibDataoperator= (const PixelOfflineCalibData &rhs)
 
 ~PixelOfflineCalibData ()=default
 default destructor More...
 
bool update (const PixelClusterErrorData &idat)
 
PixelClusterErrorDatagetClusterErrorData ()
 
const PixelClusterErrorDatagetClusterErrorData () const
 
std::vector< float > getConstants () const
 
void setConstants (const std::vector< float > &constants)
 
void dump ()
 

Private Attributes

std::unique_ptr< PixelClusterErrorDatam_clusterErrorData {}
 

Detailed Description

The ITk::PixelOfflineCalibData is a class that designed to hold the data used by ITk pixel offline algorithms.

Definition at line 27 of file ITkPixelOfflineCalibData.h.

Constructor & Destructor Documentation

◆ PixelOfflineCalibData() [1/2]

ITk::PixelOfflineCalibData::PixelOfflineCalibData ( )
inline

Constructor:

Definition at line 31 of file ITkPixelOfflineCalibData.h.

32  : m_clusterErrorData(std::make_unique<PixelClusterErrorData>()) {}

◆ PixelOfflineCalibData() [2/2]

PixelOfflineCalibData::PixelOfflineCalibData ( const PixelOfflineCalibData rhs)
inline

Definition at line 55 of file ITkPixelOfflineCalibData.h.

55  {
56  m_clusterErrorData.reset(new PixelClusterErrorData(*rhs.m_clusterErrorData));
57 }

◆ ~PixelOfflineCalibData()

ITk::PixelOfflineCalibData::~PixelOfflineCalibData ( )
default

default destructor

Member Function Documentation

◆ dump()

void PixelOfflineCalibData::dump ( )

Definition at line 41 of file ITkPixelOfflineCalibData.cxx.

41  {
42  m_clusterErrorData->print("ITkPixelClusterDump.txt");
43  }

◆ getClusterErrorData() [1/2]

PixelClusterErrorData * PixelOfflineCalibData::getClusterErrorData ( )
inline

Definition at line 71 of file ITkPixelOfflineCalibData.h.

71  {
72  return m_clusterErrorData.get();
73 }

◆ getClusterErrorData() [2/2]

const PixelClusterErrorData * PixelOfflineCalibData::getClusterErrorData ( ) const
inline

Definition at line 75 of file ITkPixelOfflineCalibData.h.

75  {
76  return m_clusterErrorData.get();
77 }

◆ getConstants()

std::vector< float > PixelOfflineCalibData::getConstants ( ) const

Definition at line 17 of file ITkPixelOfflineCalibData.cxx.

17  {
18 
19  std::map< const Identifier, std::vector<double> > constMap = m_clusterErrorData->getConstMap();
20 
21  int entry_size = 9; // pixel Id + period_phi + period_sinheta + delta_x_slope + delta_x_offset + delta_err_x + delta_y_slope + delta_y_offset + delta_err_y
22  int data_size = entry_size*constMap.size();
23 
24  std::vector<float> constants;
25  constants.reserve(data_size);
26 
27  for(auto& x : constMap){
28 
29  long long pixelId(x.first.get_compact());
30  std::vector<double> value = x.second;
31 
32  constants.push_back(pixelId);
33  for(auto& y : value) constants.push_back(y);
34 
35  }
36 
37  return constants;
38 
39  }

◆ operator=()

PixelOfflineCalibData & PixelOfflineCalibData::operator= ( const PixelOfflineCalibData rhs)
inline

Definition at line 59 of file ITkPixelOfflineCalibData.h.

59  {
60  if (this != &rhs) {
61  m_clusterErrorData.reset(new PixelClusterErrorData(*rhs.m_clusterErrorData));
62  }
63  return (*this);
64 }

◆ setConstants()

void PixelOfflineCalibData::setConstants ( const std::vector< float > &  constants)

Definition at line 46 of file ITkPixelOfflineCalibData.cxx.

46  {
47 
48  int entry_size = 9;
49  int map_size = constants.size()/entry_size;
50 
51  for(int i=0;i<map_size;i++){
52 
53  long long pixelId_long = constants[i*entry_size];
54  std::ostringstream ss;
55  ss << "0x" << std::hex << pixelId_long;
56  std::string pixelId_str(ss.str());
57  Identifier pixelId;
58  pixelId.set(pixelId_str);
59 
60  double period_phi = constants[i*entry_size + 1];
61  double period_sinheta = constants[i*entry_size + 2];
62  double delta_x_slope = constants[i*entry_size + 3];
63  double delta_x_offset = constants[i*entry_size + 4];
64  double delta_err_x = constants[i*entry_size + 5];
65  double delta_y_slope = constants[i*entry_size + 6];
66  double delta_y_offset = constants[i*entry_size + 7];
67  double delta_err_y = constants[i*entry_size + 8];
68 
69  m_clusterErrorData->setDeltaError(&pixelId, period_phi, period_sinheta,
70  delta_x_slope, delta_x_offset, delta_err_x,
71  delta_y_slope, delta_y_offset, delta_err_y);
72 
73  }
74  }

◆ update()

bool PixelOfflineCalibData::update ( const PixelClusterErrorData idat)
inline

Definition at line 66 of file ITkPixelOfflineCalibData.h.

66  {
67  *m_clusterErrorData = idat;
68  return true;
69 }

Member Data Documentation

◆ m_clusterErrorData

std::unique_ptr<PixelClusterErrorData> ITk::PixelOfflineCalibData::m_clusterErrorData {}
private

Definition at line 51 of file ITkPixelOfflineCalibData.h.


The documentation for this class was generated from the following files:
Identifier::set
void set(const std::string &id)
build from a string form - hexadecimal
Definition: Identifier.cxx:12
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
athena.value
value
Definition: athena.py:124
x
#define x
ITk::PixelOfflineCalibData::m_clusterErrorData
std::unique_ptr< PixelClusterErrorData > m_clusterErrorData
Definition: ITkPixelOfflineCalibData.h:51
lumiFormat.i
int i
Definition: lumiFormat.py:85
y
#define y
constants
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:1
Identifier
Definition: IdentifierFieldParser.cxx:14