//*-- AUTHOR : J. Markert //_HADES_CLASS_DESCRIPTION //////////////////////////////////////////////////////////////////////////// // HOnlineTofinoHistFiller // // Container class for the tof hists //////////////////////////////////////////////////////////////////////////// //#include #include "honlinetofinohistfiller.h" #include "hparamlist.h" #include "honlinemonhist.h" #include "honlinetrendhist.h" #include "honlinehistarray.h" #include "tofinodef.h" #include "htofinoraw.h" #include "htofinocal.h" #include "hshowerhittof.h" #include "hades.h" #include "hevent.h" #include "hcategory.h" #include "hiterator.h" #include "TList.h" #include "TArrayI.h" #include "TString.h" #define TOFINO_CELL_MAX 4 #define TOFINO_HIT_MAX 30 // Color definitions TArrayI HOnlineTofinoHistFiller::colorsSector; TArrayI HOnlineTofinoHistFiller::colorsModule; TArrayI HOnlineTofinoHistFiller::colorsCuts; // Hist Pointers HOnlineHistArray* HOnlineTofinoHistFiller::hhits_raw=0; HOnlineHistArray* HOnlineTofinoHistFiller::hprof=0; HOnlineMonHist* HOnlineTofinoHistFiller::hmulttdcall=0; HOnlineMonHist2* HOnlineTofinoHistFiller::hAdc=0; HOnlineMonHist2* HOnlineTofinoHistFiller::hTdc=0; HOnlineHistArray* HOnlineTofinoHistFiller::hTofinoShower=0; HOnlineMonHist2* HOnlineTofinoHistFiller::htofinomult_raw=0; HOnlineMonHist2* HOnlineTofinoHistFiller::htofinomulttemp_raw=0; HOnlineTrendArray* HOnlineTofinoHistFiller::htofinomulttrend_raw=0; // Hist Addon Pointers HOnlineMonHistAddon* HOnlineTofinoHistFiller::hhits_rawA=0; HOnlineMonHistAddon* HOnlineTofinoHistFiller::hprofA=0; HOnlineMonHistAddon* HOnlineTofinoHistFiller::hmulttdcallA=0; HOnlineMonHistAddon* HOnlineTofinoHistFiller::hAdcA=0; HOnlineMonHistAddon* HOnlineTofinoHistFiller::hTdcA=0; HOnlineMonHistAddon* HOnlineTofinoHistFiller::hTofinoShowerA=0; HOnlineMonHistAddon* HOnlineTofinoHistFiller::htofinomult_rawA=0; HOnlineMonHistAddon* HOnlineTofinoHistFiller::htofinomulttemp_rawA=0; HOnlineMonHistAddon* HOnlineTofinoHistFiller::htofinomulttrend_rawA=0; ClassImp(HOnlineTofinoHistFiller) HOnlineTofinoHistFiller::HOnlineTofinoHistFiller(const Char_t* name,const Char_t* title) : TNamed(name,title) { colorsSector.Set(6); colorsModule.Set(4); colorsCuts.Set(4); } HOnlineTofinoHistFiller::~HOnlineTofinoHistFiller() { } void HOnlineTofinoHistFiller::fillRawCat(HIterator* rawiter) { Int_t s,c,mult=0,count=0; Float_t t; HTofinoRaw* raw=0; rawiter->Reset(); TH1* h=hprof->getP(0,0); while ((raw=(HTofinoRaw*)rawiter->Next())!= 0 &&count<30){ s=raw->getSector(); c=raw->getCell(); t=raw->getTime(); if(t>0. && t<4096.) {mult++;h->SetBinContent(s*4+c+1,h->GetBinContent(s*4+c+1)+1);} count++; } hmulttdcall->getP()->Fill((Float_t)(mult)); } void HOnlineTofinoHistFiller::fillRaw(HTofinoRaw* raw) { Float_t time=raw->getTime(); Float_t charge=raw->getCharge(); Char_t s=raw->getSector(); Char_t c=raw->getCell(); if(hhits_raw)hhits_raw->fill(0,s,c); if(hAdc)hAdc->getP()->Fill((Axis_t)(s*4+c),(Axis_t)charge); if(hTdc)hTdc->getP()->Fill((Axis_t)(s*4+c),(Axis_t)time); if(htofinomult_raw) htofinomult_raw ->getP()->Fill(c,s); if(htofinomulttemp_raw)htofinomulttemp_raw->getP()->Fill(c,s); } void HOnlineTofinoHistFiller::fillCal(HTofinoCal* cal) { } void HOnlineTofinoHistFiller::fillShowerTofino(HIterator* caliter,HIterator* showTofIter){ HTofinoCal *pTofCal=NULL; HShowerHitTof *pShowHitTof=NULL; Int_t nTofSec,nTofCell,nIndex; Int_t tofinoSec[TOFINO_HIT_MAX],tofino_cell[TOFINO_HIT_MAX]; Int_t tofCal[6][4],showTofHit[6][4]; Int_t nTofino=0; caliter->Reset(); showTofIter->Reset(); for(Int_t s=0;s<6;s++){ for(Int_t c=0;cNext())!= 0){ nTofSec = pTofCal->getSector(); nTofCell = pTofCal->getCell(); nIndex = nTofSec*TOFINO_CELL_MAX+nTofCell; tofCal[nTofSec][nTofCell]=nTofCell; } while (((pShowHitTof=(HShowerHitTof*)showTofIter->Next())!=0)&& (nTofinogetSector(); tofino_cell[nTofino]=pShowHitTof->getTofinoCell(); showTofHit[tofinoSec[nTofino]][tofino_cell[nTofino]]=tofino_cell[nTofino]; nTofino++; } for(Int_t s=0;s<6;s++){ for(Int_t c=0;c-1)&&(showTofHit[s][c]==-1)){ showTofHit[s][c]=4; } } for(Int_t c=0;cfill(0,0,nIndex); } if(showTofHit[s][c]==TOFINO_CELL_MAX){ //No correlation hTofinoShower->fill(0,1,nIndex); } } } } void HOnlineTofinoHistFiller::fillTrend() { for(Int_t s=0;s<6;s++){ if(htofinomulttemp_raw&&htofinomulttrend_raw){ htofinomulttrend_raw->fill(0,s,htofinomulttemp_raw->getP()->Integral(1,4,s+1,s+1)); } } if(htofinomulttemp_raw)htofinomulttemp_raw->getP()->Reset(); } void HOnlineTofinoHistFiller::putTofinoParams(HParamList* l,TList* histpool) { // Puts all params of HOnlineTofinoHistFiller to the parameter list of // HParamList (which ist used by the io); Text_t mytemp[500]; l->add("colorsSector" ,colorsSector); l->add("colorsModule" ,colorsModule); l->add("colorsCuts" ,colorsCuts ); hhits_rawA->getText(mytemp); l->add("hhits_raw" ,mytemp); hprofA->getText(mytemp); l->add("hprof" ,mytemp); hmulttdcallA->getText(mytemp); l->add("hmulttdcall" ,mytemp); hAdcA->getText(mytemp); l->add("hAdc" ,mytemp); hTdcA->getText(mytemp); l->add("hTdc" ,mytemp); hTofinoShowerA->getText(mytemp); l->add("hTofinoShower" ,mytemp); htofinomult_rawA->getText(mytemp); l->add("htofinomult_raw" ,mytemp); htofinomulttemp_rawA->getText(mytemp); l->add("htofinomulttemp_raw" ,mytemp); htofinomulttrend_rawA->getText(mytemp); l->add("htofinomulttrend_raw" ,mytemp); } Bool_t HOnlineTofinoHistFiller::getTofinoParams(HParamList* l,TList* histpool,TList* activeHists) { if(!(l->fill("colorsSector",&colorsSector))) return kFALSE; if(!(l->fill("colorsModule",&colorsModule))) return kFALSE; if(!(l->fill("colorsCuts" ,&colorsCuts ))) return kFALSE; Text_t mytemp[500]; if(!(l->fill("hhits_raw",mytemp,500))) {return kFALSE;} else { histpool->Add(hhits_rawA=new HOnlineMonHistAddon(mytemp)); if(hhits_rawA->getActive()==1) { activeHists->Add(hhits_raw=new HOnlineHistArray(*hhits_rawA)); hhits_raw->getP(0,0)->SetLineColor(colorsSector[0]); hhits_raw->getP(0,1)->SetLineColor(colorsSector[1]); hhits_raw->getP(0,2)->SetLineColor(colorsSector[2]); hhits_raw->getP(0,3)->SetLineColor(colorsSector[3]); hhits_raw->getP(0,4)->SetLineColor(colorsSector[4]); hhits_raw->getP(0,5)->SetLineColor(colorsSector[5]); } } if(!(l->fill("hprof",mytemp,500))) {return kFALSE;} else { histpool->Add(hprofA=new HOnlineMonHistAddon(mytemp)); if(hprofA->getActive()==1) { activeHists->Add(hprof=new HOnlineHistArray(*hprofA)); hprof->getP(0,0)->SetNdivisions(6); } } if(!(l->fill("hmulttdcall",mytemp,500))) {return kFALSE;} else { histpool->Add(hmulttdcallA=new HOnlineMonHistAddon(mytemp)); if(hmulttdcallA->getActive()==1) { activeHists->Add(hmulttdcall=new HOnlineMonHist(*hmulttdcallA)); } } if(!(l->fill("hAdc",mytemp,500))) {return kFALSE;} else { histpool->Add(hAdcA=new HOnlineMonHistAddon(mytemp)); if(hAdcA->getActive()==1) { activeHists->Add(hAdc=new HOnlineMonHist2(*hAdcA)); } } if(!(l->fill("hTdc",mytemp,500))) {return kFALSE;} else { histpool->Add(hTdcA=new HOnlineMonHistAddon(mytemp)); if(hTdcA->getActive()==1) { activeHists->Add(hTdc=new HOnlineMonHist2(*hTdcA)); } } if(!(l->fill("hTofinoShower",mytemp,500))) {return kFALSE;} else{ histpool->Add(hTofinoShowerA=new HOnlineMonHistAddon(mytemp)); if(hTofinoShowerA->getActive()==1){ activeHists->Add(hTofinoShower=new HOnlineHistArray(*hTofinoShowerA)); hTofinoShower->getP(0,0)->SetFillColor(38); hTofinoShower->getP(0,1)->SetFillColor(46); } } if(!(l->fill("htofinomult_raw",mytemp,500))) {return kFALSE;} else { histpool->Add(htofinomult_rawA=new HOnlineMonHistAddon(mytemp)); if(htofinomult_rawA->getActive()==1) { activeHists->Add(htofinomult_raw=new HOnlineMonHist2(*htofinomult_rawA)); } } if(!(l->fill("htofinomulttemp_raw",mytemp,500))) {return kFALSE;} else { histpool->Add(htofinomulttemp_rawA=new HOnlineMonHistAddon(mytemp)); if(htofinomulttemp_rawA->getActive()==1) { activeHists->Add(htofinomulttemp_raw=new HOnlineMonHist2(*htofinomulttemp_rawA)); } } if(!(l->fill("htofinomulttrend_raw",mytemp,500))) {return kFALSE;} else { histpool->Add(htofinomulttrend_rawA=new HOnlineMonHistAddon(mytemp)); if(htofinomulttrend_rawA->getActive()==1) { activeHists->Add(htofinomulttrend_raw=new HOnlineTrendArray(*htofinomulttrend_rawA)); for(Int_t s=0;s<6;s++){ htofinomulttrend_raw->getP(0,s)->SetLineColor(colorsSector[s]); htofinomulttrend_raw->getP(0,s)->SetMarkerColor(colorsSector[s]); } } } return kTRUE; }