]> git.uio.no Git - u/mrichter/AliRoot.git/blame - JETAN/AliAnalysisTaskJets.cxx
added VZERO
[u/mrichter/AliRoot.git] / JETAN / AliAnalysisTaskJets.cxx
CommitLineData
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 **************************************************************************/
15
16#include <TROOT.h>
17#include <TSystem.h>
18#include <TInterpreter.h>
19#include <TChain.h>
20#include <TH1.h>
21
22#include "AliAnalysisTaskJets.h"
23#include "AliJetFinder.h"
24#include "AliESD.h"
25
26ClassImp(AliAnalysisTaskJets)
27
28////////////////////////////////////////////////////////////////////////
29
19e6695b 30AliAnalysisTaskJets::AliAnalysisTaskJets():
31 fDebug(0),
32 fJetFinder(0x0),
33 fChain(0x0),
34 fESD(0x0)
35{
36 // Default constructor
37}
38
e5b96aa0 39AliAnalysisTaskJets::AliAnalysisTaskJets(const char* name):
40 AliAnalysisTask(name, "AnalysisTaskJets"),
68093d75 41 fDebug(0),
e5b96aa0 42 fJetFinder(0x0),
43 fChain(0x0),
44 fESD(0x0)
45{
46 // Default constructor
47 DefineInput (0, TChain::Class());
19e6695b 48// DefineOutput(0, TTree::Class());
e5b96aa0 49}
50
19e6695b 51void AliAnalysisTaskJets::Init()
e5b96aa0 52{
19e6695b 53 // Initialization
54 if (fDebug > 1) printf("AnalysisTaskJets::Init() \n");
e5b96aa0 55 // Call configuration file
56 gROOT->LoadMacro("ConfigJetAnalysis.C");
57 fJetFinder = (AliJetFinder*) gInterpreter->ProcessLine("ConfigJetAnalysis()");
58 // Initialise Jet Analysis
59 fJetFinder->Init();
19e6695b 60}
61
62void AliAnalysisTaskJets::ConnectInputData(Option_t */*option*/)
63{
64// Connect the input data
65//
66 if (fDebug > 1) printf("AnalysisTaskJets::ConnectInputData() \n");
e5b96aa0 67 fChain = (TChain*)GetInputData(0);
68 fJetFinder->ConnectTree(fChain);
69 fJetFinder->WriteHeaders();
70}
71
72void AliAnalysisTaskJets::Exec(Option_t */*option*/)
73{
74// Execute analysis for current event
75//
76 Long64_t ientry = fChain->GetReadEntry();
68093d75 77 if (fDebug > 1) printf("Analysing event # %5d \n", (Int_t) ientry);
e5b96aa0 78
79 fJetFinder->ProcessEvent(ientry);
80}
81
82void AliAnalysisTaskJets::Terminate(Option_t */*option*/)
83{
84// Terminate analysis
85//
19e6695b 86 if (fDebug > 1) printf("AnalysisJets: Terminate() \n");
68093d75 87 if (fJetFinder) fJetFinder->FinishRun();
e5b96aa0 88}
89