X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSCompressRawDataSDD.cxx;h=e46f6aaed87aa82634595f8faec92bbb67eab197;hb=714c82027c481e3e6b897a8b7fd98fd63bb2f9f1;hp=513741a33533ac261ac06a6b81ff2d373f288193;hpb=6297cc01e06cddd751d69859b4da51a0a33d4e0c;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSCompressRawDataSDD.cxx b/ITS/AliITSCompressRawDataSDD.cxx index 513741a3353..e46f6aaed87 100644 --- a/ITS/AliITSCompressRawDataSDD.cxx +++ b/ITS/AliITSCompressRawDataSDD.cxx @@ -25,7 +25,7 @@ // 29 | // // 28 |-> 4 bits to identify the Carlos (0-11) inside the DDL // // 27 - // -// 26 detecot side (0= left, =right) // +// 26 detecor side (0= left, =right) // // 25 - // // 24 | // // 23 | // @@ -53,9 +53,11 @@ // 1 | // // 0 - // // // -// Plus 1 type of control words: // +// Plus 2 typs of control words: // // - End of module data (needed by the Cluster Finder) // // first 4 most significant bits = 1111 // +// - Jitter word // +// first 4 most significant bits = 1000 // // // // Origin: F.Prino, Torino, prino@to.infn.it // // // @@ -75,73 +77,14 @@ AliITSCompressRawDataSDD::AliITSCompressRawDataSDD(): TObject(), fRawReader(0), fPointerToData(0), -fSizeInMemory(0), -fEventRange(kFALSE), -fFirstEvent(0), -fLastEvent(0) +fSizeInMemory(0) { // default constructor - fNameFile=""; -} -//______________________________________________________________________ -AliITSCompressRawDataSDD::AliITSCompressRawDataSDD(TString filename): -TObject(), -fRawReader(0), -fPointerToData(0), -fSizeInMemory(0), -fEventRange(kFALSE), -fFirstEvent(0), -fLastEvent(0) -{ - // Contructor for tests - fNameFile=filename; } //______________________________________________________________________ AliITSCompressRawDataSDD::~AliITSCompressRawDataSDD(){ // raw reader is passed from outdside, don't delete it } - -//______________________________________________________________________ -void AliITSCompressRawDataSDD::Compress(){ - // Test method to dump raw data on ascii file - Int_t iev=0; - if(fEventRange) iev=fFirstEvent; - - AliRawReader* rd; - if(fNameFile.Contains(".root")){ - rd=new AliRawReaderRoot(fNameFile.Data(),iev); - }else{ - rd=new AliRawReaderDate(fNameFile.Data(),iev); - } - - FILE *outtxt=fopen("data.txt","w"); - Int_t oldddl=-1; - UInt_t word=0; - do{ - rd->Reset(); - - AliITSRawStreamSDD s(rd); - s.SetDecompressAmbra(kFALSE); - while(s.Next()){ - if(s.IsCompletedModule()==kFALSE){ - word=s.GetCarlosId()<<27; - word+=s.GetChannel()<<26; - word+=s.GetCoord1()<<18; - word+=s.GetCoord2()<<10; - word+=s.GetEightBitSignal(); - fprintf(outtxt,"%08X\n",word); - } - if(s.IsCompletedModule()==kTRUE){ - word=15<<28; - word+=s.GetCarlosId(); - fprintf(outtxt,"%08X\n",word); - } - } - iev++; - if(fEventRange && iev>fLastEvent) break; - }while(rd->NextEvent()); - fclose(outtxt); -} //______________________________________________________________________ UInt_t AliITSCompressRawDataSDD::CompressEvent(UChar_t* inputPtr){ // Method to be used in HLT @@ -157,36 +100,49 @@ UInt_t AliITSCompressRawDataSDD::CompressEvent(UChar_t* inputPtr){ Int_t mask3=0x0000FF00; Int_t mask4=0x000000FF; while(s.Next()){ - if(s.IsCompletedModule()==kFALSE){ - word=s.GetCarlosId()<<27; - word+=s.GetChannel()<<26; - word+=s.GetCoord1()<<18; - word+=s.GetCoord2()<<10; - word+=s.GetEightBitSignal(); + if(s.IsCompletedModule()==kTRUE){ + word=UInt_t(15)<<28; + word+=s.GetCarlosId(); if(siz+4>24; - ++fPointerToData; - *(fPointerToData)=(word&mask2)>>16; + *(fPointerToData)=(word&mask4); ++fPointerToData; *(fPointerToData)=(word&mask3)>>8; ++fPointerToData; - *(fPointerToData)=(word&mask4); + *(fPointerToData)=(word&mask2)>>16; + ++fPointerToData; + *(fPointerToData)=(word&mask1)>>24; ++fPointerToData; siz+=4; } - } - if(s.IsCompletedModule()==kTRUE){ - word=15<<28; - word+=s.GetCarlosId(); + }else if(s.IsCompletedDDL()==kTRUE){ + word=UInt_t(8)<<28; + word+=s.GetJitter(); if(siz+4>24; + *(fPointerToData)=(word&mask4); + ++fPointerToData; + *(fPointerToData)=(word&mask3)>>8; ++fPointerToData; *(fPointerToData)=(word&mask2)>>16; ++fPointerToData; - *(fPointerToData)=(word&mask3)>>8; + *(fPointerToData)=(word&mask1)>>24; ++fPointerToData; + siz+=4; + } + }else{ + word=s.GetCarlosId()<<27; + word+=s.GetChannel()<<26; + word+=s.GetCoord1()<<18; + word+=s.GetCoord2()<<10; + word+=s.GetEightBitSignal(); + if(siz+4>8; + ++fPointerToData; + *(fPointerToData)=(word&mask2)>>16; + ++fPointerToData; + *(fPointerToData)=(word&mask1)>>24; + ++fPointerToData; siz+=4; } }