Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / STEER / STEER / AliHLTTestInputHandler.cxx
CommitLineData
b9f1d917 1/**************************************************************************
2 * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16//-------------------------------------------------------------------------
17// Event handler for reconstruction
18// Author: Andrei Gheata, CERN
19//-------------------------------------------------------------------------
20
21#include "AliHLTTestInputHandler.h"
22#include "AliVCuts.h"
16af082b 23#include "AliVEvent.h"
afdb0e0d 24#include "TObjArray.h"
25#include "AliAnalysisTask.h"
b9f1d917 26
27ClassImp(AliHLTTestInputHandler)
28
29//______________________________________________________________________________
2de4dc45 30AliHLTTestInputHandler::AliHLTTestInputHandler()
31 : AliVEventHandler()
32 , fEvent(NULL)
33 , fFriendEvent(NULL)
34{
35// default constructor
36}
37
38//______________________________________________________________________________
b9f1d917 39AliHLTTestInputHandler::AliHLTTestInputHandler(const char* name, const char* title)
afdb0e0d 40 : AliVEventHandler(name,title)
2de4dc45 41 , fEvent(NULL)
42 , fFriendEvent(NULL)
b9f1d917 43{
44// Named constructor
45}
46
47//______________________________________________________________________________
2de4dc45 48AliHLTTestInputHandler::AliHLTTestInputHandler(AliHLTTestInputHandler& that)
49 : AliVEventHandler(that)
50 , fEvent(that.fEvent)
51 , fFriendEvent(that.fFriendEvent)
52{
53// dummy cpy constructor
54}
55
56//______________________________________________________________________________
a453390d 57Bool_t AliHLTTestInputHandler::Init(TTree* /*tree*/, Option_t* /*opt*/)
b9f1d917 58{
59// Initialisation necessary for each new tree. In reco case this is once.
afdb0e0d 60 Printf("----> AliHLTTestInputHandler::Init");
61 Printf("<---- AliHLTTestInputHandler::Init");
62
b9f1d917 63 return kTRUE;
64}
65//______________________________________________________________________________
66Bool_t AliHLTTestInputHandler::BeginEvent(Long64_t)
67{
68// Called at the beginning of every event
afdb0e0d 69
70 Printf("----> HLTTestInputHandler: BeginEvent: now fEvent is %p", fEvent);
71
72 Printf("----> HLTTestInputHandler: at the end of BeginEvent: now fEvent is %p", fEvent);
b9f1d917 73 return kTRUE;
74}
afdb0e0d 75
76//______________________________________________________________________________
16af082b 77Bool_t AliHLTTestInputHandler::InitTaskInputData(AliVEvent* esdEvent, AliVfriendEvent* friendEvent, TObjArray* arrTasks) {
afdb0e0d 78
79// Method to propagte to all the connected tasks the HLT event.
80// The method gets the list of tasks from the manager
81
82 Printf("----> AliHLTTestInputHandler::InitTaskInpuData: Setting the event...");
16af082b 83 SetEvent(esdEvent);
1f516476 84 SetVFriendEvent(friendEvent);
afdb0e0d 85 // set transient pointer to event inside tracks
86 fEvent->ConnectTracks();
82245e04 87 Printf("----> AliHLTTestInputHandler::InitTaskInpuData: ...Event set: fEvent = %p; friend = %p", fEvent, friendEvent);
afdb0e0d 88 for (Int_t i = 0; i < arrTasks->GetEntries(); i++){
89 AliAnalysisTask* t = (AliAnalysisTask*)(arrTasks->At(i));
90 t->ConnectInputData("");
91 }
92 return kTRUE;
93}