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 // Event handler for AOD input
20 // Author: Andreas Morsch, CERN
21 //-------------------------------------------------------------------------
27 #include "AliAODInputHandler.h"
28 #include "AliAODEvent.h"
30 ClassImp(AliAODInputHandler)
32 static Option_t *gAODDataType = "AOD";
34 //______________________________________________________________________________
35 AliAODInputHandler::AliAODInputHandler() :
36 AliInputEventHandler(),
40 // Default constructor
43 //______________________________________________________________________________
44 AliAODInputHandler::AliAODInputHandler(const char* name, const char* title):
45 AliInputEventHandler(name, title),
52 //______________________________________________________________________________
53 AliAODInputHandler::~AliAODInputHandler()
60 Bool_t AliAODInputHandler::Init(TTree* tree, Option_t* /*opt*/)
62 // Initialisation necessary for each new tree
67 while((obj = (TNamed*)next())) {
68 if (fTree->GetTree()) {
69 (fTree->GetTree())->AddFriend("aodTree", obj->GetName());
71 fTree->AddFriend("aodTree", obj->GetName());
75 if (!fTree) return kFALSE;
76 // Get pointer to AOD event
81 fEvent = new AliAODEvent();
83 fEvent->ReadFromTree(fTree);
87 Bool_t AliAODInputHandler::BeginEvent(Long64_t /*entry*/)
90 //if (fTree) fTree->BranchRef();
94 void AliAODInputHandler::AddFriend(char* filename)
97 TNamed* obj = new TNamed(filename, filename);
101 Option_t *AliAODInputHandler::GetDataType() const
103 // Returns handled data type.