]>
Commit | Line | Data |
---|---|---|
ee4b3d66 | 1 | void AddTask_GammaCalo_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 | |
9 | Bool_t doWeighting = kFALSE, //enable Weighting | |
10 | Bool_t enableExtendedMatching = kFALSE //enable or disable extended matching histograms for conversion electrons <-> cluster | |
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"); | |
31 | ||
32 | Int_t isHeavyIon = 1; | |
33 | ||
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"); | |
47 | AddTaskPIDResponse(isMC); | |
48 | } | |
49 | ||
50 | //========= Set Cutnumber for V0Reader ================================ | |
51 | TString cutnumberPhoton = "000084001001500000000"; | |
52 | TString cutnumberEvent = "1000000"; | |
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 | ||
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 | ||
79 | // Set AnalysisCut Number | |
80 | AliConversionPhotonCuts *fCuts=NULL; | |
81 | if(cutnumberPhoton!=""){ | |
82 | fCuts= new AliConversionPhotonCuts(cutnumberPhoton.Data(),cutnumberPhoton.Data()); | |
83 | fCuts->SetPreSelectionCutFlag(kTRUE); | |
84 | fCuts->SetIsHeavyIon(isHeavyIon); | |
85 | if(fCuts->InitializeCutsFromCutString(cutnumberPhoton.Data())){ | |
86 | fV0ReaderV1->SetConversionCuts(fCuts); | |
87 | fCuts->SetFillCutHistograms("",kTRUE); | |
88 | } | |
89 | } | |
90 | ||
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 | AliAnalysisTaskGammaCalo *task=NULL; | |
109 | task= new AliAnalysisTaskGammaCalo(Form("GammaCalo_%i",trainConfig)); | |
110 | task->SetIsHeavyIon(isHeavyIon); | |
111 | task->SetIsMC(isMC); | |
112 | // Cut Numbers to use in Analysis | |
113 | Int_t numberOfCuts = 5; | |
114 | ||
115 | TString *eventCutArray = new TString[numberOfCuts]; | |
116 | TString *clusterCutArray = new TString[numberOfCuts]; | |
117 | TString *mesonCutArray = new TString[numberOfCuts]; | |
118 | ||
119 | // meson cuts | |
120 | // 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 | |
121 | ||
122 | if (trainConfig == 1){ // EMCAL clusters | |
123 | eventCutArray[ 0] = "6010001"; clusterCutArray[0] = "10000040022030000"; mesonCutArray[ 0] = "01525065000000"; // 0-5% | |
124 | eventCutArray[ 1] = "6120001"; clusterCutArray[1] = "10000040022030000"; mesonCutArray[ 1] = "01525065000000"; // 5-10% | |
125 | eventCutArray[ 2] = "5010001"; clusterCutArray[2] = "10000040022030000"; mesonCutArray[ 2] = "01525065000000"; // 0-10% | |
126 | eventCutArray[ 3] = "5240001"; clusterCutArray[3] = "10000040022030000"; mesonCutArray[ 3] = "01525065000000"; // 20-40% | |
127 | eventCutArray[ 4] = "5250001"; clusterCutArray[4] = "10000040022030000"; mesonCutArray[ 4] = "01525065000000"; // 20-50% | |
128 | } else if (trainConfig == 2){ // EMCAL clusters | |
129 | eventCutArray[ 0] = "6010001"; clusterCutArray[0] = "10000040022030000"; mesonCutArray[ 0] = "01525065000000"; // 0-5% | |
130 | eventCutArray[ 1] = "6120001"; clusterCutArray[1] = "10000040022030000"; mesonCutArray[ 1] = "01525065000000"; // 5-10% | |
131 | eventCutArray[ 2] = "5010001"; clusterCutArray[2] = "10000040022030000"; mesonCutArray[ 2] = "01525065000000"; // 0-10% | |
132 | eventCutArray[ 3] = "5120001"; clusterCutArray[3] = "10000040022030000"; mesonCutArray[ 3] = "01525065000000"; // 10-20% | |
133 | eventCutArray[ 4] = "5240001"; clusterCutArray[4] = "10000040022030000"; mesonCutArray[ 4] = "01525065000000"; // 20-40% | |
134 | } else if (trainConfig == 3){ // EMCAL clusters | |
135 | eventCutArray[ 0] = "5460001"; clusterCutArray[0] = "10000040022030000"; mesonCutArray[ 0] = "01525065000000"; // 40-60% | |
136 | eventCutArray[ 1] = "5680001"; clusterCutArray[1] = "10000040022030000"; mesonCutArray[ 1] = "01525065000000"; // 60-80% | |
137 | eventCutArray[ 2] = "5260001"; clusterCutArray[2] = "10000040022030000"; mesonCutArray[ 2] = "01525065000000"; // 20-60% | |
138 | eventCutArray[ 3] = "5480001"; clusterCutArray[3] = "10000040022030000"; mesonCutArray[ 3] = "01525065000000"; // 40-80% | |
139 | eventCutArray[ 4] = "5250001"; clusterCutArray[4] = "10000040022030000"; mesonCutArray[ 4] = "01525065000000"; // 20-50% | |
140 | } else if (trainConfig == 31){ // PHOS clusters | |
141 | eventCutArray[ 0] = "6010001"; clusterCutArray[0] = "20000040053200000"; mesonCutArray[ 0] = "01525065000000"; // 0-5% | |
142 | eventCutArray[ 1] = "6120001"; clusterCutArray[1] = "20000040053200000"; mesonCutArray[ 1] = "01525065000000"; // 5-10% | |
143 | eventCutArray[ 2] = "5010001"; clusterCutArray[2] = "20000040053200000"; mesonCutArray[ 2] = "01525065000000"; // 0-10% | |
144 | eventCutArray[ 3] = "5240001"; clusterCutArray[3] = "20000040053200000"; mesonCutArray[ 3] = "01525065000000"; // 20-40% | |
145 | eventCutArray[ 4] = "5250001"; clusterCutArray[4] = "20000040053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-50% | |
146 | } else if (trainConfig == 32){ // PHOS clusters | |
147 | eventCutArray[ 0] = "6010001"; clusterCutArray[0] = "20000040053200000"; mesonCutArray[ 0] = "01525065000000"; // 0-5% | |
148 | eventCutArray[ 1] = "6120001"; clusterCutArray[1] = "20000040053200000"; mesonCutArray[ 1] = "01525065000000"; // 5-10% | |
149 | eventCutArray[ 2] = "5010001"; clusterCutArray[2] = "20000040053200000"; mesonCutArray[ 2] = "01525065000000"; // 0-10% | |
150 | eventCutArray[ 3] = "5120001"; clusterCutArray[3] = "20000040053200000"; mesonCutArray[ 3] = "01525065000000"; // 10-20% | |
151 | eventCutArray[ 4] = "5240001"; clusterCutArray[4] = "20000040053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-40% | |
152 | } else if (trainConfig == 33){ // PHOS clusters | |
153 | eventCutArray[ 0] = "5460001"; clusterCutArray[0] = "20000040053200000"; mesonCutArray[ 0] = "01525065000000"; // 40-60% | |
154 | eventCutArray[ 1] = "5680001"; clusterCutArray[1] = "20000040053200000"; mesonCutArray[ 1] = "01525065000000"; // 60-80% | |
155 | eventCutArray[ 2] = "5260001"; clusterCutArray[2] = "20000040053200000"; mesonCutArray[ 2] = "01525065000000"; // 20-60% | |
156 | eventCutArray[ 3] = "5480001"; clusterCutArray[3] = "20000040053200000"; mesonCutArray[ 3] = "01525065000000"; // 40-80% | |
157 | eventCutArray[ 4] = "5250001"; clusterCutArray[4] = "20000040053200000"; mesonCutArray[ 4] = "01525065000000"; // 20-50% | |
158 | } else { | |
159 | Error(Form("GammaConvCalo_%i",trainConfig), "wrong trainConfig variable no cuts have been specified for the configuration"); | |
160 | return; | |
161 | } | |
162 | ||
163 | TList *EventCutList = new TList(); | |
164 | TList *ConvCutList = new TList(); | |
165 | TList *ClusterCutList = new TList(); | |
166 | TList *MesonCutList = new TList(); | |
167 | ||
168 | TList *HeaderList = new TList(); | |
169 | if (periodName.CompareTo("LHC13d2")==0){ | |
170 | TObjString *Header1 = new TObjString("pi0_1"); | |
171 | HeaderList->Add(Header1); | |
172 | // TObjString *Header3 = new TObjString("eta_2"); | |
173 | // HeaderList->Add(Header3); | |
174 | ||
175 | } else if (periodName.CompareTo("LHC12a17x_fix")==0){ | |
176 | TObjString *Header1 = new TObjString("PARAM"); | |
177 | HeaderList->Add(Header1); | |
178 | } else if (periodName.CompareTo("LHC14a1a")==0){ | |
179 | if (headerSelectionInt == 1){ | |
180 | TObjString *Header1 = new TObjString("pi0_1"); | |
181 | HeaderList->Add(Header1); | |
182 | } else if (headerSelectionInt == 2){ | |
183 | TObjString *Header1 = new TObjString("eta_2"); | |
184 | HeaderList->Add(Header1); | |
185 | } else { | |
186 | TObjString *Header1 = new TObjString("pi0_1"); | |
187 | HeaderList->Add(Header1); | |
188 | TObjString *Header2 = new TObjString("eta_2"); | |
189 | HeaderList->Add(Header2); | |
190 | } | |
191 | } else if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0){ | |
192 | TObjString *Header1 = new TObjString("BOX"); | |
193 | HeaderList->Add(Header1); | |
194 | } | |
195 | ||
196 | TList *EventCutList = new TList(); | |
197 | TList *ClusterCutList = new TList(); | |
198 | TList *MesonCutList = new TList(); | |
199 | ||
200 | ||
201 | EventCutList->SetOwner(kTRUE); | |
202 | AliConvEventCuts **analysisEventCuts = new AliConvEventCuts*[numberOfCuts]; | |
203 | ClusterCutList->SetOwner(kTRUE); | |
204 | AliCaloPhotonCuts **analysisClusterCuts = new AliCaloPhotonCuts*[numberOfCuts]; | |
205 | MesonCutList->SetOwner(kTRUE); | |
206 | AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts]; | |
207 | ||
208 | for(Int_t i = 0; i<numberOfCuts; i++){ | |
209 | analysisEventCuts[i] = new AliConvEventCuts(); | |
210 | analysisEventCuts[i]->InitializeCutsFromCutString(eventCutArray[i].Data()); | |
211 | EventCutList->Add(analysisEventCuts[i]); | |
212 | analysisEventCuts[i]->SetFillCutHistograms("",kFALSE); | |
213 | ||
214 | analysisClusterCuts[i] = new AliCaloPhotonCuts(); | |
215 | analysisClusterCuts[i]->InitializeCutsFromCutString(clusterCutArray[i].Data()); | |
216 | ClusterCutList->Add(analysisClusterCuts[i]); | |
217 | analysisClusterCuts[i]->SetFillCutHistograms(""); | |
218 | ||
219 | analysisMesonCuts[i] = new AliConversionMesonCuts(); | |
220 | analysisMesonCuts[i]->InitializeCutsFromCutString(mesonCutArray[i].Data()); | |
221 | MesonCutList->Add(analysisMesonCuts[i]); | |
222 | analysisMesonCuts[i]->SetFillCutHistograms(""); | |
223 | analysisEventCuts[i]->SetAcceptedHeader(HeaderList); | |
224 | } | |
225 | task->SetEventCutList(numberOfCuts,EventCutList); | |
226 | task->SetCaloCutList(numberOfCuts,ClusterCutList); | |
227 | task->SetMesonCutList(numberOfCuts,MesonCutList); | |
228 | task->SetDoMesonAnalysis(kTRUE); | |
229 | task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA | |
230 | task->SetDoClusterQA(enableQAClusterTask); //Attention new switch small for Cluster QA | |
231 | ||
232 | //connect containers | |
233 | AliAnalysisDataContainer *coutput = | |
234 | mgr->CreateContainer(Form("GammaCalo_%i",trainConfig), TList::Class(), | |
235 | AliAnalysisManager::kOutputContainer,Form("GammaCalo_%i.root",trainConfig)); | |
236 | ||
237 | mgr->AddTask(task); | |
238 | mgr->ConnectInput(task,0,cinput); | |
239 | mgr->ConnectOutput(task,1,coutput); | |
240 | ||
241 | return; | |
242 | ||
243 | } |