CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/RecoVertex/KinematicFitPrimitives/src/VirtualKinematicParticleFactory.cc

Go to the documentation of this file.
00001 #include "RecoVertex/KinematicFitPrimitives/interface/VirtualKinematicParticleFactory.h"
00002  
00003  
00004 VirtualKinematicParticleFactory::VirtualKinematicParticleFactory()
00005 {propagator =  new TrackKinematicStatePropagator();}
00006  
00007 VirtualKinematicParticleFactory::VirtualKinematicParticleFactory(KinematicStatePropagator * pr)
00008 {
00009  if(pr!=0)
00010  {
00011   propagator = pr->clone();
00012  }else{
00013   propagator =  new TrackKinematicStatePropagator();
00014  }
00015 }
00016  
00017 RefCountedKinematicParticle VirtualKinematicParticleFactory::particle(const KinematicState& kineState, 
00018           float& chiSquared, float& degreesOfFr, ReferenceCountingPointer<KinematicParticle> previousParticle,
00019                                                        KinematicConstraint * lastConstraint)const
00020 {
00021  if(previousParticle.get() != 0)
00022  {
00023   KinematicParticle * prp = &(*previousParticle);
00024   VirtualKinematicParticle * pr = dynamic_cast<VirtualKinematicParticle * >(prp);
00025   if(pr == 0){ throw VertexException("KinematicParticleFactoryFromTransientTrack::Previous particle passed is not TransientTrack based!");}
00026  } 
00027  return ReferenceCountingPointer<KinematicParticle>(new VirtualKinematicParticle(kineState, chiSquared, degreesOfFr, 
00028                                                                             lastConstraint, previousParticle, propagator));
00029 }