]>
Commit | Line | Data |
---|---|---|
cdcf01d2 | 1 | |
2 | ||
3 | AliAnalysisTaskJetResponseV2* AddTaskJetResponseV2(Char_t* type = "clusters", Char_t* jf = "FASTKT", Float_t radius = 0.4, UInt_t filterMask = 256 , Float_t ptTrackMin = 0.15, Int_t iBack = 1, Int_t eventClassMin = 0, Int_t eventClassMax = 4){ | |
4 | ||
5 | return AddTaskJetResponseV2(kTRUE, type, jf, radius, filterMask, ptTrackMin, iBack, eventClassMin, eventClassMax); | |
6 | ||
7 | } | |
8 | ||
9 | ||
10 | AliAnalysisTaskJetResponseV2* AddTaskJetResponseV2(Bool_t emb = kTRUE, Char_t* type = "clusters", Char_t* jf = "FASTKT", Float_t radius = 0.4, UInt_t filterMask = 256 , Float_t ptTrackMin = 0.15, Int_t iBack = 1, Int_t eventClassMin = 0, Int_t eventClassMax = 4){ | |
3c6a60f7 | 11 | |
31b9d515 | 12 | Printf("adding task jet response\n"); |
13 | ||
14 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
15 | if(!mgr){ | |
16 | ::Error("AddTaskJetResponseV2", "No analysis manager to connect to."); | |
17 | return NULL; | |
18 | } | |
19 | if(!mgr->GetInputEventHandler()){ | |
20 | ::Error("AddTaskJetResponseV2", "This task requires an input event handler."); | |
21 | return NULL; | |
22 | } | |
3c6a60f7 | 23 | |
cdcf01d2 | 24 | TString branch1 = ""; |
25 | TString branch2 = ""; | |
26 | TString suffix = ""; | |
27 | TString suffix2 = ""; | |
31b9d515 | 28 | |
cdcf01d2 | 29 | if(emb){ |
30 | ||
31 | // embedding in HI event | |
32 | ||
33 | suffix += Form("_%s", jf); | |
34 | suffix += Form("%02d", (int)((radius+0.01)*10.)); | |
35 | suffix += Form("_B0"); // no background subtraction for extra-only | |
36 | suffix += Form("_Filter%05d", filterMask); | |
37 | suffix += Form("_Cut%05d", (int)((1000.*ptTrackMin))); | |
38 | if(type=="clusters") suffix += Form("_Skip00"); | |
39 | ||
40 | suffix2 += Form("_%s", jf); | |
41 | suffix2 += Form("%02d", (int)((radius+0.01)*10.)); | |
42 | suffix2 += Form("_B%d", iBack); | |
43 | suffix2 += Form("_Filter%05d", filterMask); | |
44 | suffix2 += Form("_Cut%05d", (int)((1000.*ptTrackMin))); | |
45 | if(type=="clusters") suffix2 += Form("_Skip00"); | |
31b9d515 | 46 | |
cdcf01d2 | 47 | branch1 = Form("%sAODextraonly%s",type, suffix.Data()); |
48 | branch2 = Form("%sAODextra%s",type, suffix2.Data()); | |
49 | ||
50 | } else { | |
31b9d515 | 51 | |
cdcf01d2 | 52 | // p-p detector response |
53 | suffix += Form("_%s", jf); | |
54 | suffix += Form("%02d", (int)((radius+0.01)*10.)); | |
55 | suffix += Form("_B0"); | |
56 | suffix += Form("_Filter%05d", filterMask); | |
57 | suffix += Form("_Cut%05d", (int)((1000.*ptTrackMin))); | |
58 | if(type=="clusters") suffix += Form("_Skip00"); | |
59 | ||
60 | suffix2 += Form("_%s", jf); | |
61 | suffix2 += Form("%02d", (int)((radius+0.01)*10.)); | |
62 | suffix2 += Form("_B0"); | |
63 | suffix2 += Form("_Filter%05d", filterMask); | |
64 | suffix2 += Form("_Cut%05d", (int)((1000.*ptTrackMin))); | |
65 | if(type=="clusters") suffix2 += Form("_Skip02"); | |
66 | ||
67 | branch1 = Form("%sAODMC2%s",type, suffix.Data()); // MC truth | |
68 | branch2 = Form("%sAOD%s",type, suffix2.Data()); // MC reconstucted | |
31b9d515 | 69 | |
cdcf01d2 | 70 | } |
71 | ||
72 | AliAnalysisTaskJetResponseV2 *task = new AliAnalysisTaskJetResponseV2(Form("JetResponseV2%s", suffix2.Data())); | |
3c6a60f7 | 73 | |
31b9d515 | 74 | Printf("Branch1: %s",branch1.Data()); |
75 | Printf("Branch2: %s",branch2.Data()); | |
76 | ||
77 | task->SetBranchNames(branch1,branch2); | |
78 | task->SetOfflineTrgMask(AliVEvent::kMB); | |
3c6a60f7 | 79 | |
31b9d515 | 80 | task->SetEvtClassMin(eventClassMin); |
81 | task->SetEvtClassMax(eventClassMax); | |
82 | task->SetCentMin(0.); | |
83 | task->SetCentMax(100.); | |
84 | ||
85 | //task->SetVtxMin(-10.); | |
86 | //task->SetVtxMax(10.); | |
87 | ||
88 | task->SetJetPtMin(0.); // min jet pt is implicit a cut on delta pT!! | |
3c6a60f7 | 89 | |
31b9d515 | 90 | task->SetKeepJets(kTRUE); |
91 | ||
92 | //task->SetNMatchJets(1); // leading jets only | |
93 | ||
94 | if(!emb){ | |
95 | task->SetIsPbPb(kFALSE); | |
96 | task->SetJetPtFractionMin(0.01); | |
97 | task->SetNMatchJets(999); | |
98 | } | |
3c6a60f7 | 99 | |
3c6a60f7 | 100 | |
31b9d515 | 101 | mgr->AddTask(task); |
3c6a60f7 | 102 | |
3c6a60f7 | 103 | |
31b9d515 | 104 | AliAnalysisDataContainer *coutputJetResponseV2 = mgr->CreateContainer( |
105 | Form("jetresponseV2_%s%s", type,suffix2.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, | |
106 | Form("%s:PWG4_JetResponseV2_%s%s", AliAnalysisManager::GetCommonFileName(), type, suffix2.Data())); | |
3c6a60f7 | 107 | |
31b9d515 | 108 | mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer()); |
109 | mgr->ConnectOutput(task, 0, mgr->GetCommonOutputContainer()); | |
110 | mgr->ConnectOutput(task, 1, coutputJetResponseV2); | |
3c6a60f7 | 111 | |
31b9d515 | 112 | return task; |
3c6a60f7 | 113 | } |