]>
Commit | Line | Data |
---|---|---|
5ce0dc6d | 1 | /* |
2 | * AddTask macro for class | |
3 | * Redmer Alexander Bertens, rbertens@cern.ch | |
4 | * Utrecht University, Utrecht, Netherlands | |
5 | * | |
6 | * Note: this macro is pretty much a copy of AddTaskEmcalJetSample.C | |
7 | * | |
8 | */ | |
9 | ||
10 | AliAnalysisTaskLocalRho* AddTaskLocalRho( | |
7dd1eeea | 11 | const char *ntracks = "Tracks", // track selection used for vn estimate |
12 | const char *nclusters = "", // clusters (not used) | |
13 | const char *njets = "Jets", // jet selection for finding leading jet | |
14 | const char *nrho = "Rho", // name of nominal rho | |
15 | const char *lrho = "LocalRho", // name of local rho object | |
16 | Double_t jetradius = 0.3, // jet radius (to remove leading jet) | |
17 | Double_t jetptcut = 1, | |
5ce0dc6d | 18 | Double_t jetareacut = 0.557, |
b7f62d00 | 19 | UInt_t type = AliJetContainer::kTPC, |
5ce0dc6d | 20 | Int_t leadhadtype = 0, |
7dd1eeea | 21 | const char *name = "AliAnalysisTaskLocalRho", // task name |
22 | TString fitOpts = "WLQI", // options for tfitter | |
23 | UInt_t fitType = AliAnalysisTaskLocalRho::kCombined, // fitting strategy | |
24 | TArrayI *centralities = 0x0, // centrality binning for qa | |
25 | UInt_t runMode = AliAnalysisTaskLocalRho::kGrid // run mode | |
5ce0dc6d | 26 | ) |
27 | { | |
28 | // Get the pointer to the existing analysis manager via the static access method. | |
29 | //============================================================================== | |
30 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
31 | if (!mgr) | |
32 | { | |
33 | ::Error("AddTaskEmcalJetSample", "No analysis manager to connect to."); | |
34 | return NULL; | |
35 | } | |
36 | ||
37 | // Check the analysis type using the event handlers connected to the analysis manager. | |
38 | //============================================================================== | |
39 | if (!mgr->GetInputEventHandler()) | |
40 | { | |
41 | ::Error("AddTaskEmcalJetSample", "This task requires an input event handler"); | |
42 | return NULL; | |
43 | } | |
44 | ||
45 | //------------------------------------------------------- | |
46 | // Init the task and do settings | |
47 | //------------------------------------------------------- | |
48 | ||
49 | AliAnalysisTaskLocalRho* jetTask = new AliAnalysisTaskLocalRho(name, runMode); | |
50 | // inherited setters | |
f6d1b1a7 | 51 | jetTask->SetJetsName(njets); |
5ce0dc6d | 52 | jetTask->SetAnaType(type); |
53 | jetTask->SetTracksName(ntracks); | |
54 | jetTask->SetClusName(nclusters); | |
5ce0dc6d | 55 | jetTask->SetRhoName(nrho); |
7dd1eeea | 56 | jetTask->SetLocalRhoName(lrho); |
5ce0dc6d | 57 | jetTask->SetJetRadius(jetradius); |
58 | jetTask->SetJetPtCut(jetptcut); | |
59 | jetTask->SetPercAreaCut(jetareacut); | |
60 | jetTask->SetLeadingHadronType(leadhadtype); | |
61 | // task specific setters | |
62 | jetTask->SetDebugMode(-1); | |
63 | jetTask->SetModulationFitType(fitType); | |
64 | jetTask->SetModulationFitOptions(fitOpts); | |
65 | jetTask->SetModulationFitMinMaxP(.001, 1); | |
66 | jetTask->SetCentralityClasses(centralities); | |
67 | ||
68 | //------------------------------------------------------- | |
69 | // Final settings, pass to manager and set the containers | |
70 | //------------------------------------------------------- | |
71 | ||
72 | mgr->AddTask(jetTask); | |
73 | ||
74 | // Create containers for input/output | |
75 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ; | |
76 | TString contname(name); | |
77 | contname += "_histos"; | |
78 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(), | |
79 | TList::Class(),AliAnalysisManager::kOutputContainer, | |
80 | Form("%s", AliAnalysisManager::GetCommonFileName())); | |
81 | mgr->ConnectInput (jetTask, 0, cinput1 ); | |
82 | mgr->ConnectOutput (jetTask, 1, coutput1 ); | |
83 | ||
84 | switch (runMode) { | |
85 | case AliAnalysisTaskLocalRho::kLocal : { | |
86 | gStyle->SetOptFit(1); | |
7714ec7e | 87 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(Form("good_fits_%s", name), |
5ce0dc6d | 88 | TList::Class(),AliAnalysisManager::kOutputContainer, |
89 | Form("%s", AliAnalysisManager::GetCommonFileName())); | |
7714ec7e | 90 | AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(Form("bad_fits_%s", name), |
5ce0dc6d | 91 | TList::Class(),AliAnalysisManager::kOutputContainer, |
92 | Form("%s", AliAnalysisManager::GetCommonFileName())); | |
93 | mgr->ConnectOutput (jetTask, 2, coutput2); | |
94 | mgr->ConnectOutput (jetTask, 3, coutput3); | |
95 | } break; | |
96 | default: break; | |
97 | } | |
98 | return jetTask; | |
99 | } |