]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliPhysicsSelectionTask.cxx
preserve bit 8 for TPC only tracks
[u/mrichter/AliRoot.git] / ANALYSIS / AliPhysicsSelectionTask.cxx
index c1b297c96db7b39e30704bf185de4873a70fc4fc..813384d1307e8cbcaefc295566d25562e8ccff34 100644 (file)
@@ -47,6 +47,7 @@ AliPhysicsSelectionTask::AliPhysicsSelectionTask(const char* opt) :
   }
   // Define input and output slots here
   DefineOutput(1, TList::Class());
+  fBranchNames = "ESD:AliESDRun.,AliESDHeader.,AliMultiplicity.,AliESDFMD.,AliESDVZERO.,AliESDZDC.,SPDVertex.,PrimaryVertex.";
   
   AliLog::SetClassDebugLevel("AliPhysicsSelectionTask", AliLog::kWarning);
 }
@@ -60,7 +61,7 @@ AliPhysicsSelectionTask::~AliPhysicsSelectionTask()
   // histograms are in the output list and deleted when the output
   // list is deleted by the TSelector dtor
 
-  if (fOutput) {
+  if (fOutput && !AliAnalysisManager::GetAnalysisManager()->IsProofMode()) {
     delete fOutput;
     fOutput = 0;
   }
@@ -79,6 +80,8 @@ void AliPhysicsSelectionTask::UserCreateOutputObjects()
     fPhysicsSelection = new AliPhysicsSelection;
   
   fOutput->Add(fPhysicsSelection);
+  // All tasks must post data once for all outputs (AG)
+  PostData(1, fOutput);
 }
 
 void AliPhysicsSelectionTask::UserExec(Option_t*)
@@ -90,6 +93,14 @@ void AliPhysicsSelectionTask::UserExec(Option_t*)
   PostData(1, fOutput);
 }
 
+void AliPhysicsSelectionTask::FinishTaskOutput()
+{
+// This gets called at the end of the processing on the worker. It allows dumping
+// statistics printed by the physics selection object to the statistics message
+// handled by the analysis manager.
+   if (fPhysicsSelection) fPhysicsSelection->Print("STAT");
+}
+
 void AliPhysicsSelectionTask::Terminate(Option_t *)
 {
   // The Terminate() function is the last function to be called during
@@ -110,7 +121,7 @@ void AliPhysicsSelectionTask::Terminate(Option_t *)
   if (fPhysicsSelection)
   {
     fPhysicsSelection->Print();
-    fPhysicsSelection->SaveHistograms("physics_selection");
+    fPhysicsSelection->SaveHistograms();
   }
     
   fout->Write();