CMS 3D CMS Logo

TrajectoryStateClosestToBeamLineBuilder Class Reference

This class builds a TrajectoryStateClosestToBeamLine given an original FreeTrajectoryState. More...

#include <TrackingTools/PatternTools/interface/TrajectoryStateClosestToBeamLineBuilder.h>

List of all members.

Public Types

typedef FreeTrajectoryState FTS

Public Member Functions

TrajectoryStateClosestToBeamLine operator() (const FTS &originalFTS, const reco::BeamSpot &beamSpot) const


Detailed Description

This class builds a TrajectoryStateClosestToBeamLine given an original FreeTrajectoryState.

This new state is then defined at the point of closest approach to the beam line.

Definition at line 14 of file TrajectoryStateClosestToBeamLineBuilder.h.


Member Typedef Documentation

typedef FreeTrajectoryState TrajectoryStateClosestToBeamLineBuilder::FTS

Definition at line 18 of file TrajectoryStateClosestToBeamLineBuilder.h.


Member Function Documentation

TrajectoryStateClosestToBeamLine TrajectoryStateClosestToBeamLineBuilder::operator() ( const FTS originalFTS,
const reco::BeamSpot beamSpot 
) const

Definition at line 10 of file TrajectoryStateClosestToBeamLineBuilder.cc.

References TwoTrackMinimumDistance::calculate(), FreeTrajectoryState::charge(), FreeTrajectoryState::curvilinearError(), TwoTrackMinimumDistance::firstAngle(), FreeTrajectoryState::hasError(), LogDebug, GlobalTrajectoryParameters::magneticField(), CurvilinearTrajectoryError::matrix(), FreeTrajectoryState::momentum(), FreeTrajectoryState::parameters(), TwoTrackMinimumDistance::pathLength(), PV3DBase< T, PVType, FrameType >::perp(), TwoTrackMinimumDistance::points(), s, StDecayID::status, and PV3DBase< T, PVType, FrameType >::z().

00012 {
00013   TwoTrackMinimumDistance ttmd;
00014   bool status = ttmd.calculate( originalFTS.parameters(), 
00015         GlobalTrajectoryParameters(
00016                 GlobalPoint(beamSpot.position().x(), beamSpot.position().y(), beamSpot.position().z()), 
00017 //              GlobalPoint(0., 0., 0.), 
00018                 GlobalVector(beamSpot.dxdz(), beamSpot.dydz(), 1.), 
00019 //              GlobalVector(0., 0., 1.), 
00020                 0, &(originalFTS.parameters().magneticField()) ) );
00021   if (!status) {
00022     LogDebug  ("TrackingTools/PatternTools")
00023       << "TrajectoryStateClosestToBeamLine: Failure in TTMD when searching for PCA of track to beamline.\n"
00024       << "TrajectoryStateClosestToBeamLine is now invalid.";
00025     return TrajectoryStateClosestToBeamLine();
00026   }
00027 
00028   pair<GlobalPoint, GlobalPoint> points = ttmd.points();
00029 
00030   GlobalPoint xTrack = points.first;
00031   GlobalVector pTrack = GlobalVector ( GlobalVector::Cylindrical(originalFTS.momentum().perp(), ttmd.firstAngle(), originalFTS.momentum().z()) );
00032 
00033   double s =  ttmd.pathLength().first;
00034 
00035   FreeTrajectoryState theFTS;
00036   if (originalFTS.hasError()) {
00037     const AlgebraicSymMatrix55 &errorMatrix = originalFTS.curvilinearError().matrix();
00038     AnalyticalCurvilinearJacobian curvilinJacobian(originalFTS.parameters(), xTrack,
00039                                                    pTrack, s);
00040     const AlgebraicMatrix55 &jacobian = curvilinJacobian.jacobian();
00041     CurvilinearTrajectoryError cte( ROOT::Math::Similarity(jacobian, errorMatrix) );
00042   
00043     theFTS = FreeTrajectoryState(GlobalTrajectoryParameters(xTrack, pTrack, originalFTS.charge(), 
00044                                         &(originalFTS.parameters().magneticField())),
00045                                 cte);
00046   }
00047   else {
00048     theFTS = FreeTrajectoryState(GlobalTrajectoryParameters(xTrack, pTrack, originalFTS.charge(),
00049                                         &(originalFTS.parameters().magneticField())));
00050   }
00051   return TrajectoryStateClosestToBeamLine(theFTS, points.second, beamSpot);
00052 }


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