Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-11 04:32:50

0001 #ifndef EtaPtBin_H
0002 #define EtaPtBin_H
0003 
0004 #include <string>
0005 
0006 #include "DataFormats/JetReco/interface/Jet.h"
0007 // #include "RecoBTag/MCTools/interface/JetFlavour.h"
0008 
0009 /** \class EtaPtBin
0010  *
0011  *  Decide if jet/parton lie within desired abs(pseudo-rapidity)/pt range.
0012  *
0013  */
0014 
0015 class EtaPtBin {
0016 public:
0017   EtaPtBin(const bool& etaActive_,
0018            const double& etaMin_,
0019            const double& etaMax_,
0020            const bool& ptActive_,
0021            const double& ptMin_,
0022            const double& ptMax_);
0023 
0024   ~EtaPtBin() {}
0025 
0026   /// String describes rapidity/pt range.
0027   std::string getDescriptionString() const { return descriptionString; }
0028 
0029   /// method to build the string from other quantities
0030   /// (static for easy external use)
0031   static std::string buildDescriptionString(const bool& etaActive_,
0032                                             const double& etaMin_,
0033                                             const double& etaMax_,
0034                                             const bool& ptActive_,
0035                                             const double& ptMin_,
0036                                             const double& ptMax_);  // pt
0037 
0038   /// Get rapidity/pt ranges and check whether rapidity/pt cuts are active.
0039   bool getEtaActive() const { return etaActive; }
0040   double getEtaMin() const { return etaMin; }
0041   double getEtaMax() const { return etaMax; }
0042 
0043   bool getPtActive() const { return ptActive; }
0044   double getPtMin() const { return ptMin; }
0045   double getPtMax() const { return ptMax; }
0046 
0047   /// Check if jet/parton are within rapidity/pt cuts.
0048   bool inBin(const double& eta, const double& pt) const;
0049   bool inBin(const reco::Jet& jet, const double jec) const;
0050   //   bool inBin(const BTagMCTools::JetFlavour & jetFlavour) const;
0051 
0052 private:
0053   // definition of the bin
0054 
0055   bool etaActive;  // should cuts be applied?
0056   double etaMin;
0057   double etaMax;
0058 
0059   bool ptActive;  // should cuts be applied?
0060   double ptMin;
0061   double ptMax;
0062 
0063   // description string as built from bin definition
0064   std::string descriptionString;
0065 };
0066 
0067 #endif