using namespace std;
#include "TROOT.h"
#include "hparrootfileio.h"
#include "hdetpario.h"
#include "hades.h"
#include "hspectrometer.h"
#include "hrun.h"
#include <stdio.h>
#include <iostream>
#include <iomanip>
ClassImp(HParRootFile)
ClassImp(HParRootFileIo)
HParRootFile::HParRootFile(const Text_t* fname,const Option_t* option,
const Text_t* ftitle, Int_t compress)
: TFile(fname,option,ftitle,compress) {
run=0;
}
HParRootFile::~HParRootFile() {
if (run) delete run;
run=0;
}
void HParRootFile::readVersions(HRun* currentRun) {
if (run) delete run;
run=(HRun*)Get(((Char_t*)currentRun->GetName()));
}
HParRootFileIo::HParRootFileIo() {
file=0;
}
HParRootFileIo::~HParRootFileIo() {
close();
}
Bool_t HParRootFileIo::open(const Text_t* fname,const Option_t* option,
const Text_t* ftitle, Int_t compress) {
close();
file=new HParRootFile(fname,option,ftitle,compress);
if (file && file->IsOpen()) {
gHades->getSetup()->activateParIo(this);
return kTRUE;
}
return kFALSE;
}
void HParRootFileIo::close() {
if (file) {
file->Close();
delete file;
file=0;
}
if (detParIoList) detParIoList->Delete();
}
void HParRootFileIo::print() {
if (file) {
file->ls();
TIter next(detParIoList);
HDetParIo* io;
cout<<"detector I/Os: ";
while ((io=(HDetParIo*)next())) {
cout<<" "<<io->GetName();
}
cout<<'\n';
}
else cout<<"No pointer to ROOT file"<<'\n';
}
HParRootFile* HParRootFileIo::getParRootFile() {
return file;
}
void HParRootFileIo::readVersions(HRun* currentRun) {
if (file) file->readVersions(currentRun);
}
TList* HParRootFileIo::getList() {
if (file) return file->GetListOfKeys();
return 0;
}
Last change: Sat May 22 13:06:28 2010
Last generated: 2010-05-22 13:06
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.