CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
TrackFitter Class Reference

#include <TrackFitter.h>

Inheritance diagram for TrackFitter:
PixelFitterBase

Public Member Functions

std::unique_ptr< reco::Trackrun (const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region, const edm::EventSetup &setup) const override
 
 TrackFitter (const TrackerGeometry *tracker, const MagneticField *field, const TransientTrackingRecHitBuilder *ttrhBuilder)
 
 ~TrackFitter () override
 
- Public Member Functions inherited from PixelFitterBase
virtual ~PixelFitterBase ()
 

Private Member Functions

float getCotThetaAndUpdateZip (const GlobalPoint &inner, const GlobalPoint &outer, float radius, float phi, float d0, float &zip) const
 
void getErrTipAndErrZip (float pt, float eta, float &errZip, float &errTip) const
 
float getPhi (float xC, float yC, int charge) const
 
float getZip (float d0, float curv, const GlobalPoint &inner, const GlobalPoint &outer) const
 

Private Attributes

const MagneticFieldtheField
 
const TrackerGeometrytheTracker
 
const TransientTrackingRecHitBuildertheTTRecHitBuilder
 

Detailed Description

Definition at line 17 of file TrackFitter.h.

Constructor & Destructor Documentation

◆ TrackFitter()

TrackFitter::TrackFitter ( const TrackerGeometry tracker,
const MagneticField field,
const TransientTrackingRecHitBuilder ttrhBuilder 
)
inline

Definition at line 19 of file TrackFitter.h.

22  : theTracker(tracker), theField(field), theTTRecHitBuilder(ttrhBuilder) {}

◆ ~TrackFitter()

TrackFitter::~TrackFitter ( )
inlineoverride

Definition at line 23 of file TrackFitter.h.

23 {}

Member Function Documentation

◆ getCotThetaAndUpdateZip()

float TrackFitter::getCotThetaAndUpdateZip ( const GlobalPoint inner,
const GlobalPoint outer,
float  radius,
float  phi,
float  d0,
float &  zip 
) const
private

Definition at line 111 of file TrackFitter.cc.

112  {
113  float chi = phi - M_PI_2;
114  GlobalPoint IP(d0 * cos(chi), d0 * sin(chi), zip);
115 
116  float phi1 = 2 * asin(0.5 * (inner - IP).perp() / radius);
117  float phi2 = 2 * asin(0.5 * (outer - IP).perp() / radius);
118 
119  float dr = radius * (phi2 - phi1);
120  float dz = outer.z() - inner.z();
121 
122  // Recalculate ZIP
123  zip = (inner.z() * phi2 - outer.z() * phi1) / (phi2 - phi1);
124 
125  return (fabs(dr) > 1.e-3) ? dz / dr : 0;
126 }

References funct::cos(), d0, flavorHistoryFilter_cfi::dr, PVValHelper::dz, SurfaceOrientation::inner, listHistos::IP, M_PI_2, SurfaceOrientation::outer, perp(), CosmicsPD_Skims::radius, funct::sin(), and ComparisonHelper::zip().

◆ getErrTipAndErrZip()

void TrackFitter::getErrTipAndErrZip ( float  pt,
float  eta,
float &  errZip,
float &  errTip 
) const
private

Definition at line 158 of file TrackFitter.cc.

158  {
159  float coshEta = cosh(eta);
160 
161  { // transverse
162  float c_ms = 0.0115; //0.0115;
163  float s_le = 0.0095; //0.0123;
164  float s_ms2 = c_ms * c_ms / (pt * pt) * coshEta;
165 
166  errTip = sqrt(s_le * s_le + s_ms2);
167  }
168 
169  { // z
170  float c_ms = 0.0070;
171  float s_le = 0.0135;
172 
173  errZip = sqrt((s_le * s_le + c_ms * c_ms / (pt * pt)) * coshEta * coshEta * coshEta);
174  }
175 }

References PVValHelper::eta, DiDispStaMuonMonitor_cfi::pt, and mathSSE::sqrt().

◆ getPhi()

