]>
Commit | Line | Data |
---|---|---|
34fc0eec | 1 | void AddTask_GammaConvDalitzQAV1_pPb( Int_t trainConfig = 1, |
2 | Bool_t isMC = kFALSE, //run MC | |
3 | Bool_t enableQAMesonTask = kTRUE, //enable QA in AliAnalysisTaskGammaConvDalitzV1 | |
4 | Bool_t enableDoMesonChic = kFALSE, // enable additional Chic analysis | |
5 | TString fileNameInputForWeighting = "MCSpectraInput.root", // path to file for weigting input | |
6 | Bool_t doWeighting = kFALSE, //enable Weighting | |
7 | TString generatorName = "DPMJET", | |
8 | TString cutnumberAODBranch = "0000000060084001001500000" | |
9 | ) { | |
10 | ||
11 | ||
12 | ||
13 | cout<<"*********Parameters*******"<<endl; | |
14 | cout<<"trainConfig: "<<trainConfig<<endl; | |
15 | cout<<"isMC: "<<isMC<<endl; | |
16 | cout<<"enableQAMesonTask: "<<enableQAMesonTask<<endl; | |
17 | cout<<"enableDoMesonChic: "<<enableDoMesonChic<<endl; | |
18 | cout<<"fileNameInputForWeighting: "<<fileNameInputForWeighting.Data()<<endl; | |
19 | cout<<"doWeighting: "<<doWeighting<<endl; | |
20 | cout<<"generatorName: "<<generatorName.Data()<<endl; | |
21 | cout<<"cutnumberAODBranch: "<<cutnumberAODBranch.Data()<<endl; | |
22 | ||
23 | // ================= Load Librariers ================================= | |
24 | gSystem->Load("libCore.so"); | |
25 | gSystem->Load("libTree.so"); | |
26 | gSystem->Load("libGeom.so"); | |
27 | gSystem->Load("libVMC.so"); | |
28 | gSystem->Load("libPhysics.so"); | |
29 | gSystem->Load("libMinuit"); | |
30 | gSystem->Load("libSTEERBase"); | |
31 | gSystem->Load("libESD"); | |
32 | gSystem->Load("libAOD"); | |
33 | gSystem->Load("libANALYSIS"); | |
34 | gSystem->Load("libANALYSISalice"); | |
35 | gSystem->Load("libPWGGAGammaConv.so"); | |
36 | gSystem->Load("libCDB.so"); | |
37 | gSystem->Load("libSTEER.so"); | |
38 | gSystem->Load("libSTEERBase.so"); | |
39 | gSystem->Load("libTENDER.so"); | |
40 | gSystem->Load("libTENDERSupplies.so"); | |
41 | ||
42 | ||
43 | cout<<"Entro 0"<<endl; | |
44 | ||
45 | // ================== GetAnalysisManager =============================== | |
46 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
47 | if (!mgr) { | |
48 | Error(Form("AddTask_GammaConvDalitzV1_pPb_%i",trainConfig), "No analysis manager found."); | |
49 | return ; | |
50 | } | |
51 | ||
52 | // ================== GetInputEventHandler ============================= | |
53 | AliVEventHandler *inputHandler=mgr->GetInputEventHandler(); | |
54 | ||
55 | //========= Add PID Reponse to ANALYSIS manager ==== | |
56 | if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){ | |
57 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); | |
58 | AddTaskPIDResponse(isMC); | |
59 | } | |
60 | ||
61 | //========= Set Cutnumber for V0Reader ================================ | |
62 | TString ConvCutnumber = "8000000060084001001500000000"; //Online V0 finder | |
63 | TString ElecCuts = "9000540000000200000"; //Electron Cuts | |
64 | Bool_t doEtaShift = kFALSE; | |
65 | ||
66 | ||
67 | ||
68 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
69 | ||
70 | //========= Add V0 Reader to ANALYSIS manager if not yet existent ===== | |
71 | if( !(AliV0ReaderV1*)mgr->GetTask("V0ReaderV1") ){ | |
72 | AliV0ReaderV1 *fV0ReaderV1 = new AliV0ReaderV1("V0ReaderV1"); | |
73 | ||
74 | fV0ReaderV1->SetUseOwnXYZCalculation(kTRUE); | |
75 | fV0ReaderV1->SetCreateAODs(kFALSE);// AOD Output | |
76 | fV0ReaderV1->SetUseAODConversionPhoton(kTRUE); | |
77 | ||
78 | if (!mgr) { | |
79 | Error("AddTask_V0ReaderV1", "No analysis manager found."); | |
80 | return; | |
81 | } | |
82 | ||
83 | // Set AnalysisCut Number | |
84 | AliConversionCuts *fCuts=NULL; | |
85 | if( ConvCutnumber !=""){ | |
86 | fCuts= new AliConversionCuts(ConvCutnumber.Data(),ConvCutnumber.Data()); | |
87 | fCuts->SetPreSelectionCutFlag(kTRUE); | |
88 | if(fCuts->InitializeCutsFromCutString(ConvCutnumber.Data())){ | |
89 | fCuts->DoEtaShift(doEtaShift); | |
90 | fV0ReaderV1->SetConversionCuts(fCuts); | |
91 | fCuts->SetFillCutHistograms("",kTRUE); | |
92 | } | |
93 | } | |
94 | if(inputHandler->IsA()==AliAODInputHandler::Class()){ | |
95 | // AOD mode | |
96 | fV0ReaderV1->SetDeltaAODBranchName(Form("GammaConv_%s_gamma",cutnumberAODBranch.Data())); | |
97 | } | |
98 | fV0ReaderV1->Init(); | |
99 | ||
100 | AliLog::SetGlobalLogLevel(AliLog::kInfo); | |
101 | ||
102 | //connect input V0Reader | |
103 | mgr->AddTask(fV0ReaderV1); | |
104 | mgr->ConnectInput(fV0ReaderV1,0,cinput); | |
105 | ||
106 | } | |
107 | ||
108 | //================================================ | |
109 | //========= Add Electron Selector ================ | |
110 | ||
111 | ||
112 | if( !(AliDalitzElectronSelector*)mgr->GetTask("ElectronSelector") ){ | |
113 | ||
114 | AliDalitzElectronSelector *fElectronSelector = new AliDalitzElectronSelector("ElectronSelector"); | |
115 | ||
116 | // Set AnalysisCut Number | |
117 | ||
118 | AliDalitzElectronCuts *fElecCuts=0; | |
119 | ||
120 | //ElecCuts = "900054000000020000"; | |
121 | ||
122 | if( ElecCuts!=""){ | |
123 | ||
124 | fElecCuts= new AliDalitzElectronCuts(ElecCuts.Data(),ElecCuts.Data()); | |
125 | ||
126 | if(fElecCuts->InitializeCutsFromCutString(ElecCuts.Data())){ | |
127 | ||
128 | fElectronSelector->SetDalitzElectronCuts(fElecCuts); | |
129 | ||
130 | fElecCuts->SetFillCutHistograms("",kTRUE); | |
131 | ||
132 | } | |
133 | } | |
134 | ||
135 | fElectronSelector->Init(); | |
136 | mgr->AddTask(fElectronSelector); | |
137 | ||
138 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
139 | ||
140 | //connect input V0Reader | |
141 | ||
142 | mgr->ConnectInput (fElectronSelector,0,cinput1); | |
143 | ||
144 | } | |
145 | ||
146 | ||
147 | ||
148 | cout<<"Entro"<<endl; | |
149 | //================================================ | |
150 | //========= Add task to the ANALYSIS manager ===== | |
151 | //================================================ | |
152 | // find input container | |
153 | ||
154 | ||
155 | ||
156 | AliAnalysisTaskGammaConvDalitzV1 *task=NULL; | |
157 | ||
158 | task= new AliAnalysisTaskGammaConvDalitzV1(Form("GammaConvDalitzV1_%i",trainConfig)); | |
159 | ||
160 | task->SetIsHeavyIon(2); | |
161 | task->SetIsMC(isMC); | |
162 | ||
163 | ||
164 | ||
165 | // Cut Numbers to use in Analysis | |
166 | Int_t numberOfCuts = 1; | |
167 | ||
168 | TString *ConvCutarray = new TString[numberOfCuts]; | |
169 | ||
170 | TString *ElecCutarray = new TString[numberOfCuts]; | |
171 | ||
172 | TString *MesonCutarray = new TString[numberOfCuts]; | |
173 | ||
174 | Bool_t doEtaShiftIndCuts = kFALSE; | |
175 | TString stringShift = ""; | |
176 | ||
177 | // Shifting in pPb direction | |
178 | ||
179 | doEtaShiftIndCuts = kFALSE; | |
180 | stringShift = "pPb"; | |
181 | ||
182 | ||
183 | ||
184 | ||
185 | if( trainConfig == 1 ) { // No eta shift |Y| < 0.8 | |
186 | ||
187 | ConvCutarray[0] = "8000011002093603007200000000"; ElecCutarray[0] = "9047540023310262371"; MesonCutarray[0] = "01031035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 | |
188 | ||
189 | } else if( trainConfig == 2 ) { // No eta shift |Y| < 0.8 | |
190 | ||
191 | ConvCutarray[0] = "8000012032093603007200000000"; ElecCutarray[0] = "9047540023910262371"; MesonCutarray[0] = "01033035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + |Y| < 0.6 and |Gamma_eta| < 0.65 and |e+_eta| < 0.65 and |e-_eta| < 0.65 | |
192 | ||
193 | } else if( trainConfig == 3 ) { // No eta shift |Y| < 0.8 | |
194 | ||
195 | ConvCutarray[0] = "8000012042093603007200000000"; ElecCutarray[0] = "9047540023510262371"; MesonCutarray[0] = "01032035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + |Y| < 0.7 and |Gamma_eta| < 0.75 and |e+_eta| < 0.75 and |e-_eta| < 0.75 | |
196 | ||
197 | } else if( trainConfig == 4 ) { // No eta shift |Y| < 0.8 | |
198 | ||
199 | ConvCutarray[0] = "8000012012093603007200000000"; ElecCutarray[0] = "9047540023610262371"; MesonCutarray[0] = "01034035009000"; //standard cut Pi0 pPb 00-100 //Tracks 2011 + |Y| < 0.5 and |Gamma_eta| < 0.60 and |e+_eta| < 0.60 and |e-_eta| < 0.60 | |
200 | ||
201 | } | |
202 | ||
203 | ||
204 | ||
205 | TList *ConvCutList = new TList(); | |
206 | TList *MesonCutList = new TList(); | |
207 | TList *ElecCutList = new TList(); | |
208 | ||
209 | TList *HeaderList = new TList(); | |
210 | TObjString *Header1 = new TObjString("pi0_1"); | |
211 | HeaderList->Add(Header1); | |
212 | TObjString *Header3 = new TObjString("eta_2"); | |
213 | HeaderList->Add(Header3); | |
214 | ||
215 | ConvCutList->SetOwner(kTRUE); | |
216 | AliConversionCuts **analysisCuts = new AliConversionCuts*[numberOfCuts]; | |
217 | MesonCutList->SetOwner(kTRUE); | |
218 | AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts]; | |
219 | ElecCutList->SetOwner(kTRUE); | |
220 | AliDalitzElectronCuts **analysisElecCuts = new AliDalitzElectronCuts*[numberOfCuts]; | |
221 | ||
222 | ||
223 | ||
224 | for(Int_t i = 0; i<numberOfCuts; i++){ | |
225 | ||
226 | ||
227 | analysisCuts[i] = new AliConversionCuts(); | |
228 | if( ! analysisCuts[i]->InitializeCutsFromCutString(ConvCutarray[i].Data()) ) { | |
229 | cout<<"ERROR: analysisCuts [" <<i<<"]"<<endl; | |
230 | return 0; | |
231 | } else { | |
232 | ||
233 | if ( ( trainConfig >= 1 && trainConfig <= 4 ) ){ | |
234 | ||
235 | if (doWeighting){ | |
236 | if (generatorName.CompareTo("DPMJET")==0){ | |
237 | analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kTRUE, kFALSE, fileNameInputForWeighting, "Pi0_DPMJET_LHC13b2_efix_pPb_5023GeV_MBV0A", "Eta_DPMJET_LHC13b2_efix_pPb_5023GeV_MBV0A", "","Pi0_Fit_Data_pPb_5023GeV_MBV0A","Eta_Fit_Data_pPb_5023GeV_MBV0A"); | |
238 | } else if (generatorName.CompareTo("HIJING")==0){ | |
239 | analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kTRUE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13e7_pPb_5023GeV_MBV0A", "Eta_Hijing_LHC13e7_pPb_5023GeV_MBV0A", "","Pi0_Fit_Data_pPb_5023GeV_MBV0A","Eta_Fit_Data_pPb_5023GeV_MBV0A"); | |
240 | } | |
241 | } | |
242 | } | |
243 | if (doEtaShiftIndCuts) { | |
244 | ||
245 | analysisCuts[i]->DoEtaShift(doEtaShiftIndCuts); | |
246 | analysisCuts[i]->SetEtaShift(stringShift); | |
247 | ||
248 | } | |
249 | ConvCutList->Add(analysisCuts[i]); | |
250 | analysisCuts[i]->SetFillCutHistograms("",kFALSE); | |
251 | analysisCuts[i]->SetAcceptedHeader(HeaderList); | |
252 | } | |
253 | ||
254 | ||
255 | ||
256 | analysisMesonCuts[i] = new AliConversionMesonCuts(); | |
257 | ||
258 | if( ! analysisMesonCuts[i]->InitializeCutsFromCutString(MesonCutarray[i].Data()) ) { | |
259 | cout<<"ERROR: analysisMesonCuts [ " <<i<<" ] "<<endl; | |
260 | return 0; | |
261 | } | |
262 | else { | |
263 | MesonCutList->Add(analysisMesonCuts[i]); | |
264 | analysisMesonCuts[i]->SetFillCutHistograms(""); | |
265 | } | |
266 | ||
267 | ||
268 | TString cutName( Form("%s_%s_%s",ConvCutarray[i].Data(),ElecCutarray[i].Data(),MesonCutarray[i].Data() ) ); | |
269 | ||
270 | ||
271 | analysisElecCuts[i] = new AliDalitzElectronCuts(); | |
272 | if( !analysisElecCuts[i]->InitializeCutsFromCutString(ElecCutarray[i].Data())) { | |
273 | ||
274 | cout<< "ERROR: analysisElecCuts [ " <<i<<" ] "<<endl; | |
275 | return 0; | |
276 | } | |
277 | else { | |
278 | ElecCutList->Add(analysisElecCuts[i]); | |
279 | analysisElecCuts[i]->SetFillCutHistograms("",kFALSE,cutName); | |
280 | } | |
281 | ||
282 | ||
283 | } | |
284 | ||
285 | ||
286 | task->SetConversionCutList(numberOfCuts,ConvCutList); | |
287 | task->SetMesonCutList(MesonCutList); | |
288 | task->SetElectronCutList(ElecCutList); | |
289 | ||
290 | task->SetMoveParticleAccordingToVertex(kTRUE); | |
291 | ||
292 | ||
293 | if(enableQAMesonTask) task->SetDoMesonQA(kTRUE); | |
294 | if(enableDoMesonChic) task->SetDoChicAnalysis(kTRUE); | |
295 | ||
296 | //connect containers | |
297 | AliAnalysisDataContainer *coutput = | |
298 | mgr->CreateContainer(Form("GammaConvDalitzV1_%i",trainConfig), TList::Class(), | |
299 | AliAnalysisManager::kOutputContainer,Form("GammaConvV1Dalitz_%i.root",trainConfig)); | |
300 | ||
301 | mgr->AddTask(task); | |
302 | mgr->ConnectInput(task,0,cinput); | |
303 | mgr->ConnectOutput(task,1,coutput); | |
304 | ||
305 | return; | |
306 | ||
307 | } |