CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PixelFitterByHelixProjections Class Referencefinal

#include <PixelFitterByHelixProjections.h>

Inheritance diagram for PixelFitterByHelixProjections:
PixelFitterBase

Public Member Functions

 PixelFitterByHelixProjections (const edm::EventSetup *es, const MagneticField *field)
 
virtual std::unique_ptr< reco::Trackrun (const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const override
 
virtual ~PixelFitterByHelixProjections ()
 
- Public Member Functions inherited from PixelFitterBase
virtual reco::Trackrun (const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const
 
virtual reco::Trackrun (const edm::Event &ev, const edm::EventSetup &es, const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const
 
virtual ~PixelFitterBase ()
 

Private Attributes

const edm::EventSetuptheES
 
const MagneticFieldtheField
 

Detailed Description

Definition at line 15 of file PixelFitterByHelixProjections.h.

Constructor & Destructor Documentation

PixelFitterByHelixProjections::PixelFitterByHelixProjections ( const edm::EventSetup es,
const MagneticField field 
)
explicit

Definition at line 93 of file PixelFitterByHelixProjections.cc.

93  :
94  theES(es), theField(field) {}
virtual PixelFitterByHelixProjections::~PixelFitterByHelixProjections ( )
inlinevirtual

Definition at line 18 of file PixelFitterByHelixProjections.h.

References hfClusterShapes_cfi::hits, and run().

18 {}

Member Function Documentation

std::unique_ptr< reco::Track > PixelFitterByHelixProjections::run ( const std::vector< const TrackingRecHit * > &  hits,
const TrackingRegion region 
) const
overridevirtual

Reimplemented from PixelFitterBase.

Definition at line 96 of file PixelFitterByHelixProjections.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), PV3DBase< T, PVType, FrameType >::basicVector(), PixelTrackBuilder::build(), CircleFromThreePoints::center(), ALCARECOTkAlJpsiMuMu_cff::charge, HiEvtPlane_cfi::chi2, RZLine::chi2(), funct::cos(), PixelRecoUtilities::curvature(), CircleFromThreePoints::curvature(), declareDynArray, MillePedeFileConverter_cfg::e, PixelTrackErrorParam::errCot(), PixelTrackErrorParam::errPhi(), PixelTrackErrorParam::errPt(), PixelTrackErrorParam::errTip(), PixelTrackErrorParam::errZip(), f, PixelRecoUtilities::fieldInInvGev(), i, PixelRecoUtilities::inversePt(), gedGsfElectrons_cfi::isBarrel, likely, Basic2DVector< T >::mag(), nhits, TrackingRegion::origin(), phi, EnergyCorrector::pt, rpcPointValidation_cfi::recHit, funct::sin(), theES, theField, btvTracks_cfi::tip, Basic2DVector< T >::x(), Basic2DVector< T >::y(), and ComparisonHelper::zip().

Referenced by ~PixelFitterByHelixProjections().

99 {
100  std::unique_ptr<reco::Track> ret;
101 
102  int nhits = hits.size();
103  if (nhits <2) return ret;
104 
105  declareDynArray(GlobalPoint,nhits, points);
107  declareDynArray(bool,nhits, isBarrel);
108 
109  for ( int i=0; i!=nhits; ++i) {
110  auto const & recHit = hits[i];
111  points[i] = GlobalPoint( recHit->globalPosition().basicVector()-region.origin().basicVector());
112  errors[i] = recHit->globalPositionError();
113  isBarrel[i] = recHit->detUnit()->type().isBarrel();
114  }
115 
116  CircleFromThreePoints circle = (nhits==2) ?
117  CircleFromThreePoints( GlobalPoint(0.,0.,0.), points[0], points[1]) :
118  CircleFromThreePoints(points[0],points[1],points[2]);
119 
120  float valPhi, valTip, valPt;
121 
122  int iCharge = charge(points);
123  float curvature = circle.curvature();
124 
125  if ((curvature > 1.e-4)&&
127  float invPt = PixelRecoUtilities::inversePt( circle.curvature(), *theES);
128  valPt = (invPt > 1.e-4f) ? 1.f/invPt : 1.e4f;
129  CircleFromThreePoints::Vector2D center = circle.center();
130  valTip = iCharge * (center.mag()-1.f/curvature);
131  valPhi = phi(center.x(), center.y(), iCharge);
132  }
133  else {
134  valPt = 1.e4f;
135  GlobalVector direction(points[1]-points[0]);
136  valPhi = direction.barePhi();
137  valTip = -points[0].x()*sin(valPhi) + points[0].y()*cos(valPhi);
138  }
139 
140  float valCotTheta = cotTheta(points[0],points[1]);
141  float valEta = std::asinh(valCotTheta);
142  float valZip = zip(valTip, valPhi, curvature, points[0],points[1]);
143 
144  PixelTrackErrorParam param(valEta, valPt);
145  float errValPt = param.errPt();
146  float errValCot = param.errCot();
147  float errValTip = param.errTip();
148  float errValPhi = param.errPhi();
149  float errValZip = param.errZip();
150 
151 
152  float chi2 = 0;
153  if (nhits > 2) {
154  RZLine rzLine(points,errors,isBarrel);
155  chi2 = rzLine.chi2();
156  }
157 
158  PixelTrackBuilder builder;
159  Measurement1D pt(valPt, errValPt);
160  Measurement1D phi(valPhi, errValPhi);
161  Measurement1D cotTheta(valCotTheta, errValCot);
162  Measurement1D tip(valTip, errValTip);
163  Measurement1D zip(valZip, errValZip);
164 
165  ret.reset(builder.build(pt, phi, cotTheta, tip, zip, chi2, iCharge, hits, theField, region.origin() ));
166  return ret;
167 }
int i
Definition: DBlmapReader.cc:9
GlobalPoint const & origin() const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T inversePt(T curvature, const edm::EventSetup &iSetup)
#define likely(x)
T curvature(T InversePt, const edm::EventSetup &iSetup)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
reco::Track * build(const Measurement1D &pt, const Measurement1D &phi, const Measurement1D &cotTheta, const Measurement1D &tip, const Measurement1D &zip, float chi2, int charge, const std::vector< const TrackingRecHit * > &hits, const MagneticField *mf, const GlobalPoint &reference=GlobalPoint(0, 0, 0)) const
double f[11][100]
T y() const
Cartesian y coordinate.
Definition: RZLine.h:12
Definition: errors.py:1
#define declareDynArray(T, n, x)
Definition: DynArray.h:59
float fieldInInvGev(const edm::EventSetup &iSetup)
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
T x() const
Cartesian x coordinate.

Member Data Documentation

const edm::EventSetup* PixelFitterByHelixProjections::theES
private

Definition at line 35 of file PixelFitterByHelixProjections.h.

Referenced by run().

const MagneticField* PixelFitterByHelixProjections::theField
private

Definition at line 36 of file PixelFitterByHelixProjections.h.

Referenced by run().