submitted AddTasks for Dalitz
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / macros / AddTask_GammaConvV1_PbPb.C
1 void AddTask_GammaConvV1_PbPb(  Int_t trainConfig = 1,  //change different set of cuts
2                               Bool_t isMC   = kFALSE, //run MC 
3                               Bool_t enableQAMesonTask = kFALSE, //enable QA in AliAnalysisTaskGammaConvV1
4                               Bool_t enableQAPhotonTask = kFALSE, // enable additional QA task
5                               TString fileNameInputForWeighting = "MCSpectraInput.root", // path to file for weigting input
6                               Bool_t doWeighting = kFALSE,  //enable Weighting
7                               TString cutnumberAODBranch = "1000000060084000001500000" 
8                            ) {
9
10    // ================= Load Librariers =================================
11    gSystem->Load("libCore.so");  
12    gSystem->Load("libTree.so");
13    gSystem->Load("libGeom.so");
14    gSystem->Load("libVMC.so");
15    gSystem->Load("libPhysics.so");
16    gSystem->Load("libMinuit");
17    gSystem->Load("libSTEERBase");
18    gSystem->Load("libESD");
19    gSystem->Load("libAOD");
20    gSystem->Load("libANALYSIS");
21    gSystem->Load("libANALYSISalice");  
22    gSystem->Load("libPWGGAGammaConv.so");
23    gSystem->Load("libCDB.so");
24    gSystem->Load("libSTEER.so");
25    gSystem->Load("libSTEERBase.so");
26    gSystem->Load("libTENDER.so");
27    gSystem->Load("libTENDERSupplies.so");
28       
29    // ================== GetAnalysisManager ===============================
30    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
31    if (!mgr) {
32       Error(Form("AddTask_GammaConvV1_%i",trainConfig), "No analysis manager found.");
33       return ;
34    }
35
36    // ================== GetInputEventHandler =============================
37    AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
38    
39    //========= Add PID Reponse to ANALYSIS manager ====
40    if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){
41       gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
42       AddTaskPIDResponse(isMC);
43    }
44    
45    //=========  Set Cutnumber for V0Reader ================================
46    TString cutnumber = "100000000008400100150000000"; 
47    AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
48    //========= Add V0 Reader to  ANALYSIS manager if not yet existent =====
49    if( !(AliV0ReaderV1*)mgr->GetTask("V0ReaderV1") ){
50       AliV0ReaderV1 *fV0ReaderV1 = new AliV0ReaderV1("V0ReaderV1");
51       
52       fV0ReaderV1->SetUseOwnXYZCalculation(kTRUE);
53       fV0ReaderV1->SetCreateAODs(kFALSE);// AOD Output
54       fV0ReaderV1->SetUseAODConversionPhoton(kTRUE);
55
56       if (!mgr) {
57          Error("AddTask_V0ReaderV1", "No analysis manager found.");
58          return;
59       }
60
61       // Set AnalysisCut Number
62       AliConversionCuts *fCuts=NULL;
63       if(cutnumber!=""){
64          fCuts= new AliConversionCuts(cutnumber.Data(),cutnumber.Data());
65          fCuts->SetPreSelectionCutFlag(kTRUE);
66          if(fCuts->InitializeCutsFromCutString(cutnumber.Data())){
67             fV0ReaderV1->SetConversionCuts(fCuts);
68             fCuts->SetFillCutHistograms("",kTRUE);
69          }
70       }
71       
72       if(inputHandler->IsA()==AliAODInputHandler::Class()){
73       // AOD mode
74          fV0ReaderV1->SetDeltaAODBranchName(Form("GammaConv_%s_gamma",cutnumberAODBranch.Data()));
75       }
76       fV0ReaderV1->Init();
77
78       AliLog::SetGlobalLogLevel(AliLog::kInfo);
79
80       //connect input V0Reader
81       mgr->AddTask(fV0ReaderV1);
82       mgr->ConnectInput(fV0ReaderV1,0,cinput);
83
84    }
85
86    //================================================
87    //========= Add task to the ANALYSIS manager =====
88    //================================================
89    AliAnalysisTaskGammaConvV1 *task=NULL;
90    task= new AliAnalysisTaskGammaConvV1(Form("GammaConvV1_%i",trainConfig));
91    task->SetIsHeavyIon(1);
92    task->SetIsMC(isMC);
93    // Cut Numbers to use in Analysis
94    Int_t numberOfCuts = 4;
95
96    TString *cutarray = new TString[numberOfCuts];
97    TString *mesonCutArray = new TString[numberOfCuts];
98
99    if (trainConfig == 1){ 
100       cutarray[ 0] = "601000104209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
101       cutarray[ 1] = "612000104209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
102       cutarray[ 2] = "501000104209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
103       cutarray[ 3] = "512000104209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
104    } else if (trainConfig == 2) { 
105       cutarray[ 0] = "524000104209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
106       cutarray[ 1] = "546000104209297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
107       cutarray[ 2] = "568000104209297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
108       cutarray[ 3] = "524000104209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
109    } else if (trainConfig == 3) { 
110       cutarray[ 0] = "502000104209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
111       cutarray[ 1] = "501000104209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
112       cutarray[ 2] = "512000104209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
113       cutarray[ 3] = "548000104209297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
114    } else if (trainConfig == 4) { 
115       cutarray[ 0] = "601000204209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
116       cutarray[ 1] = "612000204209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
117       cutarray[ 2] = "501000204209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
118       cutarray[ 3] = "512000204209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
119    } else if (trainConfig == 5) { 
120       cutarray[ 0] = "524000204209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
121       cutarray[ 1] = "546000204209297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
122       cutarray[ 2] = "568000204209297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
123       cutarray[ 3] = "524000204209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
124    } else if (trainConfig == 6) { 
125       cutarray[ 0] = "502000204209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
126       cutarray[ 1] = "501000204209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
127       cutarray[ 2] = "512000204209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
128       cutarray[ 3] = "548000204209297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
129    } else if (trainConfig == 7){ // Psi pair 10000
130       cutarray[ 0] = "601000104209297002320000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
131       cutarray[ 1] = "612000104209297002320000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
132       cutarray[ 2] = "501000104209297002320000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
133       cutarray[ 3] = "512000104209297002320000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
134    } else if (trainConfig == 8) { // Psi pair 10000
135       cutarray[ 0] = "524000104209297002320000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
136       cutarray[ 1] = "546000104209297002320000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
137       cutarray[ 2] = "568000104209297002320000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
138       cutarray[ 3] = "524000104209297002320000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
139    } else if (trainConfig == 9) { // Psi pair 10000
140       cutarray[ 0] = "502000104209297002320000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
141       cutarray[ 1] = "501000104209297002320000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
142       cutarray[ 2] = "512000104209297002320000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
143       cutarray[ 3] = "548000104209297002320000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
144    } else if (trainConfig == 10) { // Psi pair 10000
145       cutarray[ 0] = "601000204209297002320000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
146       cutarray[ 1] = "612000204209297002320000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
147       cutarray[ 2] = "501000204209297002320000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
148       cutarray[ 3] = "512000204209297002320000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
149    } else if (trainConfig == 11) { // Psi pair 10000
150       cutarray[ 0] = "524000204209297002320000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
151       cutarray[ 1] = "546000204209297002320000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
152       cutarray[ 2] = "568000204209297002320000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
153       cutarray[ 3] = "524000204209297002320000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
154    } else if (trainConfig == 12) { // Psi pair 10000
155       cutarray[ 0] = "502000204209297002320000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
156       cutarray[ 1] = "501000204209297002320000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
157       cutarray[ 2] = "512000204209297002320000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
158       cutarray[ 3] = "548000204209297002320000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%   
159    } else if (trainConfig == 13){ // Psi pair 0.1
160       cutarray[ 0] = "601000104209297002321000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
161       cutarray[ 1] = "612000104209297002321000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
162       cutarray[ 2] = "501000104209297002321000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
163       cutarray[ 3] = "512000104209297002321000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
164    } else if (trainConfig == 14) { // Psi pair 0.1
165       cutarray[ 0] = "524000104209297002321000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
166       cutarray[ 1] = "546000104209297002321000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
167       cutarray[ 2] = "568000104209297002321000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
168       cutarray[ 3] = "524000104209297002321000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
169    } else if (trainConfig == 15) { // Psi pair 0.1
170       cutarray[ 0] = "502000104209297002321000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
171       cutarray[ 1] = "501000104209297002321000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
172       cutarray[ 2] = "512000104209297002321000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
173       cutarray[ 3] = "548000104209297002321000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
174    } else if (trainConfig == 16) { // Psi pair 0.1
175       cutarray[ 0] = "601000204209297002321000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
176       cutarray[ 1] = "612000204209297002321000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
177       cutarray[ 2] = "501000204209297002321000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
178       cutarray[ 3] = "512000204209297002321000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
179    } else if (trainConfig == 17) { // Psi pair 0.1
180       cutarray[ 0] = "524000204209297002321000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
181       cutarray[ 1] = "546000204209297002321000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
182       cutarray[ 2] = "568000204209297002321000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
183       cutarray[ 3] = "524000204209297002321000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
184    } else if (trainConfig == 18) { // Psi pair 0.1
185       cutarray[ 0] = "502000204209297002321000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
186       cutarray[ 1] = "501000204209297002321000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
187       cutarray[ 2] = "512000204209297002321000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
188       cutarray[ 3] = "548000204209297002321000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%      
189    } else if (trainConfig == 19){ // Psi pair 0.035
190       cutarray[ 0] = "601000104209297002323000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
191       cutarray[ 1] = "612000104209297002323000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
192       cutarray[ 2] = "501000104209297002323000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
193       cutarray[ 3] = "512000104209297002323000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
194    } else if (trainConfig == 20) { // Psi pair 0.035
195       cutarray[ 0] = "524000104209297002323000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
196       cutarray[ 1] = "546000104209297002323000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
197       cutarray[ 2] = "568000104209297002323000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
198       cutarray[ 3] = "524000104209297002323000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
199    } else if (trainConfig == 21) { // Psi pair 0.035
200       cutarray[ 0] = "502000104209297002323000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
201       cutarray[ 1] = "501000104209297002323000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
202       cutarray[ 2] = "512000104209297002323000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
203       cutarray[ 3] = "548000104209297002323000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
204    } else if (trainConfig == 22) { // Psi pair 0.035
205       cutarray[ 0] = "601000204209297002323000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
206       cutarray[ 1] = "612000204209297002323000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
207       cutarray[ 2] = "501000204209297002323000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
208       cutarray[ 3] = "512000204209297002323000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
209    } else if (trainConfig == 23) { // Psi pair 0.035
210       cutarray[ 0] = "524000204209297002323000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
211       cutarray[ 1] = "546000204209297002323000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
212       cutarray[ 2] = "568000204209297002323000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
213       cutarray[ 3] = "524000204209297002323000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
214    } else if (trainConfig == 24) { // Psi pair 0.035
215       cutarray[ 0] = "502000204209297002323000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
216       cutarray[ 1] = "501000204209297002323000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
217       cutarray[ 2] = "512000204209297002323000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
218       cutarray[ 3] = "548000204209297002323000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%         
219    } else if (trainConfig == 25){ // Eta 0.75
220       cutarray[ 0] = "601000103209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
221       cutarray[ 1] = "612000103209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
222       cutarray[ 2] = "501000103209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
223       cutarray[ 3] = "512000103209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
224    } else if (trainConfig == 26) { // Eta 0.75
225       cutarray[ 0] = "524000103209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
226       cutarray[ 1] = "546000103209297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
227       cutarray[ 2] = "568000103209297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
228       cutarray[ 3] = "524000103209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
229    } else if (trainConfig == 27) { // Eta 0.75
230       cutarray[ 0] = "502000103209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
231       cutarray[ 1] = "501000103209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
232       cutarray[ 2] = "512000103209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
233       cutarray[ 3] = "548000103209297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
234    } else if (trainConfig == 28) { // Eta 0.75
235       cutarray[ 0] = "601000203209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
236       cutarray[ 1] = "612000203209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
237       cutarray[ 2] = "501000203209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
238       cutarray[ 3] = "512000203209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
239    } else if (trainConfig == 29) { // Eta 0.75
240       cutarray[ 0] = "524000203209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
241       cutarray[ 1] = "546000203209297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
242       cutarray[ 2] = "568000203209297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
243       cutarray[ 3] = "524000203209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
244    } else if (trainConfig == 30) { // Eta 0.75
245       cutarray[ 0] = "502000203209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
246       cutarray[ 1] = "501000203209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
247       cutarray[ 2] = "512000203209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
248       cutarray[ 3] = "548000203209297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%         
249    } else if (trainConfig == 31){ // Eta 0.8
250       cutarray[ 0] = "601000100209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
251       cutarray[ 1] = "612000100209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
252       cutarray[ 2] = "501000100209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
253       cutarray[ 3] = "512000100209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
254    } else if (trainConfig == 32) { // Eta 0.8
255       cutarray[ 0] = "524000100209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
256       cutarray[ 1] = "546000100209297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
257       cutarray[ 2] = "568000100209297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
258       cutarray[ 3] = "524000100209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
259    } else if (trainConfig == 33) { // Eta 0.8
260       cutarray[ 0] = "502000100209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
261       cutarray[ 1] = "501000100209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
262       cutarray[ 2] = "512000100209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
263       cutarray[ 3] = "548000100209297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
264    } else if (trainConfig == 34) { // Eta 0.8
265       cutarray[ 0] = "601000200209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
266       cutarray[ 1] = "612000200209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
267       cutarray[ 2] = "501000200209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
268       cutarray[ 3] = "512000200209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
269    } else if (trainConfig == 35) { // Eta 0.8
270       cutarray[ 0] = "524000200209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
271       cutarray[ 1] = "546000200209297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
272       cutarray[ 2] = "568000200209297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
273       cutarray[ 3] = "524000200209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
274    } else if (trainConfig == 36) { // Eta 0.8
275       cutarray[ 0] = "502000200209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
276       cutarray[ 1] = "501000200209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
277       cutarray[ 2] = "512000200209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
278       cutarray[ 3] = "548000200209297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%         
279    } else if (trainConfig == 37){ // Eta 0.6
280       cutarray[ 0] = "601000101209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
281       cutarray[ 1] = "612000101209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
282       cutarray[ 2] = "501000101209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
283       cutarray[ 3] = "512000101209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
284    } else if (trainConfig == 38) { // Eta 0.6
285       cutarray[ 0] = "524000101209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
286       cutarray[ 1] = "546000101209297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
287       cutarray[ 2] = "568000101209297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
288       cutarray[ 3] = "524000101209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
289    } else if (trainConfig == 39) { // Eta 0.6
290       cutarray[ 0] = "502000101209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
291       cutarray[ 1] = "501000101209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
292       cutarray[ 2] = "512000101209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
293       cutarray[ 3] = "548000101209297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
294    } else if (trainConfig == 40) { // Eta 0.6
295       cutarray[ 0] = "601000201209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
296       cutarray[ 1] = "612000201209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
297       cutarray[ 2] = "501000201209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
298       cutarray[ 3] = "512000201209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
299    } else if (trainConfig == 41) { // Eta 0.6
300       cutarray[ 0] = "524000201209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
301       cutarray[ 1] = "546000201209297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
302       cutarray[ 2] = "568000201209297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
303       cutarray[ 3] = "524000201209297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
304    } else if (trainConfig == 42) { // Eta 0.6
305       cutarray[ 0] = "502000201209297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
306       cutarray[ 1] = "501000201209297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
307       cutarray[ 2] = "512000201209297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
308       cutarray[ 3] = "548000201209297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
309    } else if (trainConfig == 43){ // R 10-180
310       cutarray[ 0] = "601000104509297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
311       cutarray[ 1] = "612000104509297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
312       cutarray[ 2] = "501000104509297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
313       cutarray[ 3] = "512000104509297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
314    } else if (trainConfig == 44) {  // R 10-180
315       cutarray[ 0] = "524000104509297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
316       cutarray[ 1] = "546000104509297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
317       cutarray[ 2] = "568000104509297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
318       cutarray[ 3] = "524000104509297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
319    } else if (trainConfig == 45) {  // R 10-180
320       cutarray[ 0] = "502000104509297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
321       cutarray[ 1] = "501000104509297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
322       cutarray[ 2] = "512000104509297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
323       cutarray[ 3] = "548000104509297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
324    } else if (trainConfig == 46) {  // R 10-180
325       cutarray[ 0] = "601000204509297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
326       cutarray[ 1] = "612000204509297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
327       cutarray[ 2] = "501000204509297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
328       cutarray[ 3] = "512000204509297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
329    } else if (trainConfig == 47) {  // R 10-180
330       cutarray[ 0] = "524000204509297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
331       cutarray[ 1] = "546000204509297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
332       cutarray[ 2] = "568000204509297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
333       cutarray[ 3] = "524000204509297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
334    } else if (trainConfig == 48) {  // R 10-180
335       cutarray[ 0] = "502000204509297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
336       cutarray[ 1] = "501000204509297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
337       cutarray[ 2] = "512000204509297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
338       cutarray[ 3] = "548000204509297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%  
339     } else if (trainConfig == 49){ // R 2.8-180
340       cutarray[ 0] = "601000104109297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
341       cutarray[ 1] = "612000104109297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
342       cutarray[ 2] = "501000104109297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
343       cutarray[ 3] = "512000104109297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
344    } else if (trainConfig == 50) {  // R 2.8-180
345       cutarray[ 0] = "524000104109297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
346       cutarray[ 1] = "546000104109297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
347       cutarray[ 2] = "568000104109297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
348       cutarray[ 3] = "524000104109297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
349    } else if (trainConfig == 51) {  // R 2.8-180
350       cutarray[ 0] = "502000104109297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
351       cutarray[ 1] = "501000104109297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
352       cutarray[ 2] = "512000104109297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
353       cutarray[ 3] = "548000104109297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
354    } else if (trainConfig == 52) {  // R 2.8-180
355       cutarray[ 0] = "601000204109297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
356       cutarray[ 1] = "612000204109297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
357       cutarray[ 2] = "501000204109297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
358       cutarray[ 3] = "512000204109297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
359    } else if (trainConfig == 53) {  // R 2.8-180
360       cutarray[ 0] = "524000204109297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
361       cutarray[ 1] = "546000204109297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
362       cutarray[ 2] = "568000204109297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
363       cutarray[ 3] = "524000204109297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
364    } else if (trainConfig == 54) {  // R 2.8-180
365       cutarray[ 0] = "502000204109297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
366       cutarray[ 1] = "501000204109297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
367       cutarray[ 2] = "512000204109297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
368       cutarray[ 3] = "548000204109297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%  
369     } else if (trainConfig == 55){ // R 2.8-180
370       cutarray[ 0] = "601000104609297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
371       cutarray[ 1] = "612000104609297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
372       cutarray[ 2] = "501000104609297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
373       cutarray[ 3] = "512000104609297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
374    } else if (trainConfig == 56) {  // R 2.8-180
375       cutarray[ 0] = "524000104609297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
376       cutarray[ 1] = "546000104609297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
377       cutarray[ 2] = "568000104609297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
378       cutarray[ 3] = "524000104609297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
379    } else if (trainConfig == 57) {  // R 2.8-180
380       cutarray[ 0] = "502000104609297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
381       cutarray[ 1] = "501000104609297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
382       cutarray[ 2] = "512000104609297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
383       cutarray[ 3] = "548000104609297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
384    } else if (trainConfig == 58) {  // R 2.8-180
385       cutarray[ 0] = "601000204609297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
386       cutarray[ 1] = "612000204609297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
387       cutarray[ 2] = "501000204609297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
388       cutarray[ 3] = "512000204609297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
389    } else if (trainConfig == 59) {  // R 2.8-180
390       cutarray[ 0] = "524000204609297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
391       cutarray[ 1] = "546000204609297002322000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
392       cutarray[ 2] = "568000204609297002322000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
393       cutarray[ 3] = "524000204609297002322000000"; mesonCutArray[ 3] = "01522045009000"; // 20-40% //direct photon
394    } else if (trainConfig == 60) {  // R 2.8-180
395       cutarray[ 0] = "502000204609297002322000000"; mesonCutArray[ 0] = "01522045009000"; // 0-20%
396       cutarray[ 1] = "501000204609297002322000000"; mesonCutArray[ 1] = "01522045009000"; // 0-10%
397       cutarray[ 2] = "512000204609297002322000000"; mesonCutArray[ 2] = "01522045009000"; // 10-20%
398       cutarray[ 3] = "548000204609297002322000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%  
399      
400    } else {
401       Error(Form("GammaConvV1_%i",trainConfig), "wrong trainConfig variable no cuts have been specified for the configuration");
402       return;
403    }
404
405    TList *ConvCutList = new TList();
406    TList *MesonCutList = new TList();
407
408    TList *HeaderList = new TList();
409    TObjString *Header1 = new TObjString("pi0_1");
410    HeaderList->Add(Header1);
411 //    TObjString *Header3 = new TObjString("eta_2");
412 //    HeaderList->Add(Header3);
413    
414    ConvCutList->SetOwner(kTRUE);
415    AliConversionCuts **analysisCuts = new AliConversionCuts*[numberOfCuts];
416    MesonCutList->SetOwner(kTRUE);
417    AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts];
418
419    for(Int_t i = 0; i<numberOfCuts; i++){
420       analysisCuts[i] = new AliConversionCuts();
421       if (trainConfig == 1 ||trainConfig == 7 || trainConfig == 13 || trainConfig == 19 || trainConfig == 25 || trainConfig == 31 || trainConfig == 37 || trainConfig == 43 || trainConfig == 49 || trainConfig == 55 || trainConfig == 61 || trainConfig == 67 || trainConfig == 73 || trainConfig == 79 || trainConfig == 85){
422          if (i == 0 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_0005TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0005V0M");
423          if (i == 1 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_0510TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0510V0M");
424          if (i == 2 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_0010TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0010V0M");
425          if (i == 3 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_1020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_1020V0M");
426       } else if (trainConfig == 2 ||trainConfig == 8 || trainConfig == 14 || trainConfig == 20 || trainConfig == 26 || trainConfig == 32 || trainConfig == 38 || trainConfig == 44 || trainConfig == 50 || trainConfig == 56 || trainConfig == 62 || trainConfig == 68 || trainConfig == 74 || trainConfig == 80 || trainConfig == 86){ 
427         if (i == 0 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_2040TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_2040V0M");
428         if (i == 1 && doWeighting) analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_4060TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4060V0M");
429         if (i == 2 && doWeighting) analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_6080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_6080V0M");
430         if (i == 3 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_2040TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_2040V0M");
431       } else if (trainConfig == 3 ||trainConfig == 9 || trainConfig == 15 || trainConfig == 21 || trainConfig == 27 || trainConfig == 33 || trainConfig == 39 || trainConfig == 45 || trainConfig == 51 || trainConfig == 57 || trainConfig == 63 || trainConfig == 69 || trainConfig == 75 || trainConfig == 81 || trainConfig == 87){
432         if (i == 0 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_0020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0020V0M");
433         if (i == 1 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_0010TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0010V0M");
434         if (i == 2 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_1020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_1020V0M");
435         if (i == 3 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_4080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4080V0M");
436       } else if (trainConfig == 4 ||trainConfig == 10 || trainConfig == 16 || trainConfig == 22 || trainConfig == 28 || trainConfig == 34 || trainConfig == 40 || trainConfig == 46 || trainConfig == 52 || trainConfig == 58 || trainConfig == 64 || trainConfig == 70 || trainConfig == 76 || trainConfig == 82 || trainConfig == 88){
437          if (i == 0 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_0005TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0005V0M");
438          if (i == 1 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_0510TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0510V0M");
439          if (i == 2 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_0010TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0010V0M");
440          if (i == 3 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_1020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_1020V0M");
441       } else if (trainConfig == 5 ||trainConfig == 11 || trainConfig == 17 || trainConfig == 23 || trainConfig == 29 || trainConfig == 35 || trainConfig == 41 || trainConfig == 47 || trainConfig == 53 || trainConfig == 59 || trainConfig == 65 || trainConfig == 71 || trainConfig == 77 || trainConfig == 83 || trainConfig == 89){ 
442         if (i == 0 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_2040TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_2040V0M");
443         if (i == 1 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_4060TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4060V0M");
444         if (i == 2  && doWeighting) analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_6080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_6080V0M");
445         if (i == 3 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_2040TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_2040V0M");
446       } else if (trainConfig == 6 ||trainConfig == 12 || trainConfig == 18 || trainConfig == 24 || trainConfig == 30 || trainConfig == 36 || trainConfig == 42 || trainConfig == 48 || trainConfig == 54 || trainConfig == 60 || trainConfig == 66 || trainConfig == 72 || trainConfig == 78 || trainConfig == 84 || trainConfig == 90){
447         if (i == 0 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_0020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0020V0M");
448         if (i == 1 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_0010TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0010V0M");
449         if (i == 2 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_1020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_1020V0M");
450         if (i == 3 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_4080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4080V0M");
451       }
452       
453       analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data());
454       ConvCutList->Add(analysisCuts[i]);
455
456       analysisCuts[i]->SetFillCutHistograms("",kFALSE);
457       analysisMesonCuts[i] = new AliConversionMesonCuts();
458       analysisMesonCuts[i]->InitializeCutsFromCutString(mesonCutArray[i].Data());
459       MesonCutList->Add(analysisMesonCuts[i]);
460       analysisMesonCuts[i]->SetFillCutHistograms("");
461       analysisCuts[i]->SetAcceptedHeader(HeaderList);
462    }
463
464    task->SetConversionCutList(numberOfCuts,ConvCutList);
465    task->SetMesonCutList(numberOfCuts,MesonCutList);
466    task->SetMoveParticleAccordingToVertex(kTRUE);
467    task->SetDoMesonAnalysis(kTRUE);
468    if (enableQAMesonTask) task->SetDoMesonQA(kTRUE); //Attention new switch for Pi0 QA
469    if (enableQAPhotonTask) task->SetDoPhotonQA(kTRUE);  //Attention new switch small for Photon QA
470
471    //connect containers
472    AliAnalysisDataContainer *coutput =
473       mgr->CreateContainer(Form("GammaConvV1_%i",trainConfig), TList::Class(),
474                            AliAnalysisManager::kOutputContainer,Form("GammaConvV1_%i.root",trainConfig));
475
476    mgr->AddTask(task);
477    mgr->ConnectInput(task,0,cinput);
478    mgr->ConnectOutput(task,1,coutput);
479
480    return;
481
482 }