From b90071818599c5dd4a1df07d09782a58bfa288ec Mon Sep 17 00:00:00 2001 From: basanta Date: Sat, 31 Oct 2009 11:15:38 +0000 Subject: [PATCH] segmentation fault in daq machine is fixed --- PMD/PMDGAINda.cxx | 19 ++++++++++--------- PMD/PMDPEDESTALda.cxx | 8 +++++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/PMD/PMDGAINda.cxx b/PMD/PMDGAINda.cxx index 48f887f87d8..c732a8fe05a 100644 --- a/PMD/PMDGAINda.cxx +++ b/PMD/PMDGAINda.cxx @@ -64,7 +64,7 @@ int main(int argc, char **argv) { // Reads the pedestal file and keep the values in memory for subtraction - AliPMDCalibGain calibgain; + AliPMDCalibGain *calibgain = new AliPMDCalibGain(); // Fetch the pedestal file - PMD_PED.root @@ -80,7 +80,7 @@ int main(int argc, char **argv) { return -1; } - Int_t pstatus = calibgain.ExtractPedestal("PMD_PED.root"); + Int_t pstatus = calibgain->ExtractPedestal("PMD_PED.root"); if(pstatus == -3) return -3; @@ -113,7 +113,7 @@ int main(int argc, char **argv) { status = daqDA_DB_getFile("pmd_gain_tempfile.dat","pmd_gain_tempfile.dat"); if(!status) { - calibgain.ReadTempFile("pmd_gain_tempfile.dat"); + calibgain->ReadTempFile("pmd_gain_tempfile.dat"); } else { @@ -123,7 +123,7 @@ int main(int argc, char **argv) { status = daqDA_DB_getFile("PMD_HOT.root","PMD_HOT.root"); if(!status) { - calibgain.ExtractHotChannel("PMD_HOT.root"); + calibgain->ExtractHotChannel("PMD_HOT.root"); } else { @@ -248,7 +248,7 @@ int main(int argc, char **argv) { //if(nevents_physics%100 == 0)printf("Physis Events = %d\n",nevents_physics); AliRawReader *rawReader = new AliRawReaderDate((void*)event); TObjArray *pmdddlcont = new TObjArray(); - calibgain.ProcessEvent(rawReader, pmdddlcont); + calibgain->ProcessEvent(rawReader, pmdddlcont); if (totevt%hotevtsize == 0) hotfilestatus = true; delete pmdddlcont; @@ -275,7 +275,7 @@ int main(int argc, char **argv) { TTree *hot = new TTree("hot","PMD Hot cell tree"); - calibgain.FindHotCell(hot,xvar); + calibgain->FindHotCell(hot,xvar); hot->Write(); hotRun->Close(); @@ -296,7 +296,7 @@ int main(int argc, char **argv) { TTree *hot = new TTree("hot","PMD Hot cell tree"); - calibgain.FindHotCell(hot,xvar); + calibgain->FindHotCell(hot,xvar); hot->Write(); hotRun->Close(); @@ -322,7 +322,7 @@ int main(int argc, char **argv) { printf("*** Writing the intermediate ASCII file ***\n"); printf("-----------------------------------------------\n"); - calibgain.WriteTempFile("pmd_gain_tempfile.dat"); + calibgain->WriteTempFile("pmd_gain_tempfile.dat"); // Store the Intermediate ascii file in the DB status = daqDA_DB_storeFile("pmd_gain_tempfile.dat","pmd_gain_tempfile.dat"); @@ -342,7 +342,7 @@ int main(int argc, char **argv) { printf("*** Writing the PMDGAINS.root file ***\n"); printf("-----------------------------------------------\n"); - calibgain.Analyse(ic, meanc); + calibgain->Analyse(ic, meanc); TFile * gainRun = new TFile ("PMDGAINS.root","RECREATE"); ic->Write(); @@ -368,6 +368,7 @@ int main(int argc, char **argv) { delete meanc; meanc = 0; + delete calibgain; /* store the result file on FES */ diff --git a/PMD/PMDPEDESTALda.cxx b/PMD/PMDPEDESTALda.cxx index 80c0fa6f6bf..b3d09a9e9ae 100644 --- a/PMD/PMDPEDESTALda.cxx +++ b/PMD/PMDPEDESTALda.cxx @@ -52,7 +52,7 @@ int main(int argc, char **argv) { "TStreamerInfo()"); - AliPMDCalibPedestal calibped; + AliPMDCalibPedestal *calibped = new AliPMDCalibPedestal(); TTree *ped = NULL; @@ -172,7 +172,7 @@ int main(int argc, char **argv) { AliRawReader *rawReader = new AliRawReaderDate((void*)event); TObjArray *pmdddlcont = new TObjArray(); - calibped.ProcessEvent(rawReader,pmdddlcont); + calibped->ProcessEvent(rawReader,pmdddlcont); delete pmdddlcont; pmdddlcont = 0; @@ -203,7 +203,7 @@ int main(int argc, char **argv) { if (eventT==END_OF_RUN) { printf("EOR event detected\n"); - calibped.Analyse(ped); + calibped->Analyse(ped); } TFile * pedRun = new TFile ("PMD_PED.root","RECREATE"); @@ -213,6 +213,8 @@ int main(int argc, char **argv) { delete ped; ped = 0; + delete calibped; + /* store the pedestal file in database */ status = daqDA_DB_storeFile("PMD_PED.root","PMD_PED.root"); -- 2.43.0