CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
RZLine Class Reference

#include <RZLine.h>

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 
)

Definition at line 22 of file RZLine.cc.

References errZ2, i, nPoints, AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::perp(), r, storage, z, and PV3DBase< T, PVType, FrameType >::z().

24  :
25  storage(3*points.size()) {
26  nPoints = points.size();
27  r = &storage.front();
28  z = r+nPoints;
29  errZ2 = z+nPoints;
30  for (int i=0; i!=nPoints; ++i) {
31  const GlobalPoint & p = points[i];
32  r[i] = p.perp();
33  z[i] = p.z();
34  }
35 
36  float simpleCot2 = ( z[nPoints-1]-z[0] )/ (r[nPoints-1] - r[0] );
37  simpleCot2 *= simpleCot2;
38  for (int i=0; i!=nPoints; ++i) {
39  errZ2[i] = (isBarrel[i]) ? errors[i].czz() :
40  errors[i].rerr(points[i]) * simpleCot2;
41  }
42 }
int i
Definition: DBlmapReader.cc:9
float * errZ2
Definition: RZLine.h:26
T perp() const
Definition: PV3DBase.h:71
T z() const
Definition: PV3DBase.h:63
std::vector< float > storage
Definition: RZLine.h:24
float * r
Definition: RZLine.h:26
int nPoints
Definition: RZLine.h:25
float * z
Definition: RZLine.h:26
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.

9  :
10  storage(3*aR.size()) {
11  nPoints = aR.size();
12  r = &storage.front();
13  z = r+nPoints;
14  errZ2 = z+nPoints;
15  for (int i=0; i<nPoints; i++) {
16  r[i] = aR[i];
17  z[i]=aZ[i];
18  errZ2[i] = aErrZ[i]*aErrZ[i];
19  }
20 }
int i
Definition: DBlmapReader.cc:9
float * errZ2
Definition: RZLine.h:26
std::vector< float > storage
Definition: RZLine.h:24
float * r
Definition: RZLine.h:26
int nPoints
Definition: RZLine.h:25
float * z
Definition: RZLine.h:26

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().

51 {
52  float chi2 = 0.f;
53  for (int i=0; i!=nPoints; ++i) chi2 += sqr( ((z[i]-intercept) - cotTheta*r[i]) ) / errZ2[i];
54  return chi2;
55 }
int i
Definition: DBlmapReader.cc:9
float * errZ2
Definition: RZLine.h:26
Square< F >::type sqr(const F &f)
Definition: Square.h:13
float * r
Definition: RZLine.h:26
int nPoints
Definition: RZLine.h:25
float chi2(float cotTheta, float intercept) const
Definition: RZLine.cc:50
float * z
Definition: RZLine.h:26
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(), nPoints, r, and z.

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

46 {
47  linearFit( r, z, nPoints, errZ2, cotTheta, intercept, covss, covii, covsi);
48 }
float * errZ2
Definition: RZLine.h:26
void linearFit(T const *__restrict__ x, T const *__restrict__ y, int ndat, T const *__restrict__ sigy2, T &slope, T &intercept, T &covss, T &covii, T &covsi)
Definition: LinearFit.h:26
float * r
Definition: RZLine.h:26
int nPoints
Definition: RZLine.h:25
float * z
Definition: RZLine.h:26

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(), fit(), 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(), geometryXMLparser.Alignable::pos(), and RZLine().