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.

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

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

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 }
Local3DVector LocalVector
Definition: LocalVector.h:12
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
T z() const
Definition: PV3DBase.h:61
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
Definition: Plane.h:16
#define LogTrace(id)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:19
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
T sqr(T t)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
double value() const
Definition: Measurement1D.h:25
double error() const
Definition: Measurement1D.h:27
#define LogDebug(id)