nEvPerPad2=fnpc[nDDL][2*row][dil][pad];
if(nEvPerPad1 < 1 ) { mean1 = 4000; sigma1 = 1000; }
+ else
+ {
+ mean1 = fsq[nDDL][2*row-1][dil][pad]*1.0/nEvPerPad1;
+ qs2m1 = fsq2[nDDL][2*row-1][dil][pad]*1.0/nEvPerPad1;
+ qsm21 = TMath::Power(fsq[nDDL][2*row-1][dil][pad]*1.0/nEvPerPad1,2);
+ sigma1 = TMath::Sqrt(TMath::Abs(qs2m1-qsm21));
+ }
+
if(nEvPerPad2 < 1 ) { mean2 = 4000; sigma2 = 1000; }
-
- mean1 = fsq[nDDL][2*row-1][dil][pad]*1.0/nEvPerPad1;
- qs2m1 = fsq2[nDDL][2*row-1][dil][pad]*1.0/nEvPerPad1;
- qsm21 = TMath::Power(fsq[nDDL][2*row-1][dil][pad]*1.0/nEvPerPad1,2);
- sigma1 = TMath::Sqrt(TMath::Abs(qs2m1-qsm21));
-
+ else
+ {
mean2 = fsq[nDDL][2*row][dil][pad]*1.0/nEvPerPad2;
qs2m2 = fsq2[nDDL][2*row][dil][pad]*1.0/nEvPerPad2;
qsm22 = TMath::Power(fsq[nDDL][2*row][dil][pad]*1.0/nEvPerPad2,2);
sigma2 = TMath::Sqrt(TMath::Abs(qs2m2-qsm22));
-
+ }
pped[(row-1)/4]<<Form("%d %3.3lf %3.3lf %3.3lf %3.3lf \n",cnt,mean1,sigma1,mean2,sigma2);cnt++;
}//pad
}//dil
fWord(0),
fZeroSup(kTRUE),
fPos(0x0),
- fiPos(0)
+ fiPos(0),
+ fTurbo(kFALSE)
{
//
// Constructor
fWord(0),
fZeroSup(kTRUE),
fPos(0x0),
- fiPos(0)
+ fiPos(0),
+ fTurbo(kFALSE)
{
//
// Constructor
fPosition=0;
fWord=0;
fZeroSup=0;
-
+ fTurbo=0;
for(Int_t i=0;i<kSumErr;i++) delete [] fNumOfErr[i];
delete [] fNumOfErr;
if (fRawReader) fRawReader->Reset();
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Bool_t AliHMPIDRawStream::Turbo()
+{
+
+ Int_t row,dilogic;UInt_t pad;
+ Int_t cntGlob = fRawReader->GetDataSize()/4;
+ fPosition=0;
+ fNPads=0;
+// Int_t gw=0;
+ for(Int_t i=1;i<cntGlob;i++) {
+ GetWord(1);
+ if (((fWord >> kbit27) & 1)) continue;
+ UInt_t statusControlRow = 0x32a8;
+ UInt_t rowControlWord = fWord >> kbit0 & 0xfbff;
+ if(rowControlWord == statusControlRow) continue;
+
+ row = (fWord >> kbit22) & 0x1f;
+ dilogic = (fWord >> kbit18) & 0xf; //dilogic info in raw word is between bits: 18...21
+
+ pad = (fWord >> kbit12) & 0x3f; //pad info in raw word is between bits: 12...17
+ if(!CheckPad(pad)) continue;
+ Int_t charge = fWord & 0xfff;
+ if(GetPad(fDDLNumber,row,dilogic,pad)<0) continue;
+ fPad[fNPads] = GetPad(fDDLNumber,row,dilogic,pad);
+ fCharge[fNPads] = charge;
+ fNPads++;
+ if(charge==0) fNumOfErr[fDDLNumber][kPedQZero]++;
+ }//word loop
+ //Printf("Size: %i DDL %i row %i dilogic %i pad %i fPos %i fNPads: %i Charge: %d Word %4.4x GoodW: %i",cntGlob,fDDLNumber,row,dilogic,pad,fPosition,fNPads,fCharge[fNPads-1],fWord,gw++);
+ return kTRUE;
+}//Turbo()
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Bool_t AliHMPIDRawStream::Next()
{
// read next DDL raw data from the HMPID raw data stream
DelVars(); //We have to delete the variables initialized in the InitVars before recall IntiVars!!!
InitVars(rawDataSize); //To read the charge and pads we cannot delete before the status return
- status = ReadHMPIDRawData();
+ if(fTurbo==kTRUE) status=Turbo();
+ else status = ReadHMPIDRawData();
if(status) AliDebug(1,Form("Event DDL %i successfully decoded!.",fDDLNumber));
else AliDebug(1,Form("Event DDL %i ERROR in decoding!.",fDDLNumber));
UInt_t GetLDCNumber() const{ return fLDCNumber;} //return the number of LDC actually being decoded
UInt_t GetTimeStamp() const{ return fTimeStamp;} //return the time stamp of the event actually being decoded
-
-
+ void SetTurbo(Bool_t isTurbo){fTurbo=isTurbo;} // Enable/Disable Turbo
+ Bool_t GetTurbo(){ return fTurbo;} // Enable Turbo
+ Bool_t Turbo(); // Read HMPID Raw data without error checks
Bool_t ReadHMPIDRawData(); // Read HMPID Raw data
Bool_t ReadSegment(Int_t &cntSegment); // Read Segment
Bool_t ReadRow(Int_t &cntRow); // Read Row
Bool_t fZeroSup; // set if zero suppression is applied
Int_t *fPos; // for debug purposes
Int_t fiPos; // counter for debug
+ Bool_t fTurbo; // kTRUE = Turbo decoding is called. DEFAULT: kFALSE = normal decoding is called
ClassDef(AliHMPIDRawStream, 2) // base class for reading HMPID raw digits
};
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ldcId=(unsigned long)event->eventLdcId;
if(iEvtNcal==firstEvt && pCal->GetWritePads()==kTRUE)
{
- if(pCal->GetLargePads()==kFALSE) pCal->InitFile((Int_t)ldcId); //The number for iEvtNcal should be the same as for the first value
- else pCal->InitFile((Int_t)runNum); //The number for iEvtNcal should be the same as for the first value
+ if(pCal->GetLargePads()==kFALSE) pCal->InitFile((Int_t)ldcId); //The number for iEvtNcal should be the same as for the first value
+ else pCal->InitFile((Int_t)runNum); //The number for iEvtNcal should be the same as for the first value
}
iEvtNcal++;
AliRawReader *reader = new AliRawReaderDate((void*)event);
- AliHMPIDRawStream stream(reader);
+ AliHMPIDRawStream stream(reader);stream.SetTurbo(kTRUE); //raw data decoding without error checks SetTurbo(kTRUE)
while(stream.Next())
{
for(Int_t iPad=0;iPad<stream.GetNPads();iPad++) {
/* Calculate pedestal for the given ddl, if there is no ddl go t next */
if(!pCal->CalcPedestal(nDDL,Form("%sHmpidPedDdl%02i.txt",sDaOut.Data(),nDDL),iEvtNcal)) continue;
/* to create pedestal file as Paolo uncomment the line */
-// if(!pCal->CalcPedestalPaolo(nDDL,Form("%sHmpidPedDdl%02i.txt",sDaOut.Data(),nDDL),iEvtNcal)) continue;
+ //if(!pCal->CalcPedestalPaolo(nDDL,Form("%sHmpidPedDdl%02i.txt",sDaOut.Data(),nDDL),iEvtNcal)) continue;
if(!pCal->WriteErrors(nDDL,Form("%sHmpidErrorsDdl%02i.txt",sDaOut.Data(),nDDL),iEvtNcal)) continue;
/* store the result file on FES */