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

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 136 of file PixelTrackBuilder.cc.

References BasicReferenceCounted::addReference(), BasicTrajectoryState::charge(), funct::cos(), SimDataFormats::CaloAnalysis::cp, BasicTrajectoryState::curvilinearError(), Measurement1D::error(), relativeConstraints::error, BasicTrajectoryState::globalMomentum(), BasicTrajectoryState::globalPosition(), LogDebug, LogTrace, funct::m, ndof, createTree::pp, edm::print(), makeMuonMisalignmentScenario::rot, funct::sin(), sqr(), mathSSE::sqrt(), HiIsolationCommonParameters_cff::track, Measurement1D::value(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

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

147 {
148 
149  LogDebug("PixelTrackBuilder::build");
150  LogTrace("") << "Reconstructed triplet kinematics: " << print(pt,phi,cotTheta,tip,zip,chi2,charge);
151 
152  double sinTheta = 1/std::sqrt(1+sqr(cotTheta.value()));
153  double cosTheta = cotTheta.value()*sinTheta;
154  int tipSign = tip.value() > 0 ? 1 : -1;
155 
157  double invPtErr = 1./sqr(pt.value()) * pt.error();
158  m(0,0) = sqr(sinTheta) * (
159  sqr(invPtErr)
160  + sqr(cotTheta.error()/pt.value()*cosTheta * sinTheta)
161  );
162  m(0,2) = sqr( cotTheta.error()) * cosTheta * sqr(sinTheta) / pt.value();
163  m(1,1) = sqr( phi.error() );
164  m(2,2) = sqr( cotTheta.error());
165  m(3,3) = sqr( tip.error() );
166  m(4,4) = sqr( zip.error() );
168 
170  LocalPoint(tipSign*tip.value(), -tipSign*zip.value(), 0),
171  LocalVector(0., -tipSign*pt.value()*cotTheta.value(), pt.value()),
172  charge);
173 
174 
175  float sp = std::sin(phi.value());
176  float cp = std::cos(phi.value());
178  sp*tipSign, -cp*tipSign, 0,
179  0 , 0, -tipSign,
180  cp , sp , 0);
181 
182  // BTSOS hold Surface in a shared pointer and will be autodeleted when BTSOS goes out of scope...
183  // to avoid memory churn we allocate it locally and just avoid it be deleted by refcount...
184  Plane impPointPlane(origin, rot);
185  // (twice just to be sure!)
186  impPointPlane.addReference(); impPointPlane.addReference();
187  // use Base (to avoid a useless new)
188  BasicTrajectoryStateOnSurface impactPointState( lpar , error, impPointPlane, mf);
189 
190  //checkState(impactPointState,mf);
191  LogTrace("") << "constructed TSOS:\n" << print(impactPointState);
192 
193  int ndof = 2*hits.size()-5;
194  GlobalPoint vv = impactPointState.globalPosition();
195  math::XYZPoint pos( vv.x(), vv.y(), vv.z() );
196  GlobalVector pp = impactPointState.globalMomentum();
197  math::XYZVector mom( pp.x(), pp.y(), pp.z() );
198 
199  reco::Track * track = new reco::Track( chi2, ndof, pos, mom,
200  impactPointState.charge(), impactPointState.curvilinearError());
201 
202 
203  return track;
204 }
#define LogDebug(id)
Local3DVector LocalVector
Definition: LocalVector.h:12
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T y() const
Definition: PV3DBase.h:63
double error() const
Definition: Measurement1D.h:30
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:65
Definition: Plane.h:17
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define LogTrace(id)
T sqr(T t)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double value() const
Definition: Measurement1D.h:28
T x() const
Definition: PV3DBase.h:62