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;
54 for(uint iEta = 0; iEta<
nEtaBins; iEta++){
67 printf(
"EffectiveAreas: source file %s\n",
filename_.c_str());
68 printf(
" eta_min eta_max effective area\n");
70 for(uint iEta = 0; iEta<
nEtaBins; iEta++){
71 printf(
" %8.4f %8.4f %8.5f\n",
84 <<
"found no effective area constans in the file " 88 for(uint iEta = 0; iEta<
nEtaBins; iEta++){
93 <<
"eta ranges improperly defined (min>max) in the file" 98 if( iEta != nEtaBins-1 )
101 <<
"eta ranges improperly defined (disjointed) in the file " 110 <<
"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_