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, bool scaleErrorsForBPix1, float scaleFactor)
 
std::unique_ptr< reco::Trackrun (const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region) const override
 
 ~PixelFitterByHelixProjections () override
 
- 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
 
const bool thescaleErrorsForBPix1
 
const float thescaleFactor
 
TrackerTopology const * theTopo = 0
 

Detailed Description

Definition at line 15 of file PixelFitterByHelixProjections.h.

Constructor & Destructor Documentation

PixelFitterByHelixProjections::PixelFitterByHelixProjections ( const edm::EventSetup es,
const MagneticField field,
bool  scaleErrorsForBPix1,
float  scaleFactor 
)
explicit
PixelFitterByHelixProjections::~PixelFitterByHelixProjections ( )
inlineoverride

Definition at line 19 of file PixelFitterByHelixProjections.h.

References hfClusterShapes_cfi::hits, and run().

19 {}

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 109 of file PixelFitterByHelixProjections.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), PV3DBase< T, PVType, FrameType >::basicVector(), PixelTrackBuilder::build(), CircleFromThreePoints::center(), ALCARECOTkAlJpsiMuMu_cff::charge, vertices_cff::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(), mps_fire::i, PixelRecoUtilities::inversePt(), gedGsfElectrons_cfi::isBarrel, likely, Basic2DVector< T >::mag(), nhits, TrackingRegion::origin(), phi, PixelSubdetector::PixelBarrel, EnergyCorrector::pt, TrackerTopology::pxbLayer(), rpcPointValidation_cfi::recHit, funct::sin(), theES, theField, thescaleErrorsForBPix1, thescaleFactor, theTopo, btvTracks_cfi::tip, Basic2DVector< T >::x(), Basic2DVector< T >::y(), and ComparisonHelper::zip().

Referenced by ~PixelFitterByHelixProjections().

112 {
113  std::unique_ptr<reco::Track> ret;
114 
115  int nhits = hits.size();
116  if (nhits <2) return ret;
117 
120  declareDynArray(bool,nhits, isBarrel);
121 
122  for ( int i=0; i!=nhits; ++i) {
123  auto const & recHit = hits[i];
124  points[i] = GlobalPoint( recHit->globalPosition().basicVector()-region.origin().basicVector());
125  errors[i] = recHit->globalPositionError();
126  isBarrel[i] = recHit->detUnit()->type().isBarrel();
127  }
128 
129  CircleFromThreePoints circle = (nhits==2) ?
130  CircleFromThreePoints( GlobalPoint(0.,0.,0.), points[0], points[1]) :
132 
133  float valPhi, valTip, valPt;
134 
135  int iCharge = charge(points);
136  float curvature = circle.curvature();
137 
138  if ((curvature > 1.e-4)&&
140  float invPt = PixelRecoUtilities::inversePt( circle.curvature(), *theES);
141  valPt = (invPt > 1.e-4f) ? 1.f/invPt : 1.e4f;
142  CircleFromThreePoints::Vector2D center = circle.center();
143  valTip = iCharge * (center.mag()-1.f/curvature);
144  valPhi = phi(center.x(), center.y(), iCharge);
145  }
146  else {
147  valPt = 1.e4f;
148  GlobalVector direction(points[1]-points[0]);
149  valPhi = direction.barePhi();
150  valTip = -points[0].x()*sin(valPhi) + points[0].y()*cos(valPhi);
151  }
152 
153  float valCotTheta = cotTheta(points[0],points[1]);
154  float valEta = std::asinh(valCotTheta);
155  float valZip = zip(valTip, valPhi, curvature, points[0],points[1]);
156 
157  // Rescale down the error to take into accont the fact that the
158  // inner pixel barrel layer for PhaseI is closer to the interaction
159  // point. The effective scale factor has been derived by checking
160  // that the pulls of the pixelVertices derived from the pixelTracks
161  // have the correct mean and sigma.
162  float errFactor = 1.;
164  && (hits[0]->geographicalId().subdetId() == PixelSubdetector::PixelBarrel) &&
165  (theTopo->pxbLayer(hits[0]->geographicalId()) == 1))
166  errFactor = thescaleFactor;
167 
168  PixelTrackErrorParam param(valEta, valPt);
169  float errValPt = errFactor*param.errPt();
170  float errValCot = errFactor*param.errCot();
171  float errValTip = errFactor*param.errTip();
172  float errValPhi = errFactor*param.errPhi();
173  float errValZip = errFactor*param.errZip();
174 
175 
176  float chi2 = 0;
177  if (nhits > 2) {
178  RZLine rzLine(points,errors,isBarrel);
179  chi2 = rzLine.chi2();
180  }
181 
182  PixelTrackBuilder builder;
183  Measurement1D pt(valPt, errValPt);
184  Measurement1D phi(valPhi, errValPhi);
185  Measurement1D cotTheta(valCotTheta, errValCot);
186  Measurement1D tip(valTip, errValTip);
187  Measurement1D zip(valZip, errValZip);
188 
189  ret.reset(builder.build(pt, phi, cotTheta, tip, zip, chi2, iCharge, hits, theField, region.origin() ));
190  return ret;
191 }
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
unsigned int pxbLayer(const DetId &id) const
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 24 of file PixelFitterByHelixProjections.h.

Referenced by run().

const MagneticField* PixelFitterByHelixProjections::theField
private

Definition at line 25 of file PixelFitterByHelixProjections.h.

Referenced by run().

const bool PixelFitterByHelixProjections::thescaleErrorsForBPix1
private

Definition at line 26 of file PixelFitterByHelixProjections.h.

Referenced by run().

const float PixelFitterByHelixProjections::thescaleFactor
private

Definition at line 27 of file PixelFitterByHelixProjections.h.

Referenced by run().

TrackerTopology const* PixelFitterByHelixProjections::theTopo = 0
private

Definition at line 28 of file PixelFitterByHelixProjections.h.

Referenced by PixelFitterByHelixProjections(), and run().