File indexing completed on 2024-04-06 12:02:12
0001 #ifndef CondFormats_HcalObjects_HBHEDarkening_h
0002 #define CondFormats_HcalObjects_HBHEDarkening_h
0003
0004 #include <vector>
0005 #include <string>
0006 #include <map>
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 class HBHEDarkening {
0018 public:
0019
0020 struct LumiYear {
0021
0022 LumiYear() : year_(""), intlumi_(0.), lumirate_(0.), energy_(0), sumlumi_(0.) {}
0023 LumiYear(std::string year, float intlumi, float lumirate, int energy)
0024 : year_(year), intlumi_(intlumi), lumirate_(lumirate), energy_(energy), sumlumi_(0.) {}
0025
0026
0027 bool operator<(const LumiYear& yr) const { return year_ < yr.year_; }
0028
0029
0030 std::string year_;
0031 float intlumi_;
0032 float lumirate_;
0033 int energy_;
0034 float sumlumi_;
0035 };
0036 struct LumiYearComp {
0037 bool operator()(const LumiYear& yr, const float& lum) const { return yr.sumlumi_ < lum; }
0038 };
0039
0040 HBHEDarkening(int ieta_shift,
0041 float drdA,
0042 float drdB,
0043 std::map<int, std::vector<std::vector<float>>> dosemaps,
0044 std::vector<LumiYear> years);
0045 ~HBHEDarkening() {}
0046
0047
0048 float degradation(float intlumi, int ieta, int lay) const;
0049 int get_ieta_shift() const { return ieta_shift_; }
0050
0051
0052 static std::vector<std::vector<float>> readDoseMap(const std::string& fullpath);
0053
0054 private:
0055
0056 float dose(int ieta, int lay, int energy) const;
0057 std::string getYearForLumi(float intlumi) const;
0058 float degradationYear(const LumiYear& year, float intlumi, int ieta, int lay) const;
0059
0060
0061 int ieta_shift_;
0062 float drdA_, drdB_;
0063 std::map<int, std::vector<std::vector<float>>> dosemaps_;
0064 std::vector<LumiYear> years_;
0065 };
0066
0067 #endif