]>
Commit | Line | Data |
---|---|---|
34fc0eec | 1 | void AddTask_GammaConvDalitzQAV1_pPb( Int_t trainConfig = 1, |
2 | Bool_t isMC = kFALSE, //run MC | |
3 | Bool_t enableQAMesonTask = kTRUE, //enable QA in AliAnalysisTaskGammaConvDalitzV1 | |
4 | Bool_t enableDoMesonChic = kFALSE, // enable additional Chic analysis | |
2d49ea4c | 5 | Bool_t enableSetProdVtxVGamma = kTRUE, |
34fc0eec | 6 | TString fileNameInputForWeighting = "MCSpectraInput.root", // path to file for weigting input |
7 | Bool_t doWeighting = kFALSE, //enable Weighting | |
8 | TString generatorName = "DPMJET", | |
9 | TString cutnumberAODBranch = "0000000060084001001500000" | |
10 | ) { | |
11 | ||
12 | ||
13 | ||
14 | cout<<"*********Parameters*******"<<endl; | |
15 | cout<<"trainConfig: "<<trainConfig<<endl; | |
16 | cout<<"isMC: "<<isMC<<endl; | |
17 | cout<<"enableQAMesonTask: "<<enableQAMesonTask<<endl; | |
18 | cout<<"enableDoMesonChic: "<<enableDoMesonChic<<endl; | |
2d49ea4c | 19 | cout<<"enableSetProdVtxVGamma: "<<enableSetProdVtxVGamma<<endl; |
34fc0eec | 20 | cout<<"fileNameInputForWeighting: "<<fileNameInputForWeighting.Data()<<endl; |
21 | cout<<"doWeighting: "<<doWeighting<<endl; | |
22 | cout<<"generatorName: "<<generatorName.Data()<<endl; | |
23 | cout<<"cutnumberAODBranch: "<<cutnumberAODBranch.Data()<<endl; | |
24 | ||
25 | // ================= Load Librariers ================================= | |
26 | gSystem->Load("libCore.so"); | |
27 | gSystem->Load("libTree.so"); | |
28 | gSystem->Load("libGeom.so"); | |
29 | gSystem->Load("libVMC.so"); | |
30 | gSystem->Load("libPhysics.so"); | |
31 | gSystem->Load("libMinuit"); | |
32 | gSystem->Load("libSTEERBase"); | |
33 | gSystem->Load("libESD"); | |
34 | gSystem->Load("libAOD"); | |
35 | gSystem->Load("libANALYSIS"); | |
36 | gSystem->Load("libANALYSISalice"); | |
37 | gSystem->Load("libPWGGAGammaConv.so"); | |
38 | gSystem->Load("libCDB.so"); | |
39 | gSystem->Load("libSTEER.so"); | |
40 | gSystem->Load("libSTEERBase.so"); | |
41 | gSystem->Load("libTENDER.so"); | |
42 | gSystem->Load("libTENDERSupplies.so"); | |
43 | ||
2d49ea4c | 44 | |
45 | ||
46 | ||
47 | ||
34fc0eec | 48 | |
49 | cout<<"Entro 0"<<endl; | |
50 | ||
51 | // ================== GetAnalysisManager =============================== | |
52 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
53 | if (!mgr) { | |
54 | Error(Form("AddTask_GammaConvDalitzV1_pPb_%i",trainConfig), "No analysis manager found."); | |
55 | return ; | |
56 | } | |
57 | ||
58 | // ================== GetInputEventHandler ============================= | |
59 | AliVEventHandler *inputHandler=mgr->GetInputEventHandler(); | |
60 | ||
61 | //========= Add PID Reponse to ANALYSIS manager ==== | |
62 | if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){ | |
63 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); | |
64 | AddTaskPIDResponse(isMC); | |
65 | } | |
66 | ||
67 | //========= Set Cutnumber for V0Reader ================================ | |
f47b2bb5 | 68 | TString ConvCutnumber=""; |
69 | ||
70 | if(trainConfig == 9 || trainConfig == 10 ){ | |
71 | ConvCutnumber = "8000000160084001001500000000"; //Offline V0 finder | |
72 | } | |
73 | else { | |
2d49ea4c | 74 | ConvCutnumber = "8000000060084001001500000000"; //Online V0 finder |
f47b2bb5 | 75 | } |
76 | ||
34fc0eec | 77 | TString ElecCuts = "9000540000000200000"; //Electron Cuts |
78 | Bool_t doEtaShift = kFALSE; | |
79 | ||
80 | ||
81 | ||
82 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
83 | ||
84 | //========= Add V0 Reader to ANALYSIS manager if not yet existent ===== | |
85 | if( !(AliV0ReaderV1*)mgr->GetTask("V0ReaderV1") ){ | |
86 | AliV0ReaderV1 *fV0ReaderV1 = new AliV0ReaderV1("V0ReaderV1"); | |
87 | ||
88 | fV0ReaderV1->SetUseOwnXYZCalculation(kTRUE); | |
89 | fV0ReaderV1->SetCreateAODs(kFALSE);// AOD Output | |
90 | fV0ReaderV1->SetUseAODConversionPhoton(kTRUE); | |
91 | ||
92 | if (!mgr) { | |
93 | Error("AddTask_V0ReaderV1", "No analysis manager found."); | |
94 | return; | |
95 | } | |
96 | ||
97 | // Set AnalysisCut Number | |
98 | AliConversionCuts *fCuts=NULL; | |
99 | if( ConvCutnumber !=""){ | |
100 | fCuts= new AliConversionCuts(ConvCutnumber.Data(),ConvCutnumber.Data()); | |
101 | fCuts->SetPreSelectionCutFlag(kTRUE); | |
102 | if(fCuts->InitializeCutsFromCutString(ConvCutnumber.Data())){ | |
103 | fCuts->DoEtaShift(doEtaShift); | |
104 | fV0ReaderV1->SetConversionCuts(fCuts); | |
105 | fCuts->SetFillCutHistograms("",kTRUE); | |
106 | } | |
107 | } | |
108 | if(inputHandler->IsA()==AliAODInputHandler::Class()){ | |
109 | // AOD mode | |
110 | fV0ReaderV1->SetDeltaAODBranchName(Form("GammaConv_%s_gamma",cutnumberAODBranch.Data())); | |
111 | } | |
112 | fV0ReaderV1->Init(); | |
113 | ||
114 | AliLog::SetGlobalLogLevel(AliLog::kInfo); | |
115 | ||
116 | //connect input V0Reader | |
117 | mgr->AddTask(fV0ReaderV1); | |
118 | mgr->ConnectInput(fV0ReaderV1,0,cinput); | |
119 | ||
120 | } | |
121 | ||
122 | //================================================ | |
123 | //========= Add Electron Selector ================ | |
124 | ||
125 | ||
126 | if( !(AliDalitzElectronSelector*)mgr->GetTask("ElectronSelector") ){ | |
127 | ||
128 | AliDalitzElectronSelector *fElectronSelector = new AliDalitzElectronSelector("ElectronSelector"); | |
129 | ||
130 | // Set AnalysisCut Number | |
131 | ||
132 | AliDalitzElectronCuts *fElecCuts=0; | |
133 | ||
134 | //ElecCuts = "900054000000020000"; | |
135 | ||
136 | if( ElecCuts!=""){ | |
137 | ||
138 | fElecCuts= new AliDalitzElectronCuts(ElecCuts.Data(),ElecCuts.Data()); | |
139 | ||
140 | if(fElecCuts->InitializeCutsFromCutString(ElecCuts.Data())){ | |
141 | ||
142 | fElectronSelector->SetDalitzElectronCuts(fElecCuts); | |
143 | ||
144 | fElecCuts->SetFillCutHistograms("",kTRUE); | |
145 | ||
146 | } | |
147 | } | |
148 | ||
149 | fElectronSelector->Init(); | |
150 | mgr->AddTask(fElectronSelector); | |
151 | ||
152 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
153 | ||
154 | //connect input V0Reader | |
155 | ||
156 | mgr->ConnectInput (fElectronSelector,0,cinput1); | |
157 | ||
158 | } | |
159 | ||
160 | ||
161 | ||
162 | cout<<"Entro"<<endl; | |
163 | //================================================ | |
164 | //========= Add task to the ANALYSIS manager ===== | |
165 | //================================================ | |
166 | // find input container | |
167 | ||
168 | ||
169 | ||
170 | AliAnalysisTaskGammaConvDalitzV1 *task=NULL; | |
171 | ||
172 | task= new AliAnalysisTaskGammaConvDalitzV1(Form("GammaConvDalitzV1_%i",trainConfig)); | |
173 | ||
174 | task->SetIsHeavyIon(2); | |
175 | task->SetIsMC(isMC); | |
176 | ||
177 | ||
178 | ||
179 | // Cut Numbers to use in Analysis | |
180 | Int_t numberOfCuts = 1; | |
181 | ||
182 | TString *ConvCutarray = new TString[numberOfCuts]; | |
183 | ||
184 | TString *ElecCutarray = new TString[numberOfCuts]; | |
185 | ||
186 | TString *MesonCutarray = new TString[numberOfCuts]; | |
187 | ||
188 | Bool_t doEtaShiftIndCuts = kFALSE; | |
189 | TString stringShift = ""; | |
190 | ||
191 | // Shifting in pPb direction | |
192 | ||
193 | doEtaShiftIndCuts = kFALSE; | |
194 | stringShift = "pPb"; | |
195 | ||
196 | ||
197 | ||
198 | ||
199 | if( trainConfig == 1 ) { // No eta shift |Y| < 0.8 | |
200 | ||
201 | ConvCutarray[0] = "8000011002093603007200000000"; ElecCutarray[0] = "9047540023310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 | |
202 | ||
203 | } else if( trainConfig == 2 ) { // No eta shift |Y| < 0.8 | |
204 | ||
258b4572 | 205 | ConvCutarray[0] = "8000011032093603007200000000"; ElecCutarray[0] = "9047540023910262371"; MesonCutarray[0] = "01033035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + |Y| < 0.6 and |Gamma_eta| < 0.65 and |e+_eta| < 0.65 and |e-_eta| < 0.65 |
34fc0eec | 206 | |
207 | } else if( trainConfig == 3 ) { // No eta shift |Y| < 0.8 | |
208 | ||
258b4572 | 209 | ConvCutarray[0] = "8000011042093603007200000000"; ElecCutarray[0] = "9047540023510262371"; MesonCutarray[0] = "01032035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + |Y| < 0.7 and |Gamma_eta| < 0.75 and |e+_eta| < 0.75 and |e-_eta| < 0.75 |
34fc0eec | 210 | |
211 | } else if( trainConfig == 4 ) { // No eta shift |Y| < 0.8 | |
212 | ||
258b4572 | 213 | ConvCutarray[0] = "8000011012093603007200000000"; ElecCutarray[0] = "9047540023610262371"; MesonCutarray[0] = "01034035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + |Y| < 0.5 and |Gamma_eta| < 0.60 and |e+_eta| < 0.60 and |e-_eta| < 0.60 |
34fc0eec | 214 | |
258b4572 | 215 | } else if ( trainConfig == 5 ) { |
216 | ||
217 | ConvCutarray[0] = "8000011002093603007200000000"; ElecCutarray[0] = "9047540023310262331"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 | |
218 | ||
78cea1d2 | 219 | } else if ( trainConfig == 6 ) { // No eta shift |Y| < 0.8 |
220 | ||
221 | ConvCutarray[0] = "8000011002093603007200000000"; ElecCutarray[0] = "9047540023310264371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 | |
222 | ||
223 | } else if ( trainConfig == 7 ) { | |
224 | ||
225 | ConvCutarray[0] = "8000012002093603007200000000"; ElecCutarray[0] = "9047540023310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 | |
226 | ||
227 | } else if ( trainConfig == 8 ) { // No eta shift |Y| < 0.8 | |
228 | ||
229 | ConvCutarray[0] = "8000012002093603007200000000"; ElecCutarray[0] = "9047540023310264371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 | |
230 | ||
f47b2bb5 | 231 | } else if ( trainConfig == 9 ) { |
232 | ||
233 | ConvCutarray[0] = "8000011102093603007200000000"; ElecCutarray[0] = "9047540023310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 | |
234 | ||
235 | } else if ( trainConfig == 10 ) { | |
236 | ||
237 | ConvCutarray[0] = "8000012102093603007200000000"; ElecCutarray[0] = "9047540023310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 | |
238 | ||
f4d5bd23 | 239 | } else if ( trainConfig == 11 ) { |
240 | ||
241 | ConvCutarray[0] = "8000011002093603007200000000"; ElecCutarray[0] = "9047540023310262301"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 | |
242 | ||
243 | } else if ( trainConfig == 12 ) { | |
244 | ||
245 | ConvCutarray[0] = "8000012002093603007200000000"; ElecCutarray[0] = "9047540023310262301"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 | |
246 | ||
2d49ea4c | 247 | } else if ( trainConfig == 13 ) { |
248 | ||
249 | ConvCutarray[0] = "8000011002093603007200000000"; ElecCutarray[0] = "9047540053310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + 4 ITScls | |
250 | ||
251 | } else if ( trainConfig == 14 ) { | |
252 | ||
253 | ConvCutarray[0] = "8000011002093603007200000000"; ElecCutarray[0] = "9047540073310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + 4 ITScls no Any | |
254 | ||
255 | } else if ( trainConfig == 15 ) { | |
34fc0eec | 256 | |
2d49ea4c | 257 | ConvCutarray[0] = "8000012002093603007200000000"; ElecCutarray[0] = "9047540053310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + 4 ITScls |
258 | ||
259 | } else if ( trainConfig == 16 ) { | |
260 | ||
261 | ConvCutarray[0] = "8000012002093603007200000000"; ElecCutarray[0] = "9047540073310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + 4 ITScls no Any | |
8fa2d145 | 262 | |
263 | } else if ( trainConfig == 17 ) { | |
264 | ||
265 | ConvCutarray[0] = "8000011002093603007200000000"; ElecCutarray[0] = "9047540083310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + kBoth | |
266 | ||
267 | } else if ( trainConfig == 18 ) { | |
34fc0eec | 268 | |
8fa2d145 | 269 | ConvCutarray[0] = "8000011002093603007200000000"; ElecCutarray[0] = "9047540093310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + kBoth + 4ITS cls |
270 | ||
271 | } else if ( trainConfig == 19 ) { | |
272 | ||
273 | ConvCutarray[0] = "8000011002093603007200000000"; ElecCutarray[0] = "9047540013310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + kFirts | |
274 | ||
2055a442 | 275 | } else if ( trainConfig == 20 ) { |
276 | ||
277 | ConvCutarray[0] = "8000011002092170008260400000"; ElecCutarray[0] = "9047540023310262371"; MesonCutarray[0] = "01621035009000"; // standar cut Annika analysis: | |
278 | ||
279 | } else if ( trainConfig == 21 ) { | |
280 | ||
281 | ConvCutarray[0] = "8000011002092170008260400000"; ElecCutarray[0] = "9047540013310262371"; MesonCutarray[0] = "01621035009000"; // standar cut Annika analysis: + kFirst | |
8fa2d145 | 282 | } |
34fc0eec | 283 | |
f4d5bd23 | 284 | |
34fc0eec | 285 | TList *ConvCutList = new TList(); |
286 | TList *MesonCutList = new TList(); | |
287 | TList *ElecCutList = new TList(); | |
288 | ||
289 | TList *HeaderList = new TList(); | |
290 | TObjString *Header1 = new TObjString("pi0_1"); | |
291 | HeaderList->Add(Header1); | |
292 | TObjString *Header3 = new TObjString("eta_2"); | |
293 | HeaderList->Add(Header3); | |
294 | ||
295 | ConvCutList->SetOwner(kTRUE); | |
296 | AliConversionCuts **analysisCuts = new AliConversionCuts*[numberOfCuts]; | |
297 | MesonCutList->SetOwner(kTRUE); | |
298 | AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts]; | |
299 | ElecCutList->SetOwner(kTRUE); | |
300 | AliDalitzElectronCuts **analysisElecCuts = new AliDalitzElectronCuts*[numberOfCuts]; | |
301 | ||
302 | ||
303 | ||
304 | for(Int_t i = 0; i<numberOfCuts; i++){ | |
305 | ||
306 | ||
2d49ea4c | 307 | analysisCuts[i] = new AliConversionCuts(); |
308 | ||
34fc0eec | 309 | |
2055a442 | 310 | if ( ( trainConfig >= 1 && trainConfig <= 6 ) || trainConfig == 9 || trainConfig == 11 || trainConfig == 13 || trainConfig == 14 || trainConfig == 17 || trainConfig == 18 || trainConfig == 19 || trainConfig == 20 || trainConfig == 21 ){ |
34fc0eec | 311 | |
312 | if (doWeighting){ | |
313 | if (generatorName.CompareTo("DPMJET")==0){ | |
314 | analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kTRUE, kFALSE, fileNameInputForWeighting, "Pi0_DPMJET_LHC13b2_efix_pPb_5023GeV_MBV0A", "Eta_DPMJET_LHC13b2_efix_pPb_5023GeV_MBV0A", "","Pi0_Fit_Data_pPb_5023GeV_MBV0A","Eta_Fit_Data_pPb_5023GeV_MBV0A"); | |
315 | } else if (generatorName.CompareTo("HIJING")==0){ | |
316 | analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kTRUE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13e7_pPb_5023GeV_MBV0A", "Eta_Hijing_LHC13e7_pPb_5023GeV_MBV0A", "","Pi0_Fit_Data_pPb_5023GeV_MBV0A","Eta_Fit_Data_pPb_5023GeV_MBV0A"); | |
317 | } | |
318 | } | |
2d49ea4c | 319 | } else if ( trainConfig == 7 || trainConfig == 8 || trainConfig == 10 || trainConfig == 12 || trainConfig == 15 || trainConfig == 16 ){ |
78cea1d2 | 320 | |
2d49ea4c | 321 | if (doWeighting){ |
322 | analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kTRUE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13e7_addSig_pPb_5023GeV_MBV0A", "Eta_Hijing_LHC13e7_addSig_pPb_5023GeV_MBV0A", "","Pi0_Fit_Data_pPb_5023GeV_MBV0A","Eta_Fit_Data_pPb_5023GeV_MBV0A"); | |
323 | } | |
34fc0eec | 324 | } |
2d49ea4c | 325 | if( ! analysisCuts[i]->InitializeCutsFromCutString(ConvCutarray[i].Data()) ) { |
326 | cout<<"ERROR: analysisCuts [" <<i<<"]"<<endl; | |
327 | return 0; | |
328 | } else { | |
329 | ||
330 | if (doEtaShiftIndCuts) { | |
78cea1d2 | 331 | |
2d49ea4c | 332 | analysisCuts[i]->DoEtaShift(doEtaShiftIndCuts); |
333 | analysisCuts[i]->SetEtaShift(stringShift); | |
334 | } | |
335 | ConvCutList->Add(analysisCuts[i]); | |
336 | analysisCuts[i]->SetFillCutHistograms("",kFALSE); | |
337 | analysisCuts[i]->SetAcceptedHeader(HeaderList); | |
34fc0eec | 338 | |
34fc0eec | 339 | } |
34fc0eec | 340 | |
341 | ||
342 | ||
343 | analysisMesonCuts[i] = new AliConversionMesonCuts(); | |
344 | ||
345 | if( ! analysisMesonCuts[i]->InitializeCutsFromCutString(MesonCutarray[i].Data()) ) { | |
346 | cout<<"ERROR: analysisMesonCuts [ " <<i<<" ] "<<endl; | |
347 | return 0; | |
348 | } | |
349 | else { | |
350 | MesonCutList->Add(analysisMesonCuts[i]); | |
351 | analysisMesonCuts[i]->SetFillCutHistograms(""); | |
352 | } | |
353 | ||
354 | ||
355 | TString cutName( Form("%s_%s_%s",ConvCutarray[i].Data(),ElecCutarray[i].Data(),MesonCutarray[i].Data() ) ); | |
356 | ||
357 | ||
358 | analysisElecCuts[i] = new AliDalitzElectronCuts(); | |
359 | if( !analysisElecCuts[i]->InitializeCutsFromCutString(ElecCutarray[i].Data())) { | |
360 | ||
361 | cout<< "ERROR: analysisElecCuts [ " <<i<<" ] "<<endl; | |
362 | return 0; | |
363 | } | |
364 | else { | |
365 | ElecCutList->Add(analysisElecCuts[i]); | |
366 | analysisElecCuts[i]->SetFillCutHistograms("",kFALSE,cutName); | |
367 | } | |
368 | ||
369 | ||
370 | } | |
371 | ||
372 | ||
373 | task->SetConversionCutList(numberOfCuts,ConvCutList); | |
374 | task->SetMesonCutList(MesonCutList); | |
375 | task->SetElectronCutList(ElecCutList); | |
376 | ||
377 | task->SetMoveParticleAccordingToVertex(kTRUE); | |
2d49ea4c | 378 | |
379 | if(enableSetProdVtxVGamma) task->SetProductionVertextoVGamma(kTRUE); | |
34fc0eec | 380 | if(enableQAMesonTask) task->SetDoMesonQA(kTRUE); |
381 | if(enableDoMesonChic) task->SetDoChicAnalysis(kTRUE); | |
382 | ||
383 | //connect containers | |
384 | AliAnalysisDataContainer *coutput = | |
385 | mgr->CreateContainer(Form("GammaConvDalitzV1_%i",trainConfig), TList::Class(), | |
386 | AliAnalysisManager::kOutputContainer,Form("GammaConvV1Dalitz_%i.root",trainConfig)); | |
387 | ||
388 | mgr->AddTask(task); | |
389 | mgr->ConnectInput(task,0,cinput); | |
390 | mgr->ConnectOutput(task,1,coutput); | |
391 | ||
392 | return; | |
393 | ||
394 | } |