}
//_____________________________________________________________________________
-Int_t AliTRDmcmSim::ProduceRawStreamV2( UInt_t *buf, Int_t maxSize )
+Int_t AliTRDmcmSim::ProduceRawStreamV2( UInt_t *buf, Int_t maxSize, UInt_t iEv )
{
//
// Produce raw data stream from this MCM and put in buf
//
UInt_t x;
- UInt_t iEv = 0;
+ //UInt_t iEv = 0;
Int_t nw = 0; // Number of written words
Int_t of = 0; // Number of overflowed words
Int_t rawVer = fFeeParam->GetRAWversion();
adc = fADCF;
}
- // Produce MCM header
- x = (1<<31) | ((fRobPos * fFeeParam->GetNmcmRob() + fMcmPos) << 24) | ((iEv % 0x100000) << 4) | 0xC;
+ // Produce MCM header : xrrr mmmm eeee eeee eeee eeee eeee 1100
+ // x : 0 before , 1 since 10.2007
+ // r : Readout board position (Alice numbering)
+ // m : MCM posi
+ // e : Event counter from 1
+ //x = (1<<31) | ((fRobPos * fFeeParam->GetNmcmRob() + fMcmPos) << 24) | ((iEv % 0x100000) << 4) | 0xC;
+ x = (1<<31) | (fRobPos << 28) | (fMcmPos << 24) | ((iEv % 0x100000) << 4) | 0xC;
if (nw < maxSize) {
buf[nw++] = x;
//printf("\nMCM header: %X ",x);
for (Int_t iAdc = 0; iAdc < 21; iAdc++ ) {
if( rawVer>= 3 && fZSM1Dim[iAdc] != 0 ) continue; // Zero Suppression, 0 means not suppressed
- aa = !(iAdc & 1) + 2;
+ aa = !(iAdc & 1) + 2; // 3 for the even ADC channel , 2 for the odd ADC channel
for (Int_t iT = 0; iT < fNTimeBin; iT+=3 ) {
a1 = ((iT ) < fNTimeBin ) ? adc[iAdc][iT ] : 0;
a2 = ((iT + 1) < fNTimeBin ) ? adc[iAdc][iT+1] : 0;
break;
}
- delete dtarg;
- delete itarg;
+ delete [] dtarg;
+ delete [] itarg;
+
}
//_____________________________________________________________________________
Int_t u = 0;
AliTRDdigitsManager *digman = new AliTRDdigitsManager();
- digman->ReadDigits(gAlice->GetRunLoader()->GetLoader("TRDLoader")->TreeD());
+ digman->ReadDigits(AliRunLoader::Instance()->GetLoader("TRDLoader")->TreeD());
digman->SetUseDictionaries(kTRUE);
AliTRDfeeParam *feeParam = AliTRDfeeParam::Instance();
}
}
- AliDataLoader *dl = gAlice->GetRunLoader()->GetLoader("TRDLoader")->GetDataLoader("tracklets");
+ AliDataLoader *dl = AliRunLoader::Instance()->GetLoader("TRDLoader")->GetDataLoader("tracklets");
if (!dl) {
AliError("Could not get the tracklets data loader!");
}
}
}
}
+//_______________________________________________________________________________________
+void AliTRDmcmSim::RestoreZeros()
+{
+ //
+ // Restore the zero-suppressed values (set as -1) to the value 0
+ //
+
+ for( Int_t iadc = 1 ; iadc < fNADC-1; iadc++ )
+ {
+ for( Int_t it = 0 ; it < fNTimeBin ; it++ )
+ {
+
+ if(fADCF[iadc][it]==-1) //if is a supressed zero, reset to zero
+ {
+ fADCF[iadc][it]=0;
+ fADCR[iadc][it]=0;
+ }
+ }
+ }
+}