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