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