reduced printout, put TH1::AddDirectory to histogram creation
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Nov 2009 16:16:01 +0000 (16:16 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Nov 2009 16:16:01 +0000 (16:16 +0000)
PWG4/JetTasks/AliPWG4HighPtQAMC.cxx
PWG4/JetTasks/AliPWG4HighPtQATPConly.cxx
PWG4/JetTasks/AliPWG4HighPtSpectra.cxx

index d89e1f4..ba33bbe 100644 (file)
@@ -21,6 +21,9 @@
 // Author : Marta Verweij - UU
 //-----------------------------------------------------------------------
 
+#ifndef ALIPWG4HighPtQAMC_CXX
+#define ALIPWG4HighPtQAMC_CXX
+
 #include "AliPWG4HighPtQAMC.h"
 
 #include "TH1.h"
@@ -37,7 +40,7 @@
 #include "AliESDtrack.h"
 #include "AliESDtrackCuts.h"
 #include "AliExternalTrackParam.h"
-
+#include "AliLog.h"
 
 using namespace std; //required for resolving the 'cout' symbol
 
@@ -47,9 +50,9 @@ AliPWG4HighPtQAMC::AliPWG4HighPtQAMC(): AliAnalysisTask("AliPWG4HighPtQAMC", "")
   fESD(0), 
   fTrackCuts(0), 
   fTrackCutsITS(0),
-  fNEvent(0), // just to avoid warnings, inititialized in InitPointers too
-  fPtAll(0),  //
-  fPtSel(0),  //
+  fNEvent(0), 
+  fPtAll(0),  
+  fPtSel(0),  
   fPtAllminPtMCvsPtAll(0),
   fPtAllminPtMCvsPtAllNPointTPC(0),
   fPtAllminPtMCvsPtAllDCAR(0),
@@ -75,7 +78,7 @@ AliPWG4HighPtQAMC::AliPWG4HighPtQAMC(): AliAnalysisTask("AliPWG4HighPtQAMC", "")
   fPtITSminPtMCvsPtITSRel1PtUncertainty(0),
   fHistListITS(0)
 {
-  InitHistPointers();
+
 }
 //________________________________________________________________________
 AliPWG4HighPtQAMC::AliPWG4HighPtQAMC(const char *name): 
@@ -83,9 +86,9 @@ AliPWG4HighPtQAMC::AliPWG4HighPtQAMC(const char *name):
   fESD(0),
   fTrackCuts(),
   fTrackCutsITS(),
-  fNEvent(0), // just to avoid warnings, inititialized in InitPointers too
-  fPtAll(0),  //
-  fPtSel(0),  //
+  fNEvent(0),
+  fPtAll(0),
+  fPtSel(0),
   fPtAllminPtMCvsPtAll(0),
   fPtAllminPtMCvsPtAllNPointTPC(0),
   fPtAllminPtMCvsPtAllDCAR(0),
@@ -114,7 +117,7 @@ AliPWG4HighPtQAMC::AliPWG4HighPtQAMC(const char *name):
   //
   // Constructor. Initialization of Inputs and Outputs
   //
-  Info("AliPWG4HighPtQAMC","Calling Constructor");
+  AliDebug(2,Form("AliPWG4HighPtQAMC","Calling Constructor"));
   // Input slot #0 works with a TChain ESD
   DefineInput(0, TChain::Class());
   // Output slot #0 writes into a TList
@@ -123,66 +126,36 @@ AliPWG4HighPtQAMC::AliPWG4HighPtQAMC(const char *name):
   DefineOutput(1, TList::Class());
   // Output slot #2 writes into a TList
   DefineOutput(2, TList::Class());
-  InitHistPointers();
-  //  TH1::AddDirectory(kFALSE);
-  //  TH2::AddDirectory(kFALSE);
-  // TH3::AddDirectory(kFALSE);
-  }
+}
 
 //________________________________________________________________________
 void AliPWG4HighPtQAMC::ConnectInputData(Option_t *) 
 {
   // Connect ESD here
   // Called once
-  printf(">> AliPWG4HighPtQATPConly::ConnectInputData \n");
+  AliDebug(2,Form(">> AliPWG4HighPtSpectra::ConnectInputData \n"));
   TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
   if (!tree) {
-    Printf("ERROR: Could not read chain from input slot 0");
+    AliDebug(2,Form("ERROR: Could not read chain from input slot 0"));
   } else {
     
     AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
     
     if (!esdH) {
-      Printf("ERROR: Could not get ESDInputHandler");
+      AliDebug(2,Form("ERROR: Could not get ESDInputHandler"));
     } else
       fESD = esdH->GetEvent();
   }
 }
 
 //________________________________________________________________________
