//*-- AUTHOR : J. Markert //_HADES_CLASS_DESCRIPTION //////////////////////////////////////////////////////////////////////////// // HOnlineTofinoHistBooker // // Container class for the mdc hists //////////////////////////////////////////////////////////////////////////// //#include #include "htofinodetector.h" #include "honlinetofinohistbooker.h" #include "honlinetofinohistfiller.h" #include "honlinemonhist.h" #include "honlinetrendhist.h" #include "honlinehistarray.h" #include "hades.h" #include "hruntimedb.h" #include "hspectrometer.h" #include "hpario.h" #include "hparamlist.h" #include "hmessagemgr.h" #include "hevent.h" #include "hcategory.h" #include "hrun.h" #include "hdatasource.h" #include "TList.h" // Container/List pointers HOnlineTofinoHistBooker* HOnlineTofinoHistBooker::fTofinoHistBooker=0; TList* HOnlineTofinoHistBooker::tofHistpool=0; TList* HOnlineTofinoHistBooker::tofActiveHists=0; HOnlineTofinoHistFiller* HOnlineTofinoHistBooker::toffiller=0; ClassImp(HOnlineTofinoHistBooker) HOnlineTofinoHistBooker::HOnlineTofinoHistBooker(const Char_t* name,const Char_t* title, const Char_t* context) : HParCond(name,title,context) { strcpy(detName,"Tofino"); if (gHades) { fTofino =(HTofinoDetector*)(((HSpectrometer*)(gHades->getSetup()))->getDetector("Tofino")); } else { fTofino = 0; } clear(); fTofinoHistBooker =this; tofHistpool = new TList; tofActiveHists = new TList; toffiller = new HOnlineTofinoHistFiller("TofinoFiller","TofinoFiller"); } Bool_t HOnlineTofinoHistBooker::initStandAlone() { // intitializes the container from an input HRuntimeDb* rtdb=0; rtdb=gHades->getRuntimeDb(); HDataSource* source=gHades->getDataSource(); Int_t refId=source->getCurrentRefId(); Int_t runId=source->getCurrentRunId(); HRun* run=rtdb->getRun(runId); if(!run)run=rtdb->addRun(runId,refId); Bool_t allFound=kFALSE; HParVersion* vers; if(run) { if (!run->getParVersion((Char_t*)GetName())) { vers=new HParVersion((Char_t*)GetName()); run->addParVersion(vers); } } else { Error("HOnlineTofinoHistBooker:initStandAlone()","NO RUN SET!"); return kFALSE; } if (versions[1]!=-1 && versions[2]!=-1) resetInputVersions(); HParIo* io=rtdb->getFirstInput(); if (io) allFound=init(io,0); if (!allFound) { io=rtdb->getSecondInput(); if (io) { allFound=init(io,0); } }else setInputVersion(-1,2); if (!allFound) { cerr<<"******** "<MakeIterator(); HOnlineMonHistAddon* h=0; TString buffer; while ((h=(HOnlineMonHistAddon*)myiter->Next())!= 0) { h->reset(level,count); } delete myiter; } void HOnlineTofinoHistBooker::clear() { status=kFALSE; resetInputVersions(); changed=kFALSE; } Bool_t HOnlineTofinoHistBooker::check() { // all parameters are checked for non valid values return kTRUE; } void HOnlineTofinoHistBooker::printParam(void) { // prints the parameters of HOnlineTofinoHistBooker to the screen. // The printParam() of the subobjects are called to print the // parameters of the corresponding subobject. } void HOnlineTofinoHistBooker::printStatus(void) { // prints the parameters of HOnlineTofinoHistBooker to the screen. cout<<"###############Status TofinoHistbooker#################"<MakeIterator(); while ((h=(HOnlineMonHistAddon*)myiter->Next())!= 0) { cout<<"active: "<getActive()<<" resetable: "<getResetable()<<" "<GetName()<putTofinoParams(l,tofHistpool); } Bool_t HOnlineTofinoHistBooker::getParams(HParamList* l) { if(!l) return kFALSE; if(isStatic()==0) { if(!toffiller->getTofinoParams(l,tofHistpool,tofActiveHists)) return kFALSE; setStatic(); } return kTRUE; }