1 /**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //-------------------------------------------------------------------------
19 // Implementation of the Virtual Event Handler Interface for AOD
20 // Author: Andreas Morsch, CERN
21 //-------------------------------------------------------------------------
27 #include "AliAODHandler.h"
28 #include "AliAODEvent.h"
30 ClassImp(AliAODHandler)
32 //______________________________________________________________________________
33 AliAODHandler::AliAODHandler() :
40 // default constructor
43 //______________________________________________________________________________
44 AliAODHandler::AliAODHandler(const char* name, const char* title):
45 AliVEventHandler(name, title),
53 //______________________________________________________________________________
54 AliAODHandler::~AliAODHandler()
58 // is already handled in TerminateIO
68 Bool_t AliAODHandler::Init(Option_t* opt)
72 // Create the AODevent object
74 fAODEvent = new AliAODEvent();
75 fAODEvent->CreateStdContent();
78 // File opening according to execution mode
80 if (!(strcmp(opt, "proof"))) {
85 TDirectory *owd = gDirectory;
86 fFileA = new TFile(fName, "RECREATE");
93 Bool_t AliAODHandler::FinishEvent()
95 // Fill data structures
97 fAODEvent->ResetStd();
101 Bool_t AliAODHandler::Terminate()
104 AddAODtoTreeUserInfo();
108 Bool_t AliAODHandler::TerminateIO()
119 void AliAODHandler::CreateTree(Int_t flag)
121 // Creates the AOD Tree
122 fTreeA = new TTree("aodTree", "AliAOD tree");
123 fTreeA->Branch(fAODEvent->GetList());
124 if (flag == 0) fTreeA->SetDirectory(0);
127 void AliAODHandler::FillTree()
134 void AliAODHandler::AddAODtoTreeUserInfo()
136 // Add aod event to tree user info
137 fTreeA->GetUserInfo()->Add(fAODEvent);