]>
Commit | Line | Data |
---|---|---|
5a104c5e | 1 | void AddTask_GammaConvDalitzV1_PbPb( Bool_t isMC = kFALSE, //run MC |
39e8c2ce | 2 | Bool_t enableQAMesonTask = kTRUE, //enable QA in AliAnalysisTaskGammaConvDalitzV1 |
3 | Bool_t enableDoMesonChic = kFALSE, // enable additional Chic analysis | |
5a104c5e | 4 | TString fileNameInputForWeighting = "MCSpectraInput.root", // path to file for weigting input |
5 | Bool_t doWeighting = kFALSE, //enable Weighting | |
39e8c2ce | 6 | TString cutnumberAODBranch = "0000000060084001001500000" |
7 | ) { | |
8 | ||
9 | ||
10 | ||
11 | cout<<"Entro -1"<<endl; | |
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"); | |
31 | ||
32 | ||
33 | cout<<"Entro 0"<<endl; | |
34 | ||
35 | // ================== GetAnalysisManager =============================== | |
36 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
37 | if (!mgr) { | |
38 | Error("AddTask_GammaConvDalitzV1_PbPb", "No analysis manager found."); | |
39 | return ; | |
40 | } | |
41 | ||
42 | // ================== GetInputEventHandler ============================= | |
43 | AliVEventHandler *inputHandler=mgr->GetInputEventHandler(); | |
44 | ||
45 | //========= Add PID Reponse to ANALYSIS manager ==== | |
46 | if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){ | |
47 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); | |
48 | AddTaskPIDResponse(isMC); | |
49 | } | |
50 | ||
51 | //========= Set Cutnumber for V0Reader ================================ | |
52 | TString ConvCutnumber = "108000000008400100150000000"; //Online V0 finder | |
5a104c5e | 53 | TString ElecCuts = "903162000550020210"; //Electron Cuts |
54 | //903162000550020210 | |
55 | //900054000000020000 | |
39e8c2ce | 56 | |
57 | ||
58 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
59 | ||
60 | //========= Add V0 Reader to ANALYSIS manager if not yet existent ===== | |
61 | if( !(AliV0ReaderV1*)mgr->GetTask("V0ReaderV1") ){ | |
62 | AliV0ReaderV1 *fV0ReaderV1 = new AliV0ReaderV1("V0ReaderV1"); | |
63 | ||
64 | fV0ReaderV1->SetUseOwnXYZCalculation(kTRUE); | |
65 | fV0ReaderV1->SetCreateAODs(kFALSE);// AOD Output | |
66 | fV0ReaderV1->SetUseAODConversionPhoton(kTRUE); | |
67 | ||
68 | if (!mgr) { | |
69 | Error("AddTask_V0ReaderV1", "No analysis manager found."); | |
70 | return; | |
71 | } | |
72 | ||
73 | // Set AnalysisCut Number | |
74 | AliConversionCuts *fCuts=NULL; | |
75 | if( ConvCutnumber !=""){ | |
76 | fCuts= new AliConversionCuts(ConvCutnumber.Data(),ConvCutnumber.Data()); | |
77 | fCuts->SetPreSelectionCutFlag(kTRUE); | |
78 | if(fCuts->InitializeCutsFromCutString(ConvCutnumber.Data())){ | |
79 | fV0ReaderV1->SetConversionCuts(fCuts); | |
80 | fCuts->SetFillCutHistograms("",kTRUE); | |
81 | } | |
82 | } | |
83 | if(inputHandler->IsA()==AliAODInputHandler::Class()){ | |
84 | // AOD mode | |
85 | fV0ReaderV1->SetDeltaAODBranchName(Form("GammaConv_%s_gamma",cutnumberAODBranch.Data())); | |
86 | } | |
87 | fV0ReaderV1->Init(); | |
88 | ||
89 | AliLog::SetGlobalLogLevel(AliLog::kInfo); | |
90 | ||
91 | //connect input V0Reader | |
92 | mgr->AddTask(fV0ReaderV1); | |
93 | mgr->ConnectInput(fV0ReaderV1,0,cinput); | |
94 | ||
95 | } | |
96 | ||
97 | //================================================ | |
98 | //========= Add Electron Selector ================ | |
99 | ||
100 | ||
101 | if( !(AliDalitzElectronSelector*)mgr->GetTask("ElectronSelector") ){ | |
102 | ||
103 | AliDalitzElectronSelector *fElectronSelector = new AliDalitzElectronSelector("ElectronSelector"); | |
104 | ||
105 | // Set AnalysisCut Number | |
106 | ||
107 | AliDalitzElectronCuts *fElecCuts=0; | |
108 | ||
109 | TString ElecCuts = "900054000000020000"; | |
110 | ||
111 | ||
112 | ||
113 | if( ElecCuts!=""){ | |
114 | ||
115 | fElecCuts= new AliDalitzElectronCuts(ElecCuts.Data(),ElecCuts.Data()); | |
116 | ||
117 | if(fElecCuts->InitializeCutsFromCutString(ElecCuts.Data())){ | |
118 | ||
119 | fElectronSelector->SetDalitzElectronCuts(fElecCuts); | |
120 | ||
121 | fElecCuts->SetFillCutHistograms("",kTRUE); | |
122 | ||
123 | } | |
124 | ||
125 | } | |
126 | ||
127 | fElectronSelector->Init(); | |
128 | mgr->AddTask(fElectronSelector); | |
129 | ||
5a104c5e | 130 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); |
131 | ||
132 | //connect input V0Reader | |
133 | ||
134 | mgr->ConnectInput (fElectronSelector,0,cinput1); | |
135 | ||
39e8c2ce | 136 | } |
137 | ||
138 | ||
139 | ||
140 | cout<<"Entro"<<endl; | |
141 | //================================================ | |
142 | //========= Add task to the ANALYSIS manager ===== | |
143 | //================================================ | |
144 | // find input container | |
145 | ||
146 | ||
147 | ||
148 | AliAnalysisTaskGammaConvDalitzV1 *task=NULL; | |
149 | ||
150 | task= new AliAnalysisTaskGammaConvDalitzV1("GammaConvDalitzV1"); | |
151 | ||
152 | task->SetIsHeavyIon(2); | |
153 | task->SetIsMC(isMC); | |
154 | ||
155 | ||
156 | ||
157 | // Cut Numbers to use in Analysis | |
158 | Int_t numberOfCuts = 5; | |
159 | ||
160 | TString *ConvCutarray = new TString[numberOfCuts]; | |
161 | ||
162 | TString *ElecCutarray = new TString[numberOfCuts]; | |
163 | ||
164 | TString *MesonCutarray = new TString[numberOfCuts]; | |
165 | ||
39e8c2ce | 166 | |
5a104c5e | 167 | |
39e8c2ce | 168 | |
39e8c2ce | 169 | |
5a104c5e | 170 | ConvCutarray[0] = "312000104209297100322000000"; MesonCutarray[0] = "01522045009000"; ElecCutarray[0] = "905162002552021217"; //PbPb 5-10% kAny |
171 | ConvCutarray[1] = "112000104209297100322000000"; MesonCutarray[1] = "01522045009000"; ElecCutarray[1] = "905162002552021217"; //PbPb 10-20% kAny | |
172 | ConvCutarray[2] = "124000104209297100322000000"; MesonCutarray[2] = "01522045009000"; ElecCutarray[2] = "905162002552021217"; //PbPb 20-40% kAny | |
173 | ConvCutarray[3] = "146000104209297100322000000"; MesonCutarray[3] = "01522045009000"; ElecCutarray[3] = "905162002552021217"; //PbPb 40-60% kAny | |
174 | ConvCutarray[4] = "168000104209297100322000000"; MesonCutarray[4] = "01522045009000"; ElecCutarray[4] = "905162002552021217"; //PbPb 60-80% kAny | |
39e8c2ce | 175 | |
39e8c2ce | 176 | |
39e8c2ce | 177 | |
178 | ||
179 | TList *ConvCutList = new TList(); | |
180 | TList *MesonCutList = new TList(); | |
181 | TList *ElecCutList = new TList(); | |
182 | ||
183 | TList *HeaderList = new TList(); | |
184 | TObjString *Header1 = new TObjString("pi0_1"); | |
185 | HeaderList->Add(Header1); | |
5a104c5e | 186 | |
187 | //TObjString *Header3 = new TObjString("eta_2"); | |
188 | //HeaderList->Add(Header3); | |
39e8c2ce | 189 | |
190 | ConvCutList->SetOwner(kTRUE); | |
191 | AliConversionCuts **analysisCuts = new AliConversionCuts*[numberOfCuts]; | |
5a104c5e | 192 | |
39e8c2ce | 193 | MesonCutList->SetOwner(kTRUE); |
194 | AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts]; | |
5a104c5e | 195 | |
39e8c2ce | 196 | ElecCutList->SetOwner(kTRUE); |
197 | AliDalitzElectronCuts **analysisElecCuts = new AliDalitzElectronCuts*[numberOfCuts]; | |
198 | ||
199 | ||
200 | ||
201 | for(Int_t i = 0; i<numberOfCuts; i++){ | |
202 | ||
203 | ||
204 | analysisCuts[i] = new AliConversionCuts(); | |
205 | if( ! analysisCuts[i]->InitializeCutsFromCutString(ConvCutarray[i].Data()) ) { | |
206 | cout<<"ERROR: analysisCuts [" <<i<<"]"<<endl; | |
207 | return 0; | |
208 | } | |
209 | else { | |
210 | ||
211 | ConvCutList->Add(analysisCuts[i]); | |
212 | analysisCuts[i]->SetFillCutHistograms("",kFALSE); | |
5a104c5e | 213 | |
214 | if (i == 0 && doWeighting) analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_0510V0M", "", "","Pi0_Fit_Data_PbPb_2760GeV_0510V0M"); | |
0f5296a1 | 215 | if (i == 1 && doWeighting) analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_1020V0M", "", "","Pi0_Fit_Data_PbPb_2760GeV_1020V0M"); |
216 | if (i == 2 && doWeighting) analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_2040V0M", "", "","Pi0_Fit_Data_PbPb_2760GeV_2040V0M"); | |
217 | if (i == 3 && doWeighting) analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_4060V0M", "", "","Pi0_Fit_Data_PbPb_2760GeV_4060V0M"); | |
218 | if (i == 4 && doWeighting) analysisCuts[i]->SetUseReweightingWithHistogramFromFile(kTRUE, kFALSE, kFALSE, fileNameInputForWeighting, "Pi0_Hijing_LHC13d2_addSig_PbPb_2760GeV_6080V0M", "", "","Pi0_Fit_Data_PbPb_2760GeV_6080V0M"); | |
5a104c5e | 219 | |
220 | ||
221 | ||
39e8c2ce | 222 | } |
223 | ||
224 | ||
225 | ||
226 | analysisMesonCuts[i] = new AliConversionMesonCuts(); | |
227 | ||
228 | if( ! analysisMesonCuts[i]->InitializeCutsFromCutString(MesonCutarray[i].Data()) ) { | |
229 | cout<<"ERROR: analysisMesonCuts [ " <<i<<" ] "<<endl; | |
230 | return 0; | |
231 | } | |
232 | else { | |
233 | MesonCutList->Add(analysisMesonCuts[i]); | |
234 | analysisMesonCuts[i]->SetFillCutHistograms(""); | |
235 | } | |
236 | ||
237 | ||
238 | TString cutName( Form("%s_%s_%s",ConvCutarray[i].Data(),ElecCutarray[i].Data(),MesonCutarray[i].Data() ) ); | |
239 | ||
240 | ||
241 | analysisElecCuts[i] = new AliDalitzElectronCuts(); | |
242 | if( !analysisElecCuts[i]->InitializeCutsFromCutString(ElecCutarray[i].Data())) { | |
243 | ||
244 | cout<< "ERROR: analysisElecCuts [ " <<i<<" ] "<<endl; | |
245 | return 0; | |
246 | } | |
247 | else { | |
248 | ElecCutList->Add(analysisElecCuts[i]); | |
249 | analysisElecCuts[i]->SetFillCutHistograms("",kFALSE,cutName); | |
250 | } | |
251 | ||
252 | ||
253 | analysisCuts[i]->SetAcceptedHeader(HeaderList); | |
254 | ||
255 | } | |
256 | ||
257 | ||
258 | task->SetConversionCutList(numberOfCuts,ConvCutList); | |
259 | task->SetMesonCutList(MesonCutList); | |
260 | task->SetElectronCutList(ElecCutList); | |
261 | ||
262 | task->SetMoveParticleAccordingToVertex(kTRUE); | |
263 | ||
264 | ||
265 | if(enableQAMesonTask) task->SetDoMesonQA(kTRUE); | |
5a104c5e | 266 | if(enableDoMesonChic) task->SetDoChicAnalysis(kTRUE); |
39e8c2ce | 267 | |
268 | //connect containers | |
269 | AliAnalysisDataContainer *coutput = | |
270 | mgr->CreateContainer("GammaConvDalitzV1", TList::Class(), | |
5a104c5e | 271 | AliAnalysisManager::kOutputContainer,"GammaConvV1.root"); |
39e8c2ce | 272 | |
273 | mgr->AddTask(task); | |
274 | mgr->ConnectInput(task,0,cinput); | |
275 | mgr->ConnectOutput(task,1,coutput); | |
276 | ||
277 | return; | |
278 | ||
279 | } |