float TrackFitter::getPhi ( float  xC,
float  yC,
int  charge 
) const
private

Definition at line 129 of file TrackFitter.cc.

129  {
130  float phiC;
131 
132  if (charge > 0)
133  phiC = atan2(xC, -yC);
134  else
135  phiC = atan2(-xC, yC);
136 
137  return phiC;
138 }

References ALCARECOTkAlJpsiMuMu_cff::charge.

◆ getZip()

float TrackFitter::getZip ( float  d0,
float  curv,
const GlobalPoint inner,
const GlobalPoint outer 
) const
private

Definition at line 141 of file TrackFitter.cc.

141  {
142  // phi = asin(r*rho/2) with asin(x) ~= x+x**3/(2*3)
143  float rho3 = curv * curv * curv;
144 
145  float r1 = inner.perp();
146  double phi1 = r1 * curv / 2 + inner.perp2() * r1 * rho3 / 48.;
147 
148  float r2 = outer.perp();
149  double phi2 = r2 * curv / 2 + outer.perp2() * r2 * rho3 / 48.;
150 
151  double z1 = inner.z();
152  double z2 = outer.z();
153 
154  return z1 - phi1 / (phi1 - phi2) * (z1 - z2);
155 }

References SurfaceOrientation::inner, SurfaceOrientation::outer, diffTwoXMLs::r1, diffTwoXMLs::r2, and testProducerWithPsetDescEmpty_cfi::z2.

◆ run()

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

Implements PixelFitterBase.

Definition at line 41 of file TrackFitter.cc.

43  {
44  std::unique_ptr<reco::Track> ret;
45 
46  int nhits = hits.size();
47  if (nhits < 2)
48  return ret;
49 
53 
54  unsigned int i = 0;
55  for (auto const& ih : hits) {
56  auto recHit = theTTRecHitBuilder->build(ih);
57 
58  points[i] = recHit->globalPosition();
59  errors[i] = recHit->globalPositionError();
60  isBarrel[++i] = recHit->detUnit()->type().isBarrel();
61  }
62 
63  CircleFromThreePoints circle = (nhits == 2) ? CircleFromThreePoints(GlobalPoint(0., 0., 0.), points[0], points[1])
65 
66  int charge = getCharge(points);
67  float curvature = circle.curvature();
68 
69  // pt
71  float valPt = (invPt > 1.e-4) ? 1. / invPt : 1.e4;
72  float errPt = 0.055 * valPt + 0.017 * valPt * valPt;
73 
74  CircleFromThreePoints::Vector2D center = circle.center();
75 
76  // tip
77  float valTip = charge * (center.mag() - 1 / curvature);
78  // zip
79  float valZip = getZip(valTip, curvature, points[0], points[1]);
80  // phi
81  float valPhi = getPhi(center.x(), center.y(), charge);
82  // cot(theta), update zip
83  float valCotTheta = getCotThetaAndUpdateZip(points[0], points[1], 1 / curvature, valPhi, valTip, valZip);
84 
85  // errors
86  float errTip, errZip;
87  getErrTipAndErrZip(valPt, points.back().eta(), errTip, errZip);
88  float errPhi = 0.002;
89  float errCotTheta = 0.002;
90 
91  float chi2 = 0;
92  if (nhits > 2) {
93  RZLine rzLine(points, errors, isBarrel);
94  chi2 = rzLine.chi2();
95  }
96 
97  // build pixel track
98  PixelTrackBuilder builder;
99 
100  Measurement1D pt(valPt, errPt);
101  Measurement1D phi(valPhi, errPhi);
102  Measurement1D cotTheta(valCotTheta, errCotTheta);
103  Measurement1D tip(valTip, errTip);
104  Measurement1D zip(valZip, errZip);
105 
106  ret.reset(builder.build(pt, phi, cotTheta, tip, zip, chi2, charge, hits, theField));
107  return ret;
108 }

