]>
Commit | Line | Data |
---|---|---|
40d44b3b | 1 | // $Id$ |
d87c9c78 | 2 | |
3 | AliAnalysisTaskCLQA* AddTaskCLQA( | |
589a1a6c | 4 | const char *ntracks = "", |
5 | const char *nclusters = "", | |
6 | const char *njets = "", | |
96a87a98 | 7 | Bool_t doCumulants = kFALSE, |
8 | Double_t cumMmin = 10, | |
9 | Double_t cumPtMin = 0.3, | |
10 | Double_t cumPtMax = 5.0, | |
11 | Double_t cumEtaMin = -1.0, | |
12 | Double_t cumEtaMax = +1.0, | |
13 | UInt_t trigsel = AliVEvent::kAnyINT|AliVEvent::kHighMult|AliVEvent::kCentral|AliVEvent::kSemiCentral|AliVEvent::kINT8, | |
589a1a6c | 14 | const char *taskname = "ATCLQA" |
d87c9c78 | 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 | { | |
589a1a6c | 22 | ::Error("AddTaskCLQA", "No analysis manager to connect to."); |
d87c9c78 | 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 | { | |
589a1a6c | 30 | ::Error("AddTaskCLQA", "This task requires an input event handler"); |
d87c9c78 | 31 | return NULL; |
32 | } | |
33 | ||
34 | //------------------------------------------------------- | |
35 | // Init the task and do settings | |
36 | //------------------------------------------------------- | |
37 | ||
38 | TString name(taskname); | |
39 | if (strcmp(ntracks,"")) { | |
40 | name += "_"; | |
41 | name += ntracks; | |
42 | } | |
43 | if (strcmp(nclusters,"")) { | |
44 | name += "_"; | |
45 | name += nclusters; | |
46 | } | |
47 | if (strcmp(njets,"")) { | |
48 | name += "_"; | |
49 | name += njets; | |
50 | } | |
51 | ||
52 | AliAnalysisTaskCLQA* qaTask = new AliAnalysisTaskCLQA(name); | |
53 | qaTask->SetTracksName(ntracks); | |
54 | qaTask->SetClusName(nclusters); | |
55 | qaTask->SetJetsName(njets); | |
96a87a98 | 56 | qaTask->SetDoCumulants(doCumulants); |
57 | qaTask->SetCumParams(cumMmin,cumPtMin,cumPtMax,cumEtaMin,cumEtaMax); | |
58 | qaTask->SelectCollisionCandidates(trigsel); | |
d87c9c78 | 59 | |
60 | //------------------------------------------------------- | |
61 | // Final settings, pass to manager and set the containers | |
62 | //------------------------------------------------------- | |
63 | ||
64 | mgr->AddTask(qaTask); | |
65 | ||
66 | // Create containers for input/output | |
67 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer() ; | |
68 | ||
69 | TString contName(name); | |
70 | contName += "_histos"; | |
71 | AliAnalysisDataContainer *coutput = mgr->CreateContainer(contName.Data(), | |
72 | TList::Class(), | |
73 | AliAnalysisManager::kOutputContainer, | |
589a1a6c | 74 | Form("%s", AliAnalysisManager::GetCommonFileName())); |
d87c9c78 | 75 | mgr->ConnectInput (qaTask, 0, cinput ); |
76 | mgr->ConnectOutput (qaTask, 1, coutput ); | |
77 | ||
78 | return qaTask; | |
79 | } |