// : Author J.Markert //_HADES_CLASS_DESCRIPTION /////////////////////////////////////////////////////////////////////////////// // // HOnlineShowerMon // /////////////////////////////////////////////////////////////////////////////// using namespace std; #include "honlineshowermon.h" #include "honlineshowerhistfiller.h" #include "honlineshowerhistbooker.h" #include "showerdef.h" #include "hcategory.h" #include "hshowercal.h" #include "hshowerraw.h" #include "hshowerhit.h" #include "hdebug.h" #include "hades.h" #include "hiterator.h" #include "hruntimedb.h" #include "hspectrometer.h" #include "hdetector.h" #include "hevent.h" #include #include #include #include "TIterator.h" ClassImp(HOnlineShowerMon) HOnlineShowerHistBooker* HOnlineShowerMon::showerHistbooker=0; HOnlineShowerMon::HOnlineShowerMon(void) { // Default constructor . initVariables(); } HOnlineShowerMon::HOnlineShowerMon(const Text_t* name,const Text_t* title) : HReconstructor(name,title) { // Constructor calls the constructor of class HReconstructor with the name // and the title as arguments. initVariables(); } HOnlineShowerMon::~HOnlineShowerMon(void) { // destructor deletes the iterator if (itercal) delete itercal; if (iterraw) delete iterraw; if (iterhit) delete iterhit; itercal=0; iterraw=0; iterhit=0; } void HOnlineShowerMon::initVariables() { // iterator+categories calCat =0; rawCat =0; hitCat =0; itercal=0; iterraw=0; iterhit=0; } void HOnlineShowerMon::printStatus(){ cout << "************* HOnlineShowerMon ***************" << endl; cout << "******************************************" << endl; } void HOnlineShowerMon::setParContainers() { showerHistbooker = HOnlineShowerHistBooker::getExObject(); if(!showerHistbooker) { Error("HOnlineShowerMon::setParContainers()","ZERO POINTER FOR HSHOWERHISTBOOKER RECEIVED!"); exit(1); } } Bool_t HOnlineShowerMon::init(void) { Bool_t test=kFALSE; setParContainers(); test=getCategories(); printStatus(); fActive=kTRUE; return test; } Bool_t HOnlineShowerMon::reinit(void) { showerHistbooker = HOnlineShowerHistBooker::getExObject(); showerHistbooker->printStatus(); fActive=kTRUE; return kTRUE; } Bool_t HOnlineShowerMon::getCategories() { rawCat=(HCategory*)(((HEvent*)(gHades->getCurrentEvent()))->getCategory(catShowerRaw)); if (!rawCat) { Warning("HOnlineShowerMon:init()","CATEGORY HSHOWERRAW IS NOT FILLED!"); } calCat=(HCategory*)(((HEvent*)(gHades->getCurrentEvent()))->getCategory(catShowerCal)); if (!calCat) { Warning("HOnlineShowerMon:init()","CATEGORY HSHOWERCAL IS NOT FILLED!"); } hitCat=(HCategory*)(((HEvent*)(gHades->getCurrentEvent()))->getCategory(catShowerHit)); if (!hitCat) { Warning("HOnlineShowerMon:init()","CATEGORY HSHOWERHIT 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 HOnlineShowerMon::execute() { //showerHistbooker->resetActiveList(2,gHades->getEventCounter()); // if feature of incremental update should be used HShowerRaw* raw=0; HShowerCal* cal=0; HShowerHit* hit=0; if(rawCat) { iterraw->Reset(); //########################## Fill RAW HISTS ################################## while ((raw=(HShowerRaw *)iterraw->Next())!=0) { showerHistbooker->getShowerFiller()->fillRaw(raw); } } if(calCat) { itercal->Reset(); //######################### FIll CAL HISTS ################################## while ((cal=(HShowerCal *)itercal->Next())!=0) { showerHistbooker->getShowerFiller()->fillCal(cal); } //############################################################################ } if(hitCat) { iterhit->Reset(); //########################## Fill HIT HISTS ################################## while ((hit=(HShowerHit *)iterhit->Next())!=0) { showerHistbooker->getShowerFiller()->fillHit(hit); } } return 0; } Bool_t HOnlineShowerMon::finalize() { return kTRUE; }