]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGJE/EMCALJetTasks/macros/AddTaskSAJF.C
parameterization for pA run with 188357 - only V0 and SPD in
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / macros / AddTaskSAJF.C
CommitLineData
00514d01 1// $Id$
2
3AliAnalysisTaskSAJF* AddTaskSAJF(
00514d01 4 const char *ntracks = "Tracks",
5 const char *nclusters = "CaloClusters",
6 const char *njets = "Jets",
226f511d 7 const char *nrho = "Rho",
a487deae 8 Double_t jetradius = 0.2,
df43b607 9 Double_t jetptcut = 1,
b0e00dc4 10 Double_t jetareacut = 0.8,
226f511d 11 Double_t ptcut = 0.15,
7cf4626b 12 UInt_t type = AliAnalysisTaskEmcal::kTPC,
a487deae 13 Int_t leadhadtype = 0,
7cf4626b 14 const char *taskname = "AliAnalysisTaskSAJF"
00514d01 15)
16{
17 // Get the pointer to the existing analysis manager via the static access method.
18 //==============================================================================
19 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
20 if (!mgr)
21 {
22 ::Error("AddTaskSAJF", "No analysis manager to connect to.");
23 return NULL;
24 }
25
26 // Check the analysis type using the event handlers connected to the analysis manager.
27 //==============================================================================
28 if (!mgr->GetInputEventHandler())
29 {
30 ::Error("AddTaskSAJF", "This task requires an input event handler");
31 return NULL;
32 }
33
34 //-------------------------------------------------------
35 // Init the task and do settings
36 //-------------------------------------------------------
37
a487deae 38 TString name(Form("%s_%s_%s_R0%d_",taskname,njets,nrho,(Int_t)floor(jetradius*100+0.5)));
7cf4626b 39 if (type == AliAnalysisTaskEmcal::kTPC)
40 name += "TPC";
41 else if (type == AliAnalysisTaskEmcal::kEMCAL)
42 name += "EMCAL";
a487deae 43 else if (type == AliAnalysisTaskEmcal::kUser)
44 name += "USER";
7cf4626b 45 AliAnalysisTaskSAJF* jetTask = new AliAnalysisTaskSAJF(name);
af986cb0 46 jetTask->SetAnaType(type);
47 jetTask->SetTracksName(ntracks);
48 jetTask->SetClusName(nclusters);
49 jetTask->SetJetsName(njets);
af986cb0 50 jetTask->SetRhoName(nrho);
51 jetTask->SetPtCut(ptcut);
52 jetTask->SetJetRadius(jetradius);
df43b607 53 jetTask->SetJetPtCut(jetptcut);
b0e00dc4 54 jetTask->SetPercAreaCut(jetareacut);
a487deae 55 jetTask->SetLeadingHadronType(leadhadtype);
df43b607 56
00514d01 57 //-------------------------------------------------------
58 // Final settings, pass to manager and set the containers
59 //-------------------------------------------------------
df43b607 60
af986cb0 61 mgr->AddTask(jetTask);
00514d01 62
63 // Create containers for input/output
c10e3608 64 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
7cf4626b 65 TString contname(name);
00514d01 66 contname += "_histos";
c10e3608 67 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
68 TList::Class(),AliAnalysisManager::kOutputContainer,
69 Form("%s", AliAnalysisManager::GetCommonFileName()));
af986cb0 70 mgr->ConnectInput (jetTask, 0, cinput1 );
71 mgr->ConnectOutput (jetTask, 1, coutput1 );
df43b607 72
af986cb0 73 return jetTask;
00514d01 74}