Undoing some unwanted method renames
[u/mrichter/AliRoot.git] / PWGJE / macros / AddTaskKMeans.C
CommitLineData
a65a7e70 1AliAnalysisTaskKMeans *AddTaskKMeans()
2{
3// Creates a dijet task, configures it and adds it to the analysis manager.
4
5 // Get the pointer to the existing analysis manager via the static access method.
6 //==============================================================================
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8 if (!mgr) {
9 ::Error("AddTaskJets", "No analysis manager to connect to.");
10 return NULL;
11 }
12
13 // Check the analysis type using the event handlers connected to the analysis manager.
14 //==============================================================================
15 if (!mgr->GetInputEventHandler()) {
16 ::Error("AddTaskKMeans", "This task requires an input event handler");
17 return NULL;
18 }
19
20 // Create the task and configure it.
21 //===========================================================================
22
23 AliAnalysisTaskKMeans *taskKMeans = new AliAnalysisTaskKMeans("K-Means Analysis");
24 taskKMeans->SetDebugLevel(0);
25 AliESDtrackCuts* esdTrackCutsL = new AliESDtrackCuts("AliESDtrackCuts", "Standard");
26 esdTrackCutsL->SetMinNClustersTPC(50);
27 esdTrackCutsL->SetRequireTPCRefit(kTRUE);
28 esdTrackCutsL->SetRequireITSRefit(kTRUE);
29 esdTrackCutsL->SetMaxDCAToVertexXY(3.);
30 esdTrackCutsL->SetMaxDCAToVertexZ(3.);
31 esdTrackCutsL->SetAcceptKinkDaughters(kFALSE);
32 taskKMeans->SetCuts(esdTrackCutsL);
33 taskKMeans->SetK(4);
34 taskKMeans->SetMinimumMultiplicity(10);
35 AliKMeansClustering::SetBeta(1.);
36 mgr->AddTask(taskKMeans);
37
38 AliAnalysisDataContainer* cout_kmeans = mgr->CreateContainer("KMeans", TList::Class(),AliAnalysisManager::kOutputContainer,
39 Form("%s:PWG4_KMeans", AliAnalysisManager::GetCommonFileName()));
40
41 // Create ONLY the output containers for the data produced by the task.
42 // Get and connect other common input/output containers via the manager as below
43 //==============================================================================
44 mgr->ConnectInput (taskKMeans, 0, mgr->GetCommonInputContainer());
45 mgr->ConnectOutput (taskKMeans, 1, cout_kmeans);
46
47 return taskKMeans;
48}