modified trainconfig GammaConv PbPb 124 to 131
[u/mrichter/AliRoot.git] / PWGGA / GammaConv / macros / AddTask_GammaConvCalo_PbPb.C
CommitLineData
8bdca7f1 1void AddTask_GammaConvCalo_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 Int_t headerSelectionInt = 0, // 1 pi0 header, 2 eta header, 3 both (only for "named" boxes)
7 TString cutnumberAODBranch = "1000000060084000001500000",
8 TString periodName = "LHC13d2", //name of the period for added signals and weighting
4e8dcc76 9 Bool_t doWeighting = kFALSE, //enable Weighting
10 Bool_t enableExtendedMatching = kFALSE //enable or disable extended matching histograms for conversion electrons <-> cluster
8bdca7f1 11 ) {
12
13 // ================= Load Librariers =================================
14 gSystem->Load("libCore.so");
15 gSystem->Load("libTree.so");
16 gSystem->Load("libGeom.so");
17 gSystem->Load("libVMC.so");
18 gSystem->Load("libPhysics.so");
19 gSystem->Load("libMinuit");
20 gSystem->Load("libSTEERBase");
21 gSystem->Load("libESD");
22 gSystem->Load("libAOD");
23 gSystem->Load("libANALYSIS");
24 gSystem->Load("libANALYSISalice");
25 gSystem->Load("libPWGGAGammaConv.so");
26 gSystem->Load("libCDB.so");
27 gSystem->Load("libSTEER.so");
28 gSystem->Load("libSTEERBase.so");
29 gSystem->Load("libTENDER.so");
30 gSystem->Load("libTENDERSupplies.so");
344100c4 31
32 Int_t isHeavyIon = 1;
33
8bdca7f1 34 // ================== GetAnalysisManager ===============================
35 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
36 if (!mgr) {
37 Error(Form("AddTask_GammaConvV1_%i",trainConfig), "No analysis manager found.");
38 return ;
39 }
40
41 // ================== GetInputEventHandler =============================
42 AliVEventHandler *inputHandler=mgr->GetInputEventHandler();
43
44 //========= Add PID Reponse to ANALYSIS manager ====
45 if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){
46 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
344100c4 47 AddTaskPIDResponse(isMC);
8bdca7f1 48 }
49
50 //========= Set Cutnumber for V0Reader ================================
344100c4 51 TString cutnumberPhoton = "000084001001500000000";
52 TString cutnumberEvent = "1000000";
8bdca7f1 53 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
54
55 //========= Add V0 Reader to ANALYSIS manager if not yet existent =====
56 if( !(AliV0ReaderV1*)mgr->GetTask("V0ReaderV1") ){
57 AliV0ReaderV1 *fV0ReaderV1 = new AliV0ReaderV1("V0ReaderV1");
58
59 fV0ReaderV1->SetUseOwnXYZCalculation(kTRUE);
60 fV0ReaderV1->SetCreateAODs(kFALSE);// AOD Output
61 fV0ReaderV1->SetUseAODConversionPhoton(kTRUE);
62
63 if (!mgr) {
64 Error("AddTask_V0ReaderV1", "No analysis manager found.");
65 return;
66 }
67
344100c4 68 AliConvEventCuts *fEventCuts=NULL;
69 if(cutnumberEvent!=""){
70 fEventCuts= new AliConvEventCuts(cutnumberEvent.Data(),cutnumberEvent.Data());
71 fEventCuts->SetPreSelectionCutFlag(kTRUE);
72 if(fEventCuts->InitializeCutsFromCutString(cutnumberEvent.Data())){
73 fV0ReaderV1->SetEventCuts(fEventCuts);
74 fEventCuts->SetFillCutHistograms("",kTRUE);
75 }
76 }
77
78
8bdca7f1 79 // Set AnalysisCut Number
344100c4 80 AliConversionPhotonCuts *fCuts=NULL;
81 if(cutnumberPhoton!=""){
82 fCuts= new AliConversionPhotonCuts(cutnumberPhoton.Data(),cutnumberPhoton.Data());
8bdca7f1 83 fCuts->SetPreSelectionCutFlag(kTRUE);
344100c4 84 fCuts->SetIsHeavyIon(isHeavyIon);
85 if(fCuts->InitializeCutsFromCutString(cutnumberPhoton.Data())){
8bdca7f1 86 fV0ReaderV1->SetConversionCuts(fCuts);
87 fCuts->SetFillCutHistograms("",kTRUE);
88 }
89 }
344100c4 90
8bdca7f1 91 if(inputHandler->IsA()==AliAODInputHandler::Class()){
92 // AOD mode
93 fV0ReaderV1->SetDeltaAODBranchName(Form("GammaConv_%s_gamma",cutnumberAODBranch.Data()));
94 }
95 fV0ReaderV1->Init();
96
97 AliLog::SetGlobalLogLevel(AliLog::kFatal);
98
99 //connect input V0Reader
100 mgr->AddTask(fV0ReaderV1);
101 mgr->ConnectInput(fV0ReaderV1,0,cinput);
102
103 }
104
105 //================================================
106 //========= Add task to the ANALYSIS manager =====
107 //================================================
108 AliAnalysisTaskGammaConvCalo *task=NULL;
109 task= new AliAnalysisTaskGammaConvCalo(Form("GammaConvCalo_%i",trainConfig));
344100c4 110 task->SetIsHeavyIon(isHeavyIon);
8bdca7f1 111 task->SetIsMC(isMC);
112 // Cut Numbers to use in Analysis
113 Int_t numberOfCuts = 5;
114
344100c4 115 TString *eventCutArray = new TString[numberOfCuts];
116 TString *photonCutArray = new TString[numberOfCuts];
117 TString *clusterCutArray = new TString[numberOfCuts];
8bdca7f1 118 TString *mesonCutArray = new TString[numberOfCuts];
119
120 // meson cuts
121 // meson type (Dalitz or not), BG scheme, pool depth, rotation degrees, rapidity cut, radius cut, alpha, chi2, shared electrons, reject to close v0, MC smearing, dca, dca, dca
122
9df9736d 123 if (trainConfig == 1){ // EMCAL clusters
344100c4 124 eventCutArray[ 0] = "6010001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "10000040022030000"; mesonCutArray[ 0] = "01525065000000"; // 0-5%
125 eventCutArray[ 1] = "6120001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "10000040022030000"; mesonCutArray[ 1] = "01525065000000"; // 5-10%
126 eventCutArray[ 2] = "5010001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "10000040022030000"; mesonCutArray[ 2] = "01525065000000"; // 0-10%
127 eventCutArray[ 3] = "5240001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "10000040022030000"; mesonCutArray[ 3] = "01525065000000"; // 20-40%
128 eventCutArray[ 4] = "5250001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "10000040022030000"; mesonCutArray[ 4] = "01525065000000"; // 20-50%
ee4b3d66 129 } else if (trainConfig == 2){ // EMCAL clusters
130 eventCutArray[ 0] = "6010001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "10000040022030000"; mesonCutArray[ 0] = "01525065000000"; // 0-5%
131 eventCutArray[ 1] = "6120001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "10000040022030000"; mesonCutArray[ 1] = "01525065000000"; // 5-10%
132 eventCutArray[ 2] = "5010001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "10000040022030000"; mesonCutArray[ 2] = "01525065000000"; // 0-10%
133 eventCutArray[ 3] = "5120001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "10000040022030000"; mesonCutArray[ 3] = "01525065000000"; // 10-20%
134 eventCutArray[ 4] = "5240001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "10000040022030000"; mesonCutArray[ 4] = "01525065000000"; // 20-40%
135 } else if (trainConfig == 3){ // EMCAL clusters
136 eventCutArray[ 0] = "5460001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "10000040022030000"; mesonCutArray[ 0] = "01525065000000"; // 40-60%
137 eventCutArray[ 1] = "5680001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "10000040022030000"; mesonCutArray[ 1] = "01525065000000"; // 60-80%
138 eventCutArray[ 2] = "5260001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "10000040022030000"; mesonCutArray[ 2] = "01525065000000"; // 20-60%
139 eventCutArray[ 3] = "5480001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "10000040022030000"; mesonCutArray[ 3] = "01525065000000"; // 40-80%
140 eventCutArray[ 4] = "5250001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "10000040022030000"; mesonCutArray[ 4] = "01525065000000"; // 20-50%
b6f448d7 141 } else if (trainConfig == 4){ // EMCAL clusters
142 eventCutArray[ 0] = "6010001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "10000043022030000"; mesonCutArray[ 0] = "01525065000000"; // 0-5%
143 eventCutArray[ 1] = "6120001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "10000043022030000"; mesonCutArray[ 1] = "01525065000000"; // 5-10%
144 eventCutArray[ 2] = "5010001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "10000043022030000"; mesonCutArray[ 2] = "01525065000000"; // 0-10%
145 eventCutArray[ 3] = "5240001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "10000043022030000"; mesonCutArray[ 3] = "01525065000000"; // 20-40%
146 eventCutArray[ 4] = "5250001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "10000043022030000"; mesonCutArray[ 4] = "01525065000000"; // 20-50%
147 } else if (trainConfig == 5){ // EMCAL clusters
148 eventCutArray[ 0] = "6010001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "10000043022030000"; mesonCutArray[ 0] = "01525065000000"; // 0-5%
149 eventCutArray[ 1] = "6120001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "10000043022030000"; mesonCutArray[ 1] = "01525065000000"; // 5-10%
150 eventCutArray[ 2] = "5010001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "10000043022030000"; mesonCutArray[ 2] = "01525065000000"; // 0-10%
151 eventCutArray[ 3] = "5120001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "10000043022030000"; mesonCutArray[ 3] = "01525065000000"; // 10-20%
152 eventCutArray[ 4] = "5240001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "10000043022030000"; mesonCutArray[ 4] = "01525065000000"; // 20-40%
153 } else if (trainConfig == 6){ // EMCAL clusters
154 eventCutArray[ 0] = "5460001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "10000043022030000"; mesonCutArray[ 0] = "01525065000000"; // 40-60%
155 eventCutArray[ 1] = "5680001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "10000043022030000"; mesonCutArray[ 1] = "01525065000000"; // 60-80%
156 eventCutArray[ 2] = "5260001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "10000043022030000"; mesonCutArray[ 2] = "01525065000000"; // 20-60%
157 eventCutArray[ 3] = "5480001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "10000043022030000"; mesonCutArray[ 3] = "01525065000000"; // 40-80%
158 eventCutArray[ 4] = "5250001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "10000043022030000"; mesonCutArray[ 4] = "01525065000000"; // 20-50%
ee4b3d66 159 } else if (trainConfig == 31){ // PHOS clusters
160 eventCutArray[ 0] = "6010001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "20000042053200000"; mesonCutArray[ 0] = "01525065000000"; // 0-5%
161 eventCutArray[ 1] = "6120001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "20000042053200000"; mesonCutArray[ 1] = "01525065000000"; // 5-10%
162 eventCutArray[ 2] = "5010001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "20000042053200000"; mesonCutArray[ 2] = "01525065000000"; // 0-10%
163 eventCutArray[ 3] = "5240001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "20000042053200000"; mesonCutArray[ 3] = "01525065000000"; // 20-40%
164 eventCutArray[ 4] = "5250001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "20000042053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-50%
165 } else if (trainConfig == 32){ // PHOS clusters
166 eventCutArray[ 0] = "6010001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "20000042053200000"; mesonCutArray[ 0] = "01525065000000"; // 0-5%
167 eventCutArray[ 1] = "6120001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "20000042053200000"; mesonCutArray[ 1] = "01525065000000"; // 5-10%
168 eventCutArray[ 2] = "5010001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "20000042053200000"; mesonCutArray[ 2] = "01525065000000"; // 0-10%
169 eventCutArray[ 3] = "5120001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "20000042053200000"; mesonCutArray[ 3] = "01525065000000"; // 10-20%
170 eventCutArray[ 4] = "5240001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "20000042053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-40%
171 } else if (trainConfig == 33){ // PHOS clusters
172 eventCutArray[ 0] = "5460001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "20000042053200000"; mesonCutArray[ 0] = "01525065000000"; // 40-60%
173 eventCutArray[ 1] = "5680001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "20000042053200000"; mesonCutArray[ 1] = "01525065000000"; // 60-80%
174 eventCutArray[ 2] = "5260001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "20000042053200000"; mesonCutArray[ 2] = "01525065000000"; // 20-60%
175 eventCutArray[ 3] = "5480001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "20000042053200000"; mesonCutArray[ 3] = "01525065000000"; // 40-80%
176 eventCutArray[ 4] = "5250001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "20000042053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-50%
b6f448d7 177 } else if (trainConfig == 34){ // PHOS clusters
178 eventCutArray[ 0] = "6010001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "20000043053200000"; mesonCutArray[ 0] = "01525065000000"; // 0-5%
179 eventCutArray[ 1] = "6120001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "20000043053200000"; mesonCutArray[ 1] = "01525065000000"; // 5-10%
180 eventCutArray[ 2] = "5010001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "20000043053200000"; mesonCutArray[ 2] = "01525065000000"; // 0-10%
181 eventCutArray[ 3] = "5240001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "20000043053200000"; mesonCutArray[ 3] = "01525065000000"; // 20-40%
182 eventCutArray[ 4] = "5250001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "20000043053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-50%
183 } else if (trainConfig == 35){ // PHOS clusters
184 eventCutArray[ 0] = "6010001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "20000043053200000"; mesonCutArray[ 0] = "01525065000000"; // 0-5%
185 eventCutArray[ 1] = "6120001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "20000043053200000"; mesonCutArray[ 1] = "01525065000000"; // 5-10%
186 eventCutArray[ 2] = "5010001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "20000043053200000"; mesonCutArray[ 2] = "01525065000000"; // 0-10%
187 eventCutArray[ 3] = "5120001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "20000043053200000"; mesonCutArray[ 3] = "01525065000000"; // 10-20%
188 eventCutArray[ 4] = "5240001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "20000043053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-40%
189 } else if (trainConfig == 36){ // PHOS clusters
190 eventCutArray[ 0] = "5460001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "20000043053200000"; mesonCutArray[ 0] = "01525065000000"; // 40-60%
191 eventCutArray[ 1] = "5680001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "20000043053200000"; mesonCutArray[ 1] = "01525065000000"; // 60-80%
192 eventCutArray[ 2] = "5260001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "20000043053200000"; mesonCutArray[ 2] = "01525065000000"; // 20-60%
193 eventCutArray[ 3] = "5480001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "20000043053200000"; mesonCutArray[ 3] = "01525065000000"; // 40-80%
194 eventCutArray[ 4] = "5250001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "20000043053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-50%
8bdca7f1 195 } else {
196 Error(Form("GammaConvCalo_%i",trainConfig), "wrong trainConfig variable no cuts have been specified for the configuration");
197 return;
198 }
199
344100c4 200 TList *EventCutList = new TList();
8bdca7f1 201 TList *ConvCutList = new TList();
135c1186 202 TList *ClusterCutList = new TList();
8bdca7f1 203 TList *MesonCutList = new TList();
204
205 TList *HeaderList = new TList();
206 if (periodName.CompareTo("LHC13d2")==0){
207 TObjString *Header1 = new TObjString("pi0_1");
208 HeaderList->Add(Header1);
209 // TObjString *Header3 = new TObjString("eta_2");
210 // HeaderList->Add(Header3);
211
212 } else if (periodName.CompareTo("LHC12a17x_fix")==0){
213 TObjString *Header1 = new TObjString("PARAM");
214 HeaderList->Add(Header1);
215 } else if (periodName.CompareTo("LHC14a1a")==0){
216 if (headerSelectionInt == 1){
217 TObjString *Header1 = new TObjString("pi0_1");
218 HeaderList->Add(Header1);
219 } else if (headerSelectionInt == 2){
220 TObjString *Header1 = new TObjString("eta_2");
221 HeaderList->Add(Header1);
222 } else {
223 TObjString *Header1 = new TObjString("pi0_1");
224 HeaderList->Add(Header1);
225 TObjString *Header2 = new TObjString("eta_2");
226 HeaderList->Add(Header2);
227 }
228 } else if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0){
229 TObjString *Header1 = new TObjString("BOX");
230 HeaderList->Add(Header1);
231 }
232
344100c4 233 EventCutList->SetOwner(kTRUE);
234 AliConvEventCuts **analysisEventCuts = new AliConvEventCuts*[numberOfCuts];
8bdca7f1 235 ConvCutList->SetOwner(kTRUE);
344100c4 236 AliConversionPhotonCuts **analysisCuts = new AliConversionPhotonCuts*[numberOfCuts];
8bdca7f1 237 ClusterCutList->SetOwner(kTRUE);
238 AliCaloPhotonCuts **analysisClusterCuts = new AliCaloPhotonCuts*[numberOfCuts];
239 MesonCutList->SetOwner(kTRUE);
240 AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts];
241
242 for(Int_t i = 0; i<numberOfCuts; i++){
344100c4 243
244 analysisEventCuts[i] = new AliConvEventCuts();
ee4b3d66 245// if ( trainConfig == 1){
246// if (periodName.CompareTo("LHC14a1a") ==0 || periodName.CompareTo("LHC14a1b") ==0 || periodName.CompareTo("LHC14a1c") ==0 ){
247// if ( i == 0 && doWeighting) analysisEventCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kTRUE, kFALSE,fileNameInputForWeighting, Form("Pi0_Hijing_%s_PbPb_2760GeV_0005TPC",periodName.Data()), Form("Eta_Hijing_%s_PbPb_2760GeV_0005TPC",periodName.Data()), "","Pi0_Fit_Data_PbPb_2760GeV_0005V0M","Eta_Fit_Data_PbPb_2760GeV_0005V0M");
248// if ( i == 1 && doWeighting) analysisEventCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kTRUE, kFALSE,fileNameInputForWeighting, Form("Pi0_Hijing_%s_PbPb_2760GeV_0510TPC",periodName.Data()), Form("Eta_Hijing_%s_PbPb_2760GeV_0510TPC",periodName.Data()), "","Pi0_Fit_Data_PbPb_2760GeV_0510V0M","Eta_Fit_Data_PbPb_2760GeV_0510V0M");
249// if ( i == 2 && doWeighting) analysisEventCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kTRUE, kFALSE,fileNameInputForWeighting, Form("Pi0_Hijing_%s_PbPb_2760GeV_0010TPC",periodName.Data()), Form("Eta_Hijing_%s_PbPb_2760GeV_0010TPC",periodName.Data()), "","Pi0_Fit_Data_PbPb_2760GeV_0010V0M","Eta_Fit_Data_PbPb_2760GeV_0010V0M");
250// if ( i == 3 && doWeighting) analysisEventCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kTRUE, kFALSE,fileNameInputForWeighting, Form("Pi0_Hijing_%s_PbPb_2760GeV_2040TPC",periodName.Data()), Form("Eta_Hijing_%s_PbPb_2760GeV_2040TPC",periodName.Data()), "","Pi0_Fit_Data_PbPb_2760GeV_2040V0M","Eta_Fit_Data_PbPb_2760GeV_2040V0M");
251// if ( i == 4 && doWeighting) analysisEventCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kTRUE, kFALSE,fileNameInputForWeighting, Form("Pi0_Hijing_%s_PbPb_2760GeV_2050TPC",periodName.Data()), Form("Eta_Hijing_%s_PbPb_2760GeV_2050TPC",periodName.Data()), "","Pi0_Fit_Data_PbPb_2760GeV_2050V0M","Eta_Fit_Data_PbPb_2760GeV_2050V0M");
252// }
253// }
344100c4 254 analysisEventCuts[i]->InitializeCutsFromCutString(eventCutArray[i].Data());
8bdca7f1 255 if (periodName.CompareTo("LHC14a1b") ==0 || periodName.CompareTo("LHC14a1c") ==0 ){
344100c4 256 if (headerSelectionInt == 1) analysisEventCuts[i]->SetAddedSignalPDGCode(111);
257 if (headerSelectionInt == 2) analysisEventCuts[i]->SetAddedSignalPDGCode(221);
8bdca7f1 258 }
344100c4 259 EventCutList->Add(analysisEventCuts[i]);
260 analysisEventCuts[i]->SetFillCutHistograms("",kFALSE);
8bdca7f1 261
344100c4 262 analysisCuts[i] = new AliConversionPhotonCuts();
263 analysisCuts[i]->InitializeCutsFromCutString(photonCutArray[i].Data());
264 ConvCutList->Add(analysisCuts[i]);
265 analysisCuts[i]->SetFillCutHistograms("",kFALSE);
266
8bdca7f1 267 analysisClusterCuts[i] = new AliCaloPhotonCuts();
344100c4 268 analysisClusterCuts[i]->InitializeCutsFromCutString(clusterCutArray[i].Data());
8bdca7f1 269 ClusterCutList->Add(analysisClusterCuts[i]);
4e8dcc76 270 analysisClusterCuts[i]->SetExtendedMatching(enableExtendedMatching);
8bdca7f1 271 analysisClusterCuts[i]->SetFillCutHistograms("");
272
8bdca7f1 273 analysisMesonCuts[i] = new AliConversionMesonCuts();
274 analysisMesonCuts[i]->InitializeCutsFromCutString(mesonCutArray[i].Data());
275 MesonCutList->Add(analysisMesonCuts[i]);
276 analysisMesonCuts[i]->SetFillCutHistograms("");
344100c4 277 analysisEventCuts[i]->SetAcceptedHeader(HeaderList);
278
8bdca7f1 279 }
280
344100c4 281 task->SetEventCutList(numberOfCuts,EventCutList);
8bdca7f1 282 task->SetConversionCutList(numberOfCuts,ConvCutList);
283 task->SetCaloCutList(numberOfCuts,ClusterCutList);
284 task->SetMesonCutList(numberOfCuts,MesonCutList);
285 task->SetMoveParticleAccordingToVertex(kTRUE);
286 task->SetDoMesonAnalysis(kTRUE);
287 task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA
288 task->SetDoPhotonQA(enableQAPhotonTask); //Attention new switch small for Photon QA
fd94f234 289 task->SetDoClusterQA(1); //Attention new switch small for Cluster QA
290
8bdca7f1 291 //connect containers
292 AliAnalysisDataContainer *coutput =
293 mgr->CreateContainer(Form("GammaConvCalo_%i",trainConfig), TList::Class(),
294 AliAnalysisManager::kOutputContainer,Form("GammaConvCalo_%i.root",trainConfig));
295
296 mgr->AddTask(task);
297 mgr->ConnectInput(task,0,cinput);
298 mgr->ConnectOutput(task,1,coutput);
299
300 return;
301
302}