//*-- Author : Walter Karig //*-- Modified : 05/06/98 by Manuel Sanchez //*-- Modified : 28/5/2000 by R. Holzmann // using namespace std; #include "htofunpacker99.h" #include "htofraw.h" #include "hdebug.h" #include "hades.h" #include "hevent.h" #include "hspectrometer.h" #include "hdetector.h" #include "hcategory.h" #include "hldsubevt.h" #include #include //_HADES_CLASS_DESCRIPTION ///////////////////////////////// //HTofUnpacker99 // // This is the HUnpacker used to read Nov 99 TOF data from LMD files // ////////////////////////////////// HTofUnpacker99::HTofUnpacker99(void) { pRawCat=NULL; pTofData = NULL; } HTofUnpacker99::~HTofUnpacker99(void) { } Bool_t HTofUnpacker99::init(void) { pRawCat=gHades->getCurrentEvent()->getCategory(catTofRaw); if (!pRawCat) { pRawCat=gHades->getSetup()->getDetector("Tof")->buildCategory(catTofRaw); if (!pRawCat) { return kFALSE; } else { gHades->getCurrentEvent()->addCategory(catTofRaw,pRawCat,"Tof"); } } return kTRUE; } Int_t HTofUnpacker99::execute() { Int_t i = fill(); return i; } Int_t HTofUnpacker99::fill() { // cout << "In HTofUnpacker99::fill()" << endl; if(pTofData) { delete [] pTofData; pTofData = NULL; } // if(pSubEvt) cout << "pSubEvt exists" << endl; // else cout << "pSubEvt doesn't exist" << endl; if(pSubEvt) { UInt_t channels,geo; UInt_t tdcCh,time; Int_t cursor; Int_t j; UInt_t tdcCounter; HLocation loc; loc.set(3,0,0,0); Int_t length = pSubEvt->getEnd() - pSubEvt->getData(); // printf(" length = %i \n",length); pTofData = new UInt_t[length]; UInt_t *pointer = pSubEvt->getData(); for(j=0;j> 3; channels = (UInt_t) byte(3,pTofData[cursor++]); // cout<<"geo = "<> 16; time = (pTofData[j] & 0xfff ) % 0xfff; // loc[0] = 3; //for September test if(geo==3||geo==4||geo==5||geo==6) loc[0] = 2; if(geo==8||geo==9||geo==10||geo==11) loc[0] = 5; if(geo==3||geo==5||geo==8||geo==10) loc[1] = tdcCh/8; if(geo==4||geo==6||geo==9||geo==11) loc[1] = tdcCh/8 + 4; loc[2] = tdcCh%8; // cout<<"tdcCh = "<