]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fix memory leak in QA checker, by Ruben
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 12 Nov 2011 02:52:01 +0000 (02:52 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 12 Nov 2011 02:52:01 +0000 (02:52 +0000)
Add option colz for histograms, by Francesco

EMCAL/AliEMCALQAChecker.cxx
EMCAL/AliEMCALQADataMakerRec.cxx

index a8ffa68e6526ab88d184928c781da64f0075597f..e455d4124a43d3bd15d1d6ee89a0d7fd9f264860 100644 (file)
@@ -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
 }
 
 //______________________________________________________________________________
index 5080fa4750fbfa4d041a7f98714ae9f200e79f5d..e75f61277ec6824561f89854aee97e6c34cc6cea 100644 (file)
@@ -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