File indexing completed on 2023-03-17 11:17:50
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
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