using namespace std;
#include "htofgeantreader.h"
#include "hgeanttof.h"
#include "hgeantmaxtrk.h"
#include "tofdef.h"
#include "hdebug.h"
#include "hades.h"
#include "hevent.h"
#include "hcategory.h"
#include "hdatasource.h"
#include "TDirectory.h"
#include <iostream>
#include <iomanip>
ClassImp(HTofGeantReader)
HTofGeantReader::HTofGeantReader(void) {
fEventId = 0;
}
HTofGeantReader::~HTofGeantReader(void) {
}
Bool_t HTofGeantReader::init(void) {
fGeantTofCat = (HMatrixCategory*)(gHades->getCurrentEvent()
->getCategory(catTofGeantRaw));
if (!fGeantTofCat) {
if (!fInputFile) {
t = NULL;
return kFALSE;
}
if (fInputFile->cd("dirSimul")) {
fGeantTofCat = (HMatrixCategory*)(gDirectory->Get("HGeantTof"));
fInputFile->cd("..");
} else {
Int_t ini[2] = {6,MAXTRKTOF};
fGeantTofCat = new HMatrixCategory("HGeantTof",2,ini,1.0);
}
gHades->getCurrentEvent()->
addCategory(catTofGeantRaw,fGeantTofCat,"Simul");
printf("\n%s(%d,%d) matrix category created for HGeant input\n",
fGeantTofCat->getClassName(),
fGeantTofCat->getSize(0), fGeantTofCat->getSize(1));
}
if (!fInputFile) {
t = NULL;
return kTRUE;
}
if ((t=(TTree*)fInputFile->Get("T")) == NULL) return kFALSE;
t->SetBranchAddress("HGeantTof",&fGeantTofCat);
t->SetBranchStatus("HGeantTof",kTRUE);
fGeantTofCat->activateBranch(t,2);
if (gHades->getOutputFile() != NULL) gHades->getOutputFile()->cd();
return kTRUE;
}
Bool_t HTofGeantReader::execute(void) {
if(t) {
if(t->GetEntry(fEventId)==0) return kFALSE;
}
fEventId++;
return kTRUE;
}
Last change: Sat May 22 13:16:08 2010
Last generated: 2010-05-22 13:16
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.