]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/EMCALJetTasks/macros/AddTaskRho.C
adding files that were forgotten in the previous commit
[u/mrichter/AliRoot.git] / PWGGA / EMCALJetTasks / macros / AddTaskRho.C
CommitLineData
020052e4 1// $Id$
2
3AliAnalysisTaskRho* AddTaskRho(
4 const char *outfilename = "AnalysisOutput.root",
5 const char *nJets = "Jets",
6 const char *nRhos = "rho",
7 const Double_t minPhi = 1.8,
8 const Double_t maxPhi = 2.74,
9 const Double_t minEta = -0.3,
10 const Double_t maxEta = 0.3,
11 const Double_t minArea = 0.0
12)
13{
14 // Get the pointer to the existing analysis manager via the static access method.
15 //==============================================================================
16 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
17 if (!mgr)
18 {
19 ::Error("AddTaskRho", "No analysis manager to connect to.");
20 return NULL;
21 }
22
23 // Check the analysis type using the event handlers connected to the analysis manager.
24 //==============================================================================
25 if (!mgr->GetInputEventHandler())
26 {
27 ::Error("AddTaskRho", "This task requires an input event handler");
28 return NULL;
29 }
30
31 //-------------------------------------------------------
32 // Init the task and do settings
33 //-------------------------------------------------------
34
35 TString name(Form("Rho_%s", nJets));
36 AliAnalysisTaskRho *rhotask = new AliAnalysisTaskRho(name);
37 rhotask->SetJetsName(nJets);
38 rhotask->SetRhosName(nRhos);
39 rhotask->SetJetPhi(minPhi,maxPhi);
40 rhotask->SetJetEta(minEta,maxEta);
41 rhotask->SetAreaCut(minArea);
42
43 //-------------------------------------------------------
44 // Final settings, pass to manager and set the containers
45 //-------------------------------------------------------
46
47 mgr->AddTask(rhotask);
48
49 // Create containers for input/output
50 mgr->ConnectInput (rhotask, 0, mgr->GetCommonInputContainer() );
51 AliAnalysisDataContainer *corho = mgr->CreateContainer(name,
52 TList::Class(),
53 AliAnalysisManager::kOutputContainer,
54 outfilename);
55 mgr->ConnectOutput(rhotask, 1, corho);
56
57 return rhotask;
58}