#include <TFile.h>
#include <TClass.h>
#include <TTree.h>
+#include <TROOT.h>
#include "AliAnalysisTask.h"
#include "AliAnalysisDataSlot.h"
}
AliAnalysisDataSlot::EnableBranch(bname, tree);
}
+
+//______________________________________________________________________________
+void AliAnalysisTask::FinishTaskOutput()
+{
+// Optional method that is called in SlaveTerminate phase.
+// Used for calling aditional methods just after the last event was processed ON
+// THE WORKING NODE. The call is made also in local case.
+// Do NOT delete output objects here since they will have to be sent for
+// merging in PROOF mode - use class destructor for cleanup.
+}
//______________________________________________________________________________
void AliAnalysisTask::ConnectInputData(Option_t *)
}
//______________________________________________________________________________
-void AliAnalysisTask::OpenFile(Int_t iout, Option_t *option) const
+TFile *AliAnalysisTask::OpenFile(Int_t iout, Option_t *option) const
{
// This method has to be called INSIDE the user redefined CreateOutputObjects
// method, before creating each object corresponding to the output containers
// fHist2 = new TH2F("my quality check hist2",...);
// }
- if (iout<0 || iout>=fNoutputs) return;
- AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
- if (!mgr || mgr->GetAnalysisType()==AliAnalysisManager::kProofAnalysis) return;
+ if (iout<0 || iout>=fNoutputs) {
+ Error("OpenFile", "No output slot for task %s with index %d", GetName(), iout);
+ return NULL;
+ }
+ // Method delegated to the analysis manager (A.G. 02/11/09)
AliAnalysisDataContainer *cont = GetOutputSlot(iout)->GetContainer();
- if (strlen(cont->GetFileName())) new TFile(cont->GetFileName(), option);
+ return AliAnalysisManager::OpenFile(cont, option);
}
//______________________________________________________________________________
return kTRUE;
}
+//______________________________________________________________________________
+Bool_t AliAnalysisTask::NotifyBinChange()
+{
+// Overload this IF you need to treat bin change in event mixing.
+ return kTRUE;
+}
+
//______________________________________________________________________________
void AliAnalysisTask::Terminate(Option_t *)
{