From 180c431b5ae15aad6d641807817c12f600d21621 Mon Sep 17 00:00:00 2001 From: gconesab Date: Sat, 12 Nov 2011 02:52:01 +0000 Subject: [PATCH] Fix memory leak in QA checker, by Ruben Add option colz for histograms, by Francesco --- EMCAL/AliEMCALQAChecker.cxx | 46 +++++++++++++++++++++----------- EMCAL/AliEMCALQADataMakerRec.cxx | 6 ++++- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/EMCAL/AliEMCALQAChecker.cxx b/EMCAL/AliEMCALQAChecker.cxx index a8ffa68e652..e455d4124a4 100644 --- a/EMCAL/AliEMCALQAChecker.cxx +++ b/EMCAL/AliEMCALQAChecker.cxx @@ -189,6 +189,7 @@ void AliEMCALQAChecker::CheckRaws(Double_t * test, TObjArray ** list) //Float_t kThreshold = 80. ; Int_t nTowersPerSM = 24*48; // number of towers in a SuperModule; 24x48 Double_t nTot = fknSM * nTowersPerSM ; + TList *lstF = 0; for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) { test[specie] = 0.0 ; if ( !AliQAv1::Instance()->IsEventSpecieSet(specie)) @@ -201,20 +202,35 @@ void AliEMCALQAChecker::CheckRaws(Double_t * test, TObjArray ** list) if(hdata->GetEntries()==0 || ratio->GetEntries()==0) continue; //adding the lines to distinguish different SMs - if ( hdata->GetListOfFunctions()->GetEntries() == 0 ){ - hdata->GetListOfFunctions()->Add(fLineCol); - for(Int_t iLine = 0; iLine < 4; iLine++) { - hdata->GetListOfFunctions()->Add(fLineRow[iLine]); - } - //Now adding the text to for each SM - for(Int_t iSM = 0 ; iSM < fknSM ; iSM++){ //number of SMs loop start - hdata->GetListOfFunctions()->Add(fTextSM[iSM]); - } - } - if ( ratio->GetListOfFunctions()->GetEntries() == 0 ){ //adding the object at the beginning - ratio->GetListOfFunctions()->Add(fText) ; + lstF = hdata->GetListOfFunctions(); + { // RS: clean list of functions + if (lstF) { + TObject *stats = lstF->FindObject("stats"); lstF->Remove(stats); + TObject *obj; + while ((obj = lstF->First())) { while(lstF->Remove(obj)) { } delete obj; } + if (stats) lstF->Add(stats); + } } - + lstF->Add(fLineCol->Clone()); + for(Int_t iLine = 0; iLine < 4; iLine++) { + lstF->Add(fLineRow[iLine]->Clone()); + } + //Now adding the text to for each SM + for(Int_t iSM = 0 ; iSM < fknSM ; iSM++){ //number of SMs loop start + lstF->Add(fTextSM[iSM]->Clone()); + } + // + lstF = ratio->GetListOfFunctions(); + { // RS: clean list of functions + if (lstF) { + TObject *stats = lstF->FindObject("stats"); lstF->Remove(stats); + TObject *obj; + while ((obj = lstF->First())) { while(lstF->Remove(obj)) { } delete obj; } + if (stats) lstF->Add(stats); + } + } + lstF->Add(fText->Clone()) ; + // //now check the ratio histogram Double_t binContent = 0. ; Int_t NGoodTower = 0 ; @@ -246,8 +262,8 @@ void AliEMCALQAChecker::CheckRaws(Double_t * test, TObjArray ** list) //hdata->Reset("ICE"); //ratio->Reset("ICE"); }//fText - } - } //finish the checking + } + } //finish the checking } //______________________________________________________________________________ diff --git a/EMCAL/AliEMCALQADataMakerRec.cxx b/EMCAL/AliEMCALQADataMakerRec.cxx index 5080fa4750f..e75f61277ec 100644 --- a/EMCAL/AliEMCALQADataMakerRec.cxx +++ b/EMCAL/AliEMCALQADataMakerRec.cxx @@ -533,7 +533,11 @@ void AliEMCALQADataMakerRec::InitRaws() TH1I *hS5 = new TH1I("hFrameR","Link between TRU and STU", 32, 0, 32); Add2RawsList(hS5, kSTUTRU, expert, !image, !saveCorr) ; - + hS0->SetOption("COLZ"); + hS1->SetOption("COLZ"); + hS2->SetOption("COLZ"); + hS3->SetOption("COLZ"); + hS4->SetOption("COLZ"); // ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line -- 2.39.3