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