using namespace std;
#include "hrichgo4mon.h"
#include "hrichhistfiller.h"
#include "hrichhistbooker.h"
#include "richdef.h"
#include "hcategory.h"
#include "hrichcal.h"
#include "hrichraw.h"
#include "hrichhit.h"
#include "hrichgeometrypar.h"
#include "hrichfancy.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(HRichGo4Mon)
HRichHistBooker* HRichGo4Mon::richHistbooker=0;
HRichGo4Mon::HRichGo4Mon(void) {
initVariables();
}
HRichGo4Mon::HRichGo4Mon(const Text_t* name,const Text_t* title)
: HReconstructor(name,title) {
initVariables();
}
HRichGo4Mon::~HRichGo4Mon(void) {
if (itercal) delete itercal;
if (iterraw) delete iterraw;
if (iterhit) delete iterhit;
itercal=0;
iterraw=0;
iterhit=0;
}
void HRichGo4Mon::initVariables()
{
calCat =0;
rawCat =0;
hitCat =0;
itercal=0;
iterraw=0;
iterhit=0;
}
void HRichGo4Mon::printStatus(){
cout << "************* HRichGo4Mon ***************" << endl;
cout << "******************************************" << endl;
}
void HRichGo4Mon::setParContainers() {
richHistbooker = HRichHistBooker::getExObject();
HRichGeometryPar* fRichGeomPar=0;
fRichGeomPar=(HRichGeometryPar*)(gHades->getRuntimeDb()->getContainer("RichGeometryParameters"));
if(!richHistbooker)
{
Error("HRichGo4Mon::setParContainers()","ZERO POINTER FOR HSTARTHISTBOOKER RECEIVED!");
exit(1);
}
}
Bool_t HRichGo4Mon::init(void) {
Bool_t test=kFALSE;
setParContainers();
test=getCategories();
printStatus();
fActive=kTRUE;
return test;
}
Bool_t HRichGo4Mon::reinit(void)
{
richHistbooker = HRichHistBooker::getExObject();
richHistbooker->printStatus();
HRichFancy* richfancy = richHistbooker->getRichFiller()->getRichFancy();
if(richfancy->getKnown()==kFALSE)
{richfancy->init();}
fActive=kTRUE;
return kTRUE;
}
Bool_t HRichGo4Mon::getCategories()
{
rawCat=(HCategory*)(((HEvent*)(gHades->getCurrentEvent()))->getCategory(catRichRaw));
if (!rawCat) {
Warning("HRichGo4Mon:init()","CATEGORY HRICHRAW IS NOT FILLED!");
}
calCat=(HCategory*)(((HEvent*)(gHades->getCurrentEvent()))->getCategory(catRichCal));
if (!calCat) {
Warning("HRichGo4Mon:init()","CATEGORY HRICHCAL IS NOT FILLED!");
}
hitCat=(HCategory*)(((HEvent*)(gHades->getCurrentEvent()))->getCategory(catRichHit));
if (!hitCat) {
Warning("HRichGo4Mon:init()","CATEGORY HRICHHIT IS NOT FILLED!");
}
if (rawCat)
{
iterraw =(HIterator *)((HCategory*)rawCat)->MakeIterator("native");
}
if (calCat)
{
itercal=(HIterator *)((HCategory*)calCat)->MakeIterator("native");
}
if (hitCat)
{
iterhit =(HIterator *)((HCategory*)hitCat)->MakeIterator("native");
}
return kTRUE;
}
Int_t HRichGo4Mon::execute()
{
HRichRaw* raw=0;
HRichCal* cal=0;
HRichHit* hit=0;
if(rawCat)
{
iterraw->Reset();
richHistbooker->getRichFiller()->fillRawCategory(iterraw);
iterraw->Reset();
while ((raw=(HRichRaw *)iterraw->Next())!=0) {
richHistbooker->getRichFiller()->fillRaw(raw);
}
}
if(calCat)
{
itercal->Reset();
richHistbooker->getRichFiller()->fillCalCategory(itercal);
itercal->Reset();
while ((cal=(HRichCal *)itercal->Next())!=0) {
richHistbooker->getRichFiller()->fillCal(cal);
}
}
if(hitCat)
{
iterhit->Reset();
while ((hit=(HRichHit *)iterhit->Next())!=0) {
richHistbooker->getRichFiller()->fillHit(hit);
}
}
return 0;
}
Bool_t HRichGo4Mon::finalize()
{
return kTRUE;
}
Last change: Sat May 22 13:08:57 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.