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