X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=T0%2FAliT0RawReader.cxx;h=bb72b1c941b5f652eaa078fa9ae0e5bdfa18ab87;hp=7171dd0c2c33870df332031c245e2fc508c5cdea;hb=5325480c2c283cfe4be70248f7eb1086364ea7e1;hpb=da15c49604083e6a9a1ac18a01584757a1133b7a diff --git a/T0/AliT0RawReader.cxx b/T0/AliT0RawReader.cxx index 7171dd0c2c3..bb72b1c941b 100644 --- a/T0/AliT0RawReader.cxx +++ b/T0/AliT0RawReader.cxx @@ -16,7 +16,6 @@ ClassImp(AliT0RawReader) fRawReader(rawReader), fData(NULL), fPosition(0) - { // // create an object to read T0raw digits @@ -25,7 +24,6 @@ ClassImp(AliT0RawReader) fRawReader->Reset(); fRawReader->Select("T0"); - cout<<" AliT0RawReader::AliT0RawReaderfRawReader->Select "<Branch("T0","AliT0digit",&fDigits,405,1); UInt_t word; - Int_t time=0, itdc=0, ichannel=0; + Int_t time=0, itdc=0, ichannel=0, uu; Int_t numberOfWordsInTRM=0, iTRM=0; - Int_t tdcTime, koef,hit, meanTime, timeDiff ; - Int_t numTRM=2; // number of TRMs in game For test =1 !!!!! - + Int_t tdcTime, koef,hit=0; + Int_t koefhits[110]; - - AliT0Parameters* param = AliT0Parameters::Instance(); //-->Zhenya + Int_t fDRM_GLOBAL_HEADER = 0x40000001; + Int_t fDRM_GLOBAL_TRAILER = 0x50000001; + + Int_t TRM_GLOBAL_HEADER = 0x40000000; + Int_t TRM_CHAIN_0_HEADER = 0x00000000; + Int_t TRM_CHAIN_1_HEADER = 0x20000000; + Int_t TRM_CHAIN_0_TRAILER = 0x10000000; + Int_t TRM_CHAIN_1_TRAILER = 0x30000000; + Int_t TRM_GLOBAL_TRAILER = 0x5000000f; + + AliT0Parameters* param = AliT0Parameters::Instance(); param->Init(); + Int_t fNTRM = param->GetNumberOfTRMs(); for ( Int_t k=0; k<110; k++) { - for ( Int_t jj=0; jj<5; jj++) { - fAllData[k][jj]=0; - } + koefhits[k]=0; + for ( Int_t jj=0; jj<5; jj++) { + fAllData[k][jj]=0; + } } do { if (!fRawReader->ReadNextData(fData)) return kFALSE; @@ -96,24 +101,43 @@ Bool_t AliT0RawReader::Next() // fPosition = GetPosition(); fPosition = 0; + // cout.setf( ios_base::hex, ios_base::basefield ); //DRM header - for (Int_t i=0; i<4; i++) { - word = GetNextWord(); - } - - for (Int_t ntrm=0; ntrm< numTRM; ntrm++) - { + for (Int_t i=0; i<6; i++) { + word = GetNextWord(); + uu = word&fDRM_GLOBAL_HEADER; + if(uu != fDRM_GLOBAL_HEADER ) + { + AliError(Form(" !!!! wrong DRM header %x!!!!", word)); + break; + } + } + + for (Int_t ntrm=0; ntrm< fNTRM; ntrm++) + { //TRMheader word = GetNextWord(); + uu = word&TRM_GLOBAL_HEADER; + if(uu != TRM_GLOBAL_HEADER ) + { + AliError(Form(" !!!! wrong TRM header %x!!!!", word)); + break; + } numberOfWordsInTRM=AliBitPacking::UnpackWord(word,4,16); iTRM=AliBitPacking::UnpackWord(word,0,3); //chain header - Int_t ichain=0; word = GetNextWord(); + uu = word & TRM_CHAIN_0_HEADER; + if(uu != TRM_CHAIN_0_HEADER) + { + AliError(Form(" !!!! wrong CHAIN 0 header %x!!!!", word)); + break; + } + Int_t ichain=AliBitPacking::UnpackWord(word,0,3); - for (Int_t i=0; iGetChannel(iTRM,itdc,ichain,ichannel); - // cout<<" RawReader::Next ::"<