]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliAnalysisTaskRL.cxx
Cut class for the filtering of ESD V0s (Boris Hippolyte <hippolyt@in2p3.fr>)
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisTaskRL.cxx
index ccc8c53b4370f5b62b410dc55aa8e1da786290de..04c97d56db964d183aa1d6bd9bc1dec2cd386375 100644 (file)
@@ -28,6 +28,7 @@
 
 
 #include <TTree.h>
+#include <TChain.h>
 #include <TFile.h>
 
 ClassImp(AliAnalysisTaskRL)
@@ -68,6 +69,13 @@ Bool_t AliAnalysisTaskRL::GetEntry(Long64_t ientry) {
   return kTRUE;
 }
 
+//___________________________________________________________________________
+Bool_t AliAnalysisTaskRL::Notify() {
+// The file has changed or there is a new tree. Delete the run loader.
+   DeleteRunLoader();
+   return kTRUE;
+}   
+
 //___________________________________________________________________________
 AliRunLoader *AliAnalysisTaskRL::GetRunLoader() {
   // Returns AliRun instance corresponding to current ESD active in fTree
@@ -75,11 +83,14 @@ AliRunLoader *AliAnalysisTaskRL::GetRunLoader() {
   // "galice" in the file path of the ESD file. 
 
   fTree = (TTree *)AliAnalysisTask::GetInputData(0);
+      
   if (!fRunLoader) {
     if (!fTree->GetCurrentFile())
       return 0;
     
     TString fileName(fTree->GetCurrentFile()->GetName());
+    printf("Current file %s \n", fileName.Data());
+    
     fileName.ReplaceAll("AliESDs", "galice");
     
     // temporary workaround for PROOF bug #18505