]>
Commit | Line | Data |
---|---|---|
8bdca7f1 | 1 | void 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% | |
141 | } else if (trainConfig == 31){ // PHOS clusters | |
142 | eventCutArray[ 0] = "6010001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "20000042053200000"; mesonCutArray[ 0] = "01525065000000"; // 0-5% | |
143 | eventCutArray[ 1] = "6120001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "20000042053200000"; mesonCutArray[ 1] = "01525065000000"; // 5-10% | |
144 | eventCutArray[ 2] = "5010001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "20000042053200000"; mesonCutArray[ 2] = "01525065000000"; // 0-10% | |
145 | eventCutArray[ 3] = "5240001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "20000042053200000"; mesonCutArray[ 3] = "01525065000000"; // 20-40% | |
146 | eventCutArray[ 4] = "5250001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "20000042053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-50% | |
147 | } else if (trainConfig == 32){ // PHOS clusters | |
148 | eventCutArray[ 0] = "6010001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "20000042053200000"; mesonCutArray[ 0] = "01525065000000"; // 0-5% | |
149 | eventCutArray[ 1] = "6120001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "20000042053200000"; mesonCutArray[ 1] = "01525065000000"; // 5-10% | |
150 | eventCutArray[ 2] = "5010001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "20000042053200000"; mesonCutArray[ 2] = "01525065000000"; // 0-10% | |
151 | eventCutArray[ 3] = "5120001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "20000042053200000"; mesonCutArray[ 3] = "01525065000000"; // 10-20% | |
152 | eventCutArray[ 4] = "5240001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "20000042053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-40% | |
153 | } else if (trainConfig == 33){ // PHOS clusters | |
154 | eventCutArray[ 0] = "5460001"; photonCutArray[ 0] = "002092970028250400000"; clusterCutArray[0] = "20000042053200000"; mesonCutArray[ 0] = "01525065000000"; // 40-60% | |
155 | eventCutArray[ 1] = "5680001"; photonCutArray[ 1] = "002092970028250400000"; clusterCutArray[1] = "20000042053200000"; mesonCutArray[ 1] = "01525065000000"; // 60-80% | |
156 | eventCutArray[ 2] = "5260001"; photonCutArray[ 2] = "002092970028250400000"; clusterCutArray[2] = "20000042053200000"; mesonCutArray[ 2] = "01525065000000"; // 20-60% | |
157 | eventCutArray[ 3] = "5480001"; photonCutArray[ 3] = "002092970028250400000"; clusterCutArray[3] = "20000042053200000"; mesonCutArray[ 3] = "01525065000000"; // 40-80% | |
158 | eventCutArray[ 4] = "5250001"; photonCutArray[ 4] = "002092970028250400000"; clusterCutArray[4] = "20000042053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-50% | |
8bdca7f1 | 159 | } else { |
160 | Error(Form("GammaConvCalo_%i",trainConfig), "wrong trainConfig variable no cuts have been specified for the configuration"); | |
161 | return; | |
162 | } | |
163 | ||
344100c4 | 164 | TList *EventCutList = new TList(); |
8bdca7f1 | 165 | TList *ConvCutList = new TList(); |
135c1186 | 166 | TList *ClusterCutList = new TList(); |
8bdca7f1 | 167 | TList *MesonCutList = new TList(); |
168 | ||
169 | TList *HeaderList = new TList(); | |
170 | if (periodName.CompareTo("LHC13d2")==0){ | |
171 | TObjString *Header1 = new TObjString("pi0_1"); | |
172 | HeaderList->Add(Header1); | |
173 | // TObjString *Header3 = new TObjString("eta_2"); | |
174 | // HeaderList->Add(Header3); | |
175 | ||
176 | } else if (periodName.CompareTo("LHC12a17x_fix")==0){ | |
177 | TObjString *Header1 = new TObjString("PARAM"); | |
178 | HeaderList->Add(Header1); | |
179 | } else if (periodName.CompareTo("LHC14a1a")==0){ | |
180 | if (headerSelectionInt == 1){ | |
181 | TObjString *Header1 = new TObjString("pi0_1"); | |
182 | HeaderList->Add(Header1); | |
183 | } else if (headerSelectionInt == 2){ | |
184 | TObjString *Header1 = new TObjString("eta_2"); | |
185 | HeaderList->Add(Header1); | |
186 | } else { | |
187 | TObjString *Header1 = new TObjString("pi0_1"); | |
188 | HeaderList->Add(Header1); | |
189 | TObjString *Header2 = new TObjString("eta_2"); | |
190 | HeaderList->Add(Header2); | |
191 | } | |
192 | } else if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0){ | |
193 | TObjString *Header1 = new TObjString("BOX"); | |
194 | HeaderList->Add(Header1); | |
195 | } | |
196 | ||
344100c4 | 197 | EventCutList->SetOwner(kTRUE); |
198 | AliConvEventCuts **analysisEventCuts = new AliConvEventCuts*[numberOfCuts]; | |
8bdca7f1 | 199 | ConvCutList->SetOwner(kTRUE); |
344100c4 | 200 | AliConversionPhotonCuts **analysisCuts = new AliConversionPhotonCuts*[numberOfCuts]; |
8bdca7f1 | 201 | ClusterCutList->SetOwner(kTRUE); |
202 | AliCaloPhotonCuts **analysisClusterCuts = new AliCaloPhotonCuts*[numberOfCuts]; | |
203 | MesonCutList->SetOwner(kTRUE); | |
204 | AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts]; | |
205 | ||
206 | for(Int_t i = 0; i<numberOfCuts; i++){ | |
344100c4 | 207 | |
208 | analysisEventCuts[i] = new AliConvEventCuts(); | |
ee4b3d66 | 209 | // if ( trainConfig == 1){ |
210 | // if (periodName.CompareTo("LHC14a1a") ==0 || periodName.CompareTo("LHC14a1b") ==0 || periodName.CompareTo("LHC14a1c") ==0 ){ | |
211 | // 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"); | |
212 | // 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"); | |
213 | // 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"); | |
214 | // 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"); | |
215 | // 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"); | |
216 | // } | |
217 | // } | |
344100c4 | 218 | analysisEventCuts[i]->InitializeCutsFromCutString(eventCutArray[i].Data()); |
8bdca7f1 | 219 | if (periodName.CompareTo("LHC14a1b") ==0 || periodName.CompareTo("LHC14a1c") ==0 ){ |
344100c4 | 220 | if (headerSelectionInt == 1) analysisEventCuts[i]->SetAddedSignalPDGCode(111); |
221 | if (headerSelectionInt == 2) analysisEventCuts[i]->SetAddedSignalPDGCode(221); | |
8bdca7f1 | 222 | } |
344100c4 | 223 | EventCutList->Add(analysisEventCuts[i]); |
224 | analysisEventCuts[i]->SetFillCutHistograms("",kFALSE); | |
8bdca7f1 | 225 | |
344100c4 | 226 | analysisCuts[i] = new AliConversionPhotonCuts(); |
227 | analysisCuts[i]->InitializeCutsFromCutString(photonCutArray[i].Data()); | |
228 | ConvCutList->Add(analysisCuts[i]); | |
229 | analysisCuts[i]->SetFillCutHistograms("",kFALSE); | |
230 | ||
8bdca7f1 | 231 | analysisClusterCuts[i] = new AliCaloPhotonCuts(); |
344100c4 | 232 | analysisClusterCuts[i]->InitializeCutsFromCutString(clusterCutArray[i].Data()); |
8bdca7f1 | 233 | ClusterCutList->Add(analysisClusterCuts[i]); |
4e8dcc76 | 234 | analysisClusterCuts[i]->SetExtendedMatching(enableExtendedMatching); |
8bdca7f1 | 235 | analysisClusterCuts[i]->SetFillCutHistograms(""); |
236 | ||
8bdca7f1 | 237 | analysisMesonCuts[i] = new AliConversionMesonCuts(); |
238 | analysisMesonCuts[i]->InitializeCutsFromCutString(mesonCutArray[i].Data()); | |
239 | MesonCutList->Add(analysisMesonCuts[i]); | |
240 | analysisMesonCuts[i]->SetFillCutHistograms(""); | |
344100c4 | 241 | analysisEventCuts[i]->SetAcceptedHeader(HeaderList); |
242 | ||
8bdca7f1 | 243 | } |
244 | ||
344100c4 | 245 | task->SetEventCutList(numberOfCuts,EventCutList); |
8bdca7f1 | 246 | task->SetConversionCutList(numberOfCuts,ConvCutList); |
247 | task->SetCaloCutList(numberOfCuts,ClusterCutList); | |
248 | task->SetMesonCutList(numberOfCuts,MesonCutList); | |
249 | task->SetMoveParticleAccordingToVertex(kTRUE); | |
250 | task->SetDoMesonAnalysis(kTRUE); | |
251 | task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA | |
252 | task->SetDoPhotonQA(enableQAPhotonTask); //Attention new switch small for Photon QA | |
fd94f234 | 253 | task->SetDoClusterQA(1); //Attention new switch small for Cluster QA |
254 | ||
8bdca7f1 | 255 | //connect containers |
256 | AliAnalysisDataContainer *coutput = | |
257 | mgr->CreateContainer(Form("GammaConvCalo_%i",trainConfig), TList::Class(), | |
258 | AliAnalysisManager::kOutputContainer,Form("GammaConvCalo_%i.root",trainConfig)); | |
259 | ||
260 | mgr->AddTask(task); | |
261 | mgr->ConnectInput(task,0,cinput); | |
262 | mgr->ConnectOutput(task,1,coutput); | |
263 | ||
264 | return; | |
265 | ||
266 | } |