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

#include <PixelClusterErrorData.h>

Collaboration diagram for PixelCalib::PixelClusterErrorData:

Public Member Functions

 PixelClusterErrorData ()
 
 ~PixelClusterErrorData ()
 
int getVersion () const
 Methods to access the calibration data. More...
 
void setVersion (int version)
 
float getPixelBarrelPhiError (int ibin) const
 
float getPixelBarrelEtaError (int ibin) const
 
float getPixelEndcapPhiError (int ibin) const
 
float getPixelEndcapRError (int ibin) const
 
float getPixelIBLPhiError (int ibin) const
 
float getPixelIBLEtaError (int ibin) const
 
int setPixelBarrelPhiError (int ibin, float error)
 
int setPixelBarrelEtaError (int ibin, float error)
 
int setPixelEndcapPhiError (int ibin, float error)
 
int setPixelEndcapRError (int ibin, float error)
 
int setPixelIBLPhiError (int ibin, float error)
 
int setPixelIBLEtaError (int ibin, float error)
 
int getEndcapBin (int etaClusterSize, int phiClusterSize) const
 
int getBarrelBin (double eta, int etaClusterSize, int phiClusterSize) const
 
int getNumberOfBarrelBins () const
 
int getNumberOfEndcapBins () const
 
void Print (const std::string &file) const
 
void Load (const std::string &file)
 

Private Member Functions

void Initialize ()
 

Private Attributes

std::vector< float > m_barrelphierror
 
std::vector< float > m_barreletaerror
 
std::vector< float > m_endcapphierror
 
std::vector< float > m_endcapetaerror
 
std::vector< float > m_iblphierror
 
std::vector< float > m_ibletaerror
 
int m_nPhi
 
int m_nZ
 
int m_version
 
std::vector< float > m_etaref
 

Detailed Description

Definition at line 27 of file PixelClusterErrorData.h.

Constructor & Destructor Documentation

◆ PixelClusterErrorData()

PixelCalib::PixelClusterErrorData::PixelClusterErrorData ( )
inline

Definition at line 30 of file PixelClusterErrorData.h.

30 { Initialize(); }

◆ ~PixelClusterErrorData()

PixelCalib::PixelClusterErrorData::~PixelClusterErrorData ( )
inline

Definition at line 31 of file PixelClusterErrorData.h.

31 {};

Member Function Documentation

◆ getBarrelBin()

int PixelCalib::PixelClusterErrorData::getBarrelBin ( double  eta,
int  etaClusterSize,
int  phiClusterSize 
) const

Definition at line 150 of file PixelClusterErrorData.cxx.

150  {
151 
152  int ieta=0;
153  int neta = m_etaref.size();
154  for(int i=0; i<neta; i++){ if(eta>m_etaref[i]) ieta=i; }
155  // phi cluster size bin
156  int iphi = phiClusterSize-1;
157  if(iphi > m_nPhi-1) iphi = m_nPhi-1;
158  // z cluster size bin
159  int iz = etaClusterSize-1;
160  if(iz > m_nZ-1) iz = m_nZ-1;
161 
162  return m_nZ*m_nPhi*ieta+m_nZ*iphi+iz;
163 }

◆ getEndcapBin()

int PixelCalib::PixelClusterErrorData::getEndcapBin ( int  etaClusterSize,
int  phiClusterSize 
) const

Definition at line 165 of file PixelClusterErrorData.cxx.

165  {
166 
167  // std::cout << "getting bin..." << std::endl;
168  int iphi = phiClusterSize-1;
169  if(iphi > m_nPhi-1) iphi = m_nPhi-1;
170  int iz = etaClusterSize-1;
171  if(iz > m_nZ-1) iz = m_nZ-1;
172  // std::cout << "returning" << m_nZ*iphi+iz << std::endl;
173  return m_nZ*iphi+iz;
174 }

◆ getNumberOfBarrelBins()

int PixelCalib::PixelClusterErrorData::getNumberOfBarrelBins ( ) const
inline

Definition at line 59 of file PixelClusterErrorData.h.

59 { return m_barrelphierror.size(); }

◆ getNumberOfEndcapBins()

int PixelCalib::PixelClusterErrorData::getNumberOfEndcapBins ( ) const
inline

Definition at line 60 of file PixelClusterErrorData.h.

60 { return m_endcapphierror.size(); }

◆ getPixelBarrelEtaError()

float PixelCalib::PixelClusterErrorData::getPixelBarrelEtaError ( int  ibin) const

Definition at line 89 of file PixelClusterErrorData.cxx.

89  {
90  if(ibin < 0) return -1;
91  if(static_cast<unsigned int>(ibin) > m_barreletaerror.size()) return -1;
92  return m_barreletaerror[ibin];
93 }

◆ getPixelBarrelPhiError()

float PixelCalib::PixelClusterErrorData::getPixelBarrelPhiError ( int  ibin) const

Definition at line 83 of file PixelClusterErrorData.cxx.

83  {
84  if(ibin < 0) return -1;
85  if(static_cast<unsigned int>(ibin) > m_barrelphierror.size()) return -1;
86  return m_barrelphierror[ibin];
87 }

◆ getPixelEndcapPhiError()

float PixelCalib::PixelClusterErrorData::getPixelEndcapPhiError ( int  ibin) const

Definition at line 71 of file PixelClusterErrorData.cxx.

71  {
72  if(ibin < 0) return -1;
73  if(static_cast<unsigned int>(ibin) > m_endcapphierror.size()) return -1;
74  return m_endcapphierror[ibin];
75 }

◆ getPixelEndcapRError()

float PixelCalib::PixelClusterErrorData::getPixelEndcapRError ( int  ibin) const

Definition at line 77 of file PixelClusterErrorData.cxx.

77  {
78  if(ibin < 0) return -1;
79  if(static_cast<unsigned int>(ibin) > m_endcapetaerror.size()) return -1;
80  return m_endcapetaerror[ibin];
81 }

◆ getPixelIBLEtaError()

float PixelCalib::PixelClusterErrorData::getPixelIBLEtaError ( int  ibin) const

Definition at line 102 of file PixelClusterErrorData.cxx.

102  {
103  if(ibin < 0||m_version>-2) return -1;
104  if(static_cast<unsigned int>(ibin) > m_ibletaerror.size()) return -1;
105  return m_ibletaerror[ibin];
106 }

◆ getPixelIBLPhiError()

float PixelCalib::PixelClusterErrorData::getPixelIBLPhiError ( int  ibin) const

Definition at line 96 of file PixelClusterErrorData.cxx.

96  {
97  if(ibin < 0||m_version>-2) return -1;
98  if(static_cast<unsigned int>(ibin) > m_iblphierror.size()) return -1;
99  return m_iblphierror[ibin];
100 }

◆ getVersion()

int PixelCalib::PixelClusterErrorData::getVersion ( ) const

Methods to access the calibration data.

Definition at line 69 of file PixelClusterErrorData.cxx.

69 { return m_version; }

◆ Initialize()

void PixelCalib::PixelClusterErrorData::Initialize ( )
private

Definition at line 23 of file PixelClusterErrorData.cxx.

23  {
24 
25  m_version = 1;
26  // number of bins of parametrizations
27  m_nPhi=3; m_nZ=4;
28  // Bins of eta parametrization for barrel
29  // m_etaref = 0;
30  m_etaref.reserve(6);
31  m_etaref.push_back(0.00);
32  m_etaref.push_back(0.55);
33  m_etaref.push_back(0.87);
34  m_etaref.push_back(1.32);
35  m_etaref.push_back(2.00);
36  m_etaref.push_back(2.95);
37 
38  // m_barrelphierror = 0;
39  // m_barreletaerror = 0;
40  m_barrelphierror.reserve(60);
41  m_barreletaerror.reserve(60);
42  for(int i = 0; i<60; i++){
43  m_barrelphierror.push_back(14.43*CLHEP::micrometer);
44  m_barreletaerror.push_back(115.5*CLHEP::micrometer);
45  }
46 
47  // m_endcapphierror = 0;
48  // m_endcapetaerror = 0;
49  m_endcapphierror.reserve(12);
50  m_endcapetaerror.reserve(12);
51  for(int i=0; i<12; i++){
52  m_endcapphierror.push_back(14.43*CLHEP::micrometer);
53  m_endcapetaerror.push_back(115.5*CLHEP::micrometer);
54  }
55 
56  // IBL
57  // m_iblphierror = 0;
58  // m_ibletaerror = 0;
59  m_iblphierror.reserve(60);
60  m_ibletaerror.reserve(60);
61  for(int i = 0; i<60; i++){
62  m_iblphierror.push_back(14.43*CLHEP::micrometer);
63  m_ibletaerror.push_back(72.2*CLHEP::micrometer);
64  }
65  }

◆ Load()

void PixelCalib::PixelClusterErrorData::Load ( const std::string &  file)

Definition at line 200 of file PixelClusterErrorData.cxx.

200  {
201  std::ifstream infile(file.c_str());
202 
203  // number of bins for barrel and endcap
204  int nb = 0;
205  int ne = 0;
206 
207  infile >> m_version;
208  if(m_version >= 0){ // very first format, without version number in file
209  nb = m_version;
210  m_version = 0;
211  infile >> ne;
212  }
213  else{
214  infile >> nb >> ne;
215  }
216 
217  m_barrelphierror.clear();
218  m_barreletaerror.clear();
219  m_endcapphierror.clear();
220  m_endcapetaerror.clear();
221  m_iblphierror.clear();
222  m_ibletaerror.clear();
223 
224  float value;
225  if(nb<0) nb=0;
226  else if(nb>nmax) nb=nmax;
227  if(ne<0) ne=0;
228  else if(ne>nmax) ne=nmax;
229  for(int ib=0; ib<nb && !infile.eof(); ib++){
230  infile >> value;
231  m_barrelphierror.push_back(value);
232  infile >> value;
233  m_barreletaerror.push_back(value);
234  }
235  for(int ie=0; ie<ne && !infile.eof(); ie++){
236  infile >> value;
237  m_endcapphierror.push_back(value);
238  infile >> value;
239  m_endcapetaerror.push_back(value);
240  }
241  // there is more data for IBL some version number ?
242  if(m_version<-1){
243  for(int ib=0; ib<nb; ib++){
244  infile >> value;
245  m_iblphierror.push_back(value);
246  infile >> value;
247  m_ibletaerror.push_back(value);
248  }
249  }
250 
251  infile.close();
252 }

◆ Print()

void PixelCalib::PixelClusterErrorData::Print ( const std::string &  file) const

Definition at line 176 of file PixelClusterErrorData.cxx.

176  {
177 
178  std::ofstream* outfile = new std::ofstream(file.c_str());
179 
180  if(m_version < 0) *outfile << m_version << std::endl;
181  *outfile << m_barrelphierror.size() << std::endl;
182  *outfile << m_endcapphierror.size() << std::endl;
183  for(unsigned int ib=0; ib<m_barrelphierror.size(); ib++){
184  *outfile << m_barrelphierror[ib] << " " << m_barreletaerror[ib] << std::endl;
185  }
186  for(unsigned int ie=0; ie<m_endcapphierror.size(); ie++){
187  *outfile << m_endcapphierror[ie] << " " << m_endcapetaerror[ie] << std::endl;
188  }
189  // IBL ?
190  if(m_version<-1){
191  for(unsigned int ib=0; ib<m_iblphierror.size(); ib++){
192  *outfile << m_iblphierror[ib] << " " << m_ibletaerror[ib] << std::endl;
193  }
194  }
195 
196  outfile->close();
197  delete outfile;
198 }

◆ setPixelBarrelEtaError()

int PixelCalib::PixelClusterErrorData::setPixelBarrelEtaError ( int  ibin,
float  error 
)

Definition at line 129 of file PixelClusterErrorData.cxx.

129  {
130  if(ibin<0) return 0;
131  if(static_cast<unsigned int>(ibin)>m_barreletaerror.size()) return 0;
132  m_barreletaerror[ibin] = error;
133  return 1;
134 }

◆ setPixelBarrelPhiError()

int PixelCalib::PixelClusterErrorData::setPixelBarrelPhiError ( int  ibin,
float  error 
)

Definition at line 122 of file PixelClusterErrorData.cxx.

122  {
123  if(ibin<0) return 0;
124  if(static_cast<unsigned int>(ibin)>m_barrelphierror.size()) return 0;
125  m_barrelphierror[ibin] = error;
126  return 1;
127 }

◆ setPixelEndcapPhiError()

int PixelCalib::PixelClusterErrorData::setPixelEndcapPhiError ( int  ibin,
float  error 
)

Definition at line 108 of file PixelClusterErrorData.cxx.

108  {
109  if(ibin<0) return 0;
110  if(static_cast<unsigned int>(ibin)>m_endcapphierror.size()) return 0;
111  m_endcapphierror[ibin] = error;
112  return 1;
113 }

◆ setPixelEndcapRError()

int PixelCalib::PixelClusterErrorData::setPixelEndcapRError ( int  ibin,
float  error 
)

Definition at line 115 of file PixelClusterErrorData.cxx.

115  {
116  if(ibin<0) return 0;
117  if(static_cast<unsigned int>(ibin)>m_endcapetaerror.size()) return 0;
118  m_endcapetaerror[ibin] = error;
119  return 1;
120 }

◆ setPixelIBLEtaError()

int PixelCalib::PixelClusterErrorData::setPixelIBLEtaError ( int  ibin,
float  error 
)

Definition at line 143 of file PixelClusterErrorData.cxx.

143  {
144  if(ibin<0||m_version>-2) return 0;
145  if(static_cast<unsigned int>(ibin)>m_ibletaerror.size()) return 0;
146  m_ibletaerror[ibin] = error;
147  return 1;
148 }

◆ setPixelIBLPhiError()

int PixelCalib::PixelClusterErrorData::setPixelIBLPhiError ( int  ibin,
float  error 
)

Definition at line 136 of file PixelClusterErrorData.cxx.

136  {
137  if(ibin<0||m_version>-2) return 0;
138  if(static_cast<unsigned int>(ibin)>m_iblphierror.size()) return 0;
139  m_iblphierror[ibin] = error;
140  return 1;
141 }

◆ setVersion()

void PixelCalib::PixelClusterErrorData::setVersion ( int  version)

Definition at line 67 of file PixelClusterErrorData.cxx.

67 { m_version = version; }

Member Data Documentation

◆ m_barreletaerror

std::vector<float> PixelCalib::PixelClusterErrorData::m_barreletaerror
private

Definition at line 69 of file PixelClusterErrorData.h.

◆ m_barrelphierror

std::vector<float> PixelCalib::PixelClusterErrorData::m_barrelphierror
private

Definition at line 68 of file PixelClusterErrorData.h.

◆ m_endcapetaerror

std::vector<float> PixelCalib::PixelClusterErrorData::m_endcapetaerror
private

Definition at line 71 of file PixelClusterErrorData.h.

◆ m_endcapphierror

std::vector<float> PixelCalib::PixelClusterErrorData::m_endcapphierror
private

Definition at line 70 of file PixelClusterErrorData.h.

◆ m_etaref

std::vector<float> PixelCalib::PixelClusterErrorData::m_etaref
private

Definition at line 80 of file PixelClusterErrorData.h.

◆ m_ibletaerror

std::vector<float> PixelCalib::PixelClusterErrorData::m_ibletaerror
private

Definition at line 73 of file PixelClusterErrorData.h.

◆ m_iblphierror

std::vector<float> PixelCalib::PixelClusterErrorData::m_iblphierror
private

Definition at line 72 of file PixelClusterErrorData.h.

◆ m_nPhi

int PixelCalib::PixelClusterErrorData::m_nPhi
private

Definition at line 76 of file PixelClusterErrorData.h.

◆ m_nZ

int PixelCalib::PixelClusterErrorData::m_nZ
private

Definition at line 77 of file PixelClusterErrorData.h.

◆ m_version

int PixelCalib::PixelClusterErrorData::m_version
private

Definition at line 78 of file PixelClusterErrorData.h.


The documentation for this class was generated from the following files:
run.infile
string infile
Definition: run.py:13
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
PixelCalib::PixelClusterErrorData::m_ibletaerror
std::vector< float > m_ibletaerror
Definition: PixelClusterErrorData.h:73
PlotCalibFromCool.ib
ib
Definition: PlotCalibFromCool.py:419
athena.value
value
Definition: athena.py:124
PixelCalib::PixelClusterErrorData::Initialize
void Initialize()
Definition: PixelClusterErrorData.cxx:23
PixelCalib::PixelClusterErrorData::m_endcapphierror
std::vector< float > m_endcapphierror
Definition: PixelClusterErrorData.h:70
PixelCalib::PixelClusterErrorData::m_nPhi
int m_nPhi
Definition: PixelClusterErrorData.h:76
PlotCalibFromCool.ie
ie
Definition: PlotCalibFromCool.py:420
PixelCalib::PixelClusterErrorData::m_nZ
int m_nZ
Definition: PixelClusterErrorData.h:77
PixelCalib::PixelClusterErrorData::m_endcapetaerror
std::vector< float > m_endcapetaerror
Definition: PixelClusterErrorData.h:71
lumiFormat.i
int i
Definition: lumiFormat.py:85
file
TFile * file
Definition: tile_monitor.h:29
PixelCalib::PixelClusterErrorData::m_barrelphierror
std::vector< float > m_barrelphierror
Definition: PixelClusterErrorData.h:68
python.SystemOfUnits.micrometer
int micrometer
Definition: SystemOfUnits.py:71
PixelCalib::PixelClusterErrorData::m_etaref
std::vector< float > m_etaref
Definition: PixelClusterErrorData.h:80
get_generator_info.version
version
Definition: get_generator_info.py:33
PixelCalib::PixelClusterErrorData::m_version
int m_version
Definition: PixelClusterErrorData.h:78
nmax
const int nmax(200)
get_generator_info.error
error
Definition: get_generator_info.py:40
hotSpotInTAG.nb
nb
Definition: hotSpotInTAG.py:164
PixelCalib::PixelClusterErrorData::m_barreletaerror
std::vector< float > m_barreletaerror
Definition: PixelClusterErrorData.h:69
PrepareReferenceFile.outfile
outfile
Definition: PrepareReferenceFile.py:42
PixelCalib::PixelClusterErrorData::m_iblphierror
std::vector< float > m_iblphierror
Definition: PixelClusterErrorData.h:72