42 #include "StFgtPedReader.h"
43 #include "StRoot/StFgtUtil/StFgtConsts.h"
46 inline StFgtPedReader::StFgtPedReader(
const Char_t* filename ) :
47 mTimeBinMask( 0x10 ), mFilename( filename ) {
50 mPedVec.resize( kFgtNumTimeBins * kFgtNumElecIds );
54 Int_t StFgtPedReader::Init(){
57 std::ifstream fin( mFilename.data() );
60 std::cerr <<
"Error opening file '" << mFilename <<
"'" << std::endl;
68 while( !fin.eof() && !ierr ){
69 fin >> geoId >> timebin >> ped >> stdev;
71 if( 1<<timebin & mTimeBinMask )
72 mPedVec[ key_t( geoId, timebin ) ] = ped_t( ped, stdev );
81 void StFgtPedReader::getPed( Int_t geoId, Int_t timebin, Float_t& ped, Float_t& err )
const {
82 const ped_t& pedpair = mPedVec[ key_t( geoId, timebin ) ];