]>
Commit | Line | Data |
---|---|---|
c683922f | 1 | // $Id$ |
a5190144 | 2 | |
3 | AliAnalysisTaskSAQA* AddTaskSAQA( | |
a5190144 | 4 | const char *ntracks = "Tracks", |
5 | const char *nclusters = "CaloClusters", | |
6 | const char *njets = "Jets", | |
a487deae | 7 | Double_t jetradius = 0.2, |
a5190144 | 8 | Double_t jetptcut = 1, |
624bef5b | 9 | Double_t jetareacut = 0.557, |
10 | Double_t trackptcut = 0.15, | |
11 | Double_t clusptcut = 0.30, | |
7cf4626b | 12 | UInt_t type = AliAnalysisTaskEmcal::kTPC, |
13 | const char *taskname = "AliAnalysisTaskSAQA" | |
a5190144 | 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("AddTaskSAQA", "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("AddTaskSAQA", "This task requires an input event handler"); | |
30 | return NULL; | |
31 | } | |
32 | ||
33 | //------------------------------------------------------- | |
34 | // Init the task and do settings | |
35 | //------------------------------------------------------- | |
624bef5b | 36 | |
1f9c287f | 37 | TString name(taskname); |
38 | if (strcmp(ntracks,"")) { | |
39 | name += "_"; | |
40 | name += ntracks; | |
41 | } | |
42 | if (strcmp(nclusters,"")) { | |
43 | name += "_"; | |
44 | name += nclusters; | |
624bef5b | 45 | } |
1f9c287f | 46 | if (strcmp(njets,"")) { |
47 | name += "_"; | |
48 | name += njets; | |
624bef5b | 49 | } |
1f9c287f | 50 | if (type == AliAnalysisTaskEmcal::kTPC) |
51 | name += "_TPC"; | |
52 | else if (type == AliAnalysisTaskEmcal::kEMCAL) | |
53 | name += "_EMCAL"; | |
54 | else if (type == AliAnalysisTaskEmcal::kUser) | |
55 | name += "_USER"; | |
624bef5b | 56 | |
7558568c | 57 | AliAnalysisTaskSAQA* qaTask = new AliAnalysisTaskSAQA(name); |
a5190144 | 58 | qaTask->SetTracksName(ntracks); |
59 | qaTask->SetClusName(nclusters); | |
60 | qaTask->SetJetsName(njets); | |
a5190144 | 61 | qaTask->SetJetRadius(jetradius); |
62 | qaTask->SetJetPtCut(jetptcut); | |
b0e00dc4 | 63 | qaTask->SetPercAreaCut(jetareacut); |
624bef5b | 64 | qaTask->SetTrackPtCut(trackptcut); |
65 | qaTask->SetClusPtCut(clusptcut); | |
a5190144 | 66 | qaTask->SetAnaType(type); |
67 | ||
68 | //------------------------------------------------------- | |
69 | // Final settings, pass to manager and set the containers | |
70 | //------------------------------------------------------- | |
71 | ||
72 | mgr->AddTask(qaTask); | |
73 | ||
74 | // Create containers for input/output | |
75 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ; | |
76 | ||
7cf4626b | 77 | TString contName(name); |
a5190144 | 78 | contName += "_histos"; |
79 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contName.Data(), | |
80 | TList::Class(),AliAnalysisManager::kOutputContainer, | |
81 | Form("%s", AliAnalysisManager::GetCommonFileName())); | |
82 | mgr->ConnectInput (qaTask, 0, cinput1 ); | |
83 | mgr->ConnectOutput (qaTask, 1, coutput1 ); | |
84 | ||
85 | return qaTask; | |
86 | } |