]>
Commit | Line | Data |
---|---|---|
1db1733e | 1 | |
2 | /************************************************************************************************* | |
3 | *** Add Fragmentation Function Task *** | |
4 | ************************************************************************************************** | |
5 | The fragmenation function task expects an ESD filter and jet finder running before this task. | |
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 | ||
3456f527 | 27 | AliAnalysisTaskFragmentationFunction *AddTaskFragmentationFunction(UInt_t iFlag=1, UInt_t filterMask=32){ |
1db1733e | 28 | |
29 | AliAnalysisTaskFragmentationFunction *ff=0; | |
30 | ||
c2658535 | 31 | // UA1 Jets |
1db1733e | 32 | // only reconstructed (default) |
33 | if(iFlag&(1<<0)) ff = AddTaskFragmentationFunction("jets", "", "", "", filterMask); | |
ac017ff3 | 34 | // charged MC tracks and jets |
492fbd39 | 35 | if(iFlag&(1<<1)) ff = AddTaskFragmentationFunction("jets", "jetsAODMC2_UA104", "AODMC", "AODMC2", filterMask); |
ac017ff3 | 36 | // charged MC tracks and jets with acceptance cuts |
492fbd39 | 37 | if(iFlag&(1<<2)) ff = AddTaskFragmentationFunction("jets", "jetsAODMC2_UA104", "AODMCb", "AODMC2b", filterMask); |
1db1733e | 38 | // kine tracks in acceptance, pythia jets in acceptance |
ac017ff3 | 39 | if(iFlag&(1<<3)) ff = AddTaskFragmentationFunction("jets", "", "KINEb", "KINEb", filterMask); |
1db1733e | 40 | // reconstructed charged tracks after cuts, MC jets in acceptance |
ac017ff3 | 41 | if(iFlag&(1<<4)) ff = AddTaskFragmentationFunction("jets", "jetsMC2b", "AODMCb", "AOD2b", filterMask); |
cfd02305 | 42 | // reconstruction efficiency: pointing with rec jet axis into gen tracks |
43 | if(iFlag&(1<<5)) ff = AddTaskFragmentationFunction("jets", "jetsAODMC2_UA104", "AODb", "AODMC2b", filterMask); | |
c2658535 | 44 | |
45 | // kt jets | |
46 | // only reconstructed | |
47 | if(iFlag&(1<<10)) ff = AddTaskFragmentationFunction("jetsAOD_FASTKT04", "", "", "", filterMask); | |
48 | // charged MC tracks and jets | |
49 | if(iFlag&(1<<11)) ff = AddTaskFragmentationFunction("jetsAOD_FASTKT04", "jetsAODMC2_FASTKT04", "AODMC", "AODMC2", filterMask); | |
50 | // charged MC tracks and jets with acceptance cuts | |
51 | if(iFlag&(1<<12)) ff = AddTaskFragmentationFunction("jetsAOD_FASTKT04", "jetsAODMC2_FASTKT04", "AODMCb", "AODMC2b", filterMask); | |
52 | ||
53 | // anti-kt jets | |
54 | // only reconstructed | |
55 | if(iFlag&(1<<20)) ff = AddTaskFragmentationFunction("jetsAOD_FASTJET04", "", "", "", filterMask); | |
56 | // charged MC tracks and jets | |
57 | if(iFlag&(1<<21)) ff = AddTaskFragmentationFunction("jetsAOD_FASTJET04", "jetsAODMC2_FASTJET04", "AODMC", "AODMC2", filterMask); | |
58 | // charged MC tracks and jets with acceptance cuts | |
59 | if(iFlag&(1<<22)) ff = AddTaskFragmentationFunction("jetsAOD_FASTJET04", "jetsAODMC2_FASTJET04", "AODMCb", "AODMC2b", filterMask); | |
60 | ||
61 | ||
1db1733e | 62 | |
63 | return ff; | |
64 | } | |
65 | ||
66 | // _______________________________________________________________________________________ | |
67 | ||
68 | AliAnalysisTaskFragmentationFunction *AddTaskFragmentationFunction( | |
69 | const char* recJetsBranch, | |
70 | const char* genJetsBranch, | |
71 | const char* jetType, | |
72 | const char* trackType, | |
73 | UInt_t filterMask) | |
6bec8236 | 74 | { |
1db1733e | 75 | // Creates a fragmentation function task, |
76 | // configures it and adds it to the analysis manager. | |
77 | ||
78 | //****************************************************************************** | |
79 | //*** Configuration Parameter ************************************************** | |
80 | //****************************************************************************** | |
81 | ||
82 | // space for configuration parameter: histo bin, cuts, ... | |
83 | // so far only default parameter used | |
84 | ||
85 | Int_t debug = -1; // debug level, -1: not set here | |
6bec8236 | 86 | |
1db1733e | 87 | //****************************************************************************** |
88 | ||
89 | ||
90 | ||
6bec8236 | 91 | // Get the pointer to the existing analysis manager via the static access method. |
92 | //============================================================================== | |
93 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
94 | if (!mgr) { | |
1db1733e | 95 | ::Error("AddTaskFragmentationFunction", "No analysis manager to connect to."); |
96 | return NULL; | |
97 | } | |
6bec8236 | 98 | |
99 | // Check the analysis type using the event handlers connected to the analysis manager. | |
100 | //============================================================================== | |
101 | if (!mgr->GetInputEventHandler()) { | |
1db1733e | 102 | ::Error("AddTaskFragmentationFunction", "This task requires an input event handler"); |
103 | return NULL; | |
6bec8236 | 104 | } |
105 | ||
1db1733e | 106 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" |
107 | Printf("Data Type: %s", type.Data()); | |
108 | ||
109 | TString branchRecJets(recJetsBranch); | |
110 | TString branchGenJets(genJetsBranch); | |
111 | TString typeJets(jetType); | |
112 | TString typeTracks(trackType); | |
113 | ||
114 | if(branchRecJets.Length()==0) branchRecJets = "noRecJets"; | |
115 | if(branchGenJets.Length()==0) branchGenJets = "noGenJets"; | |
116 | if(typeTracks.Length()==0) typeTracks = "trackTypeUndef"; | |
117 | if(typeJets.Length()==0) typeJets = "jetTypeUndef"; | |
118 | ||
6bec8236 | 119 | // Create the task and configure it. |
120 | //=========================================================================== | |
1db1733e | 121 | |
122 | AliAnalysisTaskFragmentationFunction *task = new AliAnalysisTaskFragmentationFunction( | |
123 | Form("Fragmenation Function %s %s %s %s", branchRecJets.Data(), branchGenJets.Data(), typeJets.Data(), typeTracks.Data())); | |
124 | ||
125 | if(debug>=0) task->SetDebugLevel(debug); | |
6bec8236 | 126 | |
1db1733e | 127 | Printf("Rec Jets %s", branchRecJets.Data()); |
128 | Printf("Gen Jets %s", branchGenJets.Data()); | |
129 | Printf("Jet Type %s", typeJets.Data()); | |
130 | Printf("Track Type %s", typeTracks.Data()); | |
6bec8236 | 131 | |
f4132e7d | 132 | // attach the filter maska |
133 | if(branchRecJets.Contains("AOD")&&branchRecJets.Contains("jets")&&!branchRecJets.Contains("MC"))branchRecJets += Form("_Filter%05d",filterMask); | |
134 | if(branchGenJets.Contains("AOD")&&branchRecJets.Contains("jets")&&!branchGenJets.Contains("MC"))branchGenJets += Form("_Filter%05d",filterMask); | |
135 | ||
1db1733e | 136 | if(!branchRecJets.Contains("noRecJets")) task->SetBranchRecJets(branchRecJets); |
137 | if(!branchGenJets.Contains("noGenJets")) task->SetBranchGenJets(branchGenJets); | |
6bec8236 | 138 | |
139 | ||
1db1733e | 140 | if(typeTracks.Contains("AODMC2b")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackAODMCChargedAcceptance); |
141 | else if(typeTracks.Contains("AODMC2")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackAODMCCharged); | |
142 | else if(typeTracks.Contains("AODMC")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackAODMCAll); | |
143 | else if(typeTracks.Contains("KINE2b")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackKineChargedAcceptance); | |
144 | else if(typeTracks.Contains("KINE2")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackKineCharged); | |
145 | else if(typeTracks.Contains("KINE")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackKineAll); | |
146 | else if(typeTracks.Contains("AODb")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackAODCuts); | |
147 | else if(typeTracks.Contains("AOD")) task->SetTrackTypeGen(AliAnalysisTaskFragmentationFunction::kTrackAOD); | |
148 | else if(typeTracks.Contains("trackTypeUndef")) task->SetTrackTypeGen(0); // undefined | |
149 | else Printf("trackType %s not found", typeTracks.Data()); | |
150 | ||
151 | if(typeJets.Contains("AODMCb")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsGenAcceptance); | |
152 | else if(typeJets.Contains("AODMC")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsGen); | |
153 | else if(typeJets.Contains("KINEb")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsKineAcceptance); | |
154 | else if(typeJets.Contains("KINE")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsKine); | |
155 | else if(typeJets.Contains("AODb")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsRecAcceptance); | |
156 | else if(typeJets.Contains("AOD")) task->SetJetTypeGen(AliAnalysisTaskFragmentationFunction::kJetsRec); | |
157 | else if(typeJets.Contains("jetTypeUndef")) task->SetJetTypeGen(0); // undefined | |
158 | else Printf("jetType %s not found", typeJets.Data()); | |
159 | ||
7d9e8b32 | 160 | if(typeJets.Contains("AODMCb")) task->SetJetTypeRecEff(AliAnalysisTaskFragmentationFunction::kJetsGenAcceptance); // kJetsRecAcceptance |
161 | else if(typeJets.Contains("AODb")) task->SetJetTypeRecEff(AliAnalysisTaskFragmentationFunction::kJetsRecAcceptance); | |
162 | else task->SetJetTypeRecEff(0); | |
163 | ||
1db1733e | 164 | task->SetFilterMask(filterMask); |
165 | ||
f3564520 | 166 | // Set default parameters |
167 | // Cut selection | |
1db1733e | 168 | task->SetTrackCuts(); // default : pt > 0.150 GeV, |eta|<0.9, full phi acc |
169 | task->SetJetCuts(); // default: jet pt > 5 GeV, |eta|<0.5, full phi acc | |
f3564520 | 170 | task->SetDiJetCuts(); // default: type of cut = 1 (cut in deltaPhi), deltaPhi = 0., cdf = 0.5, fraction of pt = 0.6 |
171 | task->SetKindSlices(); // default: kindSlice = 1 (inv mass) | |
1db1733e | 172 | task->SetFFRadius(); // default: R = 0.4 |
1da9498b | 173 | task->SetFFBckgRadius(); // default: R = 0.7 |
174 | task->SetBckgMode(); // default: bgMode = 1 | |
67e37e80 | 175 | task->SetBckgType(); // default: 0,1,2 |
176 | task->SetIJMode(); // default: ijMode = 1 | |
1db1733e | 177 | task->SetHighPtThreshold(); // default: pt > 5 Gev |
cb76764e | 178 | task->UseRecEffRecJetPtBins(); // efficiency in bins of rec/gen jet pt - default: kTRUE |
179 | ||
f3564520 | 180 | // Define histo bins |
1db1733e | 181 | task->SetFFHistoBins(); |
182 | task->SetQAJetHistoBins(); | |
183 | task->SetQATrackHistoBins(); | |
f3564520 | 184 | task->SetIJHistoBins(); |
185 | task->SetDiJetHistoBins(); | |
186 | task->SetQADiJetHistoBins(); | |
1db1733e | 187 | |
188 | mgr->AddTask(task); | |
6bec8236 | 189 | |
6bec8236 | 190 | // Create ONLY the output containers for the data produced by the task. |
191 | // Get and connect other common input/output containers via the manager as below | |
192 | //============================================================================== | |
6bec8236 | 193 | |
1db1733e | 194 | AliAnalysisDataContainer *coutput_FragFunc = mgr->CreateContainer( |
195 | Form("fracfunc_%s_%s_%s_%s", branchRecJets.Data(), branchGenJets.Data(), typeTracks.Data(), typeJets.Data()), | |
196 | TList::Class(), | |
197 | AliAnalysisManager::kOutputContainer, | |
198 | Form("%s:PWG4_FragmentationFunction_%s_%s_%s_%s", | |
199 | AliAnalysisManager::GetCommonFileName(), branchRecJets.Data(), branchGenJets. Data(), typeTracks.Data(), typeJets.Data())); | |
200 | ||
201 | mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer()); | |
202 | mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer()); | |
203 | mgr->ConnectOutput (task, 1, coutput_FragFunc); | |
6bec8236 | 204 | |
1db1733e | 205 | return task; |
6bec8236 | 206 | } |