19 const std::map<
int,
std::vector<std::vector<float>>>& dosemaps,
20 const std::vector<LumiYear>& years)
21 : ieta_shift_(ieta_shift), drdA_(drdA), drdB_(drdB), dosemaps_(dosemaps), years_(years) {
26 for (
auto& year :
years_) {
27 sumlumi += year.intlumi_;
28 year.sumlumi_ = sumlumi;
33 std::ifstream
infile(fullpath.c_str());
35 throw cms::Exception(
"FileNotFound") <<
"Unable to open '" << fullpath <<
"'" << std::endl;
38 std::vector<std::vector<float>>
result;
39 while (getline(
infile, line)) {
41 std::stringstream linestream(line);
42 std::vector<float> lineresult;
44 while (linestream >> doseval)
45 lineresult.push_back(doseval);
46 result.push_back(lineresult);
53 const auto dosemapIt =
dosemaps_.find(energy);
58 const auto& dosemap = dosemapIt->second;
59 if (ieta < 0 or ieta >=
int(dosemap.size()))
63 const auto& doserow = dosemap[ieta];
64 if (lay < 0 or lay >=
int(doserow.size()))
73 if (lb ==
years_.end()
or lb->sumlumi_ < intlumi) {
74 throw cms::Exception(
"ValueError") <<
"HBHEDarkening: insufficient LHC run information provided to simulate "
75 << intlumi <<
"/fb - check the python config" << std::endl;
95 return std::exp(-(intlumiToUse * doseToUse) / decayConst);
108 assert(!yearForLumi.empty());
110 for (
const auto& year :
years_) {
112 if (year.year_ == yearForLumi)
HBHEDarkening(int ieta_shift, float drdA, float drdB, const std::map< int, std::vector< std::vector< float >>> &dosemaps, const std::vector< LumiYear > &years)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::string getYearForLumi(float intlumi) const
Exp< T >::type exp(const T &t)
std::map< int, std::vector< std::vector< float > > > dosemaps_
static std::vector< std::vector< float > > readDoseMap(const std::string &fullpath)
Abs< T >::type abs(const T &t)
float degradationYear(const LumiYear &year, float intlumi, int ieta, int lay) const
std::vector< LumiYear > years_
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
float dose(int ieta, int lay, int energy) const
Power< A, B >::type pow(const A &a, const B &b)
float degradation(float intlumi, int ieta, int lay) const