]>
Commit | Line | Data |
---|---|---|
d3dd3d14 | 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 | /* $Id$ */ | |
17 | ||
18 | //------------------------------------------------------------------------- | |
19 | // Event handler for ESD input | |
20 | // Author: Andreas Morsch, CERN | |
21 | //------------------------------------------------------------------------- | |
22 | ||
933fd60f | 23 | #include <TTree.h> |
d3dd3d14 | 24 | |
25 | #include "AliESDInputHandler.h" | |
26 | #include "AliESDEvent.h" | |
27 | #include "AliESD.h" | |
28 | ||
29 | ClassImp(AliESDInputHandler) | |
30 | ||
31 | //______________________________________________________________________________ | |
13054f41 | 32 | AliESDInputHandler::AliESDInputHandler(): |
33 | AliInputEventHandler(), | |
34 | fEvent(0) | |
d3dd3d14 | 35 | { |
36 | // default constructor | |
37 | } | |
38 | ||
39 | //______________________________________________________________________________ | |
40 | AliESDInputHandler::~AliESDInputHandler() | |
41 | { | |
42 | // destructor | |
43 | } | |
44 | ||
45 | //______________________________________________________________________________ | |
46 | AliESDInputHandler::AliESDInputHandler(const char* name, const char* title): | |
47 | AliInputEventHandler(name, title) | |
48 | { | |
49 | } | |
50 | ||
13054f41 | 51 | Bool_t AliESDInputHandler::InitIO(Option_t* /*opt*/) |
d3dd3d14 | 52 | { |
6073f8c9 | 53 | if (!fTree) return kFALSE; |
d3dd3d14 | 54 | // Get pointer to ESD event |
55 | fEvent = new AliESDEvent(); | |
933fd60f | 56 | fEvent->ReadFromTree(fTree); |
d3dd3d14 | 57 | return kTRUE; |
58 | } | |
59 | ||
ed97dc98 | 60 | Bool_t AliESDInputHandler::BeginEvent(Long64_t /*entry*/) |
d3dd3d14 | 61 | { |
62 | // Copy from old to new format if necessary | |
63 | AliESD* old = ((AliESDEvent*) fEvent)->GetAliESDOld(); | |
64 | if (old) { | |
d3dd3d14 | 65 | ((AliESDEvent*)fEvent)->CopyFromOldESD(); |
66 | old->Reset(); | |
67 | } | |
68 | return kTRUE; | |
69 | } | |
70 |