Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:19

0001 #ifndef EgammaAnalysis_ElectronTools_EBEECutValues_h
0002 #define EgammaAnalysis_ElectronTools_EBEECutValues_h
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0005 #include "DataFormats/Common/interface/Ptr.h"
0006 
0007 template <typename T>
0008 class EBEECutValuesT {
0009 private:
0010   T barrel_;
0011   T endcap_;
0012   //this is currrently used to identify if object is barrel or endcap but may change
0013   const double barrelCutOff_ = 1.479;
0014 
0015 public:
0016   EBEECutValuesT(const edm::ParameterSet& params, const std::string& name)
0017       : barrel_(params.getParameter<T>(name + "EB")), endcap_(params.getParameter<T>(name + "EE")) {}
0018   template <typename CandType>
0019   T operator()(const edm::Ptr<CandType>& cand) const {
0020     return isBarrel(cand) ? barrel_ : endcap_;
0021   }
0022 
0023 private:
0024   template <typename CandType>
0025   const bool isBarrel(const edm::Ptr<CandType>& cand) const {
0026     return std::abs(cand->superCluster()->position().eta()) < barrelCutOff_;
0027   }
0028 };
0029 
0030 typedef EBEECutValuesT<double> EBEECutValues;
0031 typedef EBEECutValuesT<int> EBEECutValuesInt;
0032 
0033 #endif