]>
Commit | Line | Data |
---|---|---|
96c271c1 | 1 | AliAnalysisTaskJetChem *AddTaskJetChem(){ |
2 | ||
3 | AliAnalysisTaskJetChem *ff=0; | |
4 | ||
5 | ff = AddTask("clustersAOD_ANTIKT04_B1_Filter00256_Cut00150_Skip00",0,AliAnalysisTaskJetChem::kOnFly); | |
6 | ||
7 | return ff; | |
8 | } | |
9f77f0ce | 9 | |
96c271c1 | 10 | // _______________________________________________________________________________________ |
9f77f0ce | 11 | |
96c271c1 | 12 | AliAnalysisTaskJetChem *AddTask(const char* recJetsBranch,Int_t eventClass, Int_t K0type) |
13 | { | |
14 | // Creates a jet chem task, | |
15 | // configures it and adds it to the analysis manager. | |
16 | ||
17 | ||
18 | // Get the pointer to the existing analysis manager via the static access method. | |
19 | //============================================================================== | |
9f77f0ce | 20 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); |
21 | if (!mgr) { | |
96c271c1 | 22 | ::Error("AddTaskJetChem", "No analysis manager to connect to."); |
23 | return NULL; | |
9f77f0ce | 24 | } |
96c271c1 | 25 | |
26 | // Check the analysis type using the event handlers connected to the analysis manager. | |
27 | //============================================================================== | |
28 | if (!mgr->GetInputEventHandler()) { | |
29 | ::Error("AddTaskJetChem", "This task requires an input event handler"); | |
30 | return NULL; | |
9f77f0ce | 31 | } |
9f77f0ce | 32 | |
96c271c1 | 33 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" |
34 | Printf("Data Type: %s", type.Data()); | |
9f77f0ce | 35 | |
96c271c1 | 36 | |
37 | // Create the task and configure it. | |
38 | //=========================================================================== | |
39 | AliAnalysisTaskJetChem *task = new AliAnalysisTaskJetChem("bla"); | |
9f77f0ce | 40 | |
96c271c1 | 41 | Int_t debug = -1; // debug level |
42 | if(debug>=0) task->SetDebugLevel(debug); | |
43 | ||
44 | TString branchRecJets(recJetsBranch); | |
45 | if(!branchRecJets.Contains("noRecJets")) task->SetBranchRecJets(branchRecJets); | |
46 | ||
47 | task->SetFilterMask(256); // for h+/h- | |
48 | task->SetEventClass(eventClass); | |
49 | ||
50 | task->SetK0Type(K0type); | |
51 | ||
52 | if(K0type == AliAnalysisTaskJetChem::kOnFlyPrim || AliAnalysisTaskJetChem::kOfflPrim) task->SetFilterMaskK0(256); | |
53 | ||
54 | task->SetFFRadius(); | |
55 | ||
56 | task->SetTrackCuts(0.15, -0.75, 0.75, 0., 2*TMath::Pi()); | |
57 | task->SetJetCuts(5., -0.35, 0.35, 0., 2*TMath::Pi()); | |
58 | ||
59 | // Define histo bins | |
60 | task->SetFFHistoBins(); | |
61 | task->SetQATrackHistoBins(); | |
62 | task->SetFFInvMassHistoBins(); | |
63 | task->SetPhiCorrInvMassHistoBins(); | |
64 | ||
65 | mgr->AddTask(task); | |
66 | ||
67 | // Create ONLY the output containers for the data produced by the task. | |
68 | // Get and connect other common input/output containers via the manager as below | |
69 | //============================================================================== | |
70 | ||
71 | TString strK0type; | |
72 | if(K0type == AliAnalysisTaskJetChem::kOnFly) strK0type = "OnFly"; | |
73 | if(K0type == AliAnalysisTaskJetChem::kOnFlyPID) strK0type = "OnFlyPID"; | |
74 | if(K0type == AliAnalysisTaskJetChem::kOnFlydEdx) strK0type = "OnFlydEdx"; | |
75 | if(K0type == AliAnalysisTaskJetChem::kOnFlyPrim) strK0type = "OnFlyPrim"; | |
76 | if(K0type == AliAnalysisTaskJetChem::kOffl) strK0type = "Offl"; | |
77 | if(K0type == AliAnalysisTaskJetChem::kOfflPID) strK0type = "OfflPID"; | |
78 | if(K0type == AliAnalysisTaskJetChem::kOffldEdx) strK0type = "OffldEdx"; | |
79 | if(K0type == AliAnalysisTaskJetChem::kOfflPrim) strK0type = "OfflPrim"; | |
80 | ||
81 | TString listName(Form("PWG4_JetChem_%s_%s_cl%d",branchRecJets.Data(),strK0type.Data(),eventClass)); | |
82 | ||
83 | AliAnalysisDataContainer *coutput_FragFunc = mgr->CreateContainer(listName, | |
84 | TList::Class(), | |
85 | AliAnalysisManager::kOutputContainer, | |
86 | Form("%s:PWG4_JetChem",AliAnalysisManager::GetCommonFileName())); | |
87 | ||
88 | mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer()); | |
89 | mgr->ConnectOutput (task, 1, coutput_FragFunc); | |
90 | ||
91 | return task; | |
9f77f0ce | 92 | } |