]>
Commit | Line | Data |
---|---|---|
a5190144 | 1 | // $Id: AddTaskSAQA.C 56113 2012-05-01 21:39:27Z loizides $ |
2 | ||
3 | AliAnalysisTaskSAQA* AddTaskSAQA( | |
a5190144 | 4 | const char *ntracks = "Tracks", |
5 | const char *nclusters = "CaloClusters", | |
6 | const char *njets = "Jets", | |
7cf4626b | 7 | const char *ntrgclusters = "", |
a5190144 | 8 | Double_t jetradius = 0.4, |
9 | Double_t jetptcut = 1, | |
7cf4626b | 10 | Double_t jetareacut = 0.4, |
1f6fff78 | 11 | Double_t ptcut = 0.15, |
7cf4626b | 12 | Double_t jetBiasTrack = 5, |
13 | Double_t jetBiasClus = 5, | |
14 | UInt_t type = AliAnalysisTaskEmcal::kTPC, | |
15 | const char *taskname = "AliAnalysisTaskSAQA" | |
a5190144 | 16 | ) |
17 | { | |
18 | // Get the pointer to the existing analysis manager via the static access method. | |
19 | //============================================================================== | |
20 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
21 | if (!mgr) | |
22 | { | |
23 | ::Error("AddTaskSAQA", "No analysis manager to connect to."); | |
24 | return NULL; | |
25 | } | |
26 | ||
27 | // Check the analysis type using the event handlers connected to the analysis manager. | |
28 | //============================================================================== | |
29 | if (!mgr->GetInputEventHandler()) | |
30 | { | |
31 | ::Error("AddTaskSAQA", "This task requires an input event handler"); | |
32 | return NULL; | |
33 | } | |
34 | ||
35 | //------------------------------------------------------- | |
36 | // Init the task and do settings | |
37 | //------------------------------------------------------- | |
7cf4626b | 38 | TString name(taskname); |
39 | name += "_"; | |
40 | name += njets; | |
41 | name += "_Track"; | |
42 | name += jetBiasTrack; | |
43 | name += "_Clus"; | |
44 | name += jetBiasClus; | |
45 | name += "_R0"; | |
46 | name += floor(jetradius*10+0.5); | |
47 | name += "_PtCut"; | |
48 | name += floor(ptcut*1000+0.5); | |
49 | name += "_"; | |
50 | if (type == AliAnalysisTaskEmcal::kTPC) | |
51 | name += "TPC"; | |
52 | else if (type == AliAnalysisTaskEmcal::kEMCAL) | |
53 | name += "EMCAL"; | |
54 | else if (type == AliAnalysisTaskEmcal::kTPCSmall) | |
55 | name += "TPCSmall"; | |
7558568c | 56 | AliAnalysisTaskSAQA* qaTask = new AliAnalysisTaskSAQA(name); |
a5190144 | 57 | qaTask->SetTracksName(ntracks); |
58 | qaTask->SetClusName(nclusters); | |
59 | qaTask->SetJetsName(njets); | |
60 | qaTask->SetTrgClusName(ntrgclusters); | |
61 | qaTask->SetJetRadius(jetradius); | |
62 | qaTask->SetJetPtCut(jetptcut); | |
63 | qaTask->SetJetAreaCut(jetareacut); | |
1f6fff78 | 64 | qaTask->SetPtCut(ptcut); |
65 | qaTask->SetPtBiasJetTrack(jetBiasTrack); | |
66 | qaTask->SetPtBiasJetClus(jetBiasClus); | |
a5190144 | 67 | qaTask->SetAnaType(type); |
68 | ||
69 | //------------------------------------------------------- | |
70 | // Final settings, pass to manager and set the containers | |
71 | //------------------------------------------------------- | |
72 | ||
73 | mgr->AddTask(qaTask); | |
74 | ||
75 | // Create containers for input/output | |
76 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ; | |
77 | ||
7cf4626b | 78 | TString contName(name); |
a5190144 | 79 | contName += "_histos"; |
80 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contName.Data(), | |
81 | TList::Class(),AliAnalysisManager::kOutputContainer, | |
82 | Form("%s", AliAnalysisManager::GetCommonFileName())); | |
83 | mgr->ConnectInput (qaTask, 0, cinput1 ); | |
84 | mgr->ConnectOutput (qaTask, 1, coutput1 ); | |
85 | ||
86 | return qaTask; | |
87 | } |