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 edm::EventSetup &setup) const override
 
 ~PixelFitterByHelixProjections () override
 
- Public Member Functions inherited from PixelFitterBase
virtual ~PixelFitterBase ()
 

Private Attributes

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

Member Function Documentation

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

Implements PixelFitterBase.

Definition at line 102 of file PixelFitterByHelixProjections.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), PV3DBase< T, PVType, FrameType >::basicVector(), PixelTrackBuilder::build(), CircleFromThreePoints::center(), ALCARECOTkAlJpsiMuMu_cff::charge, hltPixelTracks_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(), PixelPluginsPhase0_cfi::isBarrel, LIKELY, Basic2DVector< T >::mag(), nhits, TrackingRegion::origin(), phi, PixelSubdetector::PixelBarrel, DiDispStaMuonMonitor_cfi::pt, TrackerTopology::pxbLayer(), rpcPointValidation_cfi::recHit, runTheMatrix::ret, singleTopDQM_cfi::setup, funct::sin(), theField, thescaleErrorsForBPix1, thescaleFactor, theTopo, qcdUeDQM_cfi::tip, Basic2DVector< T >::x(), Basic2DVector< T >::y(), and ComparisonHelper::zip().

Referenced by ~PixelFitterByHelixProjections().

104  {
105  std::unique_ptr<reco::Track> ret;
106 
107  int nhits = hits.size();
108  if (nhits < 2)
109  return ret;
110 
113  declareDynArray(bool, nhits, isBarrel);
114 
115  for (int i = 0; i != nhits; ++i) {
116  auto const& recHit = hits[i];
117  points[i] = GlobalPoint(recHit->globalPosition().basicVector() - region.origin().basicVector());
118  errors[i] = recHit->globalPositionError();
119  isBarrel[i] = recHit->detUnit()->type().isBarrel();
120  }
121 
122  CircleFromThreePoints circle = (nhits == 2) ? CircleFromThreePoints(GlobalPoint(0., 0., 0.), points[0], points[1])
124 
125  float valPhi, valTip, valPt;
126 
127  int iCharge = charge(points);
128  float curvature = circle.curvature();
129 
130  if ((curvature > 1.e-4) && (LIKELY(PixelRecoUtilities::fieldInInvGev(setup) > 0.01))) {
131  float invPt = PixelRecoUtilities::inversePt(circle.curvature(), setup);
132  valPt = (invPt > 1.e-4f) ? 1.f / invPt : 1.e4f;
133  CircleFromThreePoints::Vector2D center = circle.center();
134  valTip = iCharge * (center.mag() - 1.f / curvature);
135  valPhi = phi(center.x(), center.y(), iCharge);
136  } else {
137  valPt = 1.e4f;
138  GlobalVector direction(points[1] - points[0]);
139  valPhi = direction.barePhi();
140  valTip = -points[0].x() * sin(valPhi) + points[0].y() * cos(valPhi);
141  }
142 
143  float valCotTheta = cotTheta(points[0], points[1]);
144  float valEta = std::asinh(valCotTheta);
145  float valZip = zip(valTip, valPhi, curvature, points[0], points[1]);
146 
147  // Rescale down the error to take into accont the fact that the
148  // inner pixel barrel layer for PhaseI is closer to the interaction
149  // point. The effective scale factor has been derived by checking
150  // that the pulls of the pixelVertices derived from the pixelTracks
151  // have the correct mean and sigma.
152  float errFactor = 1.;
153  if (thescaleErrorsForBPix1 && (hits[0]->geographicalId().subdetId() == PixelSubdetector::PixelBarrel) &&
154  (theTopo->pxbLayer(hits[0]->geographicalId()) == 1))
155  errFactor = thescaleFactor;
156 
157  PixelTrackErrorParam param(valEta, valPt);
158  float errValPt = errFactor * param.errPt();
159  float errValCot = errFactor * param.errCot();
160  float errValTip = errFactor * param.errTip();
161  float errValPhi = errFactor * param.errPhi();
162  float errValZip = errFactor * param.errZip();
163 
164  float chi2 = 0;
165  if (nhits > 2) {
166  RZLine rzLine(points, errors, isBarrel);
167  chi2 = rzLine.chi2();
168  }
169 
170  PixelTrackBuilder builder;
171  Measurement1D pt(valPt, errValPt);
172  Measurement1D phi(valPhi, errValPhi);
173  Measurement1D cotTheta(valCotTheta, errValCot);
174  Measurement1D tip(valTip, errValTip);
175  Measurement1D zip(valZip, errValZip);
176 
177  ret.reset(builder.build(pt, phi, cotTheta, tip, zip, chi2, iCharge, hits, theField, region.origin()));
178  return ret;
179 }
#define declareDynArray(T, n, x)
Definition: DynArray.h:91
GlobalPoint const & origin() const
ret
prodAgent to be discontinued
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
#define LIKELY(x)
Definition: Likely.h:20
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T inversePt(T curvature, const edm::EventSetup &iSetup)
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
float fieldInInvGev(const edm::EventSetup &iSetup)
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
T x() const
Cartesian x coordinate.

Member Data Documentation

const MagneticField* PixelFitterByHelixProjections::theField
private

Definition at line 27 of file PixelFitterByHelixProjections.h.

Referenced by run().

const bool PixelFitterByHelixProjections::thescaleErrorsForBPix1
private

Definition at line 28 of file PixelFitterByHelixProjections.h.

Referenced by run().

const float PixelFitterByHelixProjections::thescaleFactor
private

Definition at line 29 of file PixelFitterByHelixProjections.h.

Referenced by run().

TrackerTopology const* PixelFitterByHelixProjections::theTopo = 0
private

Definition at line 30 of file PixelFitterByHelixProjections.h.

Referenced by PixelFitterByHelixProjections(), and run().