CMS 3D CMS Logo

PixelTrackBuilder Class Reference

#include <RecoPixelVertexing/PixelTrackFitting/src/PixelTrackBuilder.h>

List of all members.

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

Private Member Functions

void checkState (const TrajectoryStateOnSurface &state, const MagneticField *mf) const
std::string print (const Measurement1D &pt, const Measurement1D &phi, const Measurement1D &cotTheta, const Measurement1D &tip, const Measurement1D &zip, float chi2, int charge) const
std::string print (const TrajectoryStateOnSurface &state) const
std::string print (const reco::Track &track) 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

Definition at line 24 of file PixelTrackBuilder.cc.

References TrajectoryStateOnSurface::charge(), funct::cos(), TrajectoryStateOnSurface::curvilinearError(), lat::endl(), Measurement1D::error(), error, TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), LogDebug, LogTrace, m, print(), rot, funct::sin(), sqr(), funct::sqrt(), track, Measurement1D::value(), vv, 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().

00034 {
00035 
00036   LogDebug("PixelTrackBuilder::build");
00037   LogTrace("")<<"reconstructed TRIPLET kinematics:\n"<<print(pt,phi,cotTheta,tip,zip,chi2,charge);
00038 
00039   float sinTheta = 1/sqrt(1+sqr(cotTheta.value()));
00040   float cosTheta = cotTheta.value()*sinTheta;
00041   int tipSign = tip.value() > 0 ? 1 : -1;
00042 
00043   AlgebraicSymMatrix m(5,0);
00044   float invPtErr = 1./sqr(pt.value()) * pt.error();
00045   m[0][0] = sqr(sinTheta) * (
00046               sqr(invPtErr)
00047             + sqr(cotTheta.error()/pt.value()*cosTheta * sinTheta)
00048             );
00049   m[0][2] = sqr( cotTheta.error()) * cosTheta * sqr(sinTheta) / pt.value();
00050   m[1][1] = sqr( phi.error() );
00051   m[2][2] = sqr( cotTheta.error());
00052   m[3][3] = sqr( tip.error() );
00053   m[4][4] = sqr( zip.error() );
00054   LocalTrajectoryError error(m);
00055 
00056   LocalTrajectoryParameters lpar(
00057     LocalPoint(tipSign*tip.value(), -tipSign*zip.value(), 0),
00058     LocalVector(0., -tipSign*pt.value()*cotTheta.value(), pt.value()),
00059     charge);
00060 
00061   Surface::RotationType rot(
00062       sin(phi.value())*tipSign, -cos(phi.value())*tipSign,             0,
00063                      0,                 0,     -1*tipSign,
00064       cos(phi.value()),          sin(phi.value()),             0);
00065   BoundPlane * impPointPlane = new BoundPlane(GlobalPoint(0.,0.,0.), rot);
00066 
00067   TrajectoryStateOnSurface impactPointState( lpar , error, *impPointPlane, mf, 1.0);
00068   
00069 //  checkState(impactPointState,mf);
00070   LogTrace("")<<"constructed TSOS :\n"<<print(impactPointState);
00071 
00072   int ndof = 2*hits.size()-5;
00073   GlobalPoint vv = impactPointState.globalPosition();
00074   math::XYZPoint  pos( vv.x(), vv.y(), vv.z() );
00075   GlobalVector pp = impactPointState.globalMomentum();
00076   math::XYZVector mom( pp.x(), pp.y(), pp.z() );
00077 
00078   reco::Track * track = new reco::Track( chi2, ndof, pos, mom, 
00079         impactPointState.charge(), impactPointState.curvilinearError());
00080 
00081   LogTrace("") <<"RECONSTRUCTED TRACK:\n"<< print(*track)<<std::endl;;
00082 
00083   return track;
00084 }

void PixelTrackBuilder::checkState ( const TrajectoryStateOnSurface state,
const MagneticField mf 
) const [private]

Definition at line 166 of file PixelTrackBuilder.cc.

References lat::endl(), TransverseImpactPointExtrapolator::extrapolate(), LogTrace, GloballyPositioned< T >::rotation(), TrajectoryStateOnSurface::surface(), parsecf::pyparsing::test(), and TrajectoryStateClosestToPoint::theState().

00167 {
00168   LogTrace("")<<" *** PixelTrackBuilder::checkState: ";
00169   LogTrace("")<<"INPUT,  ROTATION" << endl<<state.surface().rotation();
00170   LogTrace("")<<"INPUT,  TSOS:"<<endl<<state;
00171   
00172   TransverseImpactPointExtrapolator tipe(mf);
00173   TrajectoryStateOnSurface test= tipe.extrapolate(state, GlobalPoint(0,0,0) );
00174   LogTrace("")<<"CHECK-1 ROTATION" << endl<<"\n"<<test.surface().rotation();
00175   LogTrace("")<<"CHECK-1 TSOS" << endl<<test;
00176 
00177   TSCPBuilderNoMaterial tscpBuilder;
00178   TrajectoryStateClosestToPoint tscp =
00179       tscpBuilder(*(state.freeState()), GlobalPoint(0,0,0) );
00180   FreeTrajectoryState fs = tscp.theState();
00181   LogTrace("")<<"CHECK-2 FTS: " << fs;
00182 }

