Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "RecoVertex/KinematicFitPrimitives/interface/VirtualKinematicParticleFactory.h"
0002 
0003 VirtualKinematicParticleFactory::VirtualKinematicParticleFactory() { propagator = new TrackKinematicStatePropagator(); }
0004 
0005 VirtualKinematicParticleFactory::VirtualKinematicParticleFactory(KinematicStatePropagator* pr) {
0006   if (pr != nullptr) {
0007     propagator = pr->clone();
0008   } else {
0009     propagator = new TrackKinematicStatePropagator();
0010   }
0011 }
0012 
0013 RefCountedKinematicParticle VirtualKinematicParticleFactory::particle(
0014     const KinematicState& kineState,
0015     float& chiSquared,
0016     float& degreesOfFr,
0017     ReferenceCountingPointer<KinematicParticle> previousParticle,
0018     KinematicConstraint* lastConstraint) const {
0019   if (previousParticle.get() != nullptr) {
0020     KinematicParticle* prp = &(*previousParticle);
0021     VirtualKinematicParticle* pr = dynamic_cast<VirtualKinematicParticle*>(prp);
0022     if (pr == nullptr) {
0023       throw VertexException(
0024           "KinematicParticleFactoryFromTransientTrack::Previous particle passed is not TransientTrack based!");
0025     }
0026   }
0027   return ReferenceCountingPointer<KinematicParticle>(
0028       new VirtualKinematicParticle(kineState, chiSquared, degreesOfFr, lastConstraint, previousParticle, propagator));
0029 }