Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:26:07

0001 //
0002 //
0003 // File: hitfit/Lepjets_Event_Lep.h
0004 // Purpose: Represent a `lepton' in a Lepjets_Event class.
0005 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
0006 //
0007 // For each lepton, we store:
0008 //
0009 //   - 4-momentum
0010 //   - type code
0011 //   - Vector_Resolution
0012 //
0013 // CMSSW File      : interface/Lepjets_Event_Lep.h
0014 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
0015 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
0016 //
0017 
0018 /**
0019     @file Lepjets_Event_Lep.h
0020 
0021     @brief Represent a lepton in an instance of Lepjets_Event class.
0022 
0023     @author Scott Stuart Snyder <snyder@bnl.gov>
0024 
0025     @par Creation date:
0026     July 2000.
0027 
0028     @par Modification History:
0029     Apr 2009: Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>:
0030     Imported to CMSSW.<br>
0031     Nov 2009: Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>:
0032     Added doxygen tags for automatic generation of documentation.
0033 
0034     @par Terms of Usage:
0035     With consent for the original author (Scott Snyder).
0036 
0037  */
0038 
0039 #ifndef HITFIT_LEPJETS_EVENT_LEP_H
0040 #define HITFIT_LEPJETS_EVENT_LEP_H
0041 
0042 #include "TopQuarkAnalysis/TopHitFit/interface/fourvec.h"
0043 #include "TopQuarkAnalysis/TopHitFit/interface/Vector_Resolution.h"
0044 #include <iosfwd>
0045 
0046 namespace hitfit {
0047 
0048   /**
0049     Possible types of lepton in an instance of Lepjets_Event class.
0050  */
0051   enum Lepton_Labels {
0052     lepton_label = 1,  // generic lepton
0053     electron_label = 2,
0054     muon_label = 3
0055   };
0056 
0057   /**
0058     @brief Represent a lepton in an instance of Lepjets_Event class. This class
0059     hold the following information:
0060     - Four-momentum.
0061     - The type code (electron, muon, or generic lepton).
0062     - The resolution in Vector_Resolution type.
0063  */
0064   class Lepjets_Event_Lep
0065   //
0066   // Purpose: Represent a `lepton' in a Lepjets_Event class.
0067   //
0068   {
0069   public:
0070     // Constructor.
0071     /**
0072      @brief Constructor, create a new instance of Lepjets_Event_Lep.
0073 
0074      @param p The four-momentum.
0075 
0076      @param type The type code.
0077 
0078      @param res The resolution.
0079    */
0080     Lepjets_Event_Lep(const Fourvec& p, int type, const Vector_Resolution& res);
0081 
0082     // Access the 4-momentum.
0083     /**
0084      @brief Return a reference to the four-momentum.
0085    */
0086     Fourvec& p();
0087 
0088     /**
0089      @brief Return a constant reference to the four-momentum.
0090    */
0091     const Fourvec& p() const;
0092 
0093     // Access the type code.
0094     /**
0095      @brief Return a reference to the type code.
0096    */
0097     int& type();
0098 
0099     /**
0100      @brief Return the type code.
0101    */
0102     int type() const;
0103 
0104     // Access the resolution.
0105     /**
0106      @brief Return a constant reference to the resolution.
0107    */
0108     const Vector_Resolution& res() const;
0109 
0110     /**
0111      @brief Return a reference to the resolution.
0112    */
0113     Vector_Resolution& res();
0114 
0115     // Return resolutions for this object.
0116     /**
0117      @brief Return the uncertainty in momentum \f$p\f$ or \f$p_{T}\f$
0118      (\f$1/p\f$ or \f$1/p_{T}\f$ if the lepton is a tracking object).
0119    */
0120     double p_sigma() const;
0121 
0122     /**
0123      @brief Return the uncertainty in pseudorapidity \f$\eta\f$.
0124    */
0125     double eta_sigma() const;
0126 
0127     /**
0128      @brief Return the uncertainty in azimuthal angle \f$\phi\f$.
0129    */
0130     double phi_sigma() const;
0131 
0132     // Smear this object.
0133     // If SMEAR_DIR is false, smear the momentum only.
0134     /**
0135      @brief Smear this object.
0136 
0137      @param engine The underlying random number generator.
0138 
0139      @param smear_dir If <b>TRUE</b>, also smear the object's direction.<br>
0140      If <b>FALSE</b>, then only smear the magnitude of three-momentum.
0141    */
0142     void smear(CLHEP::HepRandomEngine& engine, bool smear_dir = false);
0143 
0144     // Dump out this object.
0145     /**
0146      @brief Print the content of this object.
0147 
0148      @param s The output stream to which to write.
0149 
0150      @param full If <b>TRUE</b>, print all information about this instance
0151      of Lepjets_Event_Lep.<br>
0152      If <b>FALSE</b>, print partial information about this instance
0153      of Lepjets_Event_Lep.
0154    */
0155     std::ostream& dump(std::ostream& s, bool full = false) const;
0156 
0157     // Sort on pt.
0158     /**
0159      @brief Comparison operator for sorting purpose, based on
0160      \$p_{T}\$.
0161 
0162      @param x The other instance of Lepjets_Event to be compared.
0163    */
0164     bool operator<(const Lepjets_Event_Lep& x) const;
0165 
0166   private:
0167     // The object state.
0168 
0169     /**
0170      The four-momentum.
0171    */
0172     Fourvec _p;
0173 
0174     /**
0175      The type code.
0176    */
0177     int _type;
0178 
0179     /**
0180      The resolution.
0181    */
0182     Vector_Resolution _res;
0183   };
0184 
0185   // Print the object.
0186   std::ostream& operator<<(std::ostream& s, const Lepjets_Event_Lep& ev);
0187 
0188 }  // namespace hitfit
0189 
0190 #endif  // not HITFIT_LEPJETS_EVENT_LEP_H