Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:22

0001 #ifndef TopQuarkAnalysis_TopKinFitter_TopKinFitter_h
0002 #define TopQuarkAnalysis_TopKinFitter_TopKinFitter_h
0003 
0004 #include <memory>
0005 
0006 #include "TMath.h"
0007 
0008 #include "PhysicsTools/KinFitter/interface/TKinFitter.h"
0009 
0010 /*
0011   \class   TopKinFitter TopKinFitter.h "TopQuarkAnalysis/TopKinFitter/interface/TopKinFitter.h"
0012   
0013   \brief   one line description to be added here...
0014 
0015   text to be added here...
0016   
0017 **/
0018 
0019 class TopKinFitter {
0020 public:
0021   /// supported parameterizations
0022   enum Param { kEMom, kEtEtaPhi, kEtThetaPhi };
0023 
0024 public:
0025   /// default constructor
0026   explicit TopKinFitter(const int maxNrIter = 200,
0027                         const double maxDeltaS = 5e-5,
0028                         const double maxF = 1e-4,
0029                         const double mW = 80.4,
0030                         const double mTop = 173.);
0031   /// default destructor
0032   ~TopKinFitter();
0033 
0034   /// return chi2 of fit (not normalized to degrees of freedom)
0035   double fitS() const { return fitter_->getS(); };
0036   /// return number of used iterations
0037   int fitNrIter() const { return fitter_->getNbIter(); };
0038   /// return fit probability
0039   double fitProb() const { return TMath::Prob(fitter_->getS(), fitter_->getNDF()); };
0040   /// allows to change the verbosity of the TKinFitter
0041   void setVerbosity(const int verbosityLevel) { fitter_->setVerbosity(verbosityLevel); };
0042 
0043 protected:
0044   /// convert Param to human readable form
0045   std::string param(const Param& param) const;
0046 
0047 protected:
0048   /// kinematic fitter
0049   std::unique_ptr<TKinFitter> fitter_;
0050   /// maximal allowed number of iterations to be used for the fit
0051   int maxNrIter_;
0052   /// maximal allowed chi2 (not normalized to degrees of freedom)
0053   double maxDeltaS_;
0054   /// maximal allowed distance from constraints
0055   double maxF_;
0056   /// W mass value used for constraints
0057   double mW_;
0058   /// top mass value used for constraints
0059   double mTop_;
0060 };
0061 
0062 #endif