1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
20 #include <TInterpreter.h>
25 #include "AliAnalysisTaskSE.h"
26 #include "AliAnalysisManager.h"
27 #include "AliESDEvent.h"
29 #include "AliAODEvent.h"
30 #include "AliVEvent.h"
31 #include "AliAODHandler.h"
32 #include "AliMCEventHandler.h"
33 #include "AliInputEventHandler.h"
34 #include "AliMCEvent.h"
38 ClassImp(AliAnalysisTaskSE)
40 ////////////////////////////////////////////////////////////////////////
42 AliAnalysisTaskSE::AliAnalysisTaskSE():
52 // Default constructor
55 AliAnalysisTaskSE::AliAnalysisTaskSE(const char* name):
56 AliAnalysisTask(name, "AnalysisTaskSE"),
65 // Default constructor
66 DefineInput (0, TChain::Class());
67 DefineOutput(0, TTree::Class());
70 AliAnalysisTaskSE::AliAnalysisTaskSE(const AliAnalysisTaskSE& obj):
83 fInputEvent = obj.fInputEvent;
84 fInputHandler = obj.fInputHandler;
85 fOutputAOD = obj.fOutputAOD;
86 fMCEvent = obj.fMCEvent;
91 AliAnalysisTaskSE& AliAnalysisTaskSE::operator=(const AliAnalysisTaskSE& other)
94 AliAnalysisTask::operator=(other);
95 fDebug = other.fDebug;
96 fEntry = other.fEntry;
97 fInputEvent = other.fInputEvent;
98 fInputHandler = other.fInputHandler;
99 fOutputAOD = other.fOutputAOD;
100 fMCEvent = other.fMCEvent;
101 fTreeA = other.fTreeA;
106 void AliAnalysisTaskSE::ConnectInputData(Option_t* /*option*/)
108 // Connect the input data
109 if (fDebug > 1) printf("AnalysisTaskSE::ConnectInputData() \n");
113 AliInputEventHandler* fInputHandler = (AliInputEventHandler*)
114 ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
115 if (fInputHandler) fInputEvent = fInputHandler->GetEvent();
119 AliMCEventHandler* mcH = 0;
120 mcH = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
121 if (mcH) fMCEvent = mcH->MCEvent();
124 void AliAnalysisTaskSE::CreateOutputObjects()
126 // Create the output container
129 if (fDebug > 1) printf("AnalysisTaskSE::CreateOutPutData() \n");
131 AliAODHandler* handler = (AliAODHandler*)
132 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
134 fOutputAOD = handler->GetAOD();
135 fTreeA = handler->GetTree();
136 UserCreateOutputObjects();
139 void AliAnalysisTaskSE::Exec(Option_t* option)
142 // Exec analysis of one event
143 fEntry = fInputHandler->GetReadEntry();