]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODHandler.cxx
Response of the 4 towers for the 2 neutron calorimeters since,
[u/mrichter/AliRoot.git] / STEER / AliAODHandler.cxx
index 6c53a2e08240f881c10da731171aa81e0f77cb19..46f9c95c5d05740bba7c1bb42d3f28edbfac57a7 100644 (file)
 //     Author: Andreas Morsch, CERN
 //-------------------------------------------------------------------------
 
-#include <TFile.h>
+
 #include <TTree.h>
+#include <TFile.h>
+
 #include "AliAODHandler.h"
 #include "AliAODEvent.h"
 
@@ -29,18 +31,22 @@ ClassImp(AliAODHandler)
 
 //______________________________________________________________________________
 AliAODHandler::AliAODHandler() :
-    AliVirtualEventHandler(),
+    AliVEventHandler(),
     fAODEvent(NULL),
-    fAODFile(NULL)
+    fTreeA(NULL),
+    fFileA(NULL),
+    fName("")
 {
   // default constructor
 }
 
 //______________________________________________________________________________
 AliAODHandler::AliAODHandler(const char* name, const char* title):
-    AliVirtualEventHandler(name, title),
+    AliVEventHandler(name, title),
     fAODEvent(NULL),
-    fAODFile(NULL)
+    fTreeA(NULL),
+    fFileA(NULL),
+    fName("")
 {
 }
 
@@ -51,22 +57,32 @@ AliAODHandler::~AliAODHandler()
 }
 
 
-Bool_t AliAODHandler::InitIO()
+Bool_t AliAODHandler::InitIO(Option_t* opt)
 {
     // Initialize IO
+    //
+    // Create the AODevent object
     fAODEvent = new AliAODEvent();
     fAODEvent->CreateStdContent();
-//    fAODFile  = new TFile("aod.root", "recreate");
+    //
+    // File opening according to execution mode
+
+    if (!(strcmp(opt, "proof"))) {
+       // proof
+    } else {
+       // local and grid
+       fFileA = new TFile(fName, "RECREATE");
+    }
+    //
+    // Create the output tree
     CreateTree();
     
     return kTRUE;
 }
 
-Bool_t AliAODHandler::Fill()
+Bool_t AliAODHandler::FinishEvent()
 {
     // Fill data structures
-    printf(">>>>>>>>>>> AliAODHandler::Fill()\n");
-    
     FillTree();
     fAODEvent->ClearStd();
     
@@ -84,10 +100,6 @@ Bool_t AliAODHandler::TerminateIO()
 {
     // Terminate IO
 
-//    fAODFile->cd();
-//    fTreeA->Write();
-//    fAODFile->Close();
-    
     return kTRUE;
 }
 
@@ -95,7 +107,7 @@ Bool_t AliAODHandler::TerminateIO()
 void AliAODHandler::CreateTree()
 {
     // Creates the AOD Tree
-    fTreeA = new TTree("AOD", "AliAOD tree");
+    fTreeA = new TTree("aodTree", "AliAOD tree");
     fTreeA->Branch(fAODEvent->GetList());
 }