From cb9b108e24a1d7363fd413dffc9baaf67a657d5e Mon Sep 17 00:00:00 2001 From: dibari Date: Thu, 17 Apr 2008 07:29:59 +0000 Subject: [PATCH] The turbo version of decoding now as option for DA. --- HMPID/AliHMPIDCalib.cxx | 18 +++++++++------- HMPID/AliHMPIDRawStream.cxx | 42 +++++++++++++++++++++++++++++++++---- HMPID/AliHMPIDRawStream.h | 6 ++++-- HMPID/HMPIDda.cxx | 8 +++---- 4 files changed, 57 insertions(+), 17 deletions(-) diff --git a/HMPID/AliHMPIDCalib.cxx b/HMPID/AliHMPIDCalib.cxx index 85b6cccaf01..abbef796dc7 100644 --- a/HMPID/AliHMPIDCalib.cxx +++ b/HMPID/AliHMPIDCalib.cxx @@ -577,18 +577,22 @@ Bool_t AliHMPIDCalib::CalcPedestalPaolo(Int_t nDDL, Char_t* /*name*/, Int_t nEv) 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]<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> 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 @@ -179,7 +212,8 @@ Bool_t AliHMPIDRawStream::Next() 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)); diff --git a/HMPID/AliHMPIDRawStream.h b/HMPID/AliHMPIDRawStream.h index 7d099077ce0..c3aef373363 100644 --- a/HMPID/AliHMPIDRawStream.h +++ b/HMPID/AliHMPIDRawStream.h @@ -54,8 +54,9 @@ class AliHMPIDRawStream: public TObject { 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 @@ -127,6 +128,7 @@ enum Ebits {kbit0,kbit1 , kbit2, kbit3, kbit4, kbit5, kbit6, kbit7, kbit8, 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 }; //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/HMPID/HMPIDda.cxx b/HMPID/HMPIDda.cxx index beffd736d18..cbc7b03be1b 100644 --- a/HMPID/HMPIDda.cxx +++ b/HMPID/HMPIDda.cxx @@ -152,13 +152,13 @@ int main(int argc, char **argv){ 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;iPadCalcPedestal(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 */ -- 2.43.5