]>
Commit | Line | Data |
---|---|---|
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 | /* $Id$ */ | |
17 | ||
18 | #include <TROOT.h> | |
19 | #include <TSystem.h> | |
20 | #include <TInterpreter.h> | |
21 | #include <TChain.h> | |
22 | #include <TFile.h> | |
23 | #include <TList.h> | |
24 | ||
25 | #include "AliAnalysisTaskJets.h" | |
26 | #include "AliAnalysisManager.h" | |
27 | #include "AliJetFinder.h" | |
28 | #include "AliJetHistos.h" | |
29 | #include "AliESDEvent.h" | |
30 | #include "AliESD.h" | |
31 | #include "AliAODEvent.h" | |
32 | #include "AliAODHandler.h" | |
33 | #include "AliMCEventHandler.h" | |
34 | #include "AliESDInputHandler.h" | |
35 | #include "AliMCEvent.h" | |
36 | #include "AliStack.h" | |
37 | ||
38 | ||
39 | ClassImp(AliAnalysisTaskJets) | |
40 | ||
41 | //////////////////////////////////////////////////////////////////////// | |
42 | ||
43 | AliAnalysisTaskJets::AliAnalysisTaskJets(): | |
44 | AliAnalysisTaskSE(), | |
45 | fJetFinder(0x0), | |
46 | fHistos(0x0), | |
47 | fListOfHistos(0x0) | |
48 | { | |
49 | // Default constructor | |
50 | } | |
51 | ||
52 | AliAnalysisTaskJets::AliAnalysisTaskJets(const char* name): | |
53 | AliAnalysisTaskSE(name), | |
54 | fJetFinder(0x0), | |
55 | fHistos(0x0), | |
56 | fListOfHistos(0x0) | |
57 | { | |
58 | // Default constructor | |
59 | DefineOutput(1, TList::Class()); | |
60 | } | |
61 | ||
62 | void AliAnalysisTaskJets::UserCreateOutputObjects() | |
63 | { | |
64 | // Create the output container | |
65 | // | |
66 | if (fDebug > 1) printf("AnalysisTaskJets::CreateOutPutData() \n"); | |
67 | // Connec default AOD to jet finder | |
68 | ||
69 | fJetFinder->ConnectAOD(AODEvent()); | |
70 | // | |
71 | // Histograms | |
72 | OpenFile(1); | |
73 | fListOfHistos = new TList(); | |
74 | fHistos = new AliJetHistos(); | |
75 | fHistos->AddHistosToList(fListOfHistos); | |
76 | } | |
77 | ||
78 | void AliAnalysisTaskJets::Init() | |
79 | { | |
80 | // Initialization | |
81 | if (fDebug > 1) printf("AnalysisTaskJets::Init() \n"); | |
82 | ||
83 | // Call configuration file | |
84 | gROOT->LoadMacro("ConfigJetAnalysis.C"); | |
85 | fJetFinder = (AliJetFinder*) gInterpreter->ProcessLine("ConfigJetAnalysis()"); | |
86 | // Initialise Jet Analysis | |
87 | fJetFinder->Init(); | |
88 | // Write header information to local file | |
89 | fJetFinder->WriteHeaders(); | |
90 | } | |
91 | ||
92 | ||
93 | ||
94 | ||
95 | ||
96 | void AliAnalysisTaskJets::UserExec(Option_t */*option*/) | |
97 | { | |
98 | // Execute analysis for current event | |
99 | // | |
100 | ||
101 | fJetFinder->GetReader()->SetInputEvent(InputEvent(), AODEvent(), MCEvent()); | |
102 | fJetFinder->ProcessEvent(); | |
103 | ||
104 | // Fill control histos | |
105 | fHistos->FillHistos(AODEvent()->GetJets()); | |
106 | // Post the data | |
107 | PostData(1, fListOfHistos); | |
108 | } | |
109 | ||
110 | void AliAnalysisTaskJets::Terminate(Option_t */*option*/) | |
111 | { | |
112 | // Terminate analysis | |
113 | // | |
114 | if (fDebug > 1) printf("AnalysisJets: Terminate() \n"); | |
115 | // if (fJetFinder) fJetFinder->FinishRun(); | |
116 | } | |
117 |