]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDInputHandler.cxx
coding violation fixes
[u/mrichter/AliRoot.git] / STEER / AliESDInputHandler.cxx
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
23 #include <TTree.h>
24
25 #include "AliESDInputHandler.h"
26 #include "AliESDEvent.h"
27 #include "AliESD.h"
28
29 ClassImp(AliESDInputHandler)
30
31 //______________________________________________________________________________
32 AliESDInputHandler::AliESDInputHandler() :
33   AliInputEventHandler()
34 {
35   // default constructor
36 }
37
38 //______________________________________________________________________________
39 AliESDInputHandler::~AliESDInputHandler() 
40 {
41 // destructor
42 }
43
44 //______________________________________________________________________________
45 AliESDInputHandler::AliESDInputHandler(const char* name, const char* title):
46     AliInputEventHandler(name, title)
47 {
48 }
49
50 Bool_t AliESDInputHandler::InitIO(Option_t* opt)
51 {
52     if (!fTree) return kFALSE;
53     // Get pointer to ESD event
54     fEvent = new AliESDEvent();
55     fEvent->ReadFromTree(fTree);
56     return kTRUE;
57 }
58
59 Bool_t AliESDInputHandler::BeginEvent()
60 {
61     // Copy from old to new format if necessary
62     AliESD* old = ((AliESDEvent*) fEvent)->GetAliESDOld();
63     if (old) {
64         ((AliESDEvent*)fEvent)->CopyFromOldESD();
65         old->Reset();
66     }
67     return kTRUE;
68 }
69