]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
When loading the TRD response, keep the pointer to the old root directory to stay...
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 May 2010 07:46:05 +0000 (07:46 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 19 May 2010 07:46:05 +0000 (07:46 +0000)
STEER/AliTRDPIDResponse.cxx

index 24b86526acbc0b99965635fd687d5b3c8cb5b695..95f9c7e77b6b6df91eca7c115a7c994d868216e4 100644 (file)
@@ -31,6 +31,7 @@
 #include <TString.h>
 #include <TROOT.h> 
 #include <TSystem.h>
+#include <TDirectory.h>
 
 #include "AliLog.h"
 
@@ -116,6 +117,9 @@ Bool_t AliTRDPIDResponse::Load(const Char_t * filename){
  //
  // Load References into the toolkit
  //
+
+  TDirectory *owd = gDirectory;// store old working directory
+
  if(!filename)
    filename = Form("%s/STEER/LQ1dRef_v1.root",gSystem->ExpandPathName("$ALICE_ROOT"));
  TFile *in = TFile::Open(filename);
@@ -149,7 +153,7 @@ Bool_t AliTRDPIDResponse::Load(const Char_t * filename){
    arrayPos++;
  } 
  in->Close();
-
+ owd->cd();
  AliDebug(2, Form("Successfully loaded %d Reference Histograms", arrayPos));
  SetBit(kIsOwner, kTRUE);
  delete in;