#include #include using namespace RAT; #include using namespace std; void PMTVariation::BeginOfRun() { fPMTVariation = DB::Get()->GetLink( "PMT_VARIATION" )->GetDArray( "variation" ); } double PMTVariation::GetVariation( const int lcn ) const { try{ return fPMTVariation.at(lcn); } catch(const std::out_of_range&){ std::ostringstream ss; ss << "PMTVariation::GetVariation requested response for PMT #" << lcn << " but only have variations for " << fPMTVariation.size() << " lcns"; throw std::out_of_range(ss.str()); } }