Moving aod cleanup to earlier point to prevent reuse of same particle
authorslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 May 2011 12:00:32 +0000 (12:00 +0000)
committerslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 May 2011 12:00:32 +0000 (12:00 +0000)
PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx

index ef79eef..1ef5609 100644 (file)
@@ -418,6 +418,10 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/)
     }
   } 
 
+  if(fAODGamma) fAODGamma->Delete();
+  if(fAODPi0) fAODPi0->Delete();
+  if(fAODOmega) fAODOmega->Delete();
+
 
   //  if(fV0Reader == NULL){ // coverty does not permit this test
   // Write warning here cuts and so on are default if this ever happens
@@ -456,9 +460,6 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/)
   fV0Reader->Initialize();
   fDoMCTruth = fV0Reader->GetDoMCTruth();
 
-  if(fAODGamma) fAODGamma->Delete();
-  if(fAODPi0) fAODPi0->Delete();
-  if(fAODOmega) fAODOmega->Delete();
        
   if(fKFReconstructedGammasTClone == NULL){
     fKFReconstructedGammasTClone = new TClonesArray("AliKFParticle",0);