Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 //
0002 //
0003 // File: hitfit/Constrained_Top.h
0004 // Purpose: Do kinematic fitting for a ttbar -> ljets event.
0005 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
0006 //
0007 // CMSSW File      : interface/Constrained_Top.h
0008 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
0009 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
0010 
0011 /**
0012     @file Constrained_Top.h
0013 
0014     @brief Do a constrained kinematic fit of a \f$t\bar{t}\to\ell +
0015     \rm{jets}\f$ event.
0016 
0017     @par Creation date:
0018     July 2000.
0019 
0020     @author
0021     Scott Stuart Snyder <snyder@bnl.gov>.
0022 
0023     @par Modification History:
0024     Apr 2009: Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>:
0025     Imported to CMSSW.<br>
0026     Oct 2009: Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>:
0027     Added Doxygen tags for automatic generation of documentation.
0028 
0029     @par Terms of Usage:
0030     With consent from the original author (Scott Snyder).
0031  */
0032 
0033 #ifndef HITFIT_CONSTRAINED_TOP_H
0034 #define HITFIT_CONSTRAINED_TOP_H
0035 
0036 #include "TopQuarkAnalysis/TopHitFit/interface/Fourvec_Constrainer.h"
0037 #include "TopQuarkAnalysis/TopHitFit/interface/matutil.h"
0038 #include <iosfwd>
0039 
0040 namespace hitfit {
0041 
0042   class Defaults;
0043   class Lepjets_Event;
0044 
0045   /**
0046 
0047     @class Constrained_Top_Args
0048 
0049     @brief Hold on to parameters for the Constrained_Top class.
0050 
0051  */
0052   class Constrained_Top_Args
0053   //
0054   // Purpose: Hold on to parameters for the Constrained_Top class.
0055   //
0056   // Parameters controlling the operation of the fitter:
0057   //   float bmass        - The mass to which b jets should be fixed.
0058   //
0059   {
0060   public:
0061     // Constructor.  Initialize from a Defaults object.
0062     /**
0063      Constructor.
0064 
0065      @param defs An instance of defaults objects.  The instance must contain
0066      the variables necessary to set up a fourvec_constrainer_args, and the
0067      following variables with types and names.
0068      - double <i>bmass</i>.
0069      - bool <i>equal_side</i>.
0070 
0071    */
0072     Constrained_Top_Args(const Defaults& defs);
0073 
0074     // Retrieve parameter values.
0075     /**
0076      Return the <i>_bmass</i> parameter.
0077    */
0078     double bmass() const;
0079 
0080     // Arguments for subobjects.
0081     /**
0082      Return the <i>_fourvec_constrainer_args</i> parameter.
0083    */
0084     const Fourvec_Constrainer_Args& fourvec_constrainer_args() const;
0085 
0086     // Retrieve requirement for equal mass on both sides
0087     /**
0088      Return the <i>_equal_side</i> parameter.
0089    */
0090     bool equal_side() const;
0091 
0092   private:
0093     // Hold on to parameter values.
0094 
0095     /**
0096      The mass to which \f$b\f$-quark jets should be fixed.
0097    */
0098     double _bmass;
0099 
0100     /**
0101      Arguments for the subobjects, constraints among the four vectors
0102      in the event.
0103    */
0104     Fourvec_Constrainer_Args _fourvec_constrainer_args;
0105 
0106     /**
0107      If true, requires that the leptonic side and hadronic side of
0108      \f$t\bar{t}\to\ell + \rm{jets}\f$ event to have equal mass.
0109    */
0110     bool _equal_side;
0111   };
0112 
0113   //*************************************************************************
0114 
0115   /**
0116     @class Constrained_Top
0117     @brief Do a constrained kinematic fitting for a
0118     \f$t\bar{t}\to\ell + \rm{jets}\f$ event.
0119  */
0120   class Constrained_Top
0121   //
0122   // Purpose: Do kinematic fitting for a ttbar -> ljets event.
0123   //
0124   {
0125   public:
0126     // Constructor.
0127     // LEPW_MASS, HADW_MASS, and TOP_MASS are the masses to which
0128     // those objects should be constrained.  To remove a constraint,
0129     // set the mass to 0.
0130     /**
0131      @brief Constructor, create an instance of the Constrained_Top object
0132      from the arguments object and the mass constraints.
0133 
0134      @param args Argument for this instance of Constrained_Top object.
0135 
0136      @param lepw_mass The mass to which the leptonic W should be constrained.
0137      If this parameter is set to 0, the constraint is skied.
0138 
0139      @param hadw_mass The mass to which the hadronic W should be constrained.
0140      If this parameter is set to 0, the constraint is skied.
0141 
0142      @param top_mass The mass to which the top quarks should be constrained.
0143      If this parameter is set to 0, the constraints is skied.
0144 
0145    */
0146     Constrained_Top(const Constrained_Top_Args& args, double lepw_mass, double hadw_mass, double top_mass);
0147 
0148     // Do a constrained fit.
0149     /**
0150      @brief Do a constrained fit of \f$t\bar{t}\to\ell + \rm{jets}\f$ events.
0151      Returns the
0152      top mass and its error in <i>mt</i> and <i>sigmt</i>, and the pull
0153      quantities in <i>pullx</i> and <i>pully</i>. Returns the \f$\chi^{2}\f$,
0154      this will be negative if the fit failed to converge.
0155 
0156      @param ev The event to be fitted (input), and the event after fitting
0157      (output).
0158 
0159      @param mt The fitted top mass.
0160 
0161      @param sigmt The uncertainty on the fitted top mass.
0162 
0163      @param pullx Pull quantities for the well-measured variables.
0164 
0165      @param pully Pull quantities for the poorly-measured variables.
0166 
0167      @par Input:
0168      - Lepjets_Event <i>ev</i>.
0169 
0170      @par Output:
0171      - Lepjets_Event <i>ev</i>.
0172      - double <i>mt</i>.
0173      - double <i>sigmt</i>.
0174      - Column_Vector <i>pullx</i>.
0175      - Column_Vector <i>pully</i>.
0176 
0177      @par Return:
0178      The \f$\chi^{2}\f$ of the fit.  Return a negative value if the fit
0179      didn't converge.
0180 
0181    */
0182     double constrain(Lepjets_Event& ev, double& mt, double& sigmt, Column_Vector& pullx, Column_Vector& pully);
0183 
0184     // Dump out our state.
0185     friend std::ostream& operator<<(std::ostream& s, const Constrained_Top& ct);
0186 
0187   private:
0188     // Parameter settings.
0189     /**
0190      Parameter settings for the \f$\chi^{2}\f$ constrainer.
0191    */
0192     const Constrained_Top_Args _args;
0193 
0194     // The guy that actually does the work.
0195     /**
0196      The guy that actually does the work.
0197    */
0198     Fourvec_Constrainer _constrainer;
0199   };
0200 
0201 }  // namespace hitfit
0202 
0203 #endif  // not HITFIT_CONSTRAINED_TOP_H