]>
Commit | Line | Data |
---|---|---|
00514d01 | 1 | // $Id$ |
2 | ||
3 | AliAnalysisTaskSAJF* AddTaskSAJF( | |
00514d01 | 4 | const char *ntracks = "Tracks", |
5 | const char *nclusters = "CaloClusters", | |
6 | const char *njets = "Jets", | |
0b94d67b | 7 | const char *nembtracks = "TracksEmbedded", |
8 | const char *nembclusters = "CaloClustersEmbedded", | |
2bee31e9 | 9 | const char *nembjets = "EmbJets", |
af986cb0 | 10 | const char *nrandtracks = "TracksRandomized", |
11 | const char *nrandclusters = "CaloClustersRandomized", | |
226f511d | 12 | const char *nrho = "Rho", |
2bee31e9 | 13 | Double_t jetradius = 0.4, |
df43b607 | 14 | Double_t jetptcut = 1, |
b0e00dc4 | 15 | Double_t jetareacut = 0.8, |
226f511d | 16 | Double_t ptcut = 0.15, |
7cf4626b | 17 | Double_t jetBiasTrack = 5, |
18 | Double_t jetBiasClus = 5, | |
19 | UInt_t type = AliAnalysisTaskEmcal::kTPC, | |
20 | const char *taskname = "AliAnalysisTaskSAJF" | |
00514d01 | 21 | ) |
22 | { | |
23 | // Get the pointer to the existing analysis manager via the static access method. | |
24 | //============================================================================== | |
25 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
26 | if (!mgr) | |
27 | { | |
28 | ::Error("AddTaskSAJF", "No analysis manager to connect to."); | |
29 | return NULL; | |
30 | } | |
31 | ||
32 | // Check the analysis type using the event handlers connected to the analysis manager. | |
33 | //============================================================================== | |
34 | if (!mgr->GetInputEventHandler()) | |
35 | { | |
36 | ::Error("AddTaskSAJF", "This task requires an input event handler"); | |
37 | return NULL; | |
38 | } | |
39 | ||
40 | //------------------------------------------------------- | |
41 | // Init the task and do settings | |
42 | //------------------------------------------------------- | |
43 | ||
7cf4626b | 44 | TString name(taskname); |
45 | name += "_"; | |
46 | name += njets; | |
47 | name += "_"; | |
48 | name += nrho; | |
49 | name += "_Track"; | |
50 | name += jetBiasTrack; | |
51 | name += "_Clus"; | |
52 | name += jetBiasClus; | |
53 | name += "_R0"; | |
54 | name += floor(jetradius*10+0.5); | |
55 | name += "_PtCut"; | |
56 | name += floor(ptcut*1000+0.5); | |
57 | name += "_"; | |
58 | if (type == AliAnalysisTaskEmcal::kTPC) | |
59 | name += "TPC"; | |
60 | else if (type == AliAnalysisTaskEmcal::kEMCAL) | |
61 | name += "EMCAL"; | |
62 | else if (type == AliAnalysisTaskEmcal::kTPCSmall) | |
63 | name += "TPCSmall"; | |
090a0c3e | 64 | else if (type == AliAnalysisTaskEmcal::kEMCALOnly) |
65 | name += "EMCALOnly"; | |
7cf4626b | 66 | AliAnalysisTaskSAJF* jetTask = new AliAnalysisTaskSAJF(name); |
af986cb0 | 67 | jetTask->SetAnaType(type); |
68 | jetTask->SetTracksName(ntracks); | |
69 | jetTask->SetClusName(nclusters); | |
70 | jetTask->SetJetsName(njets); | |
0b94d67b | 71 | jetTask->SetEmbTracksName(nembtracks); |
72 | jetTask->SetEmbClusName(nembclusters); | |
af986cb0 | 73 | jetTask->SetEmbJetsName(nembjets); |
74 | jetTask->SetRandTracksName(nrandtracks); | |
75 | jetTask->SetRandClusName(nrandclusters); | |
76 | jetTask->SetRhoName(nrho); | |
77 | jetTask->SetPtCut(ptcut); | |
78 | jetTask->SetJetRadius(jetradius); | |
df43b607 | 79 | jetTask->SetJetPtCut(jetptcut); |
b0e00dc4 | 80 | jetTask->SetPercAreaCut(jetareacut); |
af986cb0 | 81 | jetTask->SetPtBiasJetTrack(jetBiasTrack); |
82 | jetTask->SetPtBiasJetClus(jetBiasClus); | |
df43b607 | 83 | |
00514d01 | 84 | //------------------------------------------------------- |
85 | // Final settings, pass to manager and set the containers | |
86 | //------------------------------------------------------- | |
df43b607 | 87 | |
af986cb0 | 88 | mgr->AddTask(jetTask); |
00514d01 | 89 | |
90 | // Create containers for input/output | |
c10e3608 | 91 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ; |
7cf4626b | 92 | TString contname(name); |
00514d01 | 93 | contname += "_histos"; |
c10e3608 | 94 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(), |
95 | TList::Class(),AliAnalysisManager::kOutputContainer, | |
96 | Form("%s", AliAnalysisManager::GetCommonFileName())); | |
af986cb0 | 97 | mgr->ConnectInput (jetTask, 0, cinput1 ); |
98 | mgr->ConnectOutput (jetTask, 1, coutput1 ); | |
df43b607 | 99 | |
af986cb0 | 100 | return jetTask; |
00514d01 | 101 | } |