]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Updating AOD filter
authorslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 May 2011 09:36:55 +0000 (09:36 +0000)
committerslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 3 May 2011 09:36:55 +0000 (09:36 +0000)
PWG4/GammaConv/AliAnalysisTaskGammaConversion.cxx

index 8f9ffbd1735769e0debae2b5292ac29cba8633b1..ef79eef1e8e3172247c990b87dc17f05f598af6e 100644 (file)
@@ -47,6 +47,7 @@
 #include "AliTriggerAnalysis.h"
 #include "AliCentrality.h"
 #include "AliMultiplicity.h"
 #include "AliTriggerAnalysis.h"
 #include "AliCentrality.h"
 #include "AliMultiplicity.h"
+#include "AliAODHandler.h"
 
 class AliESDTrackCuts;
 class AliCFContainer;
 
 class AliESDTrackCuts;
 class AliCFContainer;
@@ -417,11 +418,6 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/)
     }
   } 
 
     }
   } 
 
-  //Must set fForceAOD to true for the AOD to get filled. Should only be done when running independent chain / train. 
-  if(fKFForceAOD) {
-    if (!AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()) AliFatal("Cannot run ESD filter without an output event handler");
-    AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
-  }
 
   //  if(fV0Reader == NULL){ // coverty does not permit this test
   // Write warning here cuts and so on are default if this ever happens
 
   //  if(fV0Reader == NULL){ // coverty does not permit this test
   // Write warning here cuts and so on are default if this ever happens
@@ -787,6 +783,30 @@ void AliAnalysisTaskGammaConversion::UserExec(Option_t */*option*/)
     }
   }
 
     }
   }
 
+
+  //Must set fForceAOD to true for the AOD to get filled. (Unless called by other task)
+  if(fKFForceAOD) {
+    if (!AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()) { 
+      AliFatal("Cannot run ESD filter without an output event handler");
+   
+    } else {
+      if(fAODGamma && fAODGamma->GetEntriesFast() > 0) {
+       AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
+       AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillExtension(kTRUE);   
+      }
+    }
+  
+  }
+
+  ///Make sure delta aod is filled if standard aod is filled (for synchronization when reading aod with standard aod)
+  if(fKFCreateAOD) {
+    AliAODHandler * aodhandler = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
+    if (aodhandler && aodhandler->GetFillAOD()) {
+      AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillExtension(kTRUE);   
+    }
+  }
+
+
   //Clear the data in the v0Reader
   fV0Reader->UpdateEventByEventData();
   if(fRecalculateV0ForGamma==kTRUE){
   //Clear the data in the v0Reader
   fV0Reader->UpdateEventByEventData();
   if(fRecalculateV0ForGamma==kTRUE){