-void AliPWG4HighPtQAMC::InitHistPointers() {
-  //Initialize histograms
-  fNEvent = 0;
-  fPtAll = 0;
-  fPtSel = 0;
-  //Global tracking compared to MC pt
-  fPtAllMC = 0;
-  fPtSelMC = 0;
-  fPtAllminPtMCvsPtAll = 0;
-  fPtAllminPtMCvsPtAllNPointTPC = 0;
-  fPtAllminPtMCvsPtAllDCAR = 0;
-  fPtAllminPtMCvsPtAllDCAZ = 0;
-  fPtAllminPtMCvsPtAllPhi = 0;
-  fPtAllminPtMCvsPtAllNPointITS = 0;
-  fPtAllminPtMCvsPtAllNSigmaToVertex = 0;
-  fPtAllminPtMCvsPtAllChi2C = 0;
-  fPtAllminPtMCvsPtAllRel1PtUncertainty = 0;
-  //ITSrefit histos compared to MC pt
-  fPtSelITS = 0;
-  fPtITSminPtMCvsPtITS = 0;
-  fPtITSminPtMCvsPtITSNPointTPC = 0;
-  fPtITSminPtMCvsPtITSDCAR = 0;
-  fPtITSminPtMCvsPtITSDCAZ = 0;
-  fPtITSminPtMCvsPtITSPhi = 0;
-  fPtITSminPtMCvsPtITSNPointITS = 0;
-  fPtITSminPtMCvsPtITSNSigmaToVertex = 0;
-  fPtITSminPtMCvsPtITSChi2C = 0;
-  fPtITSminPtMCvsPtITSRel1PtUncertainty = 0;
-}
-//________________________________________________________________________
 void AliPWG4HighPtQAMC::CreateOutputObjects() {
   //Create output objects
-  printf(">> AliPWG4HighPtQATPConly::CreateOutputObjects \n");
+  AliDebug(2,Form(">> AliPWG4HighPtQATPConly::CreateOutputObjects \n"));
+
+  Bool_t oldStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE); 
+
   OpenFile(0);
   fHistList = new TList();
   OpenFile(1);
