#include "TObject.h"
#include "hades.h"
#include "hreconstructor.h"
#include "TClass.h"
ClassImp(HReconstructor)
HReconstructor::HReconstructor(void) :
HTask("Reconstructor","Generic reconstructor") {
fActive=kTRUE;
fHistograms=NULL;
fIsTimed=kFALSE;
}
HReconstructor::HReconstructor(const Text_t *name,const Text_t *title) : HTask(name,title){
fActive=kTRUE;
fHistograms=NULL;
fIsTimed=kFALSE;
}
HReconstructor::~HReconstructor(void) {
}
HTask *HReconstructor::next(Int_t &errCode) {
if(fIsTimed) fTimer.Start(kFALSE);
Int_t e=(fActive) ? execute() : 0;
if(fIsTimed) fTimer.Stop();
if (e<0) {
errCode=e;
return NULL;
}
errCode=0;
return (HTask *)fOutputs[e];
}
HTask *HReconstructor::getTask(const Char_t *name) {
if (strcmp(GetName(),name)==0) return this;
else return NULL;
}
Bool_t HReconstructor::connectTask(HTask *task,Int_t n) {
if (!fOutputs[n])
fOutputs.AddAt(task,n);
else {
printf("Overwritten fOutputs!\n");
return kFALSE;
}
return kTRUE;
}
void HReconstructor::getConnections(void){
Int_t entries = fOutputs.GetEntries();
printf(".................................................\n");
printf("Tasks connected to %s:\n\n",this->GetName());
if( entries == 0 ) {
printf(" None!\n");
printf(".................................................\n");
} else {
for(Int_t i=0; i<=fOutputs.GetLast();i++){
if (fOutputs[i]) printf(" %s is connected via 'return %3i' \n",
fOutputs[i]->GetName(), i);
}
}
}
Bool_t HReconstructor::IsFolder(void) const {
return kTRUE;
}
void HReconstructor::Browse(TBrowser *b) {
if (fHistograms) b->Add(fHistograms,"Control histograms");
}
void HReconstructor::resetTimer(void) {
if(fIsTimed) fTimer.Reset();
}
void HReconstructor::printTimer(void) {
if(!fActive) {
printf("%15s: not active\n",this->GetName());
return;
}
if(fIsTimed) {
Float_t realTime = fTimer.RealTime();
Float_t cpuTime = fTimer.CpuTime();
printf("%15s: Real time: %10.2f sec CPU time: %10.2f sec\n",
this->GetName(),realTime,cpuTime);
}
else printf("%15s: not timed\n",this->GetName());
}
Last change: Sat May 22 13:08:03 2010
Last generated: 2010-05-22 13:08
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.