16 if( !inputFile.is_open() )
18 <<
"failed to open the file " <<
filename_ << std::endl;
22 const float undef = -999;
23 while( getline(inputFile, line) ){
24 if(line[0]==
'#')
continue;
26 std::stringstream ss(line);
27 ss >> etaMin >> etaMax >> effArea;
32 if( etaMin==undef || etaMax==undef || effArea==undef )
34 <<
"wrong file format, file name " <<
filename_ << std::endl;
64 printf(
"EffectiveAreas: source file %s\n",
filename_.c_str());
65 printf(
" eta_min eta_max effective area\n");
68 printf(
" %8.4f %8.4f %8.5f\n",
81 <<
"found no effective area constans in the file " 90 <<
"eta ranges improperly defined (min>max) in the file" 95 if( iEta != nEtaBins-1 )
98 <<
"eta ranges improperly defined (disjointed) in the file " 107 <<
"effective area values are too large or negative in the file"
const float getEffectiveArea(float eta) const
EffectiveAreas(const std::string &filename)
std::vector< float > absEtaMax_
std::vector< float > effectiveAreaValues_
Abs< T >::type abs(const T &t)
std::vector< float > absEtaMin_
void checkConsistency() const
void printEffectiveAreas() const
const std::string filename_