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 **************************************************************************/
18 #include <TInterpreter.h>
22 #include "AliAnalysisTaskJets.h"
23 #include "AliJetFinder.h"
26 ClassImp(AliAnalysisTaskJets)
28 ////////////////////////////////////////////////////////////////////////
30 AliAnalysisTaskJets::AliAnalysisTaskJets():
37 // Default constructor
40 AliAnalysisTaskJets::AliAnalysisTaskJets(const char* name):
41 AliAnalysisTask(name, "AnalysisTaskJets"),
48 // Default constructor
49 DefineInput (0, TChain::Class());
50 DefineOutput(0, TTree::Class());
53 void AliAnalysisTaskJets::CreateOutputObjects()
55 // Create the output container
56 fTreeJ = fJetFinder->MakeTreeJ("TreeJ");
59 void AliAnalysisTaskJets::Init()
62 if (fDebug > 1) printf("AnalysisTaskJets::Init() \n");
64 // Call configuration file
65 gROOT->LoadMacro("ConfigJetAnalysis.C");
66 fJetFinder = (AliJetFinder*) gInterpreter->ProcessLine("ConfigJetAnalysis()");
67 // Initialise Jet Analysis
71 void AliAnalysisTaskJets::ConnectInputData(Option_t */*option*/)
73 // Connect the input data
75 if (fDebug > 1) printf("AnalysisTaskJets::ConnectInputData() \n");
77 fChain = (TChain*)GetInputData(0);
78 fJetFinder->ConnectTree(fChain);
79 fJetFinder->WriteHeaders();
82 void AliAnalysisTaskJets::Exec(Option_t */*option*/)
84 // Execute analysis for current event
86 Long64_t ientry = fChain->GetReadEntry();
87 if (fDebug > 1) printf("Analysing event # %5d \n", (Int_t) ientry);
88 fJetFinder->ProcessEvent(ientry);
92 void AliAnalysisTaskJets::Terminate(Option_t */*option*/)
96 if (fDebug > 1) printf("AnalysisJets: Terminate() \n");
98 if (fJetFinder) fJetFinder->FinishRun();