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

Definition at line 19 of file PixelFitterByHelixProjections.h.

References hfClusterShapes_cfi::hits, run(), and GeneralSetup::setup().

19 {}

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 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(), GeomDetEnumerators::isBarrel(), LIKELY, Basic2DVector< T >::mag(), nhits, TrackingRegion::origin(), phi, PixelSubdetector::PixelBarrel, EnergyCorrector::pt, TrackerTopology::pxbLayer(), rpcPointValidation_cfi::recHit, GeneralSetup::setup(), funct::sin(), theField, thescaleErrorsForBPix1, thescaleFactor, theTopo, btvTracks_cfi::tip, Basic2DVector< T >::x(), Basic2DVector< T >::y(), and ComparisonHelper::zip().

Referenced by ~PixelFitterByHelixProjections().

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