X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSRawStreamSDDCompressed.cxx;h=012742e7159cbe1957aa816b9d80e2f98d5dfd85;hb=72756d8d13bd4dce58fc8aa6dabcd16559686cd4;hp=f25dacba5906b85378ff254b99e65bf3d0b80b2f;hpb=7765ca402de62617423c47063905e9f3b21cecaa;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSRawStreamSDDCompressed.cxx b/ITS/AliITSRawStreamSDDCompressed.cxx index f25dacba590..012742e7159 100644 --- a/ITS/AliITSRawStreamSDDCompressed.cxx +++ b/ITS/AliITSRawStreamSDDCompressed.cxx @@ -24,7 +24,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 | // @@ -52,9 +52,11 @@ // 1 | // // 0 - // // // -// Plus 2 types of control words: // -// - DDL identifier with the 4 more significant bits = 1000 // -// - End of module data (needed by the Cluster Finder) = 1111 // +// Plus 3 types of control words // +// identified by the the 4 most significant bits (31-28) // +// 1) Jitter word = 1000 // +// 2) JTAG answer = 1100 // +// 3) End of module data (needed by the Cluster Finder) = 1111 // // // // Origin: F.Prino, Torino, prino@to.infn.it // // // @@ -73,16 +75,15 @@ ClassImp(AliITSRawStreamSDDCompressed) //______________________________________________________________________ AliITSRawStreamSDDCompressed::AliITSRawStreamSDDCompressed(AliRawReader* rawReader) : AliITSRawStream(rawReader), -fDDLModuleMap(0), -fData(0), -fCarlosId(-1), -fChannel(0), -fJitter(0), -fDDL(0) + fDDLModuleMap(0), + fData(0), + fCarlosId(-1), + fChannel(0), + fJitter(0), + fDDL(0), + fADCEncoded(0) { // create an object to read ITS SDD raw digits - fDDLModuleMap=new AliITSDDLModuleMapSDD(); - fDDLModuleMap->SetDefaultMap(); for(Int_t im=0;imGetDDLID(); - Int_t ddln = fRawReader->GetDDLID(); - if(ddln <0) ddln=0; - fCompletedModule=kFALSE; - UInt_t masksod=8; // start of DDL has the 4 most significant bits = 1000 - UInt_t maskeom=15; // end of module has the 4 most significant bits = 1111 - UInt_t maskmod=15; // last 4 bits for module number in end of module word - UInt_t maskDDL=0xFF; // last 8 bits for DDL number in start of DDL word +// returns kTRUE and fCompletedModule=kFALSE and fCompletedDDL=kFALSE when a digit is found +// returns kTRUE and fCompletedModule=kTRUE and fCompletedDDL=kFALSE when a module is completed (=3x3FFFFFFF footer words) +// returns kTRUE and fCompletedModule=kFALSE and fCompletedDDL=kTRUE when a DDL is completed (=jitter word) + + + UInt_t idJit=8; // Jitter word has the 4 most significant bits = 1000 + UInt_t idEom=15; // end of module has the 4 most significant bits = 1111 + UInt_t idJtag=12; // end of module has the 4 most significant bits = 1100 + UInt_t maskmod=15; // last 4 bits for module number in end of module word UInt_t maskCarlos=15<<27; // 4 bits (27-30) for CarlosId in data word UInt_t maskSide=1<<26; // 1 bit (26) for side in data word UInt_t maskAnode=255<<18; // 8 bits (18-25) for Nanode in data word UInt_t maskTb=255<<10; // 8 bits (10-27) for Ntimebin in data word UInt_t maskADC=1023; // 10 bits (0-9) for ADC in data word - - if (!fRawReader->ReadNextInt(fData)) return kFALSE; // read next word - - UInt_t mostsigbits=fData>>28; - if(mostsigbits==masksod){ - fDDL=fData&maskDDL; - }else if(mostsigbits==maskeom){ - fCarlosId=fData&maskmod; - fModuleID = GetModuleNumber(fDDL,fCarlosId); - fCompletedModule=kTRUE; - return kTRUE; - }else{ - fCarlosId=(fData&maskCarlos)>>27; - fModuleID = GetModuleNumber(fDDL,fCarlosId); - fChannel=(fData&maskSide)>>26; - fCoord1=(fData&maskAnode)>>18; - fCoord2=(fData&maskTb)>>10; - fSignal=fData&maskADC; - fSignal+=fLowThresholdArray[fModuleID-kSPDModules][fChannel]; - fCompletedModule=kFALSE; - return kTRUE; + UInt_t maskCode=7; // 3 bits (0-2) for ADC range in encoded-ADC case + + while(kTRUE){ + if (!fRawReader->ReadNextInt(fData)) return kFALSE; // read next word + UInt_t mostsigbits=fData>>28; + if(fData==0xFFFFFFFF){ + // CarlosRX header do nothing + } else if(mostsigbits==idEom){ + // end of module word + fCarlosId=fData&maskmod; + fDDL=fRawReader->GetDDLID(); + if(fDDL<0) return kFALSE; + fModuleID = GetModuleNumber(fDDL,fCarlosId); + fCompletedDDL=kFALSE; + fCompletedModule=kTRUE; + return kTRUE; + } else if(mostsigbits==idJit){ + // jitter word + fJitter = fData&0x000000ff; + fCompletedModule=kFALSE; + fCompletedDDL=kTRUE; + return kTRUE; + } else if(mostsigbits==idJtag){ + // jtag word -> skipped + continue; + }else if(mostsigbits<8){ + // data word + fCarlosId=(fData&maskCarlos)>>27; + fDDL=fRawReader->GetDDLID(); + if(fDDL<0) return kFALSE; + fModuleID = GetModuleNumber(fDDL,fCarlosId); + fChannel=(fData&maskSide)>>26; + fCoord1=(fData&maskAnode)>>18; + fCoord2=(fData&maskTb)>>10; + Int_t sig8bit; + if(fADCEncoded){ + UInt_t code=fData&maskCode; + if (code < 2 || code > 7){ + AliError(Form("Wrong ADC code value %d",code)); + continue; + } + UInt_t adcmask=(1<>3) + (1<