From 4df5e18feb648951733ef8116f79ec3f88908921 Mon Sep 17 00:00:00 2001 From: coppedis Date: Sun, 25 Jul 2010 15:32:21 +0000 Subject: [PATCH] Correction for Savannah bug 70586 --- ZDC/AliZDC.cxx | 87 +++++++++++++++++++---------------------- ZDC/AliZDCDigitizer.cxx | 22 +++++------ 2 files changed, 52 insertions(+), 57 deletions(-) diff --git a/ZDC/AliZDC.cxx b/ZDC/AliZDC.cxx index 9884dad70e1..220a0bc54ce 100644 --- a/ZDC/AliZDC.cxx +++ b/ZDC/AliZDC.cxx @@ -680,52 +680,47 @@ Bool_t AliZDC::Raw2SDigits(AliRawReader* rawReader) return kFALSE; } -// // Event loop - Int_t iEvent = 0; - while(rawReader->NextEvent()){ - (AliRunLoader::Instance())->GetEvent(iEvent++); - // Create the output digit tree - TTree* treeS = loader->TreeS(); - if(!treeS){ - loader->MakeTree("S"); - treeS = loader->TreeS(); - } - // - AliZDCSDigit sdigit; - AliZDCSDigit* psdigit = &sdigit; - const Int_t kBufferSize = 4000; - treeS->Branch("ZDC", "AliZDCSDigit", &psdigit, kBufferSize); - // - AliZDCRawStream rawStream(rawReader); - Int_t sector[2], resADC, rawADC, corrADC, nPheVal; - Int_t jcount = 0; - while(rawStream.Next()){ - if(rawStream.IsADCDataWord()){ - //For the moment only in-time SDigits are foreseen (1st 48 raw values) - if(jcount < kNch){ - for(Int_t j=0; j<2; j++) sector[j] = rawStream.GetSector(j); - rawADC = rawStream.GetADCValue(); - resADC = rawStream.GetADCGain(); - //printf("\t RAw2SDigits raw%d -> RawADC[%d, %d, %d] read\n", - // jcount, sector[0], sector[1], rawADC); - // - corrADC = rawADC - Pedestal(sector[0], sector[1], resADC); - if(corrADC<0) corrADC=0; - nPheVal = ADCch2Phe(sector[0], sector[1], corrADC, resADC); - // - //printf("\t \t -> SDigit[%d, %d, %d] created\n", - // sector[0], sector[1], nPheVal); - // - new(psdigit) AliZDCSDigit(sector, (Float_t) nPheVal, 0.); - treeS->Fill(); - jcount++; - } - }//IsADCDataWord - }//rawStream.Next - // write the output tree - fLoader->WriteSDigits("OVERWRITE"); - fLoader->UnloadSDigits(); - }//Event loop + // Create the output digit tree + TTree* treeS = loader->TreeS(); + if(!treeS){ + loader->MakeTree("S"); + treeS = loader->TreeS(); + } + // + AliZDCSDigit sdigit; + AliZDCSDigit* psdigit = &sdigit; + const Int_t kBufferSize = 4000; + treeS->Branch("ZDC", "AliZDCSDigit", &psdigit, kBufferSize); + // + AliZDCRawStream rawStream(rawReader); + Int_t sector[2], resADC, rawADC, corrADC, nPheVal; + Int_t jcount = 0; + while(rawStream.Next()){ + if(rawStream.IsADCDataWord()){ + //For the moment only in-time SDigits are foreseen (1st 48 raw values) + if(jcount < kNch){ + for(Int_t j=0; j<2; j++) sector[j] = rawStream.GetSector(j); + rawADC = rawStream.GetADCValue(); + resADC = rawStream.GetADCGain(); + //printf("\t RAw2SDigits raw%d -> RawADC[%d, %d, %d] read\n", + // jcount, sector[0], sector[1], rawADC); + // + corrADC = rawADC - Pedestal(sector[0], sector[1], resADC); + if(corrADC<0) corrADC=0; + nPheVal = ADCch2Phe(sector[0], sector[1], corrADC, resADC); + // + //printf("\t \t -> SDigit[%d, %d, %d] created\n", + // sector[0], sector[1], nPheVal); + // + new(psdigit) AliZDCSDigit(sector, (Float_t) nPheVal, 0.); + treeS->Fill(); + jcount++; + } + }//IsADCDataWord + }//rawStream.Next + // write the output tree + fLoader->WriteSDigits("OVERWRITE"); + fLoader->UnloadSDigits(); return kTRUE; } diff --git a/ZDC/AliZDCDigitizer.cxx b/ZDC/AliZDCDigitizer.cxx index ba52ea1f691..9fbc6a20e68 100644 --- a/ZDC/AliZDCDigitizer.cxx +++ b/ZDC/AliZDCDigitizer.cxx @@ -149,16 +149,16 @@ Bool_t AliZDCDigitizer::Init() if((beamType.CompareTo("P-P")) == 0 || (beamType.CompareTo("p-p")) == 0){ //PTM gains rescaled to beam energy for p-p if(fBeamEnergy != 0){ - for(Int_t j = 0; j < 5; j++){ - fPMGain[0][j] = 1.515831*(661.444/fBeamEnergy+0.000740671)*10000000; - fPMGain[1][j] = 0.674234*(864.350/fBeamEnergy+0.00234375)*10000000; - fPMGain[3][j] = 1.350938*(661.444/fBeamEnergy+0.000740671)*10000000; - fPMGain[4][j] = 0.678597*(864.350/fBeamEnergy+0.00234375)*10000000; - } - fPMGain[2][1] = 0.869654*(1.32312-0.000101515*fBeamEnergy)*10000000; - fPMGain[2][2] = 1.030883*(1.32312-0.000101515*fBeamEnergy)*10000000; - AliInfo(Form(" PMT gains for p-p @ %1.0f+%1.0f GeV: ZN(%1.0f), ZP(%1.0f), ZEM(%1.0f)\n", - fBeamEnergy, fBeamEnergy, fPMGain[0][0], fPMGain[1][0], fPMGain[2][0])); + for(Int_t j = 0; j < 5; j++){ + fPMGain[0][j] = 1.515831*(661.444/fBeamEnergy+0.000740671)*10000000; + fPMGain[1][j] = 0.674234*(864.350/fBeamEnergy+0.00234375)*10000000; + fPMGain[3][j] = 1.350938*(661.444/fBeamEnergy+0.000740671)*10000000; + fPMGain[4][j] = 0.678597*(864.350/fBeamEnergy+0.00234375)*10000000; + } + fPMGain[2][1] = 0.869654*(1.32312-0.000101515*fBeamEnergy)*10000000; + fPMGain[2][2] = 1.030883*(1.32312-0.000101515*fBeamEnergy)*10000000; + AliInfo(Form(" PMT gains for p-p @ %1.0f+%1.0f GeV: ZN(%1.0f), ZP(%1.0f), ZEM(%1.0f)\n", + fBeamEnergy, fBeamEnergy, fPMGain[0][0], fPMGain[1][0], fPMGain[2][1])); } } else if((beamType.CompareTo("A-A")) == 0){ @@ -175,7 +175,7 @@ Bool_t AliZDCDigitizer::Init() fPMGain[4][j] = 100000./scalGainFactor; } AliInfo(Form(" PMT gains for Pb-Pb @ %1.0f+%1.0f A GeV: ZN(%1.0f), ZP(%1.0f), ZEM(%1.0f)\n", - fBeamEnergy, fBeamEnergy, fPMGain[0][0], fPMGain[1][0], fPMGain[2][0])); + fBeamEnergy, fBeamEnergy, fPMGain[0][0], fPMGain[1][0], fPMGain[2][1])); } // ADC Caen V965 -- 2.43.0