SctDaqRootFileExt.cpp

00001 #include "SctDaqRootFileExt.h"
00002 #include "../SCTTestAPI/Exceptions.h"
00003 #include <sstream>
00004 #include <TH1.h>
00005 #include <TFile.h>
00006 
00007 using namespace std;
00008 using namespace SctTest;
00009 
00010 SctDaqRootFileExt::SctDaqRootFileExt(string fileName) : SctDaqRootFile(fileName) {
00011 }
00012 
00013 auto_ptr<TH1> SctDaqRootFileExt::getSigmaGraph(unsigned int link, unsigned int cycle) {
00014     ostringstream oss;
00015     oss << "h_sigma" << link << ";" << cycle;
00016     auto_ptr<TH1> hist ((TH1*)file.Get(oss.str().c_str()));
00017     if (!hist.get()) throw DataNotValidException("Couldn't get histogram: " + oss.str(), __FILE__, __LINE__);
00018     return hist;
00019 }
00020 
00021 auto_ptr<TH1> SctDaqRootFileExt::getMeanGraph(unsigned int link, unsigned int cycle) {
00022     ostringstream oss;
00023     oss << "h_mean" << link << ";" << cycle;
00024     auto_ptr<TH1> hist ((TH1*)file.Get(oss.str().c_str()));
00025     if (!hist.get()) throw DataNotValidException("Couldn't get histogram: " + oss.str(), __FILE__, __LINE__);
00026     return hist;
00027 }
00028 
00029 auto_ptr<TH1> SctDaqRootFileExt::getChiSqGraph(unsigned int link, unsigned int cycle) {
00030     ostringstream oss;
00031     oss << "h_chisq" << link << ";" << cycle;
00032     auto_ptr<TH1> hist ((TH1*)file.Get(oss.str().c_str()));
00033     if (!hist.get()) throw DataNotValidException("Couldn't get histogram: " + oss.str(), __FILE__, __LINE__);
00034     return hist;
00035 }

Generated on Mon Feb 6 14:01:29 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6