CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 132 of file PixelTrackBuilder.cc.

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

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

143 {
144 
145  LogDebug("PixelTrackBuilder::build");
146  LogTrace("")<<"reconstructed TRIPLET kinematics:\n"<<print(pt,phi,cotTheta,tip,zip,chi2,charge);
147 
148  double sinTheta = 1/std::sqrt(1+sqr(cotTheta.value()));
149  double cosTheta = cotTheta.value()*sinTheta;
150  int tipSign = tip.value() > 0 ? 1 : -1;
151 
153  double invPtErr = 1./sqr(pt.value()) * pt.error();
154  m(0,0) = sqr(sinTheta) * (
155  sqr(invPtErr)
156  + sqr(cotTheta.error()/pt.value()*cosTheta * sinTheta)
157  );
158  m(0,2) = sqr( cotTheta.error()) * cosTheta * sqr(sinTheta) / pt.value();
159  m(1,1) = sqr( phi.error() );
160  m(2,2) = sqr( cotTheta.error());
161  m(3,3) = sqr( tip.error() );
162  m(4,4) = sqr( zip.error() );
164 
166  LocalPoint(tipSign*tip.value(), -tipSign*zip.value(), 0),
167  LocalVector(0., -tipSign*pt.value()*cotTheta.value(), pt.value()),
168  charge);
169 
170 
171  float sp = std::sin(phi.value());
172  float cp = std::cos(phi.value());
174  sp*tipSign, -cp*tipSign, 0,
175  0 , 0, -tipSign,
176  cp , sp , 0);
177 
178  // BTSOS hold Surface in a shared pointer and will be autodeleted when BTSOS goes out of scope...
179  // to avoid memory churn we allocate it locally and just avoid it be deleted by refcount...
180  Plane impPointPlane(origin, rot);
181  // (twice just to be sure!)
182  impPointPlane.addReference(); impPointPlane.addReference();
183  // use Base (to avoid a useless new)
184  BasicTrajectoryStateOnSurface impactPointState( lpar , error, impPointPlane, mf, 1.0);
185 
186  //checkState(impactPointState,mf);
187  LogTrace("")<<"constructed TSOS :\n"<<print(impactPointState);
188 
189  int ndof = 2*hits.size()-5;
190  GlobalPoint vv = impactPointState.globalPosition();
191  math::XYZPoint pos( vv.x(), vv.y(), vv.z() );
192  GlobalVector pp = impactPointState.globalMomentum();
193  math::XYZVector mom( pp.x(), pp.y(), pp.z() );
194 
195  reco::Track * track = new reco::Track( chi2, ndof, pos, mom,
196  impactPointState.charge(), impactPointState.curvilinearError());
197 
198  LogTrace("") <<"RECONSTRUCTED TRACK (0,0,0):\n"<< print(*track,GlobalPoint(0,0,0))<<std::endl;
199  LogTrace("") <<"RECONSTRUCTED TRACK "<<origin<<"\n"<< print(*track,origin)<<std::endl;
200 
201  return track;
202 }
#define LogDebug(id)
Local3DVector LocalVector
Definition: LocalVector.h:12
tuple pp
Definition: createTree.py:15
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:8
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:62
double error() const
Definition: Measurement1D.h:30
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
double charge(const std::vector< uint8_t > &Ampls)
Definition: Plane.h:17
T sqrt(T t)
Definition: SSEVec.h:46
T z() const
Definition: PV3DBase.h:63
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define LogTrace(id)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
double value() const
Definition: Measurement1D.h:28
Square< F >::type sqr(const F &f)
Definition: Square.h:13
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
T x() const
Definition: PV3DBase.h:61