Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:23:25

0001 #ifndef KinematicVertexFactory_H
0002 #define KinematicVertexFactory_H
0003 
0004 #include "RecoVertex/KinematicFitPrimitives/interface/RefCountedKinematicVertex.h"
0005 
0006 /**
0007  * Factory to create Reference counting pointers
0008  * to KinematicVertex objects. Can be used both
0009  * to create object and pointers or simple
0010  * pointers to existing object. 
0011  *
0012  * Kirill Prokofiev December 2002
0013  */
0014 
0015 class KinematicVertexFactory {
0016 public:
0017   KinematicVertexFactory() {}
0018 
0019   /**
0020  * Constructor with vertex state, chi2 and ndf.
0021  * Previous state of the vertex pointer is set to 0.
0022  */
0023   static RefCountedKinematicVertex vertex(const VertexState& state, float totalChiSq, float degreesOfFr) {
0024     return ReferenceCountingPointer<KinematicVertex>(new KinematicVertex(state, totalChiSq, degreesOfFr));
0025   }
0026 
0027   /**
0028  * Constructor with previous (before constraint)
0029  * state of the vertex
0030  */
0031   static RefCountedKinematicVertex vertex(const VertexState state,
0032                                           const ReferenceCountingPointer<KinematicVertex> pVertex,
0033                                           float totalChiSq,
0034                                           float degreesOfFr) {
0035     return ReferenceCountingPointer<KinematicVertex>(new KinematicVertex(state, pVertex, totalChiSq, degreesOfFr));
0036   }
0037 
0038   /**
0039  * Direct conversion from caching vertex
0040  */
0041   static RefCountedKinematicVertex vertex(const CachingVertex<6>& vertex) {
0042     return ReferenceCountingPointer<KinematicVertex>(new KinematicVertex(vertex));
0043   }
0044 
0045   /**
0046  * Method producing invalid kinematic vertices
0047  * to mark top production and final state decay vertices
0048  */
0049   static RefCountedKinematicVertex vertex() { return ReferenceCountingPointer<KinematicVertex>(new KinematicVertex()); }
0050 };
0051 #endif