// Author: Andreas Morsch, CERN
//-------------------------------------------------------------------------
-#include <TFile.h>
+
#include <TTree.h>
+#include <TFile.h>
+
#include "AliAODHandler.h"
#include "AliAODEvent.h"
//______________________________________________________________________________
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("")
{
}
}
-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();
{
// Terminate IO
-// fAODFile->cd();
-// fTreeA->Write();
-// fAODFile->Close();
-
return kTRUE;
}
void AliAODHandler::CreateTree()
{
// Creates the AOD Tree
- fTreeA = new TTree("AOD", "AliAOD tree");
+ fTreeA = new TTree("aodTree", "AliAOD tree");
fTreeA->Branch(fAODEvent->GetList());
}