@@ -321,55 +294,58 @@ void AliPWG4HighPtQAMC::CreateOutputObjects() {
   fPtSelMCITS = new TH1F("fPtSelMCITS","PtSel",fgkNPtBins, fgkPtMin, fgkPtMax);
   fHistList->Add(fPtSelMCITS);
   
+  TH1::AddDirectory(oldStatus); 
+
 }
 //________________________________________________________________________
 void AliPWG4HighPtQAMC::Exec(Option_t *) {  
   // Main loop
   // Called for each event
-  printf(">> AliPWG4HighPtQATPConly::Exec \n");  
+  AliDebug(2,Form(">> AliPWG4HighPtQATPConly::Exec \n"));  
   
   if (!fESD) {
-    Printf("ERROR: fESD not available");
+    AliDebug(2,Form("ERROR: fESD not available"));
     return;
   }
 
  AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
   if (!eventHandler) {
-    Printf("ERROR: Could not retrieve MC event handler");
+    AliDebug(2,Form("ERROR: Could not retrieve MC event handler"));
     return;
   }
 
   AliMCEvent* mcEvent = eventHandler->MCEvent();
   if (!mcEvent) {
-    Printf("ERROR: Could not retrieve MC event");
+    AliDebug(2,Form("ERROR: Could not retrieve MC event"));
     return;
   }
 
-  Printf("MC particles: %d", mcEvent->GetNumberOfTracks());
+  AliDebug(2,Form("MC particles: %d", mcEvent->GetNumberOfTracks()));
 
   if (!fESD) {
-    Printf("ERROR: fESD not available");
+    AliDebug(2,Form("ERROR: fESD not available"));
     return;
   }
 
   AliStack* stack = mcEvent->Stack();                //Particles Stack
 
-  Printf("MC particles stack: %d", stack->GetNtrack());
+  AliDebug(2,Form("MC particles stack: %d", stack->GetNtrack()));
 
   const AliESDVertex *vtx = fESD->GetPrimaryVertex();
 
   // Need vertex cut
   if (vtx->GetNContributors() < 2)
     return;
+  
+  AliDebug(2,Form("Vertex title %s, status %d, nCont %d\n",vtx->GetTitle(), vtx->GetStatus(), vtx->GetNContributors()));
 
-  printf("Vertex title %s, status %d, nCont %d\n",vtx->GetTitle(), vtx->GetStatus(), vtx->GetNContributors());
   // Need to keep track of evts without vertex
   fNEvent->Fill(0.);
 
   if(!fESD->GetNumberOfTracks() || fESD->GetNumberOfTracks()<2) return;
   Int_t nTracks = fESD->GetNumberOfTracks();
-  printf("nTracks %d\n", nTracks);
-  
+  AliDebug(2,Form("nTracks %d", nTracks));
+
   for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
     
     AliESDtrack *track = fESD->GetTrack(iTrack);
@@ -439,7 +415,10 @@ void AliPWG4HighPtQAMC::Exec(Option_t *) {
 //________________________________________________________________________
 void AliPWG4HighPtQAMC::Terminate(Option_t *)
 {
-  printf("->AliPWG4HighPtQATPConly::Terminate \n");
+  // The Terminate() function is the last function to be called during
+  // a query. It always runs on the client, it can be used to present
+  // the results graphically or save the results to file.
 
-  printf("-<AliPWG4HighPtQATPConly::Terminate \n");
 }
+
+#endif
index d7dba74..e064e05 100644 (file)
@@ -22,6 +22,9 @@
 // Author : Marta Verweij - UU
 //-----------------------------------------------------------------------
 
+#ifndef ALIPWG4HighPtQATPCONLY_CXX
+#define ALIPWG4HighPtQATPCONLY_CXX
+
 #include "AliPWG4HighPtQATPConly.h"
 
 #include "TH1.h"
@@ -35,6 +38,7 @@
 #include "AliESDtrack.h"
 #include "AliESDtrackCuts.h"
 #include "AliExternalTrackParam.h"
+#include "AliLog.h"
 
 using namespace std; //required for resolving the 'cout' symbol
 
@@ -44,9 +48,9 @@ AliPWG4HighPtQATPConly::AliPWG4HighPtQATPConly(): AliAnalysisTask("AliPWG4HighPt
   fESD(0), 
   fTrackCuts(0), 
   fTrackCutsITS(0),
-  fNEvent(0), // just to avoid warnings, inititialized in InitPointers too
-  fPtAll(0),  //
-  fPtSel(0),  //
+  fNEvent(0),
+  fPtAll(0),
+  fPtSel(0),
   fPtAllminPtTPCvsPtAll(0),
   fPtAllminPtTPCvsPtAllNPointTPC(0),
   fPtAllminPtTPCvsPtAllDCAR(0),
@@ -73,7 +77,7 @@ AliPWG4HighPtQATPConly::AliPWG4HighPtQATPConly(): AliAnalysisTask("AliPWG4HighPt
   fPtITSminPtTPCvsPtITSRel1PtUncertainty(0),
   fHistListITS(0)
 {
-  InitHistPointers();
+
 }
 //________________________________________________________________________
 AliPWG4HighPtQATPConly::AliPWG4HighPtQATPConly(const char *name): 
@@ -81,9 +85,9 @@ AliPWG4HighPtQATPConly::AliPWG4HighPtQATPConly(const char *name):
   fESD(0),
   fTrackCuts(),
   fTrackCutsITS(),
-  fNEvent(0), // just to avoid warnings, inititialized in InitPointers too
-  fPtAll(0),  //
-  fPtSel(0),  // 
+  fNEvent(0),
+  fPtAll(0),
+  fPtSel(0),
   fPtAllminPtTPCvsPtAll(0),
   fPtAllminPtTPCvsPtAllNPointTPC(0),
   fPtAllminPtTPCvsPtAllDCAR(0),
@@ -122,18 +126,14 @@ AliPWG4HighPtQATPConly::AliPWG4HighPtQATPConly(const char *name):
   DefineOutput(1, TList::Class());
   // Output slot #2 writes into a TList
   DefineOutput(2, TList::Class());
-  InitHistPointers();
-  //  TH1::AddDirectory(kFALSE);
-  //  TH2::AddDirectory(kFALSE);
-  //  TH3::AddDirectory(kFALSE);
-  }
+}
 
 //________________________________________________________________________
 void AliPWG4HighPtQATPConly::ConnectInputData(Option_t *) 
 {
   // Connect ESD here
   // Called once
-  printf(">> AliPWG4HighPtQATPConly::ConnectInputData \n");
+  AliDebug(2,Form(">> AliPWG4HighPtSpectra::ConnectInputData \n"));
   TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
   if (!tree) {
     Printf("ERROR: Could not read chain from input slot 0");
@@ -142,46 +142,20 @@ void AliPWG4HighPtQATPConly::ConnectInputData(Option_t *)
     AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
     
     if (!esdH) {
-      Printf("ERROR: Could not get ESDInputHandler");
+      AliDebug(2,Form("ERROR: Could not get ESDInputHandler")); 
     } else
       fESD = esdH->GetEvent();
   }
 }
 
 //________________________________________________________________________
-void AliPWG4HighPtQATPConly::InitHistPointers() {
-  //Initialize histograms
-  fNEvent = 0;
-  fPtAll = 0;
-  fPtSel = 0;
-  //TPC only histos compared to global tracking
-  fPtAllTPC = 0;
-  fPtSelTPC = 0;
-  fPtAllminPtTPCvsPtAll = 0;
-  fPtAllminPtTPCvsPtAllNPointTPC = 0;
-  fPtAllminPtTPCvsPtAllDCAR = 0;
-  fPtAllminPtTPCvsPtAllDCAZ = 0;
-  fPtAllminPtTPCvsPtAllPhi = 0;
-  fPtAllminPtTPCvsPtAllNPointITS = 0;
-  fPtAllminPtTPCvsPtAllNSigmaToVertex = 0;
-  fPtAllminPtTPCvsPtAllChi2C = 0;
-  fPtAllminPtTPCvsPtAllRel1PtUncertainty = 0;
-  //ITSrefit histos compared to TPConly tracks
-  fPtSelITS = 0;
-  fPtITSminPtTPCvsPtITS = 0;
-  fPtITSminPtTPCvsPtITSNPointTPC = 0;
-  fPtITSminPtTPCvsPtITSDCAR = 0;
-  fPtITSminPtTPCvsPtITSDCAZ = 0;
-  fPtITSminPtTPCvsPtITSPhi = 0;
-  fPtITSminPtTPCvsPtITSNPointITS = 0;
-  fPtITSminPtTPCvsPtITSNSigmaToVertex = 0;
-  fPtITSminPtTPCvsPtITSChi2C = 0;
-  fPtITSminPtTPCvsPtITSRel1PtUncertainty = 0;
-}
-//________________________________________________________________________
 void AliPWG4HighPtQATPConly::CreateOutputObjects() {
   //Create output objects
-  printf(">> AliPWG4HighPtQATPConly::CreateOutputObjects \n");
+  AliDebug(2,Form(">> AliPWG4HighPtQATPConly::CreateOutputObjects \n")); 
+
+  Bool_t oldStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE); 
+
   OpenFile(0);
   fHistList = new TList();
   OpenFile(1);
@@ -321,16 +295,18 @@ void AliPWG4HighPtQATPConly::CreateOutputObjects() {
   fHistListTPC->Add(fPtSelTPC);
   fPtSelTPCITS = new TH1F("fPtSelTPCITS","PtSel",fgkNPtBins, fgkPtMin, fgkPtMax);
   fHistListTPC->Add(fPtSelTPCITS);
-  
+
+  TH1::AddDirectory(oldStatus);   
+
 }
 //________________________________________________________________________
 void AliPWG4HighPtQATPConly::Exec(Option_t *) {  
   // Main loop
   // Called for each event
-  printf(">> AliPWG4HighPtQATPConly::Exec \n");
-  
- if (!fESD) {
-    Printf("ERROR: fESD not available");
+  AliDebug(2,Form(">> AliPWG4HighPtQATPConly::Exec \n"));  
+
+  if (!fESD) {
+    AliDebug(2,Form("ERROR: fESD not available"));
     return;
   }
 
@@ -340,14 +316,15 @@ void AliPWG4HighPtQATPConly::Exec(Option_t *) {
   if (vtx->GetNContributors() < 2)
     return;
 
-  printf("Vertex title %s, status %d, nCont %d\n",vtx->GetTitle(), vtx->GetStatus(), vtx->GetNContributors());
+  AliDebug(2,Form("Vertex title %s, status %d, nCont %d\n",vtx->GetTitle(), vtx->GetStatus(), vtx->GetNContributors()));
+
   // Need to keep track of evts without vertex
   fNEvent->Fill(0.);
 
   if(!fESD->GetNumberOfTracks() || fESD->GetNumberOfTracks()<2) return;
   Int_t nTracks = fESD->GetNumberOfTracks();
-  printf("nTracks %d\n", nTracks);
-  
+  AliDebug(2,Form("nTracks %d", nTracks));
+
   for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
     
     AliESDtrack *track = fESD->GetTrack(iTrack);
@@ -420,7 +397,7 @@ void AliPWG4HighPtQATPConly::Exec(Option_t *) {
 //________________________________________________________________________
 void AliPWG4HighPtQATPConly::Terminate(Option_t *)
 {
-  printf("->AliPWG4HighPtQATPConly::Terminate \n");
 
-  printf("-<AliPWG4HighPtQATPConly::Terminate \n");
 }
+
+#endif
index 3773363..f171e23 100644 (file)
@@ -65,14 +65,14 @@ AliPWG4HighPtSpectra::AliPWG4HighPtSpectra(const Char_t* name) :
   fReadAODData(0),
   fCFManager(0x0),
   fESD(0),
-  fTrackCuts(new AliESDtrackCuts),
+  fTrackCuts(),//new AliESDtrackCuts),
   fHistList(0),
   fHistEventsProcessed(0x0)
 {
   //
   // Constructor. Initialization of Inputs and Outputs
   //
-  Info("AliPWG4HighPtSpectra","Calling Constructor");
+  AliDebug(2,Form("AliPWG4HighPtQAMC","Calling Constructor"));
   // Input slot #0 works with a TChain ESD
   DefineInput(0, TChain::Class());
   DefineOutput(0,TList::Class());
@@ -124,17 +124,18 @@ void AliPWG4HighPtSpectra::ConnectInputData(Option_t *)
 {
   // Connect ESD here
   // Called once
-  printf(">> AliPWG4HighPtSpectra::ConnectInputData \n");
+  AliDebug(2,Form(">> AliPWG4HighPtSpectra::ConnectInputData \n"));
+  //  printf(">> AliPWG4HighPtSpectra::ConnectInputData \n");
 
   TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
   if (!tree) {
-    Printf("ERROR: Could not read chain from input slot 0");
+    AliDebug(2,Form("ERROR: Could not read chain from input slot 0"));
   } else {
     
     AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
     
     if (!esdH) {
-      Printf("ERROR: Could not get ESDInputHandler");
+      AliDebug(2,Form("ERROR: Could not get ESDInputHandler"));
     } else
       fESD = esdH->GetEvent();
   }
@@ -146,10 +147,10 @@ void AliPWG4HighPtSpectra::Exec(Option_t *)//UserExec(Option_t *)
   //
   // Main loop function
   //
-  Info("Exec","") ;
+  AliDebug(2,Form(">> AliPWG4HighPtSpectra::Exec \n"));  
 
   if (!fESD) {
-    Printf("ERROR: fESD not available");
+    AliDebug(2,Form("ERROR: fESD not available"));
     return;
   }
 
@@ -158,26 +159,26 @@ void AliPWG4HighPtSpectra::Exec(Option_t *)//UserExec(Option_t *)
 
   AliMCEventHandler* eventHandler = dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler());
   if (!eventHandler) {
-    Printf("ERROR: Could not retrieve MC event handler");
+    AliDebug(2,Form("ERROR: Could not retrieve MC event handler"));
     return;
   }
 
   AliMCEvent* mcEvent = eventHandler->MCEvent();
   if (!mcEvent) {
-    Printf("ERROR: Could not retrieve MC event");
+    AliDebug(2,Form("ERROR: Could not retrieve MC event"));
     return;
   }
 
-  Printf("MC particles: %d", mcEvent->GetNumberOfTracks());
+  AliDebug(2,Form("MC particles: %d", mcEvent->GetNumberOfTracks()));
 
   if (!fESD) {
-    Printf("ERROR: fESD not available");
+    AliDebug(2,Form("ERROR: fESD not available"));
     return;
   }
 
   AliStack* stack = mcEvent->Stack();                //Particles Stack
 
-  Printf("MC particles stack: %d", stack->GetNtrack());
+  AliDebug(2,Form("MC particles stack: %d", stack->GetNtrack()));
 
   const AliESDVertex *vtx = fESD->GetPrimaryVertex();
 
@@ -187,13 +188,12 @@ void AliPWG4HighPtSpectra::Exec(Option_t *)//UserExec(Option_t *)
   vtx->GetXYZ(pvtx);
   if(TMath::Abs(pvtx[2])>10.) return;
 
-  printf("Vertex title %s, status %d, nCont %d\n",vtx->GetTitle(), vtx->GetStatus(), vtx->GetNContributors());
+  AliDebug(2,Form("Vertex title %s, status %d, nCont %d\n",vtx->GetTitle(), vtx->GetStatus(), vtx->GetNContributors()));
   // Need to keep track of evts without vertex
 
   Int_t nTracks = fESD->GetNumberOfTracks();
   AliDebug(2,Form("nTracks %d", nTracks));
-  printf("nTracks %d\n", nTracks);
-
   // AliVEvent*    fEvent = fInputEvent ;
   
 //   if (!fEvent) {
@@ -276,18 +276,18 @@ void AliPWG4HighPtSpectra::Terminate(Option_t*)
   // a query. It always runs on the client, it can be used to present
   // the results graphically or save the results to file.
 
-  Info("Terminate","");
-//   AliAnalysisTaskSE::Terminate();
 
 }
 
-
 //___________________________________________________________________________
 void AliPWG4HighPtSpectra::CreateOutputObjects() {
   //HERE ONE CAN CREATE OUTPUT OBJECTS, IN PARTICULAR IF THE OBJECT PARAMETERS DON'T NEED
   //TO BE SET BEFORE THE EXECUTION OF THE TASK
   //
-  Info("CreateOutputObjects","CreateOutputObjects of task %s", GetName());
+  AliDebug(2,Form("CreateOutputObjects","CreateOutputObjects of task %s", GetName()));
+
+  Bool_t oldStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE); 
 
   OpenFile(0);
   fHistList = new TList();
@@ -296,6 +296,8 @@ void AliPWG4HighPtSpectra::CreateOutputObjects() {
   fHistEventsProcessed = new TH1I("fHistEventsProcessed","",1,0,1) ;
   fHistList->Add(fHistEventsProcessed);
 
+  TH1::AddDirectory(oldStatus); 
+
 }
 
 #endif