From abf601868fb3bd4208a26c275649624c3985da38 Mon Sep 17 00:00:00 2001 From: coppedis Date: Wed, 12 Jul 2006 10:31:50 +0000 Subject: [PATCH] Digitizer and raw data decoding updated --- ZDC/AliZDC.cxx | 65 +++++++++++++++++++------------ ZDC/AliZDCDigit.cxx | 8 +--- ZDC/AliZDCDigit.h | 14 +++---- ZDC/AliZDCDigitizer.cxx | 70 ++++++++++++++++++++------------- ZDC/AliZDCDigitizer.h | 7 ++-- ZDC/AliZDCRawStream.cxx | 86 +++++++++++++++++++++++++---------------- ZDC/AliZDCRawStream.h | 4 +- 7 files changed, 153 insertions(+), 101 deletions(-) diff --git a/ZDC/AliZDC.cxx b/ZDC/AliZDC.cxx index fcc243848a4..05e75cfaebb 100644 --- a/ZDC/AliZDC.cxx +++ b/ZDC/AliZDC.cxx @@ -338,9 +338,10 @@ void AliZDC::Digits2Raw() { // Convert ZDC digits to raw data - // preliminary format: 12 interger values (ZNC, ZNQ1-4, ZPC, ZPQ1-4, ZEM1,2) + // Format: 22 interger values -> ZN1 (C+Q1-4), ZP1 (C+Q1-4), ZEM1, 2, ZN (C+Q1-4), ZP2 (C+Q1-4)) // For the CAEN module V965 we have an header, the Data Words and an End Of Block - const int knADCData1=24, knADCData2=20; + // 24 channels read on 1st ADC module, 20 channels read on 2nd ADC module + const int knADCData1=24, knADCData2=20; UInt_t lADCHeader1; UInt_t lADCData1[knADCData1]; // @@ -356,6 +357,9 @@ void AliZDC::Digits2Raw() TTree* treeD = fLoader->TreeD(); if (!treeD) return; treeD->SetBranchAddress("ZDC", &pdigit); + //printf("\t AliZDC::Digits2raw -> TreeD has %d entries\n",(Int_t) treeD->GetEntries()); + //digit.Print(""); // Ch. debug + // Fill data array // ADC header @@ -366,11 +370,11 @@ void AliZDC::Digits2Raw() lADCHeader1 = lADCHeaderGEO << 27 | 0x1 << 25 | lADCHeaderCRATE << 16 | lADCHeaderCNT1 << 8 ; -// + // lADCHeader2 = lADCHeaderGEO << 27 | 0x1 << 25 | lADCHeaderCRATE << 16 | lADCHeaderCNT2 << 8 ; - //printf("lADCHeader = %d\n",lADCHeader); + //printf("\t lADCHeader1 = %x, lADCHeader2 = %x\n",lADCHeader1, lADCHeader2); // ADC data word UInt_t lADCDataGEO = lADCHeaderGEO; @@ -389,35 +393,46 @@ void AliZDC::Digits2Raw() UInt_t lADCDataChannel = 0; // loop over digits - for (Int_t iDigit = 0; iDigit < treeD->GetEntries(); iDigit++) { + for (Int_t iDigit = 0; iDigitGetEntries(); iDigit++) { treeD->GetEntry(iDigit); if (!pdigit) continue; - + //ADC data Int_t index1 = 0, index2 = 0; + // ADC #1 (ZN1, ZP1, ZEM1,2) if(digit.GetSector(0)==1 || digit.GetSector(0)==2 || digit.GetSector(0)==3){ if(digit.GetSector(0)==1 || digit.GetSector(0)==2){ - index1 = (digit.GetSector(0)-1) + digit.GetSector(1)*4; + index1 = (digit.GetSector(0)-1) + digit.GetSector(1)*4; // ZN1 or ZP1 lADCDataChannel = (digit.GetSector(0)-1)*8 + digit.GetSector(1); } - else if(digit.GetSector(0)==3){ - index1 = 19 + digit.GetSector(1); - lADCDataChannel = 5 + digit.GetSector(1)*8; + else if(digit.GetSector(0)==3){ // ZEM 1,2 + index1 = 20 + (digit.GetSector(1)-1); + lADCDataChannel = 5 + (digit.GetSector(1)-1)*8; } - lADCDataValue1[index1] = digit.GetADCValue(0); - if (lADCDataValue1[index1] > 2047) lADCDataOvFlw1[index1] = 1; - lADCDataValue1[index1+2] = digit.GetADCValue(1); - if (lADCDataValue1[index1+2] > 2047) lADCDataOvFlw1[index1+2] = 1; + // + /*printf("\t AliZDC::Digits2raw -> det %d, quad %d, index = %d, ADCch = %d\n", + digit.GetSector(0),digit.GetSector(1),index1,lADCDataChannel);// Ch. debug + */ + // + lADCDataValue1[index1] = digit.GetADCValue(0); // High gain ADC ch. + if(lADCDataValue1[index1] > 2047) lADCDataOvFlw1[index1] = 1; + lADCDataValue1[index1+2] = digit.GetADCValue(1); // Low gain ADC ch. + if(lADCDataValue1[index1+2] > 2047) lADCDataOvFlw1[index1+2] = 1; - lADCData1[index1] = lADCDataGEO << 27 | lADCDataChannel << 17 | + lADCData1[index1] = lADCDataGEO << 27 | lADCDataChannel << 17 | lADCDataOvFlw1[index1] << 12 | (lADCDataValue1[index1] & 0xfff); lADCData1[index1+2] = lADCDataGEO << 27 | lADCDataChannel << 17 | 0x1 << 16 | lADCDataOvFlw1[index1+2] << 12 | (lADCDataValue1[index1+2] & 0xfff); } + // ADC #2 (ZN2, ZP2) else if(digit.GetSector(0)==4 || digit.GetSector(0)==5){ - index2 = (digit.GetSector(0)-4) + digit.GetSector(1)*4; + index2 = (digit.GetSector(0)-4) + digit.GetSector(1)*4; // ZN2 or ZP2 lADCDataChannel = (digit.GetSector(0)-4)*8 + digit.GetSector(1); - + // + /*printf("\t AliZDC::Digits2raw -> det %d, quad %d, index = %d, ADCch = %d\n", + digit.GetSector(0),digit.GetSector(1),index1,lADCDataChannel); // Ch. debug + */ + // lADCDataValue2[index2] = digit.GetADCValue(0); if (lADCDataValue2[index2] > 2047) lADCDataOvFlw2[index2] = 1; lADCDataValue2[index2+2] = digit.GetADCValue(1); @@ -428,12 +443,12 @@ void AliZDC::Digits2Raw() lADCData2[index2+2] = lADCDataGEO << 27 | lADCDataChannel << 17 | 0x1 << 16 | lADCDataOvFlw2[index2+2] << 12 | (lADCDataValue2[index2+2] & 0xfff); } - if ((index1 < 0) || (index1 >= 22)) { + if((index1<0) || (index1>23)) { Error("Digits2Raw", "sector[0] = %d, sector[1] = %d", digit.GetSector(0), digit.GetSector(1)); continue; } - if ((index2 < 0) || (index2 >= 18)) { + if((index2<0) || (index2>19)) { Error("Digits2Raw", "sector[0] = %d, sector[1] = %d", digit.GetSector(0), digit.GetSector(1)); continue; @@ -441,8 +456,8 @@ void AliZDC::Digits2Raw() } - //for (Int_t i=0;i<24;i++)printf("ADCData1[%d] = %d\n",i,lADCData1[i]); - //for (Int_t i=0;i<20;i++)printf("ADCData2[%d] = %d\n",i,lADCData2[i]); + //for(Int_t i=0;i<24;i++) printf("\t ADCData1[%d] = %x\n",i,lADCData1[i]); + //for(Int_t i=0;i<20;i++) printf("\t ADCData2[%d] = %x\n",i,lADCData2[i]); // End of Block UInt_t lADCEndBlockGEO = lADCHeaderGEO; @@ -450,7 +465,7 @@ void AliZDC::Digits2Raw() lADCEndBlock = lADCEndBlockGEO << 27 | 0x1 << 26 | lADCEndBlockEvCount; - //printf("ADCEndBlock = %d\n",lADCEndBlock); + //printf("\t ADCEndBlock = %d\n",lADCEndBlock); // open the output file @@ -466,8 +481,10 @@ void AliZDC::Digits2Raw() AliRawDataHeader header; header.fSize = sizeof(header) + sizeof(lADCHeader1) + sizeof(lADCData1) + sizeof(lADCEndBlock)+ sizeof(lADCHeader2) + sizeof(lADCData2) + sizeof(lADCEndBlock); - //printf("sizeof header = %d, ADCHeader = %d, ADCData = %d, ADCEndBlock = %d\n", - // sizeof(header),sizeof(lADCHeader),sizeof(lADCData),sizeof(lADCEndBlock)); + /*printf("sizeof header = %d, ADCHeader1 = %d, ADCData1 = %d, ADCEndBlock = %d\n", + sizeof(header),sizeof(lADCHeader1),sizeof(lADCData1),sizeof(lADCEndBlock)); + printf("sizeof header = %d, ADCHeader2 = %d, ADCData2 = %d, ADCEndBlock = %d\n", + sizeof(header),sizeof(lADCHeader2),sizeof(lADCData2),sizeof(lADCEndBlock));*/ header.SetAttribute(0); // valid data file.write((char*)(&header), sizeof(header)); diff --git a/ZDC/AliZDCDigit.cxx b/ZDC/AliZDCDigit.cxx index fa500347d38..b72d437e955 100644 --- a/ZDC/AliZDCDigit.cxx +++ b/ZDC/AliZDCDigit.cxx @@ -43,12 +43,8 @@ AliZDCDigit::AliZDCDigit(Int_t *Sector, Int_t *ADCValue) // Constructor Int_t i; - for(i=0; i<2; i++) { - fSector[i] = Sector[i]; - } - for(i=0; i<2; i++) { - fADCValue[i] = ADCValue[i]; - } + for(i=0; i<2; i++) fSector[i] = Sector[i]; + for(i=0; i<2; i++) fADCValue[i] = ADCValue[i]; } //____________________________________________________________________________ diff --git a/ZDC/AliZDCDigit.h b/ZDC/AliZDCDigit.h index ea61446c9ff..17c297cd9c6 100644 --- a/ZDC/AliZDCDigit.h +++ b/ZDC/AliZDCDigit.h @@ -24,7 +24,7 @@ class AliZDCDigit : public TObject { // Getters Int_t GetSector(Int_t i) {return fSector[i];} - Int_t GetADCValue(Int_t i) {return fADCValue[i];} + Int_t GetADCValue(Int_t i) {return fADCValue[i];} // Operators // Two digits are equal if they refers to the detector @@ -39,18 +39,18 @@ class AliZDCDigit : public TObject { for(Int_t i = 0; i < 2; i++) fADCValue[i] += digit.fADCValue[i]; return *this ; } + + // Print method + virtual void Print(Option_t *) const { + printf("\t AliZDCDigit -> Detector %d Quadrant %d: ADC HighGain= %d ADC LowGain= %d\n ", + fSector[0], fSector[1], fADCValue[0], fADCValue[1]); + } protected: //Data members Int_t fSector[2]; // Detector and tower in which light is produced Int_t fADCValue[2]; // ADC channel value (0 = high gain, 1 = low gain) - - // Print method - virtual void Print(Option_t *) const { - printf(" -> DIGIT: Detector = %d Quadrant = %d ADCCh high gain= %d ADCCh low gain= %d\n ", - fSector[0], fSector[1], fADCValue[0], fADCValue[1]); - } ClassDef(AliZDCDigit,4) // Digits in ZDC diff --git a/ZDC/AliZDCDigitizer.cxx b/ZDC/AliZDCDigitizer.cxx index 9f1ec32b81f..8b1905aeca4 100644 --- a/ZDC/AliZDCDigitizer.cxx +++ b/ZDC/AliZDCDigitizer.cxx @@ -60,7 +60,7 @@ AliZDCDigitizer::AliZDCDigitizer() AliZDCDigitizer::AliZDCDigitizer(AliRunDigitizer* manager): AliDigitizer(manager) { - + fIsCalibration=0; //By default the simulation doesn't create calib. data // Get calibration data fCalibData = GetCalibData(); @@ -109,7 +109,7 @@ void AliZDCDigitizer::Exec(Option_t* /*option*/) // --- pm[4][...] = light in ZP left [C, Q1, Q2, Q3, Q4] ->NEW! for (Int_t iSector1=0; iSector1<5; iSector1++) - for (Int_t iSector2=0; iSector2<5; iSector2++) { + for (Int_t iSector2=0; iSector2<5; iSector2++){ pm[iSector1][iSector2] = 0; } @@ -119,7 +119,7 @@ void AliZDCDigitizer::Exec(Option_t* /*option*/) Int_t specP = 0; // loop over input streams - for (Int_t iInput = 0; iInputGetNinputs(); iInput++) { + for (Int_t iInput = 0; iInputGetNinputs(); iInput++){ // get run loader and ZDC loader AliRunLoader* runLoader = @@ -136,11 +136,11 @@ void AliZDCDigitizer::Exec(Option_t* /*option*/) treeS->SetBranchAddress("ZDC", &psdigit); // loop over sdigits - for (Int_t iSDigit=0; iSDigitGetEntries(); iSDigit++) { + for (Int_t iSDigit=0; iSDigitGetEntries(); iSDigit++){ treeS->GetEntry(iSDigit); // if (!psdigit) continue; - if ((sdigit.GetSector(1) < 0) || (sdigit.GetSector(1) > 4)) { + if ((sdigit.GetSector(1) < 0) || (sdigit.GetSector(1) > 4)){ AliError(Form("\nsector[0] = %d, sector[1] = %d\n", sdigit.GetSector(0), sdigit.GetSector(1))); continue; @@ -150,7 +150,7 @@ void AliZDCDigitizer::Exec(Option_t* /*option*/) /*printf("\n\t Detector %d, Tower %d -> pm[%d][%d] = %.0f \n", sdigit.GetSector(0), sdigit.GetSector(1),sdigit.GetSector(0)-1, sdigit.GetSector(1), pm[sdigit.GetSector(0)-1][sdigit.GetSector(1)]); // Chiara debugging! - */ + */ } loader->UnloadSDigits(); @@ -203,18 +203,21 @@ void AliZDCDigitizer::Exec(Option_t* /*option*/) treeD->Branch("ZDC", "AliZDCDigit", &pdigit, kBufferSize); // Create digits + if(fIsCalibration!=0) printf("\t **** AliZDCDigitizer -> Creating calibration data (pedestals)\n"); Int_t sector[2], sectorL[2]; Int_t digi[2], digiL[2]; - for (sector[0]=1; sector[0]<=3; sector[0]++) - for (sector[1]=0; sector[1]<5; sector[1]++) { - if ((sector[0]==3) && ((sector[1]<1) || (sector[1]>2))) continue; + for(sector[0]=1; sector[0]<=3; sector[0]++){ + for(sector[1]=0; sector[1]<5; sector[1]++){ + if((sector[0]==3) && ((sector[1]<1) || (sector[1]>2))) continue; for (Int_t res=0; res<2; res++){ - digi[res] = Phe2ADCch(sector[0], sector[1], pm[sector[0]-1][sector[1]], res) + digi[res] = Phe2ADCch(sector[0], sector[1], pm[sector[0]-1][sector[1]], res) + Pedestal(sector[0], sector[1], res); } - //printf("\t DIGIT added -> det = %d, quad = %d - digi[0,1] = [%d, %d]\n", - // sector[0], sector[1], digi[0], digi[1]); // Chiara debugging! - new(pdigit) AliZDCDigit(sector, digi); + /*printf("\t DIGIT added -> det = %d, quad = %d - digi[0,1] = [%d, %d]\n", + sector[0], sector[1], digi[0], digi[1]); // Chiara debugging! + */ + // + new(pdigit) AliZDCDigit(sector, digi); treeD->Fill(); // // --- Adding digits for 2nd ZDC set (left side w.r.t. IP) --- @@ -226,14 +229,17 @@ void AliZDCDigitizer::Exec(Option_t* /*option*/) digiL[res] = Phe2ADCch(sectorL[0], sectorL[1], pm[sector[0]-1][sector[1]], res) + Pedestal(sectorL[0], sectorL[1], res); } - //printf("\t DIGIT added -> det = %d, quad = %d - digi[0,1] = [%d, %d]\n", - // sectorL[0], sectorL[1], digiL[0], digiL[1]); // Chiara debugging! - new(pdigit) AliZDCDigit(sectorL, digiL); + /*printf("\t DIGIT added -> det = %d, quad = %d - digi[0,1] = [%d, %d]\n", + sectorL[0], sectorL[1], digiL[0], digiL[1]); // Chiara debugging! + */ + // + new(pdigit) AliZDCDigit(sectorL, digiL); + treeD->Fill(); } // - treeD->Fill(); + //printf("\t AliZDCDigitizer -> TreeD has %d entries\n",(Int_t) treeD->GetEntries()); } - + } // write the output tree loader->WriteDigits("OVERWRITE"); loader->UnloadDigits(); @@ -356,19 +362,29 @@ Int_t AliZDCDigitizer::Pedestal(Int_t Det, Int_t Quad, Int_t Res) const { // Returns a pedestal for detector det, PM quad, channel with res. // - Float_t meanPed; - if(Det != 3) meanPed = fCalibData->GetMeanPed(10*(Det-1)+Quad+5*Res); - else meanPed = fCalibData->GetMeanPed(10*(Det-1)+Quad+1*Res); + Float_t PedValue; - //printf("\t Pedestal -> det = %d, quad = %d, res = %d - Ped[%d] = %d\n", - // Det, Quad, Res,10*(Det-1)+Quad+5*Res,(Int_t) meanPed); // Chiara debugging! + // Normal run + if(fIsCalibration == 0){ + Float_t meanPed, Pedwidth; + Int_t index=0; + if(Det==1|| Det==2) index = 10*(Det-1)+Quad+5*Res; // ZN1, ZP1 + else if(Det==3) index = 10*(Det-1)+(Quad-1)+Res; // ZEM + else if(Det==4|| Det==5) index = 10*(Det-2)+Quad+5*Res+4; // ZN2, ZP2 + meanPed = fCalibData->GetMeanPed(index); + Pedwidth = fCalibData->GetMeanPedWidth(index); + PedValue = gRandom->Gaus(meanPed,Pedwidth); + // + /*printf("\t Pedestal -> det = %d, quad = %d, res = %d - Ped[%d] = %d\n", + Det, Quad, index,(Int_t) PedValue); // Chiara debugging! + */ + } // To create calibration object - /*Float_t meanPed; - meanPed = gRandom->Gaus((40.+10.*gRandom->Rndm()),5.); - */ + else PedValue = gRandom->Gaus((40.+10.*gRandom->Rndm()),5.); + - return (Int_t) meanPed; + return (Int_t) PedValue; } //_____________________________________________________________________________ diff --git a/ZDC/AliZDCDigitizer.h b/ZDC/AliZDCDigitizer.h index 2a61c7c76ae..31ff644809d 100644 --- a/ZDC/AliZDCDigitizer.h +++ b/ZDC/AliZDCDigitizer.h @@ -38,11 +38,11 @@ public: {return fPMGain[det][pmDet];} // Conversion factor from charge to ADC channels // F = 1.6E-19 / Resolution [Coulomb/ch] - void SetADCRes(Int_t *adcRes) + void SetADCRes(Int_t *adcRes) {for (Int_t i=0;i<2;i++) fADCRes[i] = adcRes[i];} // Two conversion factor are needed for ADC CAEN V965 - {for (Int_t i=0;i<2;i++) fADCRes[i] = adcRes[i];} Float_t GetADCRes(Int_t i) const {return fADCRes[i];} + void SetCalibrationOn() {fIsCalibration=1;} AliCDBStorage *SetStorage(const char* uri); AliZDCCalibData *GetCalibData() const; @@ -59,8 +59,9 @@ private: Float_t fPMGain[6][5]; // PM gain Float_t fADCRes[2]; // ADC conversion factors + Int_t fIsCalibration; // !=0 if simulation creates calibration data AliZDCCalibData *fCalibData; //! calibration data - ClassDef(AliZDCDigitizer, 3) // digitizer for ZDC + ClassDef(AliZDCDigitizer, 5) // digitizer for ZDC }; #endif diff --git a/ZDC/AliZDCRawStream.cxx b/ZDC/AliZDCRawStream.cxx index 52099f55241..09ac2bfaa21 100644 --- a/ZDC/AliZDCRawStream.cxx +++ b/ZDC/AliZDCRawStream.cxx @@ -37,10 +37,11 @@ AliZDCRawStream::AliZDCRawStream(AliRawReader* rawReader) : fRawReader(rawReader), fADCValue(-1) { -// create an object to read ZDC raw digits + // Create an object to read ZDC raw digits - fSector[0] = 1; + fSector[0] = 0; fSector[1] = -1; + fADCModule = 0; fRawReader->Select("ZDC"); } @@ -49,8 +50,7 @@ AliZDCRawStream::AliZDCRawStream(const AliZDCRawStream& stream) : TObject(stream), fADCValue(-1) { -// copy constructor - + // Copy constructor Fatal("AliZDCRawStream", "copy constructor not implemented"); } @@ -58,8 +58,7 @@ AliZDCRawStream::AliZDCRawStream(const AliZDCRawStream& stream) : AliZDCRawStream& AliZDCRawStream::operator = (const AliZDCRawStream& /* stream */) { -// assignment operator - + // Assignment operator Fatal("operator =", "assignment operator not implemented"); return *this; } @@ -67,7 +66,7 @@ AliZDCRawStream& AliZDCRawStream::operator = (const AliZDCRawStream& //_____________________________________________________________________________ AliZDCRawStream::~AliZDCRawStream() { -// destructor +// Destructor } @@ -75,43 +74,64 @@ AliZDCRawStream::~AliZDCRawStream() //_____________________________________________________________________________ Bool_t AliZDCRawStream::Next() { -// read the next raw digit -// returns kFALSE if there is no digit left + // Read the next raw digit + // Returns kFALSE if there is no digit left - if (!fRawReader->ReadNextInt((UInt_t&) fRawADC)) return kFALSE; + if(!fRawReader->ReadNextInt((UInt_t&) fRawADC)) return kFALSE; fIsADCDataWord = kFALSE; //ADC Header - if (fRawADC & 0x2000000) { - //printf("This is the ADC Header\n"); - //printf("%d data words will follow \n",2*((fRawADC & 0x3f00) >> 8)); - } - //ADC EOB - else if (fRawADC & 0x4000000) { - //printf("This is the ADC End Of Block\n"); - //printf("This was event number %d\n",(fRawADC & 0xffffff)); + if(fRawADC & 0x2000000){ + if(((fRawADC & 0x3f00) >> 8) == 24) fADCModule=1; //fRawADC=2001800 -> 24 words -> 1st ADC module + else if(((fRawADC & 0x3f00) >> 8) == 20) fADCModule=2; //fRawADC=2001400 -> 20 words -> 2nd ADC module + // + //printf(" **** This is the ADC Header - %d data words will follow \n",((fRawADC & 0x3f00) >> 8)); + //printf(" fRawADC = %x, fADCModule = %d\n",fRawADC, fADCModule); + } + else if((fRawADC & 0x4000000) || (fRawADC & 0x3000000)){ + fSector[0] = 0; + //ADC EOB + /*if(fRawADC & 0x4000000){ + printf(" **** This is the ADC End Of Block - event number %d\n",(fRawADC & 0xffffff)); + }*/ } - else //ADC Data Words - { - //printf("This is an ADC Data Word\n"); - //printf("Channel %d range %d\n",(fRawADC & 0x1e0000) >> 17, (fRawADC & 0x10000) >> 16); - //if(fRawADC & 0x1000) printf("Data = overflow\n"); + else{ + //printf("This is an ADC Data Word -> channel %d range %d\n",(fRawADC & 0x1e0000) >> 17, (fRawADC & 0x10000) >> 16); + if(fRawADC & 0x1000) printf("Data overflow\n"); + if(fRawADC & 0x2000) printf("Data underflow\n"); + // fADCGain = (fRawADC & 0x10000) >> 16; fADCValue = (fRawADC & 0xfff); fIsADCDataWord = kTRUE; - + // Int_t vADCChannel = (fRawADC & 0x1e0000) >> 17; - if (vADCChannel >= 0 && vADCChannel <= 4) { - fSector[0] = 1; - fSector[1] = vADCChannel; - } else if (vADCChannel >= 8 && vADCChannel <= 12) { - fSector[0] = 2; - fSector[1] = vADCChannel-8; - } else if (vADCChannel == 5 || vADCChannel == 13){ - fSector[0] = 3; - fSector[1] = (vADCChannel-5)/8; + if(fADCModule==1){ //1st ADC module + if(vADCChannel >= 0 && vADCChannel <= 4){ + fSector[0] = 1; + fSector[1] = vADCChannel; + } + else if(vADCChannel >= 8 && vADCChannel <= 12){ + fSector[0] = 2; + fSector[1] = vADCChannel-8; + } + else if(vADCChannel == 5 || vADCChannel == 13){ + fSector[0] = 3; + fSector[1] = (vADCChannel-5)/8; + } + } + else if(fADCModule==2){ //2nd ADC module + if(vADCChannel >= 0 && vADCChannel <= 4){ + fSector[0] = 4; + fSector[1] = vADCChannel; + } + else if(vADCChannel >= 8 && vADCChannel <= 12){ + fSector[0] = 5; + fSector[1] = vADCChannel-8; + } } + else printf("\t AliZDCRawStreamer -> ERROR! No valid ADC module!\n"); + } return kTRUE; } diff --git a/ZDC/AliZDCRawStream.h b/ZDC/AliZDCRawStream.h index d7d6f17042a..257a21e2ec3 100644 --- a/ZDC/AliZDCRawStream.h +++ b/ZDC/AliZDCRawStream.h @@ -24,6 +24,7 @@ class AliZDCRawStream: public TObject { virtual Bool_t Next(); Int_t GetSector(Int_t i) const {return fSector[i];}; + Int_t GetADCModule() const {return fADCModule;}; Int_t GetADCValue() const {return fADCValue;}; UInt_t GetADCRaw() const {return fRawADC;}; Int_t GetADCGain() const {return fADCGain;}; @@ -37,11 +38,12 @@ class AliZDCRawStream: public TObject { UInt_t fRawADC; // raw ADC Int_t fSector[2]; // index of current sector + Int_t fADCModule; // ADC module; Int_t fADCValue; // ADC value; Int_t fADCGain; // ADC gain (0=high range; 1=low range) Bool_t fIsADCDataWord; //True when data word - ClassDef(AliZDCRawStream, 1) // class for reading ZDC raw digits + ClassDef(AliZDCRawStream, 2) // class for reading ZDC raw digits }; #endif -- 2.43.0