CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/TopQuarkAnalysis/TopHitFit/interface/Top_Fit.h

Go to the documentation of this file.
00001 //
00002 // $Id: Top_Fit.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
00003 //
00004 // File: hitfit/Top_Fit.h
00005 // Purpose: Handle jet permutations.
00006 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
00007 //
00008 // CMSSW File      : interface/Top_Fit.h
00009 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
00010 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
00011 //
00012 
00013 
00037 #ifndef HITFIT_TOP_FIT_H
00038 #define HITFIT_TOP_FIT_H
00039 
00040 
00041 #include "TopQuarkAnalysis/TopHitFit/interface/Constrained_Top.h"
00042 #include "TopQuarkAnalysis/TopHitFit/interface/matutil.h"
00043 #include <iosfwd>
00044 
00045 
00046 namespace hitfit {
00047 
00048 
00049 class Lepjets_Event;
00050 class Fit_Results;
00051 
00052 
00053 //
00054 // Indices for the various results lists we make in Fit_Results.
00055 //
00059 enum Lists
00060 {
00061   all_list = 0,         // All events.
00062   noperm_list = 1,      // All jet assignments are correct.
00063   semicorrect_list = 2, // Jets assigned to the correct top.
00064   limited_isr_list = 3, // Top three jets are not ISR.
00065   topfour_list = 4,     // Top four jets are not ISR, any other jets are ISR.
00066   btag_list = 5,        // All tagged jets were assigned as b-jets.
00067   htag_list = 6,        // All tagged jets were assigned as b-jets or higgs.
00068   n_lists = 7
00069 };
00070 
00071 
00072 //*************************************************************************
00073 
00074 
00078 class Top_Fit_Args
00079 //
00080 // Purpose: Hold on to parameters for the Top_Fit class.
00081 //
00082 //   bool print_event_flag - If true, print the event after the fit.
00083 //   bool do_higgs_flag    - If true, fit ttH events.
00084 //   double jet_mass_cut   - Reject events with jet masses larger than this.
00085 //   double mwhad_min_cut  - Reject events with hadronic W mass before
00086 //                           fitting smaller than this.
00087 //   double mwhad_max_cut  - Reject events with hadronic W mass before
00088 //                           fitting larger than this.
00089 //   double mtdiff_max_cut - Reject events where the difference between
00090 //                           leptonic and hadronic top masses before fitting
00091 //                           is larger than this.
00092 //   int nkeep             - Number of results to keep in each list.
00093 //   bool solve_nu_tmass   - If true, use hadronic top mass to constrain
00094 //                           the neutrino pz.  Otherwise constrain the
00095 //                           neutrino + lepton mass to W mass.
00096 //
00097 {
00098 public:
00099   // Constructor.  Initialize from a Defaults object.
00116   Top_Fit_Args (const Defaults& defs);
00117 
00118   // Retrieve parameter values.
00122   bool print_event_flag () const;
00123 
00127   bool do_higgs_flag () const;
00128 
00132   double jet_mass_cut () const;
00133 
00137   double mwhad_min_cut () const;
00138 
00142   double mwhad_max_cut () const;
00143 
00147   double mtdiff_max_cut () const;
00148 
00152   int nkeep () const;
00153 
00157   bool solve_nu_tmass() const;
00158 
00159   // Arguments for subobjects.
00160   const Constrained_Top_Args& constrainer_args () const;
00161 
00162 
00163 private:
00164   // Hold on to parameter values.
00169   bool _print_event_flag;
00170 
00175   bool _do_higgs_flag;
00176 
00181   double _jet_mass_cut;
00182 
00187   double _mwhad_min_cut;
00188 
00193   double _mwhad_max_cut;
00194 
00199   double _mtdiff_max_cut;
00200 
00217   int _nkeep;
00218 
00226   bool _solve_nu_tmass;
00227 
00232   Constrained_Top_Args _args;
00233 
00234 };
00235 
00236 
00237 //*************************************************************************
00238 
00244 class Top_Fit
00245 //
00246 // Purpose: Handle jet permutations.
00247 //
00248 {
00249 public:
00250   // Constructor.
00251   // LEPW_MASS, HADW_MASS, and TOP_MASS are the masses to which
00252   // those objects should be constrained.  To remove a constraint,
00253   // set the mass to 0.
00268   Top_Fit (const Top_Fit_Args& args,
00269            double lepw_mass,
00270            double hadw_mass,
00271            double top_mass);
00272 
00273   // Fit a single jet permutation.  Return the results for that fit.
00297   double fit_one_perm (Lepjets_Event& ev,
00298                        bool& nuz,
00299                        double& umwhad,
00300                        double& utmass,
00301                        double& mt,
00302                        double& sigmt,
00303                        Column_Vector& pullx,
00304                        Column_Vector& pully);
00305 
00306   // Fit all jet permutations in EV.
00315   Fit_Results fit (const Lepjets_Event& ev);
00316 
00317   // Print.
00318   friend std::ostream& operator<< (std::ostream& s, const Top_Fit& fitter);
00319 
00323   const Top_Fit_Args& args() const;
00324 
00325 private:
00326   // The object state.
00327   const Top_Fit_Args _args;
00328   Constrained_Top _constrainer;
00329   double _lepw_mass;
00330   double _hadw_mass;
00331 };
00332 
00333 
00334 } // namespace hitfit
00335 
00336 
00337 #endif // not HITFIT_TOP_FIT_H