fIsADCEOB(kFALSE),
fSODReading(kFALSE),
fIsMapRead(kFALSE),
- fReadCDH(kTRUE),
+ fReadCDH(kFALSE),
fDeadfaceOffset(-1),
fDeadbeefOffset(-1),
fDataOffset(0),
for(Int_t kl=0; kl<4; kl++) fCPTInput[kl] = 0;
fEvType = fRawReader->GetType();
- if(fPosition==0 && fReadCDH){
- //if(fEvType==7 || fEvType ==8){ //Physics or calibration event
- ReadCDHHeader();
- //}
+ if(fPosition==0){
+ ReadCDHHeader();
+ // Needed to read simulated raw data (temporary solution?)
+ if(!fReadCDH) fReadOutCard=1;
fCurrentCh=0; fCurrScCh=0; fCurrTDCCh=0;fNChannelsOn=0;
// Ch. debug
//printf("\n AliZDCRawStream::Next() - ev. type %d",fEvType);
}
- // Needed to read simulated raw data (temporary solution?)
- else if(fPosition==0 && !fReadCDH && fReadOutCard==-1) fReadOutCard=1;
-
// Ch. debug
//printf("\n AliZDCRawStream::Next() - fBuffer[%d] = %x\n",fPosition, fBuffer);
if((fBuffer & 0x07000000) != 0x06000000){
fRawReader->AddMajorErrorLog(kZDCDataError);
}
- else if((fBuffer & 0x07000000) == 0x06000001){ // Corrupted event!!!
- fIsADCEventGood = kFALSE;
- }
+ //else if((fBuffer & 0x07000000) == 0x06000001){ // Corrupted event!!!
+ // fIsADCEventGood = kFALSE;
+ //}
}
// If the not valid datum isn't followed by the 1st ADC header
else fADCModule = (Int_t) ((fBuffer & 0xf8000000)>>27);
// ************************************ ADC MODULES ************************************
- if(fADCModule>=kFirstADCGeo && fADCModule<=kLastADCGeo){
+ if(fADCModule>=kFirstADCGeo && fADCModule<=kLastADCGeo &&
+ !fIsTriggerHistory && !fIsScHeaderRead && !fIsTriggerScaler){
// *** ADC header
if((fBuffer & 0x07000000) == 0x02000000){
fIsADCHeader = kTRUE;
fADCValue = (fBuffer & 0xfff);
//
//printf(" AliZDCRawStream -> ADC DATUM: mod. %d ch. %d gain %d value %d\n",
- // fADCModule,fADCChannel,fADCGain,fADCValue);
+ //fADCModule,fADCChannel,fADCGain,fADCValue);
// Checking if the channel map for the ADCs has been provided/read
if(fMapADC[0][0]==-1){
break;
}
}
- if(foundMapEntry==kFALSE){
+ if(foundMapEntry==kFALSE && fEvType==7){
AliWarning(Form(" No valid entry in ADC mapping for raw data %d ADCmod. %d ch. %d\n",
fPosition,fADCModule,fADCChannel));
}
// Final checks
- if(foundMapEntry==kTRUE){
+ if(foundMapEntry==kTRUE && fEvType==7){
if(fSector[0]<1 || fSector[0]>5){
AliWarning(Form(" No valid detector assignment: %d",fSector[0]));
fRawReader->AddMajorErrorLog(kInvalidSector);
// *** ADC EOB
else if((fBuffer & 0x07000000) == 0x04000000){
fIsADCEOB = kTRUE;
- printf(" AliZDCRawStream -> EOB --------------------------\n");
+ //printf(" AliZDCRawStream -> ADC EOB --------------------------\n");
}
}//ADC module
// ********************************* ADD ADC *********************************
// *** ADC EOB
else if((fBuffer & 0x07000000) == 0x04000000){
fIsADCEOB = kTRUE;
- //printf(" AliZDCRawStream -> EOB --------------------------\n");
+ //printf(" AliZDCRawStream -> ADD ADC EOB --------------------------\n");
}
}
// ********************************* TDC *********************************
if(fADCModule==kZDCTDCGeo){ // *** ZDC TDC
fIsZDCTDCHeader = kTRUE;
//Ch. debug
- //printf(" AliZDCRawStream -> ZDC TDC: mod.%d\n",fADCModule);
+ //printf(" AliZDCRawStream -> ZDC TDC header: mod.%d\n",fADCModule);
}
else if(fADCModule==kADDTDCGeo){ // *** ADD TDC
fIsADDTDCHeader = kTRUE;
//printf(" AliZDCRawStream -> VME SCALER HEADER: geo %d Nwords %d TrigSource %d TrigNo. %d\n",
// fScGeo,fScNWords,fScTriggerSource,fScTriggerNumber);
}
- else if(!(fBuffer & 0x04000000)){
- fIsScEventGood = kFALSE;
- }
+ // Commented by C.O. & M.G. (23/09/2011)
+ //else if(!(fBuffer & 0x04000000) && fIsScHeaderRead==kFALSE){
+ // fIsScEventGood = kFALSE;
+ //}
}
// *********************************** PATTERN UNIT ***********************************
else if(fADCModule == kPUGeo){
// ********************************** VME SCALER DATA **********************************
// Reading VME scaler data
if(fIsScHeaderRead && fPosition>=fScStartCounter+1){ // *** Scaler word
- fADCModule=kScalerGeo; fIsADCDataWord=kFALSE; fIsScalerWord=kTRUE;
+ fADCModule=kScalerGeo;
+ fIsADCDataWord=kFALSE;
+ fIsScalerWord=kTRUE;
fScEvCounter = fBuffer;
Int_t nWords = (Int_t) (fScNWords);
if(fPosition == fScStartCounter+nWords) fIsScHeaderRead = kFALSE;
//Ch. debug
- //printf(" AliZDCRawStream -> scaler datum %d", fScEvCounter);
+ //printf(" AliZDCRawStream -> scaler datum %x \n", fScEvCounter);
}
// ********************************** ZDC TDC DATA **********************************
// ZDC TDC data
}
}
// Ch. debug
- //printf(" AliZDCRawStream -> Trigger history word %d\n", fPosition-fTrigHistStart);
+ //printf(" AliZDCRawStream -> Trigger history word[%d] %x\n", fPosition, fBuffer);
}
}