References PixelTrackBuilder::build(), CircleFromThreePoints::center(), ALCARECOTkAlJpsiMuMu_cff::charge, hltPixelTracks_cff::chi2, RZLine::chi2(), PixelRecoUtilities::curvature(), CircleFromThreePoints::curvature(), declareDynArray, vertexPlots::e4, DeDxTools::getCharge(), hfClusterShapes_cfi::hits, mps_fire::i, PixelRecoUtilities::inversePt(), PixelPluginsPhase0_cfi::isBarrel, Basic2DVector< T >::mag(), nhits, HLT_2018_cff::points, DiDispStaMuonMonitor_cfi::pt, rpcPointValidation_cfi::recHit, runTheMatrix::ret, singleTopDQM_cfi::setup, qcdUeDQM_cfi::tip, Basic2DVector< T >::x(), Basic2DVector< T >::y(), and ComparisonHelper::zip().

Member Data Documentation

◆ theField

const MagneticField* TrackFitter::theField
private

Definition at line 37 of file TrackFitter.h.

◆ theTracker

const TrackerGeometry* TrackFitter::theTracker
private

Definition at line 36 of file TrackFitter.h.

◆ theTTRecHitBuilder

const TransientTrackingRecHitBuilder* TrackFitter::theTTRecHitBuilder
private

Definition at line 38 of file TrackFitter.h.

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
HLT_2018_cff.points
points
Definition: HLT_2018_cff.py:20125
TrackFitter::theField
const MagneticField * theField
Definition: TrackFitter.h:37
CircleFromThreePoints
Definition: CircleFromThreePoints.h:18
Measurement1D
Definition: Measurement1D.h:11
mps_fire.i
i
Definition: mps_fire.py:355
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
TrackFitter::theTracker
const TrackerGeometry * theTracker
Definition: TrackFitter.h:36
TrackFitter::getPhi
float getPhi(float xC, float yC, int charge) const
Definition: TrackFitter.cc:129
CircleFromThreePoints::curvature
float curvature() const
Definition: CircleFromThreePoints.h:42
TrackFitter::getZip
float getZip(float d0, float curv, const GlobalPoint &inner, const GlobalPoint &outer) const
Definition: TrackFitter.cc:141
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
TransientTrackingRecHitBuilder::build
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
PixelRecoUtilities::curvature
T curvature(T InversePt, const edm::EventSetup &iSetup)
Definition: PixelRecoUtilities.h:42
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
DeDxTools::getCharge
int getCharge(const SiStripCluster *cluster, int &nSatStrip, const GeomDetUnit &detUnit, const std::vector< std::vector< float > > &calibGains, const unsigned int &m_off)
Definition: DeDxTools.cc:214
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
testProducerWithPsetDescEmpty_cfi.z2
z2
Definition: testProducerWithPsetDescEmpty_cfi.py:41
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
errors
Definition: errors.py:1
PVValHelper::eta
Definition: PVValidationHelpers.h:69
SurfaceOrientation::inner
Definition: Surface.h:19
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
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 >
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
listHistos.IP
IP
Definition: listHistos.py:76
diffTwoXMLs.r2
r2
Definition: diffTwoXMLs.py:73
TrackFitter::getErrTipAndErrZip
void getErrTipAndErrZip(float pt, float eta, float &errZip, float &errTip) const
Definition: TrackFitter.cc:158
GlobalErrorBase< double, ErrorMatrixTag >
ComparisonHelper::zip
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
Definition: L1TStage2CaloLayer1.h:38
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
PVValHelper::dz
Definition: PVValidationHelpers.h:50
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
TrackFitter::getCotThetaAndUpdateZip
float getCotThetaAndUpdateZip(const GlobalPoint &inner, const GlobalPoint &outer, float radius, float phi, float d0, float &zip) const
Definition: TrackFitter.cc:111
M_PI_2
#define M_PI_2
Definition: CSCGattiFunction.cc:6
SurfaceOrientation::outer
Definition: Surface.h:19
d0
static constexpr float d0
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
vertexPlots.e4
e4
Definition: vertexPlots.py:64
TrackFitter::theTTRecHitBuilder
const TransientTrackingRecHitBuilder * theTTRecHitBuilder
Definition: TrackFitter.h:38