AliRoot Core  3dc7879 (3dc7879)
AliAnalysisTaskCopyESD.cxx
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 #include <TTree.h>
17 
18 #include "AliAnalysisTaskFilter.h"
19 #include "AliAnalysisTaskCopyESD.h"
20 #include "AliESDEvent.h"
21 #include "AliLog.h"
22 #include "AliESDfriend.h"
23 
24 ClassImp(AliAnalysisTaskCopyESD)
25 
26 
30  fESDEvent(0x0),
31  fESDfriend(0x0)
32 {
33  // Default constructor
34  //DefineInput(0, TChain::Class());
35  // Output slot #0 writes into a TTree
36  //DefineOutput(0,TTree::Class()); //My private output
37 }
38 //-------------------------------------------------------------------------------
41  fESDEvent(0x0),
42  fESDfriend(0x0)
43 {
45 
46 }
47 
48 //-------------------------------------------------------------------------------
50 {
52 
53  AliInfo("In UserCreateOuptputObject");
54 }
55 
56 //-------------------------------------------------------------------------------
58 {
60 
61  if (fDebug > 1) AliInfo("Init() \n");
62 }
63 
64 
65 //-------------------------------------------------------------------------------
66 void AliAnalysisTaskCopyESD::UserExec(Option_t */*option*/)
67 {
69 
70  AliInfo("Copying event");
71  AliESDEvent* esd = dynamic_cast<AliESDEvent*>(InputEvent());
72  fESDEvent = ESDEvent(); // get the output ESD
73  fESDfriend = ESDfriend(); // get the output friend
74  esd->Copy(*fESDEvent);
75 
76  // releasing tracks to avoid copying them
77  // for (Int_t i = 0; i<fESDEvent->GetNumberOfTracks(); i++){
78  // fESDEvent->GetTrack(i)->ReleaseESDfriendTrack();
79  //}
80 }
81 
82 
83 //-------------------------------------------------------------------------------
84 void AliAnalysisTaskCopyESD::Terminate(Option_t */*option*/)
85 {
87 
88  if (fDebug > 1) printf("AnalysisCopyESD: Terminate() \n");
89 }
90 
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
virtual void UserExec(Option_t *option)
virtual void Copy(TObject &obj) const
virtual AliESDfriend * ESDfriend()
virtual void Terminate(Option_t *option)
#define AliInfo(message)
Definition: AliLog.h:484
Base class for filtering friends.
virtual AliVEvent * InputEvent()