]>
Commit | Line | Data |
---|---|---|
1db1733e | 1 | |
2 | /************************************************************************************************* | |
3 | *** Add Fragmentation Function Task *** | |
4 | ************************************************************************************************** | |
44b235ce | 5 | The fragmentation function task expects an ESD filter and jet finder running before this task. |
1db1733e | 6 | Or it runs on delta-AODs filled with filtered tracks and jets before. |
7 | ||
8 | ** Parameters ** | |
9 | (char) recJetsBranch: branch in AOD for (reconstructed) jets | |
10 | (char) genJetsBranch: branch in AOD for (generated) jets | |
11 | (char) jetType: "AOD" jets from recJetsBranch | |
12 | "AODMC" jets from genJetsBranch | |
13 | "KINE" jets from PYCELL | |
14 | +"b" (e.g. "AODb") jets with acceptance cuts | |
15 | (char) trackType: "AOD" reconstructed tracks from AOD filled by ESD filter (choose filter mask!) | |
16 | "AODMC" MC tracks from AOD filled by kine filter | |
17 | "KINE" kine particles from MC event | |
18 | +"2" (e.g. "AOD2") charged tracks only | |
19 | +"b" (e.g. "AOD2b") with acceptance cuts | |
20 | (UInt_t) filterMask: select filter bit of ESD filter task | |
21 | ||
22 | ***************************************************************************************************/ | |
23 | ||
24 | ||
25 | ||
26 | ||
44b235ce | 27 | AliAnalysisTaskFragmentationFunction *AddTaskFragmentationFunction(UInt_t iFlag=1, UInt_t filterMask=32, Int_t eventClass=0){ |
1db1733e | 28 | |
29 | AliAnalysisTaskFragmentationFunction *ff=0; | |
30 | ||
c2658535 | 31 | // UA1 Jets |
1db1733e | 32 | // only reconstructed (default) |
44b235ce | 33 | if(iFlag&(1<<0)) ff = AddTaskFragmentationFunction("jetsAOD_UA1", "", "", "", "", filterMask, 0.4,0,1000., eventClass); |
ac017ff3 | 34 | // charged MC tracks and jets |
44b235ce | 35 | if(iFlag&(1<<1)) ff = AddTaskFragmentationFunction("jetsAOD_UA1", "", "jetsAODMC2_UA1", "AODMC", "AODMC2", filterMask, 0.4,0,1000., eventClass); |
ac017ff3 | 36 | // charged MC tracks and jets with acceptance cuts |
44b235ce | 37 | if(iFlag&(1<<2)) ff = AddTaskFragmentationFunction("jetsAOD_UA1", "", "jetsAODMC2_UA1", "AODMCb", "AODMC2b", filterMask, 0.4,0,1000., eventClass); |
1db1733e | 38 | // kine tracks in acceptance, pythia jets in acceptance |
44b235ce | 39 | if(iFlag&(1<<3)) ff = AddTaskFragmentationFunction("jetsAOD_UA1", "", "", "KINEb", "KINEb", filterMask, 0.4,0,1000., eventClass); |
1db1733e | 40 | // reconstructed charged tracks after cuts, MC jets in acceptance |
44b235ce | 41 | if(iFlag&(1<<4)) ff = AddTaskFragmentationFunction("jetsAOD_UA1", "", "jetsMC2b", "AODMCb", "AOD2b", filterMask, 0.4,0,1000., eventClass); |
cfd02305 | 42 | // reconstruction efficiency: pointing with rec jet axis into gen tracks |
44b235ce | 43 | if(iFlag&(1<<5)) ff = AddTaskFragmentationFunction("jetsAOD_UA1", "", "jetsAODMC2_UA1", "AODb", "AODMC2b", filterMask, 0.4,0,1000., eventClass); |
c2658535 | 44 | |
45 | // kt jets | |
46 | // only reconstructed | |
44b235ce | 47 | if(iFlag&(1<<10)) ff = AddTaskFragmentationFunction("clustersAOD_KT", "jeteventbackground_clustersAOD_KT", "", "", "", filterMask, 0.4,0,150., eventClass, "_Skip00"); |
c2658535 | 48 | // charged MC tracks and jets |
44b235ce | 49 | if(iFlag&(1<<11)) ff = AddTaskFragmentationFunction("clustersAOD_KT", "jeteventbackground_clustersAOD_KT", "jetsAODMC2_FASTKT", "AODMC", "AODMC2", filterMask, 0.4,0,150.,eventClass,"_Skip00"); |
c2658535 | 50 | // charged MC tracks and jets with acceptance cuts |
44b235ce | 51 | if(iFlag&(1<<12)) ff = AddTaskFragmentationFunction("clustersAOD_KT", "jeteventbackground_clustersAOD_KT", "jetsAODMC2_FASTKT", "AODMCb", "AODMC2b", filterMask, 0.4,0,150.,eventClass, "_Skip00"); |
c2658535 | 52 | |
53 | // anti-kt jets | |
44b235ce | 54 | // Jet not background subtracted |
c2658535 | 55 | // only reconstructed |
44b235ce | 56 | if(iFlag&(1<<20)) ff = AddTaskFragmentationFunction("clustersAOD_ANTIKT", "jeteventbackground_clustersAOD_KT", "", "", "", filterMask, 0.4,0,150., eventClass, "_Skip02"); |
c2658535 | 57 | // charged MC tracks and jets |
44b235ce | 58 | if(iFlag&(1<<21)) ff = AddTaskFragmentationFunction("clustersAOD_ANTIKT", "jeteventbackground_clustersAOD_KT", "jetsAODMC2_FASTJET", "AODMC", "AODMC2", filterMask, 0.4,0,150.,eventClass, "_Skip02"); |
c2658535 | 59 | // charged MC tracks and jets with acceptance cuts |
44b235ce | 60 | if(iFlag&(1<<22)) ff = AddTaskFragmentationFunction("clustersAOD_ANTIKT", "jeteventbackground_clustersAOD_KT", "jetsAODMC2_FASTJET", "AODMCb", "AODMC2b", filterMask, 0.4,0,150.,eventClass, "_Skip02"); |
c2658535 | 61 | |
44b235ce | 62 | // Jet background subtracted |
63 | if(iFlag&(1<<23)) ff = AddTaskFragmentationFunction("clustersAOD_ANTIKT", "", "", "", "", filterMask, 0.4,1,150.,eventClass, "_Skip02"); | |
64 | // charged MC tracks and jets | |
65 | if(iFlag&(1<<24)) ff = AddTaskFragmentationFunction("clustersAOD_ANTIKT", "", "jetsAODMC2_FASTJET", "AODMC", "AODMC2", filterMask, 0.4,1,150.,eventClass, "_Skip02"); | |
66 | // charged MC tracks and jets with acceptance cuts | |
67 | if(iFlag&(1<<25)) ff = AddTaskFragmentationFunction("clustersAOD_ANTIKT", "", "jetsAODMC2_FASTJET", "AODMCb", "AODMC2b", filterMask, 0.4,1,150., eventClass, "_Skip02"); | |
c2658535 | 68 | |
b101fa2e | 69 | if(iFlag&(1<<26)) ff = AddTaskFragmentationFunction("clustersAOD_ANTIKT", "", "", "", "", filterMask, 0.4,2,150.,eventClass, "_Skip02"); |
70 | ||
71 | if(iFlag&(1<<27)) ff = AddTaskFragmentationFunction("clustersAOD_ANTIKT", "", "", "", "", filterMask, 0.4,3,150.,eventClass, "_Skip02"); | |
72 | ||
73 | // SISCONE | |
74 | if(iFlag&(1<<28)) ff = AddTaskFragmentationFunction("jetsAOD_SISCONE", "", "", "", "", filterMask, 0.4,1,150.,eventClass); | |
75 | if(iFlag&(1<<29)) ff = AddTaskFragmentationFunction("jetsAOD_SISCONE", "", "", "", "", filterMask, 0.4,2,150.,eventClass); | |
76 | if(iFlag&(1<<30)) ff = AddTaskFragmentationFunction("jetsAOD_SISCONE", "", "", "", "", filterMask, 0.4,3,150.,eventClass); | |
77 | ||
1db1733e | 78 | return ff; |
79 | } | |
80 | ||
81 | // _______________________________________________________________________________________ | |
82 | ||
83 | AliAnalysisTaskFragmentationFunction *AddTaskFragmentationFunction( | |
84 | const char* recJetsBranch, | |
44b235ce | 85 | const char* recJetsBackBranch, |
1db1733e | 86 | const char* genJetsBranch, |
87 | const char* jetType, | |
88 | const char* trackType, | |
44b235ce | 89 | UInt_t filterMask, |
90 | Float_t radius, | |
91 | int kBackgroundMode, | |
92 | float PtTrackMin, | |
93 | Int_t eventClass=0, | |
94 | TString BrOpt="", | |
95 | TString BrOpt2="", | |
96 | Float_t radiusBckg=0.4) | |
6bec8236 | 97 | { |
1db1733e | 98 | // Creates a fragmentation function task, |
99 | // configures it and adds it to the analysis manager. | |
100 | ||
101 | //****************************************************************************** | |
102 | //*** Configuration Parameter ************************************************** | |
103 | //****************************************************************************** | |
104 | ||
105 | // space for configuration parameter: histo bin, cuts, ... | |
106 | // so far only default parameter used | |
107 | ||
108 | Int_t debug = -1; // debug level, -1: not set here | |
6bec8236 | 109 | |
1db1733e | 110 | //****************************************************************************** |
111 | ||
112 | ||
113 | ||
6bec8236 | 114 | // Get the pointer to the existing analysis manager via the static access method. |
115 | //============================================================================== | |
116 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
117 | if (!mgr) { | |
1db1733e | 118 | ::Error("AddTaskFragmentationFunction", "No analysis manager to connect to."); |
119 | return NULL; | |
120 | } | |
6bec8236 | 121 | |
122 | // Check the analysis type using the event handlers connected to the analysis manager. | |
123 | //============================================================================== | |
124 | if (!mgr->GetInputEventHandler()) { | |
1db1733e | 125 | ::Error("AddTaskFragmentationFunction", "This task requires an input event handler"); |
126 | return NULL; | |
6bec8236 | 127 | } |
128 | ||
1db1733e | 129 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" |
130 | Printf("Data Type: %s", type.Data()); | |
131 | ||
44b235ce | 132 | TString branchRecBackJets(recJetsBackBranch); |
1db1733e | 133 | TString branchRecJets(recJetsBranch); |
134 | TString branchGenJets(genJetsBranch); | |
135 | TString typeJets(jetType); | |
136 | TString typeTracks(trackType); | |
137 | ||
44b235ce | 138 | if(branchRecBackJets.Length()==0) branchRecBackJets = "noRecBackJets"; |
1db1733e | 139 | if(branchRecJets.Length()==0) branchRecJets = "noRecJets"; |
140 | if(branchGenJets.Length()==0) branchGenJets = "noGenJets"; | |
141 | if(typeTracks.Length()==0) typeTracks = "trackTypeUndef"; | |
142 | if(typeJets.Length()==0) typeJets = "jetTypeUndef"; | |
143 | ||
6bec8236 | 144 | // Create the task and configure it. |
145 | //=========================================================================== | |
1db1733e | 146 | |
147 | AliAnalysisTaskFragmentationFunction *task = new AliAnalysisTaskFragmentationFunction( | |
44b235ce | 148 | Form("Fragmentation Function %s %s %s %s", branchRecJets.Data(), branchGenJets.Data(), typeJets.Data(), typeTracks.Data())); |
1db1733e | 149 | |
150 | if(debug>=0) task->SetDebugLevel(debug); | |
6bec8236 | 151 | |
1db1733e | 152 | Printf("Rec Jets %s", branchRecJets.Data()); |
44b235ce | 153 | Printf("Back Rec Jets %s", branchRecBackJets.Data()); |
1db1733e | 154 | Printf("Gen Jets %s", branchGenJets.Data()); |
155 | Printf("Jet Type %s", typeJets.Data()); | |
156 | Printf("Track Type %s", typeTracks.Data()); | |
6bec8236 | 157 | |
44b235ce | 158 | // attach the filter mask and options |
159 | TString cAdd = ""; | |
160 | cAdd += Form("%02d",(int)((radius+0.01)*10.)); | |
161 | cAdd += Form("_B%d",(int)((kBackgroundMode))); | |
162 | cAdd += Form("_Filter%05d",filterMask); | |
163 | cAdd += Form("_Cut%05d",(int)((PtTrackMin))); | |
164 | cAdd += Form("%s",BrOpt.Data()); | |
165 | cAdd += Form("%s",BrOpt2.Data()); | |
166 | Printf("%s",cAdd.Data()); | |
167 | ||
168 | TString cAddb = ""; | |
169 | cAddb += Form("%02d",(int)((radiusBckg+0.01)*10.)); | |
170 | cAddb += Form("_B%d",(int)((kBackgroundMode))); | |
171 | cAddb += Form("_Filter%05d",filterMask); | |
172 | cAddb += Form("_Cut%05d",(int)((PtTrackMin))); | |
173 | cAddb += Form("%s",BrOpt.Data()); | |
174 | cAddb += Form("%s",BrOpt2.Data()); | |
175 | Printf("%s",cAddb.Data()); | |
176 | ||
177 | TString cAddmc = ""; | |
178 | cAddmc += Form("%02d",(int)((radius+0.01)*10.)); | |
179 | cAddmc += Form("_B%d",(int)((kBackgroundMode))); | |
180 | cAddmc += Form("_Filter%05d",filterMask); | |
181 | cAddmc += Form("_Cut%05d",(int)((PtTrackMin))); | |
182 | Printf("%s",cAddmc.Data()); | |
183 | ||
184 | ||
185 | if(branchRecJets.Contains("AOD")&&branchRecJets.Contains("jets")&&!branchRecJets.Contains("MC"))branchRecJets = branchRecJets + cAdd; | |
186 | if(branchRecJets.Contains("AOD")&&branchRecJets.Contains("cluster")&&!branchRecJets.Contains("MC"))branchRecJets = branchRecJets + cAdd; | |
187 | ||
188 | if(branchRecBackJets.Contains("back")&&branchRecBackJets.Contains("cluster")&&!branchRecBackJets.Contains("MC"))branchRecBackJets = branchRecBackJets + cAddb; | |
189 | ||
190 | if(branchGenJets.Contains("AOD")&&branchGenJets.Contains("MC"))branchGenJets = branchGenJets + cAddmc; | |
191 | ||
192 | Printf("Gen jets branch %s: ", branchGenJets.Data()); | |
193 | Printf("Rec jets branch %s: ", branchRecJets.Data()); | |
194 | Printf("Jet backg branch %s: ", branchRecBackJets.Data()); | |
f4132e7d | 195 | |
1db1733e | 196 | if(!branchRecJets.Contains("noRecJets")) task->SetBranchRecJets(branchRecJets); |
44b235ce | 197 | if(!branchRecBackJets.Contains("noRecBackJets")) task->SetBranchRecBackJets(branchRecBackJets); |
1db1733e | 198 | if(!branchGenJets.Contains("noGenJets")) task->SetBranchGenJets(branchGenJets); |
6bec8236 | 199 | |
200 | ||
1db1733e | 201 | if(typeTracks.Contains("AODMC2b")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackAODMCChargedAcceptance); |
202 | else if(typeTracks.Contains("AODMC2")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackAODMCCharged); | |
203 | else if(typeTracks.Contains("AODMC")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackAODMCAll); | |
204 | else if(typeTracks.Contains("KINE2b")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackKineChargedAcceptance); | |
205 | else if(typeTracks.Contains("KINE2")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackKineCharged); | |
206 | else if(typeTracks.Contains("KINE")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackKineAll); | |
207 | else if(typeTracks.Contains("AODb")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackAODCuts); | |
208 | else if(typeTracks.Contains("AOD")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackAOD); | |
209 | else if(typeTracks.Contains("trackTypeUndef")) task->SetTrackTypeGen(0); // undefined | |
210 | else Printf("trackType %s not found", typeTracks.Data()); | |
211 | ||
212 | if(typeJets.Contains("AODMCb")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsGenAcceptance); | |
213 | else if(typeJets.Contains("AODMC")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsGen); | |
214 | else if(typeJets.Contains("KINEb")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsKineAcceptance); | |
215 | else if(typeJets.Contains("KINE")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsKine); | |
216 | else if(typeJets.Contains("AODb")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsRecAcceptance); | |
217 | else if(typeJets.Contains("AOD")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsRec); | |
218 | else if(typeJets.Contains("jetTypeUndef")) task->SetJetTypeGen(0); // undefined | |
219 | else Printf("jetType %s not found", typeJets.Data()); | |
220 | ||
7d9e8b32 | 221 | if(typeJets.Contains("AODMCb")) task->SetJetTypeRecEff(AliAnalysisTaskFragmentationFunction::kJetsGenAcceptance); // kJetsRecAcceptance |
222 | else if(typeJets.Contains("AODb")) task->SetJetTypeRecEff(AliAnalysisTaskFragmentationFunction::kJetsRecAcceptance); | |
223 | else task->SetJetTypeRecEff(0); | |
224 | ||
1db1733e | 225 | task->SetFilterMask(filterMask); |
44b235ce | 226 | task->SetEventClass(eventClass); |
1db1733e | 227 | |
f3564520 | 228 | // Set default parameters |
229 | // Cut selection | |
1db1733e | 230 | task->SetTrackCuts(); // default : pt > 0.150 GeV, |eta|<0.9, full phi acc |
231 | task->SetJetCuts(); // default: jet pt > 5 GeV, |eta|<0.5, full phi acc | |
f3564520 | 232 | task->SetDiJetCuts(); // default: type of cut = 1 (cut in deltaPhi), deltaPhi = 0., cdf = 0.5, fraction of pt = 0.6 |
233 | task->SetKindSlices(); // default: kindSlice = 1 (inv mass) | |
1db1733e | 234 | task->SetFFRadius(); // default: R = 0.4 |
1da9498b | 235 | task->SetFFBckgRadius(); // default: R = 0.7 |
44b235ce | 236 | task->SetBckgSubMethod(); // default: subMethod = O, 1 = leading jet removed for rho extraction, 2 = 2 leading jets removed |
b101fa2e | 237 | task->SetIJMode(0); // default: ijMode = 1 |
44b235ce | 238 | task->SetQAMode(); // default: qaMode = 3 |
239 | task->SetFFMode(); // default: ffMode = 1 | |
b101fa2e | 240 | task->SetDJMode(0); // default: djMode = 1 |
241 | task->SetEffMode(0); // default: effMode = 1 | |
242 | task->SetPhiCorrMode(0); // default: phiCorrMode = 1 | |
1db1733e | 243 | task->SetHighPtThreshold(); // default: pt > 5 Gev |
cb76764e | 244 | task->UseRecEffRecJetPtBins(); // efficiency in bins of rec/gen jet pt - default: kTRUE |
245 | ||
c08c3ad2 | 246 | task->SetBckgMode(1); // default: bgMode = 1 |
3170a3f8 | 247 | task->SetBckgType(); |
d5e8640d | 248 | task->SetBranchRecBackClusters(Form("clustersAOD_KT04_B0_Filter%05d_Cut00150_Skip00",filterMask)); |
c08c3ad2 | 249 | |
f3564520 | 250 | // Define histo bins |
1db1733e | 251 | task->SetFFHistoBins(); |
252 | task->SetQAJetHistoBins(); | |
253 | task->SetQATrackHistoBins(); | |
f3564520 | 254 | task->SetIJHistoBins(); |
255 | task->SetDiJetHistoBins(); | |
256 | task->SetQADiJetHistoBins(); | |
1db1733e | 257 | |
258 | mgr->AddTask(task); | |
6bec8236 | 259 | |
6bec8236 | 260 | // Create ONLY the output containers for the data produced by the task. |
261 | // Get and connect other common input/output containers via the manager as below | |
262 | //============================================================================== | |
6bec8236 | 263 | |
1db1733e | 264 | AliAnalysisDataContainer *coutput_FragFunc = mgr->CreateContainer( |
44b235ce | 265 | Form("fracfunc_%s_%s_%s_%s_cl%d", branchRecJets.Data(), branchGenJets.Data(), typeTracks.Data(), typeJets.Data(), eventClass), |
1db1733e | 266 | TList::Class(), |
267 | AliAnalysisManager::kOutputContainer, | |
44b235ce | 268 | Form("%s:PWG4_FragmentationFunction_%s_%s_%s_%s_cl%d", |
269 | AliAnalysisManager::GetCommonFileName(), branchRecJets.Data(), branchGenJets. Data(), typeTracks.Data(), typeJets.Data(), eventClass)); | |
1db1733e | 270 | |
271 | mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer()); | |
272 | mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer()); | |
273 | mgr->ConnectOutput (task, 1, coutput_FragFunc); | |
6bec8236 | 274 | |
1db1733e | 275 | return task; |
6bec8236 | 276 | } |