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():
50 // Default constructor
53 AliAnalysisTaskSE::AliAnalysisTaskSE(const char* name):
54 AliAnalysisTask(name, "AnalysisTaskSE"),
61 // Default constructor
62 DefineInput (0, TChain::Class());
63 DefineOutput(0, TTree::Class());
68 void AliAnalysisTaskSE::ConnectInputData(Option_t* /*option*/)
70 // Connect the input data
71 if (fDebug > 1) printf("AnalysisTaskSE::ConnectInputData() \n");
75 AliInputEventHandler* handler = (AliInputEventHandler*)
76 ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
77 if (handler) fInputEvent = handler->GetEvent();
81 AliMCEventHandler* mcH = 0;
82 mcH = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
83 if (mcH) fMCEvent = mcH->MCEvent();
86 void AliAnalysisTaskSE::CreateOutputObjects()
88 // Create the output container
91 if (fDebug > 1) printf("AnalysisTaskSE::CreateOutPutData() \n");
93 AliAODHandler* handler = (AliAODHandler*)
94 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
96 fOutputAOD = handler->GetAOD();
97 fTreeA = handler->GetTree();
98 UserCreateOutputObjects();
101 void AliAnalysisTaskSE::Exec(Option_t* option)
104 // Exec analysis of one event