added weighting for pi0& eta pPb as well
[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                               Int_t enableQAMesonTask = 0, //enable QA in AliAnalysisTaskGammaConvV1
4                               Int_t enableQAPhotonTask = 0, // 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                               TString periodName = "LHC13d2"
9                            ) {
10
11    // ================= Load Librariers =================================
12    gSystem->Load("libCore.so");  
13    gSystem->Load("libTree.so");
14    gSystem->Load("libGeom.so");
15    gSystem->Load("libVMC.so");
16    gSystem->Load("libPhysics.so");
17    gSystem->Load("libMinuit");
18    gSystem->Load("libSTEERBase");
19    gSystem->Load("libESD");
20    gSystem->Load("libAOD");
21    gSystem->Load("libANALYSIS");
22    gSystem->Load("libANALYSISalice");  
23    gSystem->Load("libPWGGAGammaConv.so");
24    gSystem->Load("libCDB.so");
25    gSystem->Load("libSTEER.so");
26    gSystem->Load("libSTEERBase.so");
27    gSystem->Load("libTENDER.so");
28    gSystem->Load("libTENDERSupplies.so");
29       
30    // ================== GetAnalysisManager ===============================
31    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
32    if (!mgr) {
33       Error(Form("AddTask_GammaConvV1_%i",trainConfig), "No analysis manager found.");
34       return ;
35    }
36
37    // ================== GetInputEventHandler =============================
38    AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
39    
40    //========= Add PID Reponse to ANALYSIS manager ====
41    if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){
42       gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
43       AddTaskPIDResponse(isMC);
44    }
45    
46    //=========  Set Cutnumber for V0Reader ================================
47    TString cutnumber = "1000000000084001001500000000"; 
48    AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
49    //========= Add V0 Reader to  ANALYSIS manager if not yet existent =====
50    if( !(AliV0ReaderV1*)mgr->GetTask("V0ReaderV1") ){
51       AliV0ReaderV1 *fV0ReaderV1 = new AliV0ReaderV1("V0ReaderV1");
52       
53       fV0ReaderV1->SetUseOwnXYZCalculation(kTRUE);
54       fV0ReaderV1->SetCreateAODs(kFALSE);// AOD Output
55       fV0ReaderV1->SetUseAODConversionPhoton(kTRUE);
56
57       if (!mgr) {
58          Error("AddTask_V0ReaderV1", "No analysis manager found.");
59          return;
60       }
61
62       // Set AnalysisCut Number
63       AliConversionCuts *fCuts=NULL;
64       if(cutnumber!=""){
65          fCuts= new AliConversionCuts(cutnumber.Data(),cutnumber.Data());
66          fCuts->SetPreSelectionCutFlag(kTRUE);
67          if(fCuts->InitializeCutsFromCutString(cutnumber.Data())){
68             fV0ReaderV1->SetConversionCuts(fCuts);
69             fCuts->SetFillCutHistograms("",kTRUE);
70          }
71       }
72       
73       if(inputHandler->IsA()==AliAODInputHandler::Class()){
74       // AOD mode
75          fV0ReaderV1->SetDeltaAODBranchName(Form("GammaConv_%s_gamma",cutnumberAODBranch.Data()));
76       }
77       fV0ReaderV1->Init();
78
79       AliLog::SetGlobalLogLevel(AliLog::kInfo);
80
81       //connect input V0Reader
82       mgr->AddTask(fV0ReaderV1);
83       mgr->ConnectInput(fV0ReaderV1,0,cinput);
84
85    }
86
87    //================================================
88    //========= Add task to the ANALYSIS manager =====
89    //================================================
90    AliAnalysisTaskGammaConvV1 *task=NULL;
91    task= new AliAnalysisTaskGammaConvV1(Form("GammaConvV1_%i",trainConfig));
92    task->SetIsHeavyIon(1);
93    task->SetIsMC(isMC);
94    // Cut Numbers to use in Analysis
95    Int_t numberOfCuts = 5;
96
97    TString *cutarray = new TString[numberOfCuts];
98    TString *mesonCutArray = new TString[numberOfCuts];
99
100    if (trainConfig == 1){ // Standard cuts
101       cutarray[ 0] = "6010001042092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
102       cutarray[ 1] = "6120001042092970023220000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
103       cutarray[ 2] = "5010001042092970023220000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
104       cutarray[ 3] = "5120001042092970023220000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
105       cutarray[ 4] = "5020001042092970023220000000"; mesonCutArray[ 4] = "01522045009000"; // 0-20%
106    } else if (trainConfig == 2) { // Standard cuts
107       cutarray[ 0] = "5240001042092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
108       cutarray[ 1] = "5460001042092970023220000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
109       cutarray[ 2] = "5680001042092970023220000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
110       cutarray[ 3] = "5480001042092970023220000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
111       cutarray[ 4] = "5490001042092970023220000000"; mesonCutArray[ 4] = "01522065009000"; // 40-90%
112    } else if (trainConfig == 3) { // Standard cuts only added signals
113       cutarray[ 0] = "6010002042092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
114       cutarray[ 1] = "6120002042092970023220000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
115       cutarray[ 2] = "5010002042092970023220000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
116       cutarray[ 3] = "5120002042092970023220000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
117       cutarray[ 4] = "5020002042092970023220000000"; mesonCutArray[ 4] = "01522045009000"; // 0-20%
118    } else if (trainConfig == 4) { // Standard cuts only added signals
119       cutarray[ 0] = "5240002042092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
120       cutarray[ 1] = "5460002042092970023220000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
121       cutarray[ 2] = "5680002042092970023220000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
122       cutarray[ 3] = "5480002042092970023220000000"; mesonCutArray[ 3] = "01522065009000"; // 20-40% 
123       cutarray[ 4] = "5490002042092970023220000000"; mesonCutArray[ 4] = "01522065009000"; // 40-90%
124    } else if (trainConfig == 5){ // R-minCut 7.5 cm
125       cutarray[ 0] = "6010001049092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
126       cutarray[ 1] = "6120001049092970023220000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
127       cutarray[ 2] = "5010001049092970023220000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
128       cutarray[ 3] = "5120001049092970023220000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
129       cutarray[ 4] = "5020001049092970023220000000"; mesonCutArray[ 4] = "01522045009000"; // 0-20%
130    } else if (trainConfig == 6) { // R-minCut 7.5 cm
131       cutarray[ 0] = "5240001049092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
132       cutarray[ 1] = "5460001049092970023220000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
133       cutarray[ 2] = "5680001049092970023220000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
134       cutarray[ 3] = "5480001049092970023220000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
135       cutarray[ 4] = "5490001049092970023220000000"; mesonCutArray[ 4] = "01522065009000"; // 40-90%
136    } else if (trainConfig == 7) {// R-minCut 7.5 cm
137       cutarray[ 0] = "6010002049092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
138       cutarray[ 1] = "6120002049092970023220000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
139       cutarray[ 2] = "5010002049092970023220000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
140       cutarray[ 3] = "5120002049092970023220000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
141       cutarray[ 4] = "5020002049092970023220000000"; mesonCutArray[ 4] = "01522045009000"; // 0-20%
142    } else if (trainConfig == 8) { // R-minCut 7.5 cm
143       cutarray[ 0] = "5240002040092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
144       cutarray[ 1] = "5460002049092970023220000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
145       cutarray[ 2] = "5680002049092970023220000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
146       cutarray[ 3] = "5480002049092970023220000000"; mesonCutArray[ 3] = "01522065009000"; // 20-40% 
147       cutarray[ 4] = "5490002049092970023220000000"; mesonCutArray[ 4] = "01522065009000"; // 40-90%   
148    } else if (trainConfig == 9){ // R-minCut 12.5 cm
149       cutarray[ 0] = "6010001048092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
150       cutarray[ 1] = "6120001048092970023220000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
151       cutarray[ 2] = "5010001048092970023220000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
152       cutarray[ 3] = "5120001048092970023220000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
153       cutarray[ 4] = "5020001048092970023220000000"; mesonCutArray[ 4] = "01522045009000"; // 0-20%
154    } else if (trainConfig == 10) { // R-minCut 12.5 cm
155       cutarray[ 0] = "5240001048092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
156       cutarray[ 1] = "5460001048092970023220000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
157       cutarray[ 2] = "5680001048092970023220000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
158       cutarray[ 3] = "5480001048092970023220000000"; mesonCutArray[ 3] = "01522065009000"; // 40-80%
159       cutarray[ 4] = "5490001048092970023220000000"; mesonCutArray[ 4] = "01522065009000"; // 40-90%
160    } else if (trainConfig == 11) {// R-minCut 12.5 cm
161       cutarray[ 0] = "6010002048092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 0-5%
162       cutarray[ 1] = "6120002048092970023220000000"; mesonCutArray[ 1] = "01522045009000"; // 5-10%
163       cutarray[ 2] = "5010002048092970023220000000"; mesonCutArray[ 2] = "01522045009000"; // 0-10%
164       cutarray[ 3] = "5120002048092970023220000000"; mesonCutArray[ 3] = "01522045009000"; // 10-20%
165       cutarray[ 4] = "5020002048092970023220000000"; mesonCutArray[ 4] = "01522045009000"; // 0-20%
166    } else if (trainConfig == 12) { // R-minCut 12.5 cm
167       cutarray[ 0] = "5240002040092970023220000000"; mesonCutArray[ 0] = "01522045009000"; // 20-40%
168       cutarray[ 1] = "5460002048092970023220000000"; mesonCutArray[ 1] = "01522065009000"; // 40-60%
169       cutarray[ 2] = "5680002048092970023220000000"; mesonCutArray[ 2] = "01522065009000"; // 60-80%
170       cutarray[ 3] = "5480002048092970023220000000"; mesonCutArray[ 3] = "01522065009000"; // 20-40% 
171       cutarray[ 4] = "5490002048092970023220000000"; mesonCutArray[ 4] = "01522065009000"; // 40-90%      
172    } else  if (trainConfig == 13){ // eta 0.65 (new standard), y = 0.6 (new Standard)
173       cutarray[ 0] = "6010001032092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 0-5%
174       cutarray[ 1] = "6120001032092970023220000000"; mesonCutArray[ 1] = "01523045009000"; // 5-10%
175       cutarray[ 2] = "5010001032092970023220000000"; mesonCutArray[ 2] = "01523045009000"; // 0-10%
176       cutarray[ 3] = "5120001032092970023220000000"; mesonCutArray[ 3] = "01523045009000"; // 10-20%
177       cutarray[ 4] = "5020001032092970023220000000"; mesonCutArray[ 4] = "01523045009000"; // 0-20%
178    } else if (trainConfig == 14) {  // eta 0.65 (new standard), y = 0.6 (new Standard)
179       cutarray[ 0] = "5240001032092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 20-40%
180       cutarray[ 1] = "5460001032092970023220000000"; mesonCutArray[ 1] = "01523065009000"; // 40-60%
181       cutarray[ 2] = "5680001032092970023220000000"; mesonCutArray[ 2] = "01523065009000"; // 60-80%
182       cutarray[ 3] = "5480001032092970023220000000"; mesonCutArray[ 3] = "01523065009000"; // 40-80%
183       cutarray[ 4] = "5490001032092970023220000000"; mesonCutArray[ 4] = "01523065009000"; // 40-90%
184    } else if (trainConfig == 15) { // eta 0.65 (new standard), y = 0.6 (new Standard) cuts only added signals
185       cutarray[ 0] = "6010002032092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 0-5%
186       cutarray[ 1] = "6120002032092970023220000000"; mesonCutArray[ 1] = "01523045009000"; // 5-10%
187       cutarray[ 2] = "5010002032092970023220000000"; mesonCutArray[ 2] = "01523045009000"; // 0-10%
188       cutarray[ 3] = "5120002032092970023220000000"; mesonCutArray[ 3] = "01523045009000"; // 10-20%
189       cutarray[ 4] = "5020002032092970023220000000"; mesonCutArray[ 4] = "01523045009000"; // 0-20%
190    } else if (trainConfig == 16) { // eta 0.65 (new standard), y = 0.6 (new Standard) cuts only added signals
191       cutarray[ 0] = "5240002032092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 20-40%
192       cutarray[ 1] = "5460002032092970023220000000"; mesonCutArray[ 1] = "01523065009000"; // 40-60%
193       cutarray[ 2] = "5680002032092970023220000000"; mesonCutArray[ 2] = "01523065009000"; // 60-80%
194       cutarray[ 3] = "5480002032092970023220000000"; mesonCutArray[ 3] = "01523065009000"; // 20-40% 
195       cutarray[ 4] = "5490002032092970023220000000"; mesonCutArray[ 4] = "01523065009000"; // 40-90%
196    } else  if (trainConfig == 17){ // eta 0.6, y = 0.6 (new Standard)
197       cutarray[ 0] = "6010001012092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 0-5%
198       cutarray[ 1] = "6120001012092970023220000000"; mesonCutArray[ 1] = "01523045009000"; // 5-10%
199       cutarray[ 2] = "5010001012092970023220000000"; mesonCutArray[ 2] = "01523045009000"; // 0-10%
200       cutarray[ 3] = "5120001012092970023220000000"; mesonCutArray[ 3] = "01523045009000"; // 10-20%
201       cutarray[ 4] = "5020001012092970023220000000"; mesonCutArray[ 4] = "01523045009000"; // 0-20%
202    } else if (trainConfig == 18) {  // eta 0.6, y = 0.6 (new Standard)
203       cutarray[ 0] = "5240001012092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 20-40%
204       cutarray[ 1] = "5460001012092970023220000000"; mesonCutArray[ 1] = "01523065009000"; // 40-60%
205       cutarray[ 2] = "5680001012092970023220000000"; mesonCutArray[ 2] = "01523065009000"; // 60-80%
206       cutarray[ 3] = "5480001012092970023220000000"; mesonCutArray[ 3] = "01523065009000"; // 40-80%
207       cutarray[ 4] = "5490001012092970023220000000"; mesonCutArray[ 4] = "01523065009000"; // 40-90%
208    } else if (trainConfig == 19) { // eta 0.6, y = 0.6 (new Standard) cuts only added signals
209       cutarray[ 0] = "6010002012092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 0-5%
210       cutarray[ 1] = "6120002012092970023220000000"; mesonCutArray[ 1] = "01523045009000"; // 5-10%
211       cutarray[ 2] = "5010002012092970023220000000"; mesonCutArray[ 2] = "01523045009000"; // 0-10%
212       cutarray[ 3] = "5120002012092970023220000000"; mesonCutArray[ 3] = "01523045009000"; // 10-20%
213       cutarray[ 4] = "5020002012092970023220000000"; mesonCutArray[ 4] = "01523045009000"; // 0-20%
214    } else if (trainConfig == 20) { // eta 0.6, y = 0.6 (new Standard) cuts only added signals
215       cutarray[ 0] = "5240002012092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 20-40%
216       cutarray[ 1] = "5460002012092970023220000000"; mesonCutArray[ 1] = "01523065009000"; // 40-60%
217       cutarray[ 2] = "5680002012092970023220000000"; mesonCutArray[ 2] = "01523065009000"; // 60-80%
218       cutarray[ 3] = "5480002012092970023220000000"; mesonCutArray[ 3] = "01523065009000"; // 20-40% 
219       cutarray[ 4] = "5490002012092970023220000000"; mesonCutArray[ 4] = "01523065009000"; // 40-90%
220    } else  if (trainConfig == 21){ // eta 0.7, y = 0.6 (new Standard)
221       cutarray[ 0] = "6010001072092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 0-5%
222       cutarray[ 1] = "6120001072092970023220000000"; mesonCutArray[ 1] = "01523045009000"; // 5-10%
223       cutarray[ 2] = "5010001072092970023220000000"; mesonCutArray[ 2] = "01523045009000"; // 0-10%
224       cutarray[ 3] = "5120001072092970023220000000"; mesonCutArray[ 3] = "01523045009000"; // 10-20%
225       cutarray[ 4] = "5020001072092970023220000000"; mesonCutArray[ 4] = "01523045009000"; // 0-20%
226    } else if (trainConfig == 22) {  // eta 0.7, y = 0.6 (new Standard)
227       cutarray[ 0] = "5240001072092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 20-40%
228       cutarray[ 1] = "5460001072092970023220000000"; mesonCutArray[ 1] = "01523065009000"; // 40-60%
229       cutarray[ 2] = "5680001072092970023220000000"; mesonCutArray[ 2] = "01523065009000"; // 60-80%
230       cutarray[ 3] = "5480001072092970023220000000"; mesonCutArray[ 3] = "01523065009000"; // 40-80%
231       cutarray[ 4] = "5490001072092970023220000000"; mesonCutArray[ 4] = "01523065009000"; // 40-90%
232    } else if (trainConfig == 23) { // eta 0.7, y = 0.6 (new Standard) cuts only added signals
233       cutarray[ 0] = "6010002072092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 0-5%
234       cutarray[ 1] = "6120002072092970023220000000"; mesonCutArray[ 1] = "01523045009000"; // 5-10%
235       cutarray[ 2] = "5010002072092970023220000000"; mesonCutArray[ 2] = "01523045009000"; // 0-10%
236       cutarray[ 3] = "5120002072092970023220000000"; mesonCutArray[ 3] = "01523045009000"; // 10-20%
237       cutarray[ 4] = "5020002072092970023220000000"; mesonCutArray[ 4] = "01523045009000"; // 0-20%
238    } else if (trainConfig == 24) { // eta 0.7, y = 0.6 (new Standard) cuts only added signals
239       cutarray[ 0] = "5240002072092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 20-40%
240       cutarray[ 1] = "5460002072092970023220000000"; mesonCutArray[ 1] = "01523065009000"; // 40-60%
241       cutarray[ 2] = "5680002072092970023220000000"; mesonCutArray[ 2] = "01523065009000"; // 60-80%
242       cutarray[ 3] = "5480002072092970023220000000"; mesonCutArray[ 3] = "01523065009000"; // 20-40% 
243       cutarray[ 4] = "5490002072092970023220000000"; mesonCutArray[ 4] = "01523065009000"; // 40-90%
244    } else  if (trainConfig == 25){ // eta 0.5, y = 0.6 (new Standard)
245       cutarray[ 0] = "6010001052092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 0-5%
246       cutarray[ 1] = "6120001052092970023220000000"; mesonCutArray[ 1] = "01523045009000"; // 5-10%
247       cutarray[ 2] = "5010001052092970023220000000"; mesonCutArray[ 2] = "01523045009000"; // 0-10%
248       cutarray[ 3] = "5120001052092970023220000000"; mesonCutArray[ 3] = "01523045009000"; // 10-20%
249       cutarray[ 4] = "5020001052092970023220000000"; mesonCutArray[ 4] = "01523045009000"; // 0-20%
250    } else if (trainConfig == 26) {  // eta 0.5, y = 0.6 (new Standard)
251       cutarray[ 0] = "5240001052092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 20-40%
252       cutarray[ 1] = "5460001052092970023220000000"; mesonCutArray[ 1] = "01523065009000"; // 40-60%
253       cutarray[ 2] = "5680001052092970023220000000"; mesonCutArray[ 2] = "01523065009000"; // 60-80%
254       cutarray[ 3] = "5480001052092970023220000000"; mesonCutArray[ 3] = "01523065009000"; // 40-80%
255       cutarray[ 4] = "5490001052092970023220000000"; mesonCutArray[ 4] = "01523065009000"; // 40-90%
256    } else if (trainConfig == 27) { // eta 0.5, y = 0.6 (new Standard) cuts only added signals
257       cutarray[ 0] = "6010002052092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 0-5%
258       cutarray[ 1] = "6120002052092970023220000000"; mesonCutArray[ 1] = "01523045009000"; // 5-10%
259       cutarray[ 2] = "5010002052092970023220000000"; mesonCutArray[ 2] = "01523045009000"; // 0-10%
260       cutarray[ 3] = "5120002052092970023220000000"; mesonCutArray[ 3] = "01523045009000"; // 10-20%
261       cutarray[ 4] = "5020002052092970023220000000"; mesonCutArray[ 4] = "01523045009000"; // 0-20%
262    } else if (trainConfig == 28) { // eta 0.5, y = 0.6 (new Standard) cuts only added signals
263       cutarray[ 0] = "5240002052092970023220000000"; mesonCutArray[ 0] = "01523045009000"; // 20-40%
264       cutarray[ 1] = "5460002052092970023220000000"; mesonCutArray[ 1] = "01523065009000"; // 40-60%
265       cutarray[ 2] = "5680002052092970023220000000"; mesonCutArray[ 2] = "01523065009000"; // 60-80%
266       cutarray[ 3] = "5480002052092970023220000000"; mesonCutArray[ 3] = "01523065009000"; // 20-40% 
267       cutarray[ 4] = "5490002052092970023220000000"; mesonCutArray[ 4] = "01523065009000"; // 40-90%
268    } else  if (trainConfig == 29){ // eta 0.65 (new standard), y = 0.6 (new Standard) pt dependent alpha
269       cutarray[ 0] = "6010001032092970023220000000"; mesonCutArray[ 0] = "01523015009000"; // 0-5%
270       cutarray[ 1] = "6120001032092970023220000000"; mesonCutArray[ 1] = "01523015009000"; // 5-10%
271       cutarray[ 2] = "5010001032092970023220000000"; mesonCutArray[ 2] = "01523015009000"; // 0-10%
272       cutarray[ 3] = "5120001032092970023220000000"; mesonCutArray[ 3] = "01523015009000"; // 10-20%
273       cutarray[ 4] = "5020001032092970023220000000"; mesonCutArray[ 4] = "01523015009000"; // 0-20%
274    } else if (trainConfig == 30) {  // eta 0.65 (new standard), y = 0.6 (new Standard) pt dependent alpha
275       cutarray[ 0] = "5240001032092970023220000000"; mesonCutArray[ 0] = "01523015009000"; // 20-40%
276       cutarray[ 1] = "5460001032092970023220000000"; mesonCutArray[ 1] = "01523025009000"; // 40-60%
277       cutarray[ 2] = "5680001032092970023220000000"; mesonCutArray[ 2] = "01523025009000"; // 60-80%
278       cutarray[ 3] = "5480001032092970023220000000"; mesonCutArray[ 3] = "01523025009000"; // 40-80%
279       cutarray[ 4] = "5490001032092970023220000000"; mesonCutArray[ 4] = "01523025009000"; // 40-90%
280    } else if (trainConfig == 31) { // eta 0.65 (new standard), y = 0.6 (new Standard) cuts only added signals, pt dependent alpha
281       cutarray[ 0] = "6010002032092970023220000000"; mesonCutArray[ 0] = "01523015009000"; // 0-5%
282       cutarray[ 1] = "6120002032092970023220000000"; mesonCutArray[ 1] = "01523015009000"; // 5-10%
283       cutarray[ 2] = "5010002032092970023220000000"; mesonCutArray[ 2] = "01523015009000"; // 0-10%
284       cutarray[ 3] = "5120002032092970023220000000"; mesonCutArray[ 3] = "01523015009000"; // 10-20%
285       cutarray[ 4] = "5020002032092970023220000000"; mesonCutArray[ 4] = "01523015009000"; // 0-20%
286    } else if (trainConfig == 32) { // eta 0.65 (new standard), y = 0.6 (new Standard) cuts only added signals, pt dependent alpha
287       cutarray[ 0] = "5240002032092970023220000000"; mesonCutArray[ 0] = "01523015009000"; // 20-40%
288       cutarray[ 1] = "5460002032092970023220000000"; mesonCutArray[ 1] = "01523025009000"; // 40-60%
289       cutarray[ 2] = "5680002032092970023220000000"; mesonCutArray[ 2] = "01523025009000"; // 60-80%
290       cutarray[ 3] = "5480002032092970023220000000"; mesonCutArray[ 3] = "01523025009000"; // 20-40% 
291       cutarray[ 4] = "5490002032092970023220000000"; mesonCutArray[ 4] = "01523025009000"; // 40-90%
292    } else if (trainConfig == 33){ // Standard cuts, eta 0.9, only to be run on data
293       cutarray[ 0] = "6010001002092970023220000000"; mesonCutArray[ 0] = "01525045009000"; // 0-5%
294       cutarray[ 1] = "6120001002092970023220000000"; mesonCutArray[ 1] = "01525045009000"; // 5-10%
295       cutarray[ 2] = "5010001002092970023220000000"; mesonCutArray[ 2] = "01525045009000"; // 0-10%
296       cutarray[ 3] = "5120001002092970023220000000"; mesonCutArray[ 3] = "01525045009000"; // 10-20%
297       cutarray[ 4] = "5020001002092970023220000000"; mesonCutArray[ 4] = "01525045009000"; // 0-20%
298    } else if (trainConfig == 34) { // Standard cuts, eta 0.9, only to be run on data
299       cutarray[ 0] = "5240001002092970023220000000"; mesonCutArray[ 0] = "01525045009000"; // 20-40%
300       cutarray[ 1] = "5460001002092970023220000000"; mesonCutArray[ 1] = "01525065009000"; // 40-60%
301       cutarray[ 2] = "5680001002092970023220000000"; mesonCutArray[ 2] = "01525065009000"; // 60-80%
302       cutarray[ 3] = "5480001002092970023220000000"; mesonCutArray[ 3] = "01525065009000"; // 40-80%
303       cutarray[ 4] = "5350001002092970023220000000"; mesonCutArray[ 4] = "01525065009000"; // 40-90%   
304    } else if (trainConfig == 35){ // Standard cuts, eta 1.4, only to be run on data
305       cutarray[ 0] = "6010001022092970023220000000"; mesonCutArray[ 0] = "01520045009000"; // 0-5%
306       cutarray[ 1] = "6120001022092970023220000000"; mesonCutArray[ 1] = "01520045009000"; // 5-10%
307       cutarray[ 2] = "5010001022092970023220000000"; mesonCutArray[ 2] = "01520045009000"; // 0-10%
308       cutarray[ 3] = "5120001022092970023220000000"; mesonCutArray[ 3] = "01520045009000"; // 10-20%
309       cutarray[ 4] = "5020001022092970023220000000"; mesonCutArray[ 4] = "01520045009000"; // 0-20%
310    } else if (trainConfig == 36) { // Standard cuts, eta 1.4, only to be run on data
311       cutarray[ 0] = "5240001022092970023220000000"; mesonCutArray[ 0] = "01520045009000"; // 20-40%
312       cutarray[ 1] = "5460001022092970023220000000"; mesonCutArray[ 1] = "01520065009000"; // 40-60%
313       cutarray[ 2] = "5680001022092970023220000000"; mesonCutArray[ 2] = "01520065009000"; // 60-80%
314       cutarray[ 3] = "5480001022092970023220000000"; mesonCutArray[ 3] = "01520065009000"; // 40-80%
315       cutarray[ 4] = "5350001022092970023220000000"; mesonCutArray[ 4] = "01520065009000"; // 40-90%   
316    } else if (trainConfig == 37){ // Standard cuts, eta 0.9, only to be run on data : kMB
317       cutarray[ 0] = "6014001002092970023220000000"; mesonCutArray[ 0] = "01525045009000"; // 0-5%
318       cutarray[ 1] = "6124001002092970023220000000"; mesonCutArray[ 1] = "01525045009000"; // 5-10%
319       cutarray[ 2] = "5014001002092970023220000000"; mesonCutArray[ 2] = "01525045009000"; // 0-10%
320       cutarray[ 3] = "5124001002092970023220000000"; mesonCutArray[ 3] = "01525045009000"; // 10-20%
321       cutarray[ 4] = "5024001002092970023220000000"; mesonCutArray[ 4] = "01525045009000"; // 0-20%
322    } else if (trainConfig == 38) { // Standard cuts, eta 0.9, only to be run on data : kMB
323       cutarray[ 0] = "5244001002092970023220000000"; mesonCutArray[ 0] = "01525045009000"; // 20-40%
324       cutarray[ 1] = "5464001002092970023220000000"; mesonCutArray[ 1] = "01525065009000"; // 40-60%
325       cutarray[ 2] = "5684001002092970023220000000"; mesonCutArray[ 2] = "01525065009000"; // 60-80%
326       cutarray[ 3] = "5484001002092970023220000000"; mesonCutArray[ 3] = "01525065009000"; // 40-80%
327       cutarray[ 4] = "5354001002092970023220000000"; mesonCutArray[ 4] = "01525065009000"; // 40-90%   
328    } else if (trainConfig == 39){ // Standard cuts, eta 0.9, only to be run on data :kCentral
329       cutarray[ 0] = "6015001002092970023220000000"; mesonCutArray[ 0] = "01525045009000"; // 0-5%
330       cutarray[ 1] = "6125001002092970023220000000"; mesonCutArray[ 1] = "01525045009000"; // 5-10%
331       cutarray[ 2] = "5015001002092970023220000000"; mesonCutArray[ 2] = "01525045009000"; // 0-10%
332       cutarray[ 3] = "5125001002092970023220000000"; mesonCutArray[ 3] = "01525045009000"; // 10-20%
333       cutarray[ 4] = "5025001002092970023220000000"; mesonCutArray[ 4] = "01525045009000"; // 0-20%
334    } else if (trainConfig == 40) { // Standard cuts, eta 0.9, only to be run on data : kCentral
335       cutarray[ 0] = "5245001002092970023220000000"; mesonCutArray[ 0] = "01525045009000"; // 20-40%
336       cutarray[ 1] = "5465001002092970023220000000"; mesonCutArray[ 1] = "01525065009000"; // 40-60%
337       cutarray[ 2] = "5685001002092970023220000000"; mesonCutArray[ 2] = "01525065009000"; // 60-80%
338       cutarray[ 3] = "5485001002092970023220000000"; mesonCutArray[ 3] = "01525065009000"; // 40-80%
339       cutarray[ 4] = "5355001002092970023220000000"; mesonCutArray[ 4] = "01525065009000"; // 40-90%   
340    } else if (trainConfig == 41){ // Standard cuts, eta 0.9, only to be run on data :kSemiCentral
341       cutarray[ 0] = "6016001002092970023220000000"; mesonCutArray[ 0] = "01525045009000"; // 0-5%
342       cutarray[ 1] = "6126001002092970023220000000"; mesonCutArray[ 1] = "01525045009000"; // 5-10%
343       cutarray[ 2] = "5016001002092970023220000000"; mesonCutArray[ 2] = "01525045009000"; // 0-10%
344       cutarray[ 3] = "5126001002092970023220000000"; mesonCutArray[ 3] = "01525045009000"; // 10-20%
345       cutarray[ 4] = "5026001002092970023220000000"; mesonCutArray[ 4] = "01525045009000"; // 0-20%
346    } else if (trainConfig == 42) { // Standard cuts, eta 0.9, only to be run on data :kSemiCentral
347       cutarray[ 0] = "5236001002092970023220000000"; mesonCutArray[ 0] = "01525065009000"; 
348       cutarray[ 1] = "5346001002092970023220000000"; mesonCutArray[ 1] = "01525065009000"; 
349       cutarray[ 2] = "5456001002092970023220000000"; mesonCutArray[ 2] = "01525065009000"; 
350       cutarray[ 3] = "5566001002092970023220000000"; mesonCutArray[ 3] = "01525065009000"; 
351       cutarray[ 4] = "5676001002092970023220000000"; mesonCutArray[ 4] = "01525065009000"; 
352    } else if (trainConfig == 43){ // Standard cuts, eta 0.9, only to be run on data
353       cutarray[ 0] = "5230001002092970023220000000"; mesonCutArray[ 0] = "01525045009000"; 
354       cutarray[ 1] = "5340001002092970023220000000"; mesonCutArray[ 1] = "01525065009000"; 
355       cutarray[ 2] = "5450001002092970023220000000"; mesonCutArray[ 2] = "01525065009000"; 
356       cutarray[ 3] = "5560001002092970023220000000"; mesonCutArray[ 3] = "01525065009000"; 
357       cutarray[ 4] = "5670001002092970023220000000"; mesonCutArray[ 4] = "01525065009000"; 
358    } else if ( trainConfig == 44){ // qt elipse cut 0.05
359       cutarray[ 0] = "6010001002092970028220000000"; mesonCutArray[ 0] = "01525065009000"; // 0-5%
360       cutarray[ 1] = "6120001002092970028220000000"; mesonCutArray[ 1] = "01525065009000"; // 5-10%
361       cutarray[ 2] = "5010001002092970028220000000"; mesonCutArray[ 2] = "01525065009000"; // 0-10%
362       cutarray[ 3] = "5120001002092970028220000000"; mesonCutArray[ 3] = "01525065009000"; // 10-20%
363       cutarray[ 4] = "5020001002092970028220000000"; mesonCutArray[ 4] = "01525065009000"; // 0-20%
364    } else if ( trainConfig == 45) { // qt elipse cut 0.05
365       cutarray[ 0] = "5240001002092970028220000000"; mesonCutArray[ 0] = "01525065009000"; // 20-40%
366       cutarray[ 1] = "5460001002092970028220000000"; mesonCutArray[ 1] = "01525065009000"; // 40-60%
367       cutarray[ 2] = "5680001002092970028220000000"; mesonCutArray[ 2] = "01525065009000"; // 60-80%
368       cutarray[ 3] = "5480001002092970028220000000"; mesonCutArray[ 3] = "01525065009000"; // 40-80%
369       cutarray[ 4] = "5350001002092970028220000000"; mesonCutArray[ 4] = "01525065009000"; // 30-50%  
370    } else if ( trainConfig == 46){ // qt elipse cut 0.05
371       cutarray[ 0] = "5230001002092970028220000000"; mesonCutArray[ 0] = "01525065009000"; // 20-30% 
372       cutarray[ 1] = "5340001002092970028220000000"; mesonCutArray[ 1] = "01525065009000"; // 30-40% 
373       cutarray[ 2] = "5450001002092970028220000000"; mesonCutArray[ 2] = "01525065009000"; // 40-50% 
374       cutarray[ 3] = "5560001002092970028220000000"; mesonCutArray[ 3] = "01525065009000"; // 50-60% 
375       cutarray[ 4] = "5670001002092970028220000000"; mesonCutArray[ 4] = "01525065009000"; // 60-70% 
376    } else if ( trainConfig == 47){ // cos(theta_point) cut 0.85
377       cutarray[ 0] = "6010001002092970023220400000"; mesonCutArray[ 0] = "01525065009000"; // 0-5%
378       cutarray[ 1] = "6120001002092970023220400000"; mesonCutArray[ 1] = "01525065009000"; // 5-10%
379       cutarray[ 2] = "5010001002092970023220400000"; mesonCutArray[ 2] = "01525065009000"; // 0-10%
380       cutarray[ 3] = "5120001002092970023220400000"; mesonCutArray[ 3] = "01525065009000"; // 10-20%
381       cutarray[ 4] = "5020001002092970023220400000"; mesonCutArray[ 4] = "01525065009000"; // 0-20%
382    } else if ( trainConfig == 48) { // cos(theta_point) cut 0.85
383       cutarray[ 0] = "5240001002092970023220400000"; mesonCutArray[ 0] = "01525065009000"; // 20-40%
384       cutarray[ 1] = "5460001002092970023220400000"; mesonCutArray[ 1] = "01525065009000"; // 40-60%
385       cutarray[ 2] = "5680001002092970023220400000"; mesonCutArray[ 2] = "01525065009000"; // 60-80%
386       cutarray[ 3] = "5480001002092970023220400000"; mesonCutArray[ 3] = "01525065009000"; // 40-80%
387       cutarray[ 4] = "5350001002092970023220400000"; mesonCutArray[ 4] = "01525065009000"; // 30-50%  
388    } else if ( trainConfig == 49){ // cos(theta_point) cut 0.85
389       cutarray[ 0] = "5230001002092970023220400000"; mesonCutArray[ 0] = "01525065009000"; // 20-30% 
390       cutarray[ 1] = "5340001002092970023220400000"; mesonCutArray[ 1] = "01525065009000"; // 30-40% 
391       cutarray[ 2] = "5450001002092970023220400000"; mesonCutArray[ 2] = "01525065009000"; // 40-50% 
392       cutarray[ 3] = "5560001002092970023220400000"; mesonCutArray[ 3] = "01525065009000"; // 50-60% 
393       cutarray[ 4] = "5670001002092970023220400000"; mesonCutArray[ 4] = "01525065009000"; // 60-70% 
394    } else if ( trainConfig == 50){ // psi pair 2D 0.05
395       cutarray[ 0] = "6010001002092970023260000000"; mesonCutArray[ 0] = "01525065009000"; // 0-5%
396       cutarray[ 1] = "6120001002092970023260000000"; mesonCutArray[ 1] = "01525065009000"; // 5-10%
397       cutarray[ 2] = "5010001002092970023260000000"; mesonCutArray[ 2] = "01525065009000"; // 0-10%
398       cutarray[ 3] = "5120001002092970023260000000"; mesonCutArray[ 3] = "01525065009000"; // 10-20%
399       cutarray[ 4] = "5020001002092970023260000000"; mesonCutArray[ 4] = "01525065009000"; // 0-20%
400    } else if ( trainConfig == 51) { // psi pair 2D 0.05
401       cutarray[ 0] = "5240001002092970023260000000"; mesonCutArray[ 0] = "01525065009000"; // 20-40%
402       cutarray[ 1] = "5460001002092970023260000000"; mesonCutArray[ 1] = "01525065009000"; // 40-60%
403       cutarray[ 2] = "5680001002092970023260000000"; mesonCutArray[ 2] = "01525065009000"; // 60-80%
404       cutarray[ 3] = "5480001002092970023260000000"; mesonCutArray[ 3] = "01525065009000"; // 40-80%
405       cutarray[ 4] = "5350001002092970023260000000"; mesonCutArray[ 4] = "01525065009000"; // 30-50%  
406    } else if ( trainConfig == 52){ // psi pair 2D 0.05
407       cutarray[ 0] = "5230001002092970023260000000"; mesonCutArray[ 0] = "01525065009000"; // 20-30% 
408       cutarray[ 1] = "5340001002092970023260000000"; mesonCutArray[ 1] = "01525065009000"; // 30-40% 
409       cutarray[ 2] = "5450001002092970023260000000"; mesonCutArray[ 2] = "01525065009000"; // 40-50% 
410       cutarray[ 3] = "5560001002092970023260000000"; mesonCutArray[ 3] = "01525065009000"; // 50-60% 
411       cutarray[ 4] = "5670001002092970023260000000"; mesonCutArray[ 4] = "01525065009000"; // 60-70%       
412    } else if ( trainConfig == 53){ // psi pair 2D 0.1
413       cutarray[ 0] = "6010001002092970023250000000"; mesonCutArray[ 0] = "01525065009000"; // 0-5%
414       cutarray[ 1] = "6120001002092970023250000000"; mesonCutArray[ 1] = "01525065009000"; // 5-10%
415       cutarray[ 2] = "5010001002092970023250000000"; mesonCutArray[ 2] = "01525065009000"; // 0-10%
416       cutarray[ 3] = "5120001002092970023250000000"; mesonCutArray[ 3] = "01525065009000"; // 10-20%
417       cutarray[ 4] = "5020001002092970023250000000"; mesonCutArray[ 4] = "01525065009000"; // 0-20%
418    } else if ( trainConfig == 54) { // psi pair 2D 0.1
419       cutarray[ 0] = "5240001002092970023250000000"; mesonCutArray[ 0] = "01525065009000"; // 20-40%
420       cutarray[ 1] = "5460001002092970023250000000"; mesonCutArray[ 1] = "01525065009000"; // 40-60%
421       cutarray[ 2] = "5680001002092970023250000000"; mesonCutArray[ 2] = "01525065009000"; // 60-80%
422       cutarray[ 3] = "5480001002092970023250000000"; mesonCutArray[ 3] = "01525065009000"; // 40-80%
423       cutarray[ 4] = "5350001002092970023250000000"; mesonCutArray[ 4] = "01525065009000"; // 30-50%  
424    } else if ( trainConfig == 55){ // psi pair 2D 0.1
425       cutarray[ 0] = "5230001002092970023250000000"; mesonCutArray[ 0] = "01525065009000"; // 20-30% 
426       cutarray[ 1] = "5340001002092970023250000000"; mesonCutArray[ 1] = "01525065009000"; // 30-40% 
427       cutarray[ 2] = "5450001002092970023250000000"; mesonCutArray[ 2] = "01525065009000"; // 40-50% 
428       cutarray[ 3] = "5560001002092970023250000000"; mesonCutArray[ 3] = "01525065009000"; // 50-60% 
429       cutarray[ 4] = "5670001002092970023250000000"; mesonCutArray[ 4] = "01525065009000"; // 60-70%          
430    } else if ( trainConfig == 56){ // cleaner cuts
431       cutarray[ 0] = "6010001002092970028250400000"; mesonCutArray[ 0] = "01525065009000"; // 0-5%
432       cutarray[ 1] = "6120001002092970028250400000"; mesonCutArray[ 1] = "01525065009000"; // 5-10%
433       cutarray[ 2] = "5010001002092970028250400000"; mesonCutArray[ 2] = "01525065009000"; // 0-10%
434       cutarray[ 3] = "5120001002092970028250400000"; mesonCutArray[ 3] = "01525065009000"; // 10-20%
435       cutarray[ 4] = "5020001002092970028250400000"; mesonCutArray[ 4] = "01525065009000"; // 0-20%
436    } else if ( trainConfig == 57) { // cleaner cuts
437       cutarray[ 0] = "5240001002092970028250400000"; mesonCutArray[ 0] = "01525065009000"; // 20-40%
438       cutarray[ 1] = "5460001002092970028250400000"; mesonCutArray[ 1] = "01525065009000"; // 40-60%
439       cutarray[ 2] = "5680001002092970028250400000"; mesonCutArray[ 2] = "01525065009000"; // 60-80%
440       cutarray[ 3] = "5480001002092970028250400000"; mesonCutArray[ 3] = "01525065009000"; // 40-80%
441       cutarray[ 4] = "5350001002092970028250400000"; mesonCutArray[ 4] = "01525065009000"; // 30-50%  
442    } else if ( trainConfig == 58){ // cleaner cuts
443       cutarray[ 0] = "5230001002092970028250400000"; mesonCutArray[ 0] = "01525065009000"; // 20-30% 
444       cutarray[ 1] = "5340001002092970028250400000"; mesonCutArray[ 1] = "01525065009000"; // 30-40% 
445       cutarray[ 2] = "5450001002092970028250400000"; mesonCutArray[ 2] = "01525065009000"; // 40-50% 
446       cutarray[ 3] = "5560001002092970028250400000"; mesonCutArray[ 3] = "01525065009000"; // 50-60% 
447       cutarray[ 4] = "5670001002092970028250400000"; mesonCutArray[ 4] = "01525065009000"; // 60-70%                
448    } else if ( trainConfig == 59){ // cleaner cuts
449       cutarray[ 0] = "6010002002092970028250400000"; mesonCutArray[ 0] = "01525065009000"; // 0-5%
450       cutarray[ 1] = "6120002002092970028250400000"; mesonCutArray[ 1] = "01525065009000"; // 5-10%
451       cutarray[ 2] = "5010002002092970028250400000"; mesonCutArray[ 2] = "01525065009000"; // 0-10%
452       cutarray[ 3] = "5120002002092970028250400000"; mesonCutArray[ 3] = "01525065009000"; // 10-20%
453       cutarray[ 4] = "5020002002092970028250400000"; mesonCutArray[ 4] = "01525065009000"; // 0-20%
454    } else if ( trainConfig == 60) { // cleaner cuts
455       cutarray[ 0] = "5240002002092970028250400000"; mesonCutArray[ 0] = "01525065009000"; // 20-40%
456       cutarray[ 1] = "5460002002092970028250400000"; mesonCutArray[ 1] = "01525065009000"; // 40-60%
457       cutarray[ 2] = "5680002002092970028250400000"; mesonCutArray[ 2] = "01525065009000"; // 60-80%
458       cutarray[ 3] = "5480002002092970028250400000"; mesonCutArray[ 3] = "01525065009000"; // 40-80%
459       cutarray[ 4] = "5350002002092970028250400000"; mesonCutArray[ 4] = "01525065009000"; // 30-50%  
460    } else if ( trainConfig == 61){ // cleaner cuts
461       cutarray[ 0] = "5230002002092970028250400000"; mesonCutArray[ 0] = "01525065009000"; // 20-30% 
462       cutarray[ 1] = "5340002002092970028250400000"; mesonCutArray[ 1] = "01525065009000"; // 30-40% 
463       cutarray[ 2] = "5450002002092970028250400000"; mesonCutArray[ 2] = "01525065009000"; // 40-50% 
464       cutarray[ 3] = "5560002002092970028250400000"; mesonCutArray[ 3] = "01525065009000"; // 50-60% 
465       cutarray[ 4] = "5670002002092970028250400000"; mesonCutArray[ 4] = "01525065009000"; // 60-70%                   
466    } else {
467       Error(Form("GammaConvV1_%i",trainConfig), "wrong trainConfig variable no cuts have been specified for the configuration");
468       return;
469    }
470
471    TList *ConvCutList = new TList();
472    TList *MesonCutList = new TList();
473
474    TList *HeaderList = new TList();
475    if (periodName.CompareTo("LHC13d2")==0){
476       TObjString *Header1 = new TObjString("pi0_1");
477       HeaderList->Add(Header1);
478    //    TObjString *Header3 = new TObjString("eta_2");
479    //    HeaderList->Add(Header3);
480
481    } else if (periodName.CompareTo("LHC12a17x_fix")==0){
482       TObjString *Header1 = new TObjString("PARAM");
483       HeaderList->Add(Header1);
484    }
485    
486    ConvCutList->SetOwner(kTRUE);
487    AliConversionCuts **analysisCuts = new AliConversionCuts*[numberOfCuts];
488    MesonCutList->SetOwner(kTRUE);
489    AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts];
490
491    for(Int_t i = 0; i<numberOfCuts; i++){
492       analysisCuts[i] = new AliConversionCuts();
493       if (trainConfig == 1 ||trainConfig == 5 || trainConfig == 9 || trainConfig == 13 || trainConfig == 17 || trainConfig == 21 || trainConfig == 25 || trainConfig == 29 ){ //|| trainConfig == 33 || trainConfig == 37 || trainConfig == 41 
494          if (i == 0 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_0005TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0005V0M");
495          if (i == 1 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_0510TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0510V0M");
496          if (i == 2 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_0010TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0010V0M");
497          if (i == 3 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_1020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_1020V0M");
498          if (i == 4 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_0020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0020V0M");
499       } else if (trainConfig == 2 ||trainConfig == 6 || trainConfig == 10 || trainConfig == 14 || trainConfig == 18 || trainConfig == 22 || trainConfig == 26 || trainConfig == 30  ){ //|| trainConfig == 34 || trainConfig == 38 || trainConfig == 42
500         if (i == 0 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_2040TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_2040V0M");
501         if (i == 1 && doWeighting) analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_4060TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4060V0M");
502         if (i == 2 && doWeighting) analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_6080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_6080V0M");
503         if (i == 3 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_4080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4080V0M");
504       } else if (trainConfig == 3 ||trainConfig == 7 || trainConfig == 11 || trainConfig == 15 || trainConfig == 19 || trainConfig == 23 || trainConfig == 27 || trainConfig == 31 ){ //|| trainConfig == 35 || trainConfig == 39 || trainConfig == 43 
505          if (i == 0 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_0005TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0005V0M");
506          if (i == 1 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_0510TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0510V0M");
507          if (i == 2 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_0010TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0010V0M");
508          if (i == 3 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_1020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_1020V0M");
509           if (i == 0 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_0020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0020V0M");
510       } else if (trainConfig == 4 ||trainConfig == 8 || trainConfig == 12 || trainConfig == 16 || trainConfig == 20 || trainConfig == 24 || trainConfig == 28 || trainConfig == 32 ){ //|| trainConfig == 36 || trainConfig == 40 || trainConfig == 44 
511         if (i == 0 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_2040TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_2040V0M");
512         if (i == 1 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_4060TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4060V0M");
513         if (i == 2  && doWeighting) analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_6080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_6080V0M");
514         if (i == 3 && doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_4080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4080V0M");
515       }
516       
517       
518 //      if (trainConfig == 45 ||trainConfig == 47 || trainConfig == 49 || trainConfig == 51 || trainConfig == 53 || trainConfig == 55  ){
519 //          if ((i == 0 || i == 1 || i == 2)&& doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_0020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0020V0M");
520 //          if ((i == 3 || i == 4 )&& doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_4080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4080V0M");
521 //      }
522 //      if (trainConfig == 46 ||trainConfig == 48 || trainConfig == 50 || trainConfig == 52 || trainConfig == 54 || trainConfig == 56  ){
523 //          if ((i == 0 || i == 1 || i == 2)&& doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_0020TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_0020V0M");
524 //          if ((i == 3 || i == 4 )&& doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_4080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4080V0M");
525 //      }
526 //      if (trainConfig == 57  ){
527 //          if (doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_PbPb_2760GeV_4080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4080V0M");
528 //      }
529 //      if (trainConfig == 58){
530 //          if (doWeighting)  analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE,fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_4080TPC", "", "","Pi0_Fit_Data_PbPb_2760GeV_4080V0M");
531 //      }
532       analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data());
533       ConvCutList->Add(analysisCuts[i]);
534
535       if (trainConfig == 37 || trainConfig == 38){
536          analysisCuts[i]->SelectSpecialTrigger(AliVEvent::kMB, "AliVEvent::kMB" );
537       }
538       if (trainConfig == 39 || trainConfig == 40){   
539          analysisCuts[i]->SelectSpecialTrigger(AliVEvent::kCentral,"AliVEvent::kCentral" );
540       }   
541       if (trainConfig == 41 || trainConfig == 42){   
542          analysisCuts[i]->SelectSpecialTrigger(AliVEvent::kSemiCentral,"AliVEvent::kSemiCentral" );
543       }   
544       
545       analysisCuts[i]->SetFillCutHistograms("",kFALSE);
546       analysisMesonCuts[i] = new AliConversionMesonCuts();
547       analysisMesonCuts[i]->InitializeCutsFromCutString(mesonCutArray[i].Data());
548       MesonCutList->Add(analysisMesonCuts[i]);
549       analysisMesonCuts[i]->SetFillCutHistograms("");
550       analysisCuts[i]->SetAcceptedHeader(HeaderList);
551    }
552
553    task->SetConversionCutList(numberOfCuts,ConvCutList);
554    task->SetMesonCutList(numberOfCuts,MesonCutList);
555    task->SetMoveParticleAccordingToVertex(kTRUE);
556    task->SetDoMesonAnalysis(kTRUE);
557    task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA
558    task->SetDoPhotonQA(enableQAPhotonTask);  //Attention new switch small for Photon QA
559
560    //connect containers
561    AliAnalysisDataContainer *coutput =
562       mgr->CreateContainer(Form("GammaConvV1_%i",trainConfig), TList::Class(),
563                            AliAnalysisManager::kOutputContainer,Form("GammaConvV1_%i.root",trainConfig));
564
565    mgr->AddTask(task);
566    mgr->ConnectInput(task,0,cinput);
567    mgr->ConnectOutput(task,1,coutput);
568
569    return;
570
571 }