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 DynArray< GlobalPoint > &points, const DynArray< GlobalError > &errors, const DynArray< bool > &isBarrel)
 
 RZLine (const GlobalPoint *points, const GlobalError *errors, const bool *isBarrel, unsigned int size)
 
 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 9 of file RZLine.h.

Constructor & Destructor Documentation

RZLine::RZLine ( const DynArray< GlobalPoint > &  points,
const DynArray< GlobalError > &  errors,
const DynArray< bool > &  isBarrel 
)
inline

Definition at line 13 of file RZLine.h.

15  : RZLine(points.begin(),errors.begin(),isBarrel.begin(),points.size()){}
T * begin()
Definition: DynArray.h:36
RZLine(const DynArray< GlobalPoint > &points, const DynArray< GlobalError > &errors, const DynArray< bool > &isBarrel)
Definition: RZLine.h:13
unsigned int size() const
Definition: DynArray.h:44
RZLine::RZLine ( const GlobalPoint points,
const GlobalError errors,
const bool *  isBarrel,
unsigned int  size 
)

Definition at line 22 of file RZLine.cc.

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

24  :
25  storage(3*size) {
26  nPoints = 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:31
T perp() const
Definition: PV3DBase.h:72
bool isBarrel(GeomDetEnumerators::SubDetector m)
T z() const
Definition: PV3DBase.h:64
T rerr(const GlobalPoint &aPoint) const
std::vector< float > storage
Definition: RZLine.h:29
float * r
Definition: RZLine.h:31
int nPoints
Definition: RZLine.h:30
float * z
Definition: RZLine.h:31
tuple size
Write out results.
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:31
std::vector< float > storage
Definition: RZLine.h:29
float * r
Definition: RZLine.h:31
int nPoints
Definition: RZLine.h:30
float * z
Definition: RZLine.h:31

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 MultiHitGeneratorFromChi2::hitSets(), PixelFitterByConformalMappingAndLine::run(), PixelFitterByHelixProjections::run(), and TrackFitter::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:31
Square< F >::type sqr(const F &f)
Definition: Square.h:13
float * r
Definition: RZLine.h:31
int nPoints
Definition: RZLine.h:30
float chi2(float cotTheta, float intercept) const
Definition: RZLine.cc:50
float * z
Definition: RZLine.h:31
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 MultiHitGeneratorFromChi2::hitSets(), trackingPlots.Iteration::modules(), PixelFitterByConformalMappingAndLine::run(), PixelFitterByHelixProjections::run(), and TrackFitter::run().

46 {
47  linearFit( r, z, nPoints, errZ2, cotTheta, intercept, covss, covii, covsi);
48 }
float * errZ2
Definition: RZLine.h:31
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:31
int nPoints
Definition: RZLine.h:30
float * z
Definition: RZLine.h:31

Member Data Documentation

float * RZLine::errZ2
private

Definition at line 31 of file RZLine.h.

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

int RZLine::nPoints
private

Definition at line 30 of file RZLine.h.

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

float* RZLine::r
private

Definition at line 31 of file RZLine.h.

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

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

Definition at line 29 of file RZLine.h.

Referenced by RZLine().

float * RZLine::z
private

Definition at line 31 of file RZLine.h.

Referenced by chi2(), fit(), geometryXMLparser.Alignable::pos(), and RZLine().