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
 
const TrackerTopologytheTopo = nullptr
 

Detailed Description

Definition at line 15 of file PixelFitterByHelixProjections.h.

Constructor & Destructor Documentation

◆ PixelFitterByHelixProjections()

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

Definition at line 91 of file PixelFitterByHelixProjections.cc.

96  //Retrieve tracker topology from geometry
98  es->get<TrackerTopologyRcd>().get(tTopo);
99  theTopo = tTopo.product();
100 }

References edm::EventSetup::get(), get, edm::ESHandle< T >::product(), and theTopo.

◆ ~PixelFitterByHelixProjections()

PixelFitterByHelixProjections::~PixelFitterByHelixProjections ( )
inlineoverride

Definition at line 21 of file PixelFitterByHelixProjections.h.

21 {}

Member Function Documentation

◆ run()

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.

104  {
105  std::unique_ptr<reco::Track> ret;
106 
107  int nhits = hits.size();
108  if (nhits < 2)
109  return ret;
110 
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 }

References PV3DBase< T, PVType, FrameType >::barePhi(), 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(), hfClusterShapes_cfi::hits, mps_fire::i, PixelRecoUtilities::inversePt(), PixelPluginsPhase0_cfi::isBarrel, LIKELY, Basic2DVector< T >::mag(), nhits, phi, PixelSubdetector::PixelBarrel, HLT_FULL_cff::points, DiDispStaMuonMonitor_cfi::pt, TrackerTopology::pxbLayer(), rpcPointValidation_cfi::recHit, HLT_FULL_cff::region, runTheMatrix::ret, singleTopDQM_cfi::setup, funct::sin(), theField, thescaleErrorsForBPix1, thescaleFactor, theTopo, qcdUeDQM_cfi::tip, Basic2DVector< T >::x(), Basic2DVector< T >::y(), and ComparisonHelper::zip().

Member Data Documentation

◆ theField

const MagneticField* PixelFitterByHelixProjections::theField
private

Definition at line 27 of file PixelFitterByHelixProjections.h.

Referenced by run().

◆ thescaleErrorsForBPix1

const bool PixelFitterByHelixProjections::thescaleErrorsForBPix1
private

Definition at line 28 of file PixelFitterByHelixProjections.h.

Referenced by run().

◆ thescaleFactor

const float PixelFitterByHelixProjections::thescaleFactor
private

Definition at line 29 of file PixelFitterByHelixProjections.h.

Referenced by run().

◆ theTopo

const TrackerTopology* PixelFitterByHelixProjections::theTopo = nullptr
private

Definition at line 30 of file PixelFitterByHelixProjections.h.

Referenced by PixelFitterByHelixProjections(), and run().

Vector3DBase
Definition: Vector3DBase.h:8
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
CircleFromThreePoints
Definition: CircleFromThreePoints.h:18
Measurement1D
Definition: Measurement1D.h:11
mps_fire.i
i
Definition: mps_fire.py:428
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
PixelRecoUtilities::fieldInInvGev
float fieldInInvGev(const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:25
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21449
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
CircleFromThreePoints::curvature
float curvature() const
Definition: CircleFromThreePoints.h:42
HLT_FULL_cff.scaleErrorsForBPix1
scaleErrorsForBPix1
Definition: HLT_FULL_cff.py:9784
PixelFitterByHelixProjections::theField
const MagneticField * theField
Definition: PixelFitterByHelixProjections.h:27
PixelRecoUtilities::inversePt
T inversePt(T curvature, const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:48
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
Basic2DVector::mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: extBasic2DVector.h:73
PixelRecoUtilities::curvature
T curvature(T InversePt, const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:42
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Basic2DVector::y
T y() const
Cartesian y coordinate.
Definition: extBasic2DVector.h:67
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
errors
Definition: errors.py:1
PixelTrackErrorParam
Definition: PixelTrackErrorParam.h:5
edm::ESHandle< TrackerTopology >
declareDynArray
#define declareDynArray(T, n, x)
Definition: DynArray.h:91
PixelTrackBuilder
Definition: PixelTrackBuilder.h:13
Basic2DVector::x
T x() const
Cartesian x coordinate.
Definition: extBasic2DVector.h:64
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
nhits
Definition: HIMultiTrackSelector.h:42
CircleFromThreePoints::center
Vector2D center() const
Definition: CircleFromThreePoints.h:50
qcdUeDQM_cfi.tip
tip
Definition: qcdUeDQM_cfi.py:23
Basic2DVector< float >
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88267
GlobalErrorBase< double, ErrorMatrixTag >
get
#define get
PixelFitterByHelixProjections::theTopo
const TrackerTopology * theTopo
Definition: PixelFitterByHelixProjections.h:30
ComparisonHelper::zip
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
Definition: L1TStage2CaloLayer1.h:41
PixelTrackBuilder::build
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
Definition: PixelTrackBuilder.cc:123
DDAxes::phi
RZLine
Definition: RZLine.h:12
LIKELY
#define LIKELY(x)
Definition: Likely.h:20
multiplicitycorr_cfi.scaleFactor
scaleFactor
Definition: multiplicitycorr_cfi.py:7
PixelFitterByHelixProjections::thescaleErrorsForBPix1
const bool thescaleErrorsForBPix1
Definition: PixelFitterByHelixProjections.h:28
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
PixelFitterByHelixProjections::thescaleFactor
const float thescaleFactor
Definition: PixelFitterByHelixProjections.h:29
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37