Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:15

0001 //
0002 //
0003 
0004 /**
0005     @file JetTranslatorBase.h
0006 
0007     @brief Template class of function object to translate jet physics
0008     object to HitFit's Lepjets_Event_Jet object.
0009 
0010     @author Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
0011 
0012     @par Creation date:
0013     Nov-2009
0014 
0015     @par Terms of Usage:
0016     With consent from the original author (Haryo Sumowidagdo).
0017  */
0018 
0019 #ifndef HitFit_JetTranslatorBase_h
0020 #define HitFit_JetTranslatorBase_h
0021 
0022 #include "TopQuarkAnalysis/TopHitFit/interface/EtaDepResolution.h"
0023 #include "TopQuarkAnalysis/TopHitFit/interface/Lepjets_Event_Jet.h"
0024 #include "TopQuarkAnalysis/TopHitFit/interface/fourvec.h"
0025 
0026 namespace hitfit {
0027 
0028   /**
0029        @class JetTranslatorBase.
0030 
0031        @brief Template class of function object to translate jet physics
0032        object to HitFit's Lepjets_Event_Jet object.    Users need to write an
0033        implementation of a template specialization of this class for their jet
0034        physics object class.  Then users combine this header file and their
0035        implementation for their analysis code.  With this approach, it is
0036        possible to use HitFit for different jet physics object class in
0037        different experiments.
0038 
0039        @param AJet The typename of the jet physics object class to
0040        be translated into HitFit's Lepjets_Event_Jet.
0041 
0042      */
0043   template <class AJet>
0044   class JetTranslatorBase {
0045   public:
0046     /**
0047            @brief Default constructor.
0048          */
0049     JetTranslatorBase();
0050 
0051     /**
0052            @brief Constructor, instantiate a JetTranslatorBase object
0053            using the names of input files in std::string format.
0054 
0055            @param udscFile The path of the input file containing
0056            resolution for \f$udsc\f$ jets.
0057 
0058            @param bFile The path of the input file containing
0059            resolution for \f$b\f$ jets.
0060 
0061          */
0062     JetTranslatorBase(const std::string& udscFile, const std::string& bFile);
0063 
0064     /**
0065            @brief Constructor, instantiate a JetTranslatorBase object
0066            using the names of input files in std::string format.
0067 
0068            @param udscFile The path of the input file containing
0069            resolution for \f$udsc\f$ jets.
0070 
0071            @param bFile The path of the input file containing
0072            resolution for \f$b\f$ jets.
0073            
0074            @param jetCorrectionLevel The jet correction level.
0075            
0076            @param jes The jet energy scale.
0077            
0078            @param jesB The b-jet energy scale.
0079 
0080          */
0081     JetTranslatorBase(const std::string& udscFile,
0082                       const std::string& bFile,
0083                       const std::string& jetCorrectionLevel,
0084                       double jes,
0085                       double jesB);
0086 
0087     /**
0088            @brief Destructor.
0089          */
0090     ~JetTranslatorBase();
0091 
0092     /**
0093            @brief Convert a jet physics object of type AJet into
0094            HitFit jet physics object of type Lepjets_Event_Jet.
0095            This operator must be able to apply the appropriate jet
0096            energy correction in accord with the type of the jet.
0097 
0098            @param jet The jet physics object to be translated.
0099 
0100            @param type The typecode of the jet to be translated
0101            (leptonic b, hadronic b, or hadronic W).
0102 
0103            @param useObjEmbRes Boolean parameter to indicate if the
0104            user would like to use the resolution embedded in the object,
0105            and not the resolution read when instantiating the class.
0106          */
0107     Lepjets_Event_Jet operator()(const AJet& jet, int type = hitfit::unknown_label, bool useObjEmbRes = false);
0108 
0109     /**
0110            @brief Return the  \f$ \eta- \f$ dependent resolution for \f$udsc\f$
0111            jets.
0112          */
0113     const EtaDepResolution& udscResolution() const;
0114 
0115     /**
0116            @brief Return the  \f$ \eta- \f$ dependent resolution for \f$b\f$
0117            jets.
0118          */
0119     const EtaDepResolution& bResolution() const;
0120 
0121     /**
0122            @brief Check if a jet has  \f$ \eta \f$  value which is within the
0123            valid  \f$ \eta \f$  range of the resolution.
0124 
0125            @param jet The jet whose  \f$ \eta \f$  value is to be checked.
0126          */
0127     bool CheckEta(const AJet& jet) const;
0128 
0129   private:
0130     /**
0131            @brief The  \f$ \eta- \f$ dependent resolution for $udsc$ jets.
0132          */
0133     EtaDepResolution udscResolution_;
0134 
0135     /**
0136            @brief The  \f$ \eta- \f$ dependent resolution for $b$ jets.
0137          */
0138     EtaDepResolution bResolution_;
0139 
0140     /**
0141            @brief The jet correction level.
0142          */
0143     std::string jetCorrectionLevel_;
0144 
0145     /**
0146            @brief The jet energy scale.
0147          */
0148     double jes_;
0149 
0150     /**
0151            @brief The b-jet energy scale.
0152          */
0153     double jesB_;
0154   };
0155 
0156 }  // namespace hitfit
0157 
0158 #endif  // #ifndef HitFit_JetTranslatorBase_h