Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef KinematicConstrainedVertexFitter_H
0002 #define KinematicConstrainedVertexFitter_H
0003 
0004 #include "RecoVertex/KinematicFitPrimitives/interface/RefCountedKinematicTree.h"
0005 #include "RecoVertex/KinematicFitPrimitives/interface/MultiTrackKinematicConstraint.h"
0006 #include "RecoVertex/VertexTools/interface/LinearizationPointFinder.h"
0007 #include "RecoVertex/KinematicFit/interface/KinematicConstrainedVertexUpdator.h"
0008 #include "RecoVertex/KinematicFit/interface/VertexKinematicConstraint.h"
0009 #include "RecoVertex/KinematicFit/interface/ConstrainedTreeBuilder.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 
0012 /**
0013  * Class fitting the veretx out of set of tracks via usual LMS
0014  * with Lagrange multipliers.
0015  * Additional constraints can be applyed to the tracks during the vertex fit
0016  * (solves non-factorizabele cases). Since the vertex constraint is included by default, do not add a separate
0017  * VertexKinematicConstraint!
0018  * Example: Vertex fit with collinear tracks..
0019  */
0020 
0021 class KinematicConstrainedVertexFitter {
0022 public:
0023   /**
0024  * Default constructor using LMSLinearizationPointFinder
0025  */
0026   KinematicConstrainedVertexFitter();
0027 
0028   /**
0029  * Constructor with user-provided LinearizationPointFinder
0030  */
0031   KinematicConstrainedVertexFitter(const LinearizationPointFinder &fnd);
0032 
0033   ~KinematicConstrainedVertexFitter();
0034 
0035   /**
0036    * Configuration through PSet: number of iterations(maxDistance) and
0037    * stopping condition (maxNbrOfIterations)
0038    */
0039 
0040   void setParameters(const edm::ParameterSet &pSet);
0041 
0042   /**
0043  * Without additional constraint, this will perform a simple
0044  * vertex fit using LMS with Lagrange multipliers method.
0045  */
0046   RefCountedKinematicTree fit(const std::vector<RefCountedKinematicParticle> &part) {
0047     return fit(part, nullptr, nullptr);
0048   }
0049 
0050   /**
0051  * LMS with Lagrange multipliers fit of vertex constraint and user-specified constraint.
0052  */
0053   RefCountedKinematicTree fit(const std::vector<RefCountedKinematicParticle> &part, MultiTrackKinematicConstraint *cs) {
0054     return fit(part, cs, nullptr);
0055   };
0056 
0057   /**
0058  * LMS with Lagrange multipliers fit of vertex constraint, user-specified constraint and user-specified starting point.
0059  */
0060   RefCountedKinematicTree fit(const std::vector<RefCountedKinematicParticle> &part,
0061                               MultiTrackKinematicConstraint *cs,
0062                               GlobalPoint *pt);
0063 
0064   //return the number of iterations
0065   int getNit() const;
0066   //return the value of the constraint equation
0067   float getCSum() const;
0068 
0069 private:
0070   void defaultParameters();
0071 
0072   float theMaxDelta;  //maximum (delta parameter)^2/(sigma parameter)^2 per iteration for convergence
0073   int theMaxStep;
0074   float theMaxReducedChiSq;  //max of initial (after 2 iterations) chisq/dof value
0075   float theMinChiSqImprovement;  //minimum required improvement in chisq to avoid fit termination for cases exceeding theMaxReducedChiSq
0076   LinearizationPointFinder *finder;
0077   KinematicConstrainedVertexUpdator *updator;
0078   VertexKinematicConstraint *vCons;
0079   ConstrainedTreeBuilder *tBuilder;
0080   int iterations;
0081   float csum;
0082 };
0083 
0084 #endif