// File: hrichdisplaycal.cc // // Author: Walter Schoen // Last update by Walter Schoen: 99/09/14 17:23:38 // Modified by Thomas Eberl: 99/09/02 // #include "hrichdisplaycal.h" #include "hevent.h" #include "hspectrometer.h" #include "hrichdetector.h" #include "hcategory.h" //#include "hcategory.h" #include "hmatrixcatiter.h" #include "hlocation.h" #include "hrichraw.h" #include "hrichcal.h" //#include "hrichcalibrater.h" #include "hdebug.h" #include "richdef.h" #include "hrichgeometrypar.h" #include "hdetgeompar.h" #include "hruntimedb.h" Int_t HRichDisplayCal::producer(void){ sharedFile = TMapFile::Create("RICHonline.map","RECREATE", 1000000,"shared memory file"); counter = new TVector(1); (*counter)(0)=0; for (Int_t i=0;iAdd(counter,"counter"); sharedFile->Update(); return 0; } HRichDisplayCal::HRichDisplayCal(const Text_t *name,const Text_t *title) : HReconstructor(name,title) { pRichCal = 0; } HRichDisplayCal::HRichDisplayCal() { pRichCal = 0; } HRichDisplayCal::~HRichDisplayCal(void) { for ( Int_t i =0; igetSetup()->getDetector("Rich"); HRuntimeDb* rtdb=gHades->getRuntimeDb(); HRichGeometryPar *pGeomPar = (HRichGeometryPar*)rtdb-> getContainer("RichGeometryParameters"); pRichCal=gHades->getCurrentEvent()->getCategory(catRichCal); sectorNum= pGeomPar->getSectorsNr(); ncounter=0; producer(); if (!pRichCal) { pRichCal=pRichDet->buildCategory(catRichCal); if (!pRichCal) return kFALSE; else gHades->getCurrentEvent() ->addCategory(catRichCal, pRichCal, "Rich"); } return kTRUE; } Bool_t HRichDisplayCal::finalize(void) { return kTRUE; } Bool_t HRichDisplayCal::display(HLocation &refLoc){ #if DEBUG_LEVEL>2 gDebuger->enterFunc("HRichDisplay::display"); gDebuger->message("Raw cat points to %p",fRawCat); #endif HRichCal *pCal=0; pCal=(HRichCal *)pRichCal->getObject(refLoc); if(pCal) { Int_t sec = pCal->getSector(); Float_t charge = pCal->getCharge(); // if (charge != 0) cout<<" **************** charge from cal:"<getRow(); Int_t col = pCal->getCol(); // if (row==10 && col==45) cout<<" hrichdisplaycal charge : "<Fill(col,row,charge); richHisto[sec][1]->Fill(col,row,charge); //cout <<"hrichdisplay: " <Update(); } #if DEBUG_LEVEL>2 gDebuger->leaveFunc("HRichDisplay::display"); #endif return kTRUE; } Int_t HRichDisplayCal::execute() { HMatrixCatIter *pIter; HRichCal *pCal=NULL; HLocation loc; pIter = (HMatrixCatIter*)getCalCat()->MakeIterator(); Int_t n =0; for (Int_t k =0; k< sectorNum ; k++){ richHisto[k][0] -> Reset(); } while((pCal = (HRichCal *)pIter->Next())) { loc = pIter->getLocation(); display(loc); n++; } ncounter++; (*counter)(0)=ncounter; cout << "event: " <Update(); return kTRUE; } ClassImp(HRichDisplayCal)