X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=T0%2FAliT0RawReader.cxx;h=65e9a2e165dab0a43433c72a7ba86cba4e2bdb5d;hb=6ff24c60916ca29332930a97a82e03604318ad0e;hp=f146111ef6353eeb4f7ea9c0be2fa45923157834;hpb=27e6a69ecae7256b72458f6242b00b4aa2466a83;p=u%2Fmrichter%2FAliRoot.git diff --git a/T0/AliT0RawReader.cxx b/T0/AliT0RawReader.cxx index f146111ef63..65e9a2e165d 100644 --- a/T0/AliT0RawReader.cxx +++ b/T0/AliT0RawReader.cxx @@ -19,18 +19,21 @@ // // T0 // Class for reading T0 RAW data in TOF data format -// Alla.Maevskaya@cern.ch // -//____________________________________________________________________ - #include "AliT0RawReader.h" #include "AliT0Parameters.h" #include "AliBitPacking.h" #include "TBits.h" -//#include +#include +#include "TMath.h" +#include "TH1F.h" +#include "TArrayI.h" #include "AliLog.h" +using std::cout; +using std::endl; +using std::ios_base; ClassImp(AliT0RawReader) AliT0RawReader::AliT0RawReader (AliRawReader *rawReader, Bool_t isOnline) @@ -39,7 +42,10 @@ ClassImp(AliT0RawReader) fData(NULL), fPosition(0), fParam(NULL), - fIsOnline(isOnline) + fIsOnline(isOnline), + fBunchID(0), + fPrintout(kFALSE) + { // // create an object to read T0raw digits @@ -58,6 +64,15 @@ ClassImp(AliT0RawReader) { // } +/* +AliT0RawReader::AliT0RawReader(const AliT0RawReader& o): TTask(o), + fRawReader(rawReader), + fData(NULL), + fPosition(0) +{ + // +} +*/ Bool_t AliT0RawReader::Next() @@ -88,54 +103,58 @@ Bool_t AliT0RawReader::Next() // allData[48] mean (T0) signal // allData[49] time difference (vertex) - UInt_t word; Int_t time=0, itdc=0, ichannel=0, uu; Int_t numberOfWordsInTRM=0, iTRM=0; Int_t tdcTime, koef,hit=0; - Int_t koefhits[110]; - Int_t trmChainHeader = 0x00000000; - Int_t trmChainTrailer = 0x10000000; + Int_t koefhits[220]; + Int_t trm_chain_header = 0x00000000; + Int_t trm_chain_trailer = 0x10000000; - Int_t filler = 0x70000000; + UInt_t filler = 0x70000000; Bool_t correct=kTRUE; Int_t header; - Int_t fNTRM = fParam->GetNumberOfTRMs(); - for ( Int_t k=0; k<110; k++) { + Int_t fNTRM = fParam->GetNumberOfTRMs(); + for ( Int_t k=0; k<220; k++) { koefhits[k]=0; for ( Int_t jj=0; jj<5; jj++) { fAllData[k][jj]=0; - } - } - do { - if (!fRawReader->ReadNextData(fData)) return kFALSE; - } while (fRawReader->GetDataSize() == 0); - - fPosition = 0; - // cout.setf( ios_base::hex, ios_base::basefield ); - - //DRM header + } + } + do { + if (!fRawReader->ReadNextData(fData)) return kFALSE; + } while (fRawReader->GetDataSize() == 0); + + fPosition = 0; + // cout.setf( ios_base::hex, ios_base::basefield ); + if(fPrintout) + cout<<" CDH :: BC ID "<< (fRawReader->GetBCID())<< + " Event size"<GetDataSize()<< + " orbit ID "<GetOrbitID()<< + " event index "<GetEventIndex()<< + " event type " <GetType()<AddFatalErrorLog(kWrongDRMHeader,Form("w=%x",word)); break; } } - // cout<<" nTRMs "<AddMajorErrorLog(kWrongChain0Header,Form("w=%x",word)); break; } + fBunchID=AliBitPacking::UnpackWord(word,4,15); + if(fPrintout) + cout<<" chain "<< ichain<<" header:: BunchID "<GetChannel(iTRM,itdc,ichain,ichannel); if (koef != 0 ) - // cout<<"RawReader>> "<<"koef "<> "<<"koef "<AddMajorErrorLog(kIncorrectLUT); @@ -179,31 +206,32 @@ Bool_t AliT0RawReader::Next() } if(correct){ hit=koefhits[koef]; - if(hit>5) { - AliWarning(Form("Too many hits for %i channel ! ",koef)); - break; + if(hit>4) { + AliDebug(10,Form("Too many hits for %i channel - %i ! ",koef,koefhits[koef] )); + hit=4; } fAllData[koef][hit]=time; koefhits[koef]++; } word = GetNextWord(); - // cout<<" next word in cycle "<AddMajorErrorLog(kWrongChain0Trailer,Form("w=%x",word)); break; } + if(fPrintout) + cout<<"chain trailer:: event counter "<< AliBitPacking::UnpackWord(word,16,27)<AddMajorErrorLog(kWrongTRMTrailer,Form("w=%x",word)); break; } + if(fPrintout) + cout<<" TRM trailer :: event counter "<< AliBitPacking::UnpackWord(word,16,27)<AddFatalErrorLog(kWrongDRMTrailer,Form("w=%x",word)); } - // cout.setf( ios_base::dec, ios_base::basefield ); - + if(fPrintout) + cout<<" DRM trailer ::event counter "<< AliBitPacking::UnpackWord(word,4,15)<