CMS 3D CMS Logo

SteppingHelixStateInfo.cc

Go to the documentation of this file.
00001 
00009 //
00010 // Original Author:  Vyacheslav Krutelyov
00011 //         Created:  Wed Jan  3 16:01:24 CST 2007
00012 // $Id: SteppingHelixStateInfo.cc,v 1.12 2008/12/04 00:27:03 slava77 Exp $
00013 //
00014 //
00015 
00016 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00017 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00018 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00019 
00020 #include "TrackPropagation/SteppingHelixPropagator/interface/SteppingHelixStateInfo.h"
00021 #include "TrackingTools/AnalyticalJacobians/interface/JacobianCartesianToCurvilinear.h"
00022 
00023 #include "DataFormats/GeometrySurface/interface/TangentPlane.h"
00024 
00025 const std::string SteppingHelixStateInfo::ResultName[MAX_RESULT] = {
00026   "RESULT_OK",
00027   "RESULT_FAULT",
00028   "RESULT_RANGEOUT",
00029   "RESULT_INACC",
00030   "RESULT_NOT_IMPLEMENTED",
00031   "RESULT_UNDEFINED"
00032 };
00033 
00034 SteppingHelixStateInfo::SteppingHelixStateInfo(const FreeTrajectoryState& fts): 
00035   path_(0), radPath_(0), dir(0), magVol(0), field(0), dEdx(0), dEdXPrime(0), radX0(1e12),
00036   status_(UNDEFINED)
00037 {
00038   p3.set(fts.momentum().x(), fts.momentum().y(), fts.momentum().z());
00039   r3.set(fts.position().x(), fts.position().y(), fts.position().z());
00040   q = fts.charge();
00041 
00042   if (fts.hasError()){
00043     cov = fts.cartesianError().matrix();
00044     hasErrorPropagated_ = true;
00045   } else {
00046     cov = AlgebraicSymMatrix66();
00047     hasErrorPropagated_ = false;
00048   }
00049 
00050   isComplete = false;
00051   isValid_ = true;
00052 }
00053 
00054 TrajectoryStateOnSurface SteppingHelixStateInfo::getStateOnSurface(const Surface& surf, bool returnTangentPlane) const {
00055   if (! isValid()) return TrajectoryStateOnSurface();
00056   GlobalVector p3GV(p3.x(), p3.y(), p3.z());
00057   GlobalPoint r3GP(r3.x(), r3.y(), r3.z());
00058   GlobalTrajectoryParameters tPars(r3GP, p3GV, q, field);
00059   CartesianTrajectoryError tCov(cov);
00060 
00061   CurvilinearTrajectoryError tCCov(ROOT::Math::Similarity(JacobianCartesianToCurvilinear(tPars).jacobian(), cov));
00062 
00063   FreeTrajectoryState fts(tPars, tCov, tCCov);
00064   if (! hasErrorPropagated_) fts = FreeTrajectoryState(tPars);
00065 
00066 
00067   SurfaceSideDefinition::SurfaceSide side = SurfaceSideDefinition::atCenterOfSurface;
00068   if ( dir > 0 ) side =  SurfaceSideDefinition::beforeSurface;
00069   if ( dir < 0 ) side =  SurfaceSideDefinition::afterSurface;
00070   return TrajectoryStateOnSurface(fts, returnTangentPlane ? *surf.tangentPlane(fts.position()) : surf, side);
00071 }
00072 
00073 
00074 void SteppingHelixStateInfo::getFreeState(FreeTrajectoryState& fts) const {
00075   if (isValid()){
00076     GlobalVector p3GV(p3.x(), p3.y(), p3.z());
00077     GlobalPoint r3GP(r3.x(), r3.y(), r3.z());
00078     GlobalTrajectoryParameters tPars(r3GP, p3GV, q, field);
00079     CartesianTrajectoryError tCov(cov);
00080     
00081     fts = (hasErrorPropagated_ ) 
00082       ? FreeTrajectoryState(tPars, tCov) : FreeTrajectoryState(tPars);
00083     if (fts.hasError()) fts.curvilinearError(); //call it so it gets created
00084   }
00085 }

Generated on Tue Jun 9 17:48:43 2009 for CMSSW by  doxygen 1.5.4