using namespace std;
#include "hhodogo4mon.h"
#include "hhodohistfiller.h"
#include "hhodohistbooker.h"
#include "hododef.h"
#include "hcategory.h"
#include "hhodoraw.h"
#include "hdebug.h"
#include "hades.h"
#include "hiterator.h"
#include "hruntimedb.h"
#include "hspectrometer.h"
#include "hdetector.h"
#include "hevent.h"
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include "TIterator.h"
ClassImp(HHodoGo4Mon)
HHodoHistBooker* HHodoGo4Mon::hodoHistbooker=0;
HHodoGo4Mon::HHodoGo4Mon(void) {
initVariables();
}
HHodoGo4Mon::HHodoGo4Mon(const Text_t* name,const Text_t* title)
: HReconstructor(name,title) {
initVariables();
}
HHodoGo4Mon::~HHodoGo4Mon(void) {
if (iterraw) delete iterraw;
iterraw=0;
}
void HHodoGo4Mon::initVariables()
{
rawCat =0;
iterraw=0;
}
void HHodoGo4Mon::printStatus(){
cout << "************* HHodoGo4Mon **************" << endl;
cout << "******************************************" << endl;
}
void HHodoGo4Mon::setParContainers() {
hodoHistbooker = HHodoHistBooker::getExObject();
if(!hodoHistbooker)
{
Error("HHodoGo4Mon::setParContainers()","ZERO POINTER FOR HHODOTHISTBOOKER RECEIVED!");
exit(1);
}
}
Bool_t HHodoGo4Mon::init(void) {
Bool_t test=kFALSE;
setParContainers();
test=getCategories();
printStatus();
fActive=kTRUE;
return test;
}
Bool_t HHodoGo4Mon::reinit(void)
{
hodoHistbooker = HHodoHistBooker::getExObject();
hodoHistbooker->printStatus();
fActive=kTRUE;
return kTRUE;
}
Bool_t HHodoGo4Mon::getCategories()
{
rawCat=(HCategory*)(((HEvent*)(gHades->getCurrentEvent()))->getCategory(catHodoRaw));
if (!rawCat) {
Warning("HHodoGo4Mon:init()","CATEGORY HHODORAW IS NOT FILLED!");
}
if (rawCat)
{
iterraw =(HIterator *)((HCategory*)rawCat)->MakeIterator("native");
}
calCat=(HCategory*)(((HEvent*)(gHades->getCurrentEvent()))->getCategory(catHodoCal));
if (!calCat) {
Warning("HHodoGo4Mon:init()","CATEGORY HHODOCAL IS NOT FILLED!");
}
if (calCat)
{
itercal =(HIterator *)((HCategory*)calCat)->MakeIterator("native");
}
hitCat=(HCategory*)(((HEvent*)(gHades->getCurrentEvent()))->getCategory(catHodoHit));
if (!hitCat) {
Warning("HHodoGo4Mon:init()","CATEGORY HHODOHIT IS NOT FILLED!");
}
if (hitCat)
{
iterhit =(HIterator *)((HCategory*)hitCat)->MakeIterator("native");
}
return kTRUE;
}
Int_t HHodoGo4Mon::execute()
{
HHodoRaw* raw=0;
HHodoCal* cal=0;
HHodoHit* hit=0;
if(rawCat)
{
hodoHistbooker->getHodoFiller()->fillRawCat(iterraw);
iterraw->Reset();
while ((raw=(HHodoRaw *)iterraw->Next())!=0) {
hodoHistbooker->getHodoFiller()->fillRaw(raw);
}
}else{
}
if(calCat)
{
itercal->Reset();
while ((cal=(HHodoCal *)itercal->Next())!=0) {
hodoHistbooker->getHodoFiller()->fillCal(cal);
}
}else{
}
if(hitCat)
{
iterhit->Reset();
while ((hit=(HHodoHit *)iterhit->Next())!=0) {
hodoHistbooker->getHodoFiller()->fillHit(hit);
}
hodoHistbooker->getHodoFiller()->fillHitCat(iterhit);
}else{
}
return 0;
}
Bool_t HHodoGo4Mon::finalize()
{
return kTRUE;
}
Last change: Sat May 22 12:57:22 2010
Last generated: 2010-05-22 12:57
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.