17 ieta_shift_(ieta_shift), drdA_(drdA), drdB_(drdB), dosemaps_(dosemaps), years_(years)
24 sumlumi +=
year.intlumi_;
25 year.sumlumi_ = sumlumi;
30 std::ifstream infile(fullpath.c_str());
31 if(!infile.is_open()){
32 throw cms::Exception(
"FileNotFound") <<
"Unable to open '" << fullpath <<
"'" << std::endl;
35 std::vector<std::vector<float>>
result;
36 while(getline(infile,line)){
38 std::stringstream linestream(line);
39 std::vector<float> lineresult;
41 while(linestream >> doseval) lineresult.push_back(doseval);
42 result.push_back(lineresult);
49 const auto dosemapIt =
dosemaps_.find(energy);
50 if(dosemapIt ==
dosemaps_.end())
return 0.0;
53 const auto& dosemap = dosemapIt->second;
54 if(ieta<0 or ieta>=
int(dosemap.size()))
return 0.0;
57 const auto& doserow = dosemap[ieta];
58 if(lay<0 or lay>=
int(doserow.size()))
return 0.0;
66 if(lb ==
years_.end()
or lb->sumlumi_ < intlumi) {
67 throw cms::Exception(
"ValueError") <<
"HBHEDarkening: insufficient LHC run information provided to simulate " << intlumi <<
"/fb - check the python config" << std::endl;
74 if(doseToUse==0.0)
return 1.0;
85 return std::exp(-(intlumiToUse*doseToUse)/decayConst);
98 assert(yearForLumi.size());
102 if(
year.year_==yearForLumi)
break;
HBHEDarkening(int ieta_shift, float drdA, float drdB, const std::map< int, std::vector< std::vector< float >>> &dosemaps, const std::vector< LumiYear > &years)
std::string getYearForLumi(float intlumi) const
std::map< int, std::vector< std::vector< float > > > dosemaps_
static std::vector< std::vector< float > > readDoseMap(const std::string &fullpath)
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Abs< T >::type abs(const T &t)
float degradationYear(const LumiYear &year, float intlumi, int ieta, int lay) const
std::vector< LumiYear > years_
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