]>
Commit | Line | Data |
---|---|---|
40d44b3b | 1 | // $Id$ |
8afc7c8d | 2 | |
3 | AliJetConstituentTagCopier* AddTaskTagCopier( | |
4 | const char *ntracks = "Tracks", | |
5 | const char *nclusters = "CaloClusters", | |
6 | const char *nmcparticles = "MCParticles", | |
7 | Double_t trackptcut = 0.15, | |
8 | Double_t clusptcut = 0.30, | |
9 | UInt_t type = AliAnalysisTaskEmcal::kTPC, | |
10 | const char *taskname = "AliJetConstituentTagCopier" | |
11 | ) | |
12 | { | |
13 | // Get the pointer to the existing analysis manager via the static access method. | |
14 | //============================================================================== | |
15 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
16 | if (!mgr) | |
17 | { | |
18 | ::Error("AddTaskTagCopier", "No analysis manager to connect to."); | |
19 | return NULL; | |
20 | } | |
21 | ||
22 | // Check the analysis type using the event handlers connected to the analysis manager. | |
23 | //============================================================================== | |
24 | if (!mgr->GetInputEventHandler()) | |
25 | { | |
26 | ::Error("AddTaskTagCopier", "This task requires an input event handler"); | |
27 | return NULL; | |
28 | } | |
29 | ||
30 | //------------------------------------------------------- | |
31 | // Init the task and do settings | |
32 | //------------------------------------------------------- | |
33 | ||
34 | TString name(taskname); | |
35 | if (strcmp(ntracks,"")) { | |
36 | name += "_"; | |
37 | name += ntracks; | |
38 | } | |
39 | if (strcmp(nclusters,"")) { | |
40 | name += "_"; | |
41 | name += nclusters; | |
42 | } | |
43 | if (strcmp(nmcparticles,"")) { | |
44 | name += "_"; | |
45 | name += nmcparticles; | |
46 | } | |
47 | if (type == AliAnalysisTaskEmcal::kTPC) | |
48 | name += "_TPC"; | |
49 | else if (type == AliAnalysisTaskEmcal::kEMCAL) | |
50 | name += "_EMCAL"; | |
51 | else if (type == AliAnalysisTaskEmcal::kUser) | |
52 | name += "_USER"; | |
53 | ||
54 | AliJetConstituentTagCopier* task = new AliJetConstituentTagCopier(name); | |
55 | task->SetTracksName(ntracks); | |
56 | task->SetClusName(nclusters); | |
57 | task->SetMCParticlesName(nmcparticles); | |
58 | task->SetTrackPtCut(trackptcut); | |
59 | task->SetClusPtCut(clusptcut); | |
60 | task->SetAnaType(type); | |
61 | ||
62 | //------------------------------------------------------- | |
63 | // Final settings, pass to manager and set the containers | |
64 | //------------------------------------------------------- | |
65 | ||
66 | mgr->AddTask(task); | |
67 | ||
68 | // Create containers for input/output | |
69 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ; | |
70 | mgr->ConnectInput(task, 0, cinput1); | |
71 | ||
72 | return task; | |
73 | } |