Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:17

0001 #include "RecoVertex/KinematicFitPrimitives/interface/TransientTrackKinematicStateBuilder.h"
0002 
0003 using namespace reco;
0004 
0005 KinematicState TransientTrackKinematicStateBuilder::operator()(const TransientTrack& track,
0006                                                                const ParticleMass& m,
0007                                                                float m_sigma) const {
0008   // FreeTrajectoryState * recState = track.impactPointState().freeState();
0009   return buildState(*(track.impactPointState().freeState()), m, m_sigma);
0010 }
0011 
0012 //KinematicState
0013 //TransientTrackKinematicStateBuilder::operator()(const KinematicParameters& par,
0014 //  const KinematicParametersError& er, const TrackCharge& ch,
0015 //  const MagneticField* field) const
0016 //{
0017 //  return KinematicState(par, er, ch, field);
0018 //}
0019 
0020 KinematicState TransientTrackKinematicStateBuilder::operator()(const TransientTrack& track,
0021                                                                const GlobalPoint& point,
0022                                                                const ParticleMass& m,
0023                                                                float m_sigma) const {
0024   //  FreeTrajectoryState  recState = track.trajectoryStateClosestToPoint(point).theState();
0025   return buildState(track.trajectoryStateClosestToPoint(point).theState(), m, m_sigma);
0026 }
0027 
0028 KinematicState TransientTrackKinematicStateBuilder::operator()(const FreeTrajectoryState& state,
0029                                                                const ParticleMass& mass,
0030                                                                float m_sigma) const {
0031   //building initial kinematic state
0032   return buildState(state, mass, m_sigma);
0033 }
0034 
0035 KinematicState TransientTrackKinematicStateBuilder::operator()(const FreeTrajectoryState& state,
0036                                                                const ParticleMass& mass,
0037                                                                float m_sigma,
0038                                                                const GlobalPoint& point) const {
0039   //building initial kinematic state
0040   KinematicState res = buildState(state, mass, m_sigma);
0041 
0042   //and propagating it to given point if needed
0043   GlobalPoint inPos = state.position();
0044   if ((inPos.x() != point.x()) || (inPos.y() != point.y()) || (inPos.z() != point.z())) {
0045     res = propagator.propagateToTheTransversePCA(res, point);
0046   }
0047   return res;
0048 }
0049 
0050 PerigeeKinematicState TransientTrackKinematicStateBuilder::operator()(const KinematicState& state,
0051                                                                       const GlobalPoint& point) const {
0052   KinematicState nState = propagator.propagateToTheTransversePCA(state, point);
0053   return PerigeeKinematicState(nState, point);
0054 }
0055 
0056 KinematicState TransientTrackKinematicStateBuilder::buildState(const FreeTrajectoryState& state,
0057                                                                const ParticleMass& mass,
0058                                                                float m_sigma) const {
0059   return KinematicState(state, mass, m_sigma);
0060 }