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 TrackerTopology *ttopo, 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 ~PixelFitterBase ()
 

Private Attributes

const MagneticFieldtheField
 
const bool thescaleErrorsForBPix1
 
const float thescaleFactor
 
const TrackerTopologytheTopo
 

Detailed Description

Definition at line 14 of file PixelFitterByHelixProjections.h.

Constructor & Destructor Documentation

◆ PixelFitterByHelixProjections()

PixelFitterByHelixProjections::PixelFitterByHelixProjections ( const TrackerTopology ttopo,
const MagneticField field,
bool  scaleErrorsForBPix1,
float  scaleFactor 
)
explicit

◆ ~PixelFitterByHelixProjections()

PixelFitterByHelixProjections::~PixelFitterByHelixProjections ( )
inlineoverride

Definition at line 20 of file PixelFitterByHelixProjections.h.

20 {}

Member Function Documentation

◆ run()

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

Implements PixelFitterBase.

Definition at line 96 of file PixelFitterByHelixProjections.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), PixelTrackBuilder::build(), CircleFromThreePoints::center(), ALCARECOTkAlJpsiMuMu_cff::charge, RZLine::chi2(), nano_mu_local_reco_cff::chi2, funct::cos(), PixelRecoUtilities::curvature(), CircleFromThreePoints::curvature(), declareDynArray, MillePedeFileConverter_cfg::e, PixelTrackErrorParam::errCot(), PixelTrackErrorParam::errPhi(), PixelTrackErrorParam::errPt(), PixelTrackErrorParam::errTip(), PixelTrackErrorParam::errZip(), f, hfClusterShapes_cfi::hits, mps_fire::i, MagneticField::inverseBzAtOriginInGeV(), PixelRecoUtilities::inversePt(), PixelPluginsPhase0_cfi::isBarrel, LIKELY, Basic2DVector< T >::mag(), nhits, phi, PixelSubdetector::PixelBarrel, hiPixelPairStep_cff::points, DiDispStaMuonMonitor_cfi::pt, TrackerTopology::pxbLayer(), rpcPointValidation_cfi::recHit, nano_mu_digi_cff::region, runTheMatrix::ret, funct::sin(), theField, thescaleErrorsForBPix1, thescaleFactor, theTopo, qcdUeDQM_cfi::tip, Basic2DVector< T >::x(), Basic2DVector< T >::y(), and reco::zip().

97  {
98  std::unique_ptr<reco::Track> ret;
99 
100  int nhits = hits.size();
101  if (nhits < 2)
102  return ret;
103 
107 
108  for (int i = 0; i != nhits; ++i) {
109  auto const& recHit = hits[i];
110  points[i] = GlobalPoint(recHit->globalPosition().basicVector() - region.origin().basicVector());
111  errors[i] = recHit->globalPositionError();
112  isBarrel[i] = recHit->detUnit()->type().isBarrel();
113  }
114 
115  CircleFromThreePoints circle = (nhits == 2) ? CircleFromThreePoints(GlobalPoint(0., 0., 0.), points[0], points[1])
117 
118  float valPhi, valTip, valPt;
119 
120  int iCharge = charge(points);
121  float curvature = circle.curvature();
122 
123  if ((curvature > 1.e-4) && (LIKELY(theField->inverseBzAtOriginInGeV()) > 0.01)) {
124  float invPt = PixelRecoUtilities::inversePt(circle.curvature(), *theField);
125  valPt = (invPt > 1.e-4f) ? 1.f / invPt : 1.e4f;
126  CircleFromThreePoints::Vector2D center = circle.center();
127  valTip = iCharge * (center.mag() - 1.f / curvature);
128  valPhi = phi(center.x(), center.y(), iCharge);
129  } else {
130  valPt = 1.e4f;
131  GlobalVector direction(points[1] - points[0]);
132  valPhi = direction.barePhi();
133  valTip = -points[0].x() * sin(valPhi) + points[0].y() * cos(valPhi);
134  }
135 
136  float valCotTheta = cotTheta(points[0], points[1]);
137  float valEta = std::asinh(valCotTheta);
138  float valZip = zip(valTip, valPhi, curvature, points[0], points[1]);
139 
140  // Rescale down the error to take into accont the fact that the
141  // inner pixel barrel layer for PhaseI is closer to the interaction
142  // point. The effective scale factor has been derived by checking
143  // that the pulls of the pixelVertices derived from the pixelTracks
144  // have the correct mean and sigma.
145  float errFactor = 1.;
146  if (thescaleErrorsForBPix1 && (hits[0]->geographicalId().subdetId() == PixelSubdetector::PixelBarrel) &&
147  (theTopo->pxbLayer(hits[0]->geographicalId()) == 1))
148  errFactor = thescaleFactor;
149 
150  PixelTrackErrorParam param(valEta, valPt);
151  float errValPt = errFactor * param.errPt();
152  float errValCot = errFactor * param.errCot();
153  float errValTip = errFactor * param.errTip();
154  float errValPhi = errFactor * param.errPhi();
155  float errValZip = errFactor * param.errZip();
156 
157  float chi2 = 0;
158  if (nhits > 2) {
159  RZLine rzLine(points, errors, isBarrel);
160  chi2 = rzLine.chi2();
161  }
162 
163  PixelTrackBuilder builder;
164  Measurement1D pt(valPt, errValPt);
165  Measurement1D phi(valPhi, errValPhi);
166  Measurement1D cotTheta(valCotTheta, errValCot);
167  Measurement1D tip(valTip, errValTip);
168  Measurement1D zip(valZip, errValZip);
169 
170  ret.reset(builder.build(pt, phi, cotTheta, tip, zip, chi2, iCharge, hits, theField, region.origin()));
171  return ret;
172 }
unsigned int pxbLayer(const DetId &id) const
ret
prodAgent to be discontinued
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float zip(ConstView const &tracks, int32_t i)
Definition: TracksSoA.h:90
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 y() const
Cartesian y coordinate.
T curvature(T InversePt, const MagneticField &field)
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
float inverseBzAtOriginInGeV() const
The inverse of field z component for this map in GeV.
Definition: MagneticField.h:52
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double f[11][100]
T inversePt(T curvature, const MagneticField &field)
Definition: RZLine.h:12
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: errors.py:1
#define declareDynArray(T, n, x)
Definition: DynArray.h:91
T x() const
Cartesian x coordinate.

Member Data Documentation

◆ theField

const MagneticField* PixelFitterByHelixProjections::theField
private

Definition at line 26 of file PixelFitterByHelixProjections.h.

Referenced by run().

◆ thescaleErrorsForBPix1

const bool PixelFitterByHelixProjections::thescaleErrorsForBPix1
private

Definition at line 27 of file PixelFitterByHelixProjections.h.

Referenced by run().

◆ thescaleFactor

const float PixelFitterByHelixProjections::thescaleFactor
private

Definition at line 28 of file PixelFitterByHelixProjections.h.

Referenced by run().

◆ theTopo

const TrackerTopology* PixelFitterByHelixProjections::theTopo
private

Definition at line 25 of file PixelFitterByHelixProjections.h.

Referenced by run().