continue;
}
- Int_t iCarlos =((AliITSRawStreamSDD*)input)->GetCarlosId();
- Int_t iSide = ((AliITSRawStreamSDD*)input)->GetChannel();
+ Int_t iCarlos =input->GetCarlosId();
+ Int_t iSide = input->GetChannel();
Int_t iHybrid=iCarlos*2+iSide;
if (input->IsCompletedModule()) {
// when all data from a module was read, search for clusters
rd->Reset();
AliITSRawStreamSDD s(rd);
+ s.SetDecompressAmbra(kFALSE);
while(s.Next()){
- if(rd->GetDDLID()!=oldddl){
- word=8<<28;
- word+=rd->GetDDLID();
- fprintf(outtxt,"%08X\n",word);
- oldddl=rd->GetDDLID();
- }
if(s.IsCompletedModule()==kFALSE){
word=s.GetCarlosId()<<27;
word+=s.GetChannel()<<26;
word+=s.GetCoord1()<<18;
word+=s.GetCoord2()<<10;
- word+=s.GetSignal();
+ word+=s.GetEightBitSignal();
fprintf(outtxt,"%08X\n",word);
}
if(s.IsCompletedModule()==kTRUE){
siz+=32;
UInt_t word=0;
AliITSRawStreamSDD s(fRawReader);
+ s.SetDecompressAmbra(kFALSE);
Int_t mask1=0xFF000000;
Int_t mask2=0x00FF0000;
Int_t mask3=0x0000FF00;
word+=s.GetChannel()<<26;
word+=s.GetCoord1()<<18;
word+=s.GetCoord2()<<10;
- word+=s.GetSignal();
+ word+=s.GetEightBitSignal();
if(siz+4<fSizeInMemory){
*(fPointerToData)=(word&mask1)>>24;
++fPointerToData;
digs = (AliITSdigit*)ITSdigits->UncheckedAt(digit);
Int_t iz=digs->GetCoord1(); // Anode
Int_t ix=digs->GetCoord2(); // Time
- Int_t is=digs->GetSignal(); // ADC Signal - 10 bit
+ Int_t is=digs->GetCompressedSignal(); // ADC Signal - 8 bit
dataWord=mod<<27;
Int_t sid=0;
if(iz>=256){
virtual void SetZeroSuppLowThreshold(Int_t /*iMod*/, Int_t /*iSid*/, Int_t /*th*/) {
AliError("This method must be implemented in a derived class");
};
+ virtual Int_t GetCarlosId() const {
+ AliError("This method must be implemented in a derived class");
+ return -1;
+ };
+ virtual Int_t GetChannel() const {
+ AliError("This method must be implemented in a derived class");
+ return -1;
+ };
protected :
fCarlosId(-1),
fChannel(0),
fJitter(0),
-fResetSkip(0)
+fResetSkip(0),
+fEightBitSignal(0),
+fDecompressAmbra(kTRUE)
{
// create an object to read ITS SDD raw digits
fDDLModuleMap=new AliITSDDLModuleMapSDD();
fCarlosId(-1),
fChannel(0),
fJitter(0),
-fResetSkip(0)
+fResetSkip(0),
+fEightBitSignal(0),
+fDecompressAmbra(kTRUE)
{
// copy constructor
AliError("Copy constructor should not be used.");
fTimeBin[fCarlosId][fChannel] = 0;
fAnode[fCarlosId][fChannel]++;
} else { // ADC signal data
- fSignal = DecompAmbra(data + (1 << fChannelCode[fCarlosId][fChannel]) + fLowThresholdArray[fModuleID-kSPDModules][fChannel]);
+ fEightBitSignal=data + (1 << fChannelCode[fCarlosId][fChannel]);
+ if(fDecompressAmbra) fSignal = DecompAmbra(fEightBitSignal + fLowThresholdArray[fModuleID-kSPDModules][fChannel]);
fCoord1 = fAnode[fCarlosId][fChannel];
fCoord2 = fTimeBin[fCarlosId][fChannel];
fTimeBin[fCarlosId][fChannel]++;
virtual Int_t GetAnode() const {return fCoord1;}
virtual Int_t GetTime() const {return fCoord2;}
virtual Int_t GetChannel() const {return fChannel;}
+ virtual Int_t GetEightBitSignal() const {return fEightBitSignal;}
virtual Int_t ReadJitter() const {return 0;}
virtual Int_t GetCarlosId() const {return fCarlosId;}
virtual Int_t GetEventId() const {return fEventId;}
+ virtual void SetDecompressAmbra(Bool_t deco=kTRUE){
+ fDecompressAmbra=deco;
+ }
virtual void SetDDLModuleMap(AliITSDDLModuleMapSDD* ddlsdd){fDDLModuleMap->SetDDLMap(ddlsdd);}
virtual void SetLowCarlosThreshold(Int_t th, Int_t i)
{fLowThreshold[i]=th;}
UInt_t fIFifoWord[kFifoWords]; // FIFO words
Int_t fICountFoot[kModulesPerDDL]; // counter for carlos footer words
Int_t fResetSkip; //if it is 0, the ResetSkip Funcion is called
- ClassDef(AliITSRawStreamSDD, 11) // class for reading ITS SDD raw digits
+ Int_t fEightBitSignal; // signal at 8 bit
+ Bool_t fDecompressAmbra; //flag to switch off decompression
+
+ ClassDef(AliITSRawStreamSDD, 12) // class for reading ITS SDD raw digits
};
#endif
}
+//______________________________________________________________________
+Int_t AliITSRawStreamSDDCompressed::DecompAmbra(Int_t value) const
+{
+ // AMBRA decompression (from 8 to 10 bit)
+
+ if ((value & 0x80) == 0) {
+ return value & 0x7f;
+ } else if ((value & 0x40) == 0) {
+ return 0x081 + ((value & 0x3f) << 1);
+ } else if ((value & 0x20) == 0) {
+ return 0x104 + ((value & 0x1f) << 3);
+ } else {
+ return 0x208 + ((value & 0x1f) << 4);
+ }
+
+}
//______________________________________________________________________
Bool_t AliITSRawStreamSDDCompressed::Next()
{
fChannel=(fData&maskSide)>>26;
fCoord1=(fData&maskAnode)>>18;
fCoord2=(fData&maskTb)>>10;
- fSignal=fData&maskADC;
- fSignal+=fLowThresholdArray[fModuleID-kSPDModules][fChannel];
+ Int_t sig8bit=fData&maskADC;
+ sig8bit+=fLowThresholdArray[fModuleID-kSPDModules][fChannel];
+ fSignal=DecompAmbra(sig8bit);
fCompletedModule=kFALSE;
return kTRUE;
}
};
protected:
-
+ virtual Int_t DecompAmbra(Int_t value) const;
AliITSDDLModuleMapSDD* fDDLModuleMap; // mapping DDL/module -> module number
UInt_t fData; // data read for file
Int_t fCarlosId; // carlos ID