CMS 3D CMS Logo

List of all members | Public Member Functions
PixelTrackBuilder Class Reference

#include <PixelTrackBuilder.h>

Public Member Functions

reco::Trackbuild (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
 

Detailed Description

Definition at line 13 of file PixelTrackBuilder.h.

Member Function Documentation

◆ build()

reco::Track * PixelTrackBuilder::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 at line 123 of file PixelTrackBuilder.cc.

132  {
133  LogDebug("PixelTrackBuilder::build");
134  LogTrace("") << "Reconstructed triplet kinematics: " << print(pt, phi, cotTheta, tip, zip, chi2, charge);
135 
136  double sinTheta = 1 / std::sqrt(1 + sqr(cotTheta.value()));
137  double cosTheta = cotTheta.value() * sinTheta;
138  int tipSign = tip.value() > 0 ? 1 : -1;
139 
141  double invPtErr = 1. / sqr(pt.value()) * pt.error();
142  m(0, 0) = sqr(sinTheta) * (sqr(invPtErr) + sqr(cotTheta.error() / pt.value() * cosTheta * sinTheta));
143  m(0, 2) = sqr(cotTheta.error()) * cosTheta * sqr(sinTheta) / pt.value();
144  m(1, 1) = sqr(phi.error());
145  m(2, 2) = sqr(cotTheta.error());
146  m(3, 3) = sqr(tip.error());
147  m(4, 4) = sqr(zip.error());
149 
150  LocalTrajectoryParameters lpar(LocalPoint(tipSign * tip.value(), -tipSign * zip.value(), 0),
151  LocalVector(0., -tipSign * pt.value() * cotTheta.value(), pt.value()),
152  charge);
153 
154  float sp = std::sin(phi.value());
155  float cp = std::cos(phi.value());
156  Surface::RotationType rot(sp * tipSign, -cp * tipSign, 0, 0, 0, -tipSign, cp, sp, 0);
157 
158  // BTSOS hold Surface in a shared pointer and will be autodeleted when BTSOS goes out of scope...
159  // to avoid memory churn we allocate it locally and just avoid it be deleted by refcount...
160  Plane impPointPlane(origin, rot);
161  // (twice just to be sure!)
162  impPointPlane.addReference();
163  impPointPlane.addReference();
164  // use Base (to avoid a useless new)
165  BasicTrajectoryStateOnSurface impactPointState(lpar, error, impPointPlane, mf);
166 
167 #ifdef DEBUG_STATE
168  checkState(impactPointState, mf);
169 #endif
170  LogTrace("") << "constructed TSOS:\n" << print(impactPointState);
171 
172  int ndof = 2 * hits.size() - 5;
173  GlobalPoint vv = impactPointState.globalPosition();
174  math::XYZPoint pos(vv.x(), vv.y(), vv.z());
175  GlobalVector pp = impactPointState.globalMomentum();
176  math::XYZVector mom(pp.x(), pp.y(), pp.z());
177 
178  reco::Track* track =
179  new reco::Track(chi2, ndof, pos, mom, impactPointState.charge(), impactPointState.curvilinearError());
180 
181  return track;
182 }

References BasicReferenceCounted::addReference(), ALCARECOTkAlJpsiMuMu_cff::charge, BasicTrajectoryState::charge(), hltPixelTracks_cff::chi2, funct::cos(), CommonMethods::cp(), BasicTrajectoryState::curvilinearError(), Measurement1D::error(), relativeConstraints::error, BasicTrajectoryState::globalMomentum(), BasicTrajectoryState::globalPosition(), hfClusterShapes_cfi::hits, LogDebug, LogTrace, visualization-live-secondInstance_cfg::m, ndof, createTree::pp, print(), DiDispStaMuonMonitor_cfi::pt, makeMuonMisalignmentScenario::rot, funct::sin(), sqr(), mathSSE::sqrt(), qcdUeDQM_cfi::tip, HLT_FULL_cff::track, Measurement1D::value(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and ComparisonHelper::zip().

Referenced by PixelFitterByConformalMappingAndLine::run(), PixelFitterByHelixProjections::run(), TrackFitter::run(), and L1MuonPixelTrackFitter::run().

Vector3DBase
Definition: Vector3DBase.h:8
TkRotation< float >
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
Measurement1D::value
double value() const
Definition: Measurement1D.h:25
pos
Definition: PixelAliasList.h:18
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
relativeConstraints.error
error
Definition: relativeConstraints.py:53
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
ndof
Definition: HIMultiTrackSelector.h:49
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::Track
Definition: Track.h:27
Point3DBase< float, GlobalTag >
sqr
T sqr(T t)
Definition: PixelTrackBuilder.cc:22
BasicSingleTrajectoryState
Definition: BasicSingleTrajectoryState.h:10
Measurement1D::error
double error() const
Definition: Measurement1D.h:27
qcdUeDQM_cfi.tip
tip
Definition: qcdUeDQM_cfi.py:23
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
LocalTrajectoryError
Definition: LocalTrajectoryError.h:20
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
LocalVector
Local3DVector LocalVector
Definition: LocalVector.h:12
ComparisonHelper::zip
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
Definition: L1TStage2CaloLayer1.h:41
DDAxes::phi
Plane
Definition: Plane.h:16
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
createTree.pp
pp
Definition: createTree.py:17
CommonMethods.cp
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)
Definition: CommonMethods.py:192
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23