00001 #ifndef MuonIsolation_NominalEfficiencyThresholds_H 00002 #define MuonIsolation_NominalEfficiencyThresholds_H 00003 00004 #include <map> 00005 #include <string> 00006 #include <utility> 00007 #include <vector> 00008 00009 namespace muonisolation { 00010 class NominalEfficiencyThresholds { 00011 public: 00012 NominalEfficiencyThresholds() { } 00013 NominalEfficiencyThresholds(const std::string & infile); 00014 ~NominalEfficiencyThresholds() { } 00015 00017 struct ThresholdLocation { float eta; int cone; }; 00018 00019 float thresholdValueForEfficiency(ThresholdLocation location, float eff_thr) const; 00020 00021 std::vector<double> bins() const; 00022 void dump(); 00023 00024 private: 00025 00026 00028 struct EfficiencyBin { 00029 float eff; 00030 float eff_previous; 00031 bool operator() (const EfficiencyBin & e1, 00032 const EfficiencyBin & e2) const; 00033 }; 00034 00035 00036 class EtaBounds { 00037 public: 00038 enum { NumberOfTowers = 32 }; 00039 EtaBounds(); 00040 int towerFromEta(double eta) const; 00041 float operator()(unsigned int i) const { return theBounds[i]; } 00042 private: 00043 float theBounds[NumberOfTowers+1]; //max eta of towers 1-32 (indx 1-32) and 0. for indx 0 00044 }; 00045 00046 00048 struct locless { 00049 bool operator()(const ThresholdLocation & l1, 00050 const ThresholdLocation & l2) const; 00051 EtaBounds etabounds; 00052 }; 00053 00054 00055 00056 typedef std::pair<EfficiencyBin,float> ThresholdConstituent; 00057 typedef std::map<EfficiencyBin,float,EfficiencyBin> ThresholdConstituents; 00058 typedef std::map<ThresholdLocation,ThresholdConstituents,locless> MapType; 00059 00060 void add(ThresholdLocation location, ThresholdConstituent threshold); 00061 MapType thresholds; 00062 00063 EtaBounds etabounds; 00064 }; 00065 } 00066 #endif 00067