CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/RecoVertex/KinematicFitPrimitives/src/KinematicParticleFactoryFromTransientTrack.cc

Go to the documentation of this file.
00001 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicParticleFactoryFromTransientTrack.h"
00002 
00003 KinematicParticleFactoryFromTransientTrack::KinematicParticleFactoryFromTransientTrack()
00004 {propagator = new TrackKinematicStatePropagator();}
00005 
00006 
00007 KinematicParticleFactoryFromTransientTrack::KinematicParticleFactoryFromTransientTrack(KinematicStatePropagator * pr)
00008 {
00009  if(pr != 0)
00010  {
00011   propagator = pr->clone();
00012  }else{
00013   propagator = new TrackKinematicStatePropagator();
00014  }
00015 }
00016 
00017 RefCountedKinematicParticle KinematicParticleFactoryFromTransientTrack::particle(const reco::TransientTrack& initialTrack, 
00018                                                                            const ParticleMass& massGuess,
00019                                                                            float chiSquared, 
00020                                                                            float degreesOfFr, 
00021                                                                            float& m_sigma) const
00022 {
00023 // cout<<"calling the state builder"<<endl;
00024  KinematicState initState = builder(initialTrack,massGuess, m_sigma);
00025  const reco::TransientTrack * track = &initialTrack;
00026  KinematicConstraint * lastConstraint = 0;
00027  ReferenceCountingPointer<KinematicParticle> previousParticle = 0;
00028  return ReferenceCountingPointer<KinematicParticle>(new TransientTrackKinematicParticle(initState,
00029                       chiSquared,degreesOfFr, lastConstraint, previousParticle, propagator, track));
00030 }
00031 
00032 RefCountedKinematicParticle KinematicParticleFactoryFromTransientTrack::particle(const reco::TransientTrack& initialTrack, 
00033                                                                            const ParticleMass& massGuess,
00034                                                                            float chiSquared, 
00035                                                                            float degreesOfFr, 
00036                                                                            float& m_sigma,
00037                                                                            const FreeTrajectoryState &freestate) const
00038 {
00039 // cout<<"calling the state builder"<<endl;
00040  KinematicState initState = builder(freestate,massGuess, m_sigma);
00041  const reco::TransientTrack * track = &initialTrack;
00042  KinematicConstraint * lastConstraint = 0;
00043  ReferenceCountingPointer<KinematicParticle> previousParticle = 0;
00044  return ReferenceCountingPointer<KinematicParticle>(new TransientTrackKinematicParticle(initState,
00045                       chiSquared,degreesOfFr, lastConstraint, previousParticle, propagator, track));
00046 }
00047 
00048 RefCountedKinematicParticle KinematicParticleFactoryFromTransientTrack::particle(const reco::TransientTrack& initialTrack, 
00049                                                                            const ParticleMass& massGuess,
00050                                                                            float chiSquared, 
00051                                                                            float degreesOfFr,
00052                                                                            const GlobalPoint& expPoint, 
00053                                                                            float m_sigma) const
00054 {
00055 //  FreeTrajectoryState st(initialTrack.impactPointTSCP().theState());
00056  KinematicState initState = builder(initialTrack.impactPointTSCP().theState(), massGuess, m_sigma, expPoint); 
00057  const reco::TransientTrack * track = &initialTrack;
00058  KinematicConstraint * lastConstraint = 0;
00059  ReferenceCountingPointer<KinematicParticle> previousParticle = 0;
00060  return ReferenceCountingPointer<KinematicParticle>(new TransientTrackKinematicParticle(initState,
00061                                 chiSquared,degreesOfFr, lastConstraint, previousParticle, propagator, track));
00062 }
00063  
00064 
00065 RefCountedKinematicParticle KinematicParticleFactoryFromTransientTrack::particle(const KinematicState& kineState, 
00066                                                                            float& chiSquared,
00067                                                                            float& degreesOfFr,
00068                                                   ReferenceCountingPointer<KinematicParticle> previousParticle,
00069                                                                    KinematicConstraint * lastConstraint) const
00070 {
00071  const reco::TransientTrack * track;
00072  KinematicParticle * prp = &(*previousParticle);
00073 // FIXME
00074 //  if(previousParticle.isValid()){
00075    TransientTrackKinematicParticle * pr = dynamic_cast<TransientTrackKinematicParticle * >(prp);
00076    if(pr == 0){
00077     throw VertexException("KinematicParticleFactoryFromTransientTrack::Previous particle passed is not TransientTrack based!");
00078    }else{track  = pr->initialTransientTrack();}
00079 //  }else{track = 0;}
00080  return ReferenceCountingPointer<KinematicParticle>(new TransientTrackKinematicParticle(kineState,
00081                                 chiSquared, degreesOfFr, lastConstraint, previousParticle, propagator, track));
00082 }