]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSv1.cxx
Displaced the deletion of fTreeQA from AliPHOSv1 to AliPHOS dtor
[u/mrichter/AliRoot.git] / PHOS / AliPHOSv1.cxx
index 70eb97c8695285f9fe81c76002847d295bd1e0fa..47c0ebebc26de2f99e52946bc56378a91d340af4 100644 (file)
@@ -40,7 +40,6 @@
 
 // --- Standard library ---
 
-#include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 #include <strstream.h>
@@ -132,8 +131,10 @@ AliPHOSv1::AliPHOSv1(const char *name, const char *title):
   // create checkables 
   fQAHitsMul   = new AliPHOSQAIntCheckable("HitsM") ; 
   fQATotEner   = new AliPHOSQAFloatCheckable("TotEn") ; 
-  fQAHitsMulB  = new TClonesArray("AliPHOSQAIntCheckable",nb) ; 
+  fQAHitsMulB  = new TClonesArray("AliPHOSQAIntCheckable",nb) ;
+  fQAHitsMulB->SetOwner() ; 
   fQATotEnerB  = new TClonesArray("AliPHOSQAFloatCheckable", nb); 
+  fQATotEnerB->SetOwner() ; 
   char tempo[20]  ; 
   Int_t i ; 
   for ( i = 0 ; i < nb ; i++ ) {
@@ -168,8 +169,17 @@ AliPHOSv1::~AliPHOSv1()
     delete fHits ;
     fHits = 0 ; 
   }
-  if (fTreeQA) 
-    delete fTreeQA ; 
+  
+  if ( fQAHitsMulB ) {
+    fQAHitsMulB->Delete() ;
+    delete fQAHitsMulB ; 
+  }
+
+  if ( fQATotEnerB ) {
+    fQATotEnerB->Delete() ;
+    delete fQATotEnerB ; 
+  }
 }
 
 //____________________________________________________________________________
@@ -290,7 +300,7 @@ void AliPHOSv1::StepManager(void)
     for (i=0; i<3; i++) xyzm[i] = pos[i];
     gMC -> Gmtod (xyzm, xyzd, 1);    // transform coordinate from master to daughter system
     
-    Float_t        xyd[3]={0,0,0}   ;   //local positon of the entering
+    Float_t        xyd[3]={0,0,0}   ;   //local position of the entering
     xyd[0]  = xyzd[0];
     xyd[1]  =-xyzd[2];
     xyd[2]  =-xyzd[1];