use dir context
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Aug 2011 21:07:11 +0000 (21:07 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Aug 2011 21:07:11 +0000 (21:07 +0000)
PWG4/CaloCalib/AliAnalysisTaskEMCALPi0PbPb.cxx

index b2f8e5c..2831dd2 100644 (file)
@@ -225,7 +225,8 @@ void AliAnalysisTaskEMCALPi0PbPb::UserCreateOutputObjects()
   fSelPrimTracks = new TObjArray;
 
   if (fDoNtuple) {
-    TFile *f = OpenFile(1);
+    TFile *f = OpenFile(1); 
+    TDirectory::TContext context(f);
     if (f) {
       f->SetCompressionLevel(2);
       fNtuple = new TTree(Form("tree%.0fto%.0f",fCentFrom,fCentTo), "StandaloneTree");
@@ -732,7 +733,8 @@ void AliAnalysisTaskEMCALPi0PbPb::Terminate(Option_t *)
   // Terminate called at the end of analysis.
 
   if (fNtuple) {
-    TFile *f = OpenFile(1);
+    TFile *f = OpenFile(1,"update");
+    TDirectory::TContext context(f);
     if (f) 
       fNtuple->Write();
   }