std::string PixelTrackBuilder::print ( const Measurement1D pt,
const Measurement1D phi,
const Measurement1D cotTheta,
const Measurement1D tip,
const Measurement1D zip,
float  chi2,
int  charge 
) const [private]

Definition at line 86 of file PixelTrackBuilder.cc.

References Measurement1D::error(), and Measurement1D::value().

00094 {
00095     ostringstream str;
00096     str <<"\t pt: "  << pt.value() <<"+/-"<<pt.error()  
00097         <<"\t phi: " << phi.value() <<"+/-"<<phi.error()
00098         <<"\t cot: " << cotTheta.value() <<"+/-"<<cotTheta.error()
00099         <<"\t tip: " << tip.value() <<"+/-"<<tip.error()
00100         <<"\t zip: " << zip.value() <<"+/-"<<zip.error()
00101         <<"\t charge: " << charge;
00102     return str.str();
00103 }

std::string PixelTrackBuilder::print ( const TrajectoryStateOnSurface state  )  const [private]

Definition at line 132 of file PixelTrackBuilder.cc.

References TrajectoryStateOnSurface::charge(), funct::cos(), TrajectoryStateOnSurface::curvilinearError(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localMomentum(), TrajectoryStateOnSurface::localPosition(), CurvilinearTrajectoryError::matrix(), LocalTrajectoryError::matrix(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phi, print(), funct::sin(), sqr(), funct::sqrt(), PV3DBase< T, PVType, FrameType >::theta(), tip, Measurement1D::value(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

00133 {
00134 
00135   float pt_v = state.globalMomentum().perp();
00136   float phi_v = state.globalMomentum().phi();
00137   float theta_v = state.globalMomentum().theta();
00138 
00139   CurvilinearTrajectoryError curv = state.curvilinearError();
00140   float errPhi2 = curv.matrix()(3,3);
00141   float errLambda2 = curv.matrix()(2,2);
00142   float errInvP2 = curv.matrix()(1,1);
00143   float covIPtTheta = curv.matrix()(1,2);
00144   float cosTheta = cos(theta_v);
00145   float sinTheta = sin(theta_v);
00146   float errInvPt2 = (   errInvP2
00147                       + sqr(cosTheta/pt_v)*errLambda2
00148                       + 2*(cosTheta/pt_v)*covIPtTheta) / sqr(sinTheta);
00149   float errCotTheta = sqrt(errLambda2)/sqr(sinTheta) ;
00150   Measurement1D pt(pt_v, sqr(pt_v) * sqrt(errInvPt2));
00151   Measurement1D phi(phi_v, sqrt(errPhi2) );
00152   Measurement1D cotTheta(cosTheta/sinTheta, errCotTheta);
00153 
00154   float zip_v = state.globalPosition().z();
00155   float zip_e = sqrt( state.localError().matrix()(5,5));
00156   Measurement1D zip(zip_v, zip_e);
00157 
00158   float tip_v  = state.localPosition().x(); 
00159   int tip_sign = (state.localMomentum().y()*cotTheta.value() > 0) ? -1 : 1;
00160   float tip_e  = sqrt( state.localError().matrix()(4,4) );
00161   Measurement1D tip( tip_sign*tip_v, tip_e);
00162 
00163   return print(pt, phi, cotTheta, tip, zip, 0., state.charge());
00164 }

std::string PixelTrackBuilder::print ( const reco::Track track  )  const [private]

Definition at line 105 of file PixelTrackBuilder.cc.

References reco::TrackBase::charge(), reco::TrackBase::chi2(), funct::cos(), reco::TrackBase::covariance(), reco::TrackBase::d0(), reco::TrackBase::d0Error(), reco::TrackBase::dz(), reco::TrackBase::dzError(), reco::TrackBase::lambdaError(), phi, reco::TrackBase::phi(), reco::TrackBase::phiError(), reco::TrackBase::pt(), reco::TrackBase::qoverpError(), funct::sin(), sqr(), funct::sqrt(), theta, reco::TrackBase::theta(), and tip.

Referenced by build(), and print().

00106 {
00107 
00108   Measurement1D phi( track.phi(), track.phiError());
00109 
00110   float theta = track.theta();
00111   float cosTheta = cos(theta);
00112   float sinTheta = sin(theta);
00113   float errLambda2 = sqr( track.lambdaError() );
00114   Measurement1D cotTheta(cosTheta/sinTheta, sqrt(errLambda2)/sqr(sinTheta));
00115 
00116   float pt_v = track.pt();
00117   float errInvP2 = sqr(track.qoverpError());
00118   float covIPtTheta = track.covariance(TrackBase::i_qoverp, TrackBase::i_lambda);
00119   float errInvPt2 = (   errInvP2
00120                       + sqr(cosTheta/pt_v)*errLambda2
00121                       + 2*(cosTheta/pt_v)*covIPtTheta
00122                      ) / sqr(sinTheta);
00123   Measurement1D pt(pt_v, sqr(pt_v)*sqrt(errInvPt2));
00124 
00125   Measurement1D tip(track.d0(), track.d0Error());
00126 
00127   Measurement1D zip(track.dz(), track.dzError());
00128 
00129   return print(pt, phi, cotTheta, tip, zip, track.chi2(),  track.charge());
00130 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:06 2009 for CMSSW by  doxygen 1.5.4