CMS 3D CMS Logo

Public Member Functions | Private Attributes

RZLine Class Reference

#include <RZLine.h>

List of all members.

Public Member Functions

float chi2 (float cotTheta, float intercept) const
void fit (float &cotTheta, float &intercept, float &covss, float &covii, float &covsi) const
 RZLine (const std::vector< GlobalPoint > &points, const std::vector< GlobalError > &errors, const std::vector< bool > isBarrel)
 RZLine (const std::vector< float > &aR, const std::vector< float > &aZ, const std::vector< float > &aErrZ)

Private Attributes

float * errZ2
int nPoints
float * r
std::vector< float > storage
float * z

Detailed Description

Definition at line 8 of file RZLine.h.


Constructor & Destructor Documentation

RZLine::RZLine ( const std::vector< GlobalPoint > &  points,
const std::vector< GlobalError > &  errors,
const std::vector< bool >  isBarrel 
)
RZLine::RZLine ( const std::vector< float > &  aR,
const std::vector< float > &  aZ,
const std::vector< float > &  aErrZ 
)

Definition at line 7 of file RZLine.cc.

References errZ2, i, nPoints, r, storage, and z.

                                               :
  storage(3*aR.size()) {
  nPoints = aR.size();
  r = &storage.front();
  z = r+nPoints;
  errZ2 = z+nPoints;
  for (int i=0; i<nPoints; i++) {
    r[i] = aR[i];
    z[i]=aZ[i];
    errZ2[i] = aErrZ[i]*aErrZ[i];
  } 
}

Member Function Documentation

float RZLine::chi2 ( float  cotTheta,
float  intercept 
) const

Definition at line 50 of file RZLine.cc.

References errZ2, i, nPoints, r, funct::sqr(), and z.

Referenced by PixelFitterByConformalMappingAndLine::run(), TrackFitter::run(), and PixelFitterByHelixProjections::run().

{
  float chi2 = 0.f;
  for (int i=0; i!=nPoints; ++i) chi2 += sqr( ((z[i]-intercept) - cotTheta*r[i]) ) / errZ2[i];
  return chi2;
}
void RZLine::fit ( float &  cotTheta,
float &  intercept,
float &  covss,
float &  covii,
float &  covsi 
) const

Definition at line 44 of file RZLine.cc.

References errZ2, linearFit(), r, and z.

Referenced by PixelFitterByConformalMappingAndLine::run(), TrackFitter::run(), and PixelFitterByHelixProjections::run().

{
  linearFit( r, z, nPoints, errZ2, cotTheta, intercept, covss, covii, covsi);
}

Member Data Documentation

float * RZLine::errZ2 [private]

Definition at line 26 of file RZLine.h.

Referenced by chi2(), fit(), and RZLine().

int RZLine::nPoints [private]

Definition at line 25 of file RZLine.h.

Referenced by chi2(), and RZLine().

float* RZLine::r [private]

Definition at line 26 of file RZLine.h.

Referenced by chi2(), fit(), and RZLine().

std::vector<float> RZLine::storage [private]

Definition at line 24 of file RZLine.h.

Referenced by RZLine().

float * RZLine::z [private]

Definition at line 26 of file RZLine.h.

Referenced by chi2(), fit(), and RZLine().