6#include "CLHEP/Units/SystemOfUnits.h"
48 for(
int i=0; i<nphibins+1; i++){
55 for(
int i = 0; i<nbiny; i++){
61 for(
int i = 0; i<nbinx; i++){
91 double errphi=50*CLHEP::micrometer/std::pow(12,0.5);
95 if(ang>12){ errphi = 50*CLHEP::micrometer/std::sqrt(12.); }
99 double frac = 0.8-0.6*ang/12;
100 errphi = frac*50*CLHEP::micrometer/std::sqrt(12.);
104 double delta = 3*CLHEP::micrometer;
105 errphi = 1.1*std::sqrt(errphi*errphi+delta*delta);
108 else if(deltax == 2){
112 if(ang > 14){ errphi = 25*CLHEP::micrometer/std::sqrt(12); }
113 else{ errphi = 3*CLHEP::micrometer+2.5*CLHEP::micrometer*ang/14; }
118 if(ang > 14){ errphi = 25*CLHEP::micrometer/std::sqrt(12); }
120 else{ errphi = deltax*50*CLHEP::micrometer/std::sqrt(12); }
126 if(ibin < 0)
return -1;
132 if(ibin < 0){
return -1; }
138 if(ibin < 0||m_version>-2)
return -1;
139 if(
static_cast<unsigned int>(ibin) >=
m_ibletaerror.size())
return -2;
144 if(ibin < 0||m_version>-2){
return -1; }
145 if(
static_cast<unsigned int>(ibin) >=
m_iblphierror.size()){
return -2;}
150 int phiClusterSize)
const {
154 for(
int i=0; i<nang; i++){
158 int nphi =
m_csx.size();
159 for(
int i=0; i<nphi; i++){
160 if(phiClusterSize>
m_csx[i]) iphi=i;
163 return nphi*iang+iphi;
167 int phiClusterSize)
const {
171 for(
int i=0; i<neta; i++){
175 int nphi =
m_csx.size();
176 for(
int i=0; i<nphi; i++){
177 if(phiClusterSize>
m_csx[i]) iphi=i;
181 int nz =
m_csy.size();
182 for(
int i=0; i<nz; i++){
183 if(etaClusterSize>
m_csy[i]) iz=i;
186 return nz*nphi*ieta+nz*iphi+iz;
190 int phiClusterSize)
const {
194 for(
int i=0; i<nang; i++){
199 if(phiClusterSize>
m_csx[i]) iphi=i;
209 for(
int i=0; i<neta; i++){
214 if(etaClusterSize>
m_csy[i]) iz=i;
224 const std::vector<float> & c){
234 for(
int i=0; i<n1; i++){
235 m_csx.push_back(c.at(i+offset));
238 for(
int i=0; i<n2; i++){
239 m_csy.push_back(c.at(i+offset));
256 for(
int i=0; i<n3; i++){
260 for(
int i=0; i<n4; i++){
268 for(
int i = 0; i<nxbinsibl; i++){
269 m_iblphierror.push_back(50.0/std::sqrt(12)*CLHEP::micrometer);
276 for(
int ib1=0; ib1<nybinsibl; ib1++){
277 m_ibletaerror.push_back(250./std::sqrt(12)*CLHEP::micrometer);
283 for(
int i = 0; i<nbiny; i++){
289 for(
int i = 0; i<nbinx; i++){
303 std::ofstream* outfile =
new std::ofstream(
file.c_str());
307 int ncsx =
m_csx.size();
308 int ncsy =
m_csy.size();
312 *outfile <<ncsx<<
" "<<ncsy<<
" "<<neta<<
" "<<nalpha<<
" "<<
m_csxbinsibl<<
316 *outfile << ncsx <<
" " << ncsy <<
" " << neta <<
" " << nalpha << std::endl;
319 for(
int i=0; i<ncsx; i++){
320 *outfile <<
m_csx[i] <<
" ";
322 *outfile << std::endl;
323 for(
int i=0; i<ncsy; i++){
324 *outfile <<
m_csy[i] <<
" ";
326 *outfile << std::endl;
329 *outfile << i <<
" ";
331 *outfile << std::endl;
333 *outfile << iblphibin <<
" ";
335 *outfile << std::endl;
337 for(
int i=0; i<neta; i++){
340 *outfile << std::endl;
341 for(
int i=0; i<nalpha; i++){
344 *outfile << std::endl;
347 for(
int ib1=0; ib1<nxbinsibl; ib1++){
352 int nb2=ncsx*ncsy*neta;
353 for(
int ib1=0; ib1<nb1; ib1++){
358 for(
int ib1=0; ib1<nybinsibl; ib1++){
362 for(
int ib2=0; ib2<nb2; ib2++){
375 std::ifstream infile(
file.c_str());
393 infile >> ncsy >> neta >> nalpha;
402 infile >> ncsx >> ncsy >> neta >> nalpha;
413 for(
int i=0; i<ncsx && !infile.eof(); i++){
415 m_csx.push_back(value);
421 for(
int i=0; i<ncsy && !infile.eof(); i++){
423 m_csy.push_back(value);
445 for(
int i=0; i<neta && !infile.eof(); i++){
449 if(nalpha<0)nalpha = 0;
453 for(
int i=0; i<nalpha && !infile.eof(); i++){
461 for(
int ib1=0; ib1<nxbinsibl; ib1++){
467 int nb2=ncsx*ncsy*neta;
472 for(
int ib1=0; ib1<nb1; ib1++){
480 for(
int ib1=0; ib1<nybinsibl; ib1++){
485 for(
int ib2=0; ib2<nb2; ib2++){
Scalar eta() const
pseudorapidity method
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
std::vector< float > m_phibins
std::vector< float > m_etaref
void Print(const std::string &file) const
std::vector< float > m_csx
void setVersion(int version)
PixelClusterOnTrackErrorData()
float getPixelIBLEtaError(int ibin) const
int getBarrelBinPhi(double angle, int phiClusterSize) const
int getNumberOfEtaBarrelBins() const
std::vector< float > m_ibletaref
std::vector< float > m_barrelphierror
int getIBLBinPhi(double angle, int phiClusterSize) const
std::vector< float > m_iblphibins
std::vector< float > m_iblphierror
float getPixelBarrelEtaError(int ibin) const
int getNumberOfPhiBarrelBins() const
float getPixelIBLPhiError(int ibin) const
std::vector< float > m_csy
int getNumberOfPhiIBLBins() const
static double getPixelBarrelPhiError(double ang, int phiClusterSize)
int getBarrelBinEta(double eta, int etaClusterSize, int phiClusterSize) const
void Load(const std::string &file)
void setParameters(const int ncsx, const int ncsy, const int neta, const int nalpha, int offset, const std::vector< float > &constants)
std::vector< float > m_barreletaerror
~PixelClusterOnTrackErrorData()
int getVersion() const
Methods to access the calibration data.
int getNumberOfEtaIBLBins() const
std::vector< float > m_ibletaerror
int getIBLBinEta(double eta, int etaClusterSize) const