]>
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 | |
ecd3e131 | 4 | Int_t enableQAClusterTask = 0, // enable additional QA task |
ee4b3d66 | 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 | |
5cade4fc | 9 | Bool_t doWeighting = kFALSE, //enable Weighting |
10 | Bool_t isUsingTHnSparse = kTRUE //enable or disable usage of THnSparses for background estimation | |
ee4b3d66 | 11 | ) { |
12 | ||
13 | // ================= Load Librariers ================================= | |
230b7aff | 14 | gSystem->Load("libCore"); |
15 | gSystem->Load("libTree"); | |
16 | gSystem->Load("libGeom"); | |
17 | gSystem->Load("libVMC"); | |
18 | gSystem->Load("libPhysics"); | |
ee4b3d66 | 19 | gSystem->Load("libMinuit"); |
20 | gSystem->Load("libSTEERBase"); | |
21 | gSystem->Load("libESD"); | |
22 | gSystem->Load("libAOD"); | |
23 | gSystem->Load("libANALYSIS"); | |
24 | gSystem->Load("libANALYSISalice"); | |
230b7aff | 25 | gSystem->Load("libCDB"); |
26 | gSystem->Load("libSTEER"); | |
27 | gSystem->Load("libSTEERBase"); | |
28 | gSystem->Load("libTender"); | |
29 | gSystem->Load("libTenderSupplies"); | |
30 | gSystem->Load("libPWGflowBase"); | |
31 | gSystem->Load("libPWGflowTasks"); | |
32 | gSystem->Load("libPWGGAGammaConv"); | |
ee4b3d66 | 33 | |
34 | Int_t isHeavyIon = 1; | |
35 | ||
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"); | |
49 | AddTaskPIDResponse(isMC); | |
50 | } | |
51 | ||
52 | //========= Set Cutnumber for V0Reader ================================ | |
3013611f | 53 | TString cutnumberPhoton = "000000084001001500000000"; |
ee4b3d66 | 54 | TString cutnumberEvent = "1000000"; |
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 | ||
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 | ||
81 | // Set AnalysisCut Number | |
82 | AliConversionPhotonCuts *fCuts=NULL; | |
83 | if(cutnumberPhoton!=""){ | |
84 | fCuts= new AliConversionPhotonCuts(cutnumberPhoton.Data(),cutnumberPhoton.Data()); | |
85 | fCuts->SetPreSelectionCutFlag(kTRUE); | |
86 | fCuts->SetIsHeavyIon(isHeavyIon); | |
87 | if(fCuts->InitializeCutsFromCutString(cutnumberPhoton.Data())){ | |
88 | fV0ReaderV1->SetConversionCuts(fCuts); | |
89 | fCuts->SetFillCutHistograms("",kTRUE); | |
90 | } | |
91 | } | |
92 | ||
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 | AliAnalysisTaskGammaCalo *task=NULL; | |
111 | task= new AliAnalysisTaskGammaCalo(Form("GammaCalo_%i",trainConfig)); | |
112 | task->SetIsHeavyIon(isHeavyIon); | |
113 | task->SetIsMC(isMC); | |
114 | // Cut Numbers to use in Analysis | |
115 | Int_t numberOfCuts = 5; | |
116 | ||
117 | TString *eventCutArray = new TString[numberOfCuts]; | |
118 | TString *clusterCutArray = new TString[numberOfCuts]; | |
119 | TString *mesonCutArray = new TString[numberOfCuts]; | |
120 | ||
121 | // meson cuts | |
122 | // 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 | |
123 | ||
124 | if (trainConfig == 1){ // EMCAL clusters | |
f1018ee5 | 125 | eventCutArray[ 0] = "6010001"; clusterCutArray[0] = "10000040032030000"; mesonCutArray[ 0] = "01631031000000"; // 0-5% |
126 | eventCutArray[ 1] = "6120001"; clusterCutArray[1] = "10000040032030000"; mesonCutArray[ 1] = "01631031000000"; // 5-10% | |
127 | eventCutArray[ 2] = "5010001"; clusterCutArray[2] = "10000040032030000"; mesonCutArray[ 2] = "01631031000000"; // 0-10% | |
128 | eventCutArray[ 3] = "5240001"; clusterCutArray[3] = "10000040032030000"; mesonCutArray[ 3] = "01631031000000"; // 20-40% | |
129 | eventCutArray[ 4] = "5250001"; clusterCutArray[4] = "10000040032030000"; mesonCutArray[ 4] = "01631031000000"; // 20-50% | |
ee4b3d66 | 130 | } else if (trainConfig == 2){ // EMCAL clusters |
f1018ee5 | 131 | eventCutArray[ 0] = "6010001"; clusterCutArray[0] = "10000040032030000"; mesonCutArray[ 0] = "01631031000000"; // 0-5% |
132 | eventCutArray[ 1] = "6120001"; clusterCutArray[1] = "10000040032030000"; mesonCutArray[ 1] = "01631031000000"; // 5-10% | |
133 | eventCutArray[ 2] = "5010001"; clusterCutArray[2] = "10000040032030000"; mesonCutArray[ 2] = "01631031000000"; // 0-10% | |
134 | eventCutArray[ 3] = "5120001"; clusterCutArray[3] = "10000040032030000"; mesonCutArray[ 3] = "01631031000000"; // 10-20% | |
135 | eventCutArray[ 4] = "5240001"; clusterCutArray[4] = "10000040032030000"; mesonCutArray[ 4] = "01631031000000"; // 20-40% | |
ee4b3d66 | 136 | } else if (trainConfig == 3){ // EMCAL clusters |
f1018ee5 | 137 | eventCutArray[ 0] = "5460001"; clusterCutArray[0] = "10000040032030000"; mesonCutArray[ 0] = "01631031000000"; // 40-60% |
138 | eventCutArray[ 1] = "5680001"; clusterCutArray[1] = "10000040032030000"; mesonCutArray[ 1] = "01631031000000"; // 60-80% | |
139 | eventCutArray[ 2] = "5260001"; clusterCutArray[2] = "10000040032030000"; mesonCutArray[ 2] = "01631031000000"; // 20-60% | |
140 | eventCutArray[ 3] = "5480001"; clusterCutArray[3] = "10000040032030000"; mesonCutArray[ 3] = "01631031000000"; // 40-80% | |
141 | eventCutArray[ 4] = "5250001"; clusterCutArray[4] = "10000040032030000"; mesonCutArray[ 4] = "01631031000000"; // 20-50% | |
ee4b3d66 | 142 | } else if (trainConfig == 31){ // PHOS clusters |
f1018ee5 | 143 | eventCutArray[ 0] = "6010001"; clusterCutArray[0] = "20000040033200000"; mesonCutArray[ 0] = "01631031000000"; // 0-5% |
144 | eventCutArray[ 1] = "6120001"; clusterCutArray[1] = "20000040033200000"; mesonCutArray[ 1] = "01631031000000"; // 5-10% | |
145 | eventCutArray[ 2] = "5010001"; clusterCutArray[2] = "20000040033200000"; mesonCutArray[ 2] = "01631031000000"; // 0-10% | |
146 | eventCutArray[ 3] = "5240001"; clusterCutArray[3] = "20000040033200000"; mesonCutArray[ 3] = "01631031000000"; // 20-40% | |
147 | eventCutArray[ 4] = "5250001"; clusterCutArray[4] = "20000040033200000"; mesonCutArray[ 4] = "01631031000000"; // 20-50% | |
ee4b3d66 | 148 | } else if (trainConfig == 32){ // PHOS clusters |
f1018ee5 | 149 | eventCutArray[ 0] = "6010001"; clusterCutArray[0] = "20000040033200000"; mesonCutArray[ 0] = "01631031000000"; // 0-5% |
150 | eventCutArray[ 1] = "6120001"; clusterCutArray[1] = "20000040033200000"; mesonCutArray[ 1] = "01631031000000"; // 5-10% | |
151 | eventCutArray[ 2] = "5010001"; clusterCutArray[2] = "20000040033200000"; mesonCutArray[ 2] = "01631031000000"; // 0-10% | |
152 | eventCutArray[ 3] = "5120001"; clusterCutArray[3] = "20000040033200000"; mesonCutArray[ 3] = "01631031000000"; // 10-20% | |
153 | eventCutArray[ 4] = "5240001"; clusterCutArray[4] = "20000040033200000"; mesonCutArray[ 4] = "01631031000000"; // 20-40% | |
ee4b3d66 | 154 | } else if (trainConfig == 33){ // PHOS clusters |
f1018ee5 | 155 | eventCutArray[ 0] = "5460001"; clusterCutArray[0] = "20000040033200000"; mesonCutArray[ 0] = "01631031000000"; // 40-60% |
156 | eventCutArray[ 1] = "5680001"; clusterCutArray[1] = "20000040033200000"; mesonCutArray[ 1] = "01631031000000"; // 60-80% | |
157 | eventCutArray[ 2] = "5260001"; clusterCutArray[2] = "20000040033200000"; mesonCutArray[ 2] = "01631031000000"; // 20-60% | |
158 | eventCutArray[ 3] = "5480001"; clusterCutArray[3] = "20000040033200000"; mesonCutArray[ 3] = "01631031000000"; // 40-80% | |
159 | eventCutArray[ 4] = "5250001"; clusterCutArray[4] = "20000040033200000"; mesonCutArray[ 4] = "01631031000000"; // 20-50% | |
ee4b3d66 | 160 | } else { |
161 | Error(Form("GammaConvCalo_%i",trainConfig), "wrong trainConfig variable no cuts have been specified for the configuration"); | |
162 | return; | |
163 | } | |
164 | ||
165 | TList *EventCutList = new TList(); | |
166 | TList *ConvCutList = new TList(); | |
167 | TList *ClusterCutList = new TList(); | |
168 | TList *MesonCutList = new TList(); | |
169 | ||
170 | TList *HeaderList = new TList(); | |
171 | if (periodName.CompareTo("LHC13d2")==0){ | |
172 | TObjString *Header1 = new TObjString("pi0_1"); | |
173 | HeaderList->Add(Header1); | |
174 | // TObjString *Header3 = new TObjString("eta_2"); | |
175 | // HeaderList->Add(Header3); | |
176 | ||
177 | } else if (periodName.CompareTo("LHC12a17x_fix")==0){ | |
178 | TObjString *Header1 = new TObjString("PARAM"); | |
179 | HeaderList->Add(Header1); | |
180 | } else if (periodName.CompareTo("LHC14a1a")==0){ | |
181 | if (headerSelectionInt == 1){ | |
182 | TObjString *Header1 = new TObjString("pi0_1"); | |
183 | HeaderList->Add(Header1); | |
184 | } else if (headerSelectionInt == 2){ | |
185 | TObjString *Header1 = new TObjString("eta_2"); | |
186 | HeaderList->Add(Header1); | |
187 | } else { | |
188 | TObjString *Header1 = new TObjString("pi0_1"); | |
189 | HeaderList->Add(Header1); | |
190 | TObjString *Header2 = new TObjString("eta_2"); | |
191 | HeaderList->Add(Header2); | |
192 | } | |
193 | } else if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0){ | |
194 | TObjString *Header1 = new TObjString("BOX"); | |
195 | HeaderList->Add(Header1); | |
196 | } | |
197 | ||
198 | TList *EventCutList = new TList(); | |
199 | TList *ClusterCutList = new TList(); | |
200 | TList *MesonCutList = new TList(); | |
201 | ||
202 | ||
203 | EventCutList->SetOwner(kTRUE); | |
204 | AliConvEventCuts **analysisEventCuts = new AliConvEventCuts*[numberOfCuts]; | |
205 | ClusterCutList->SetOwner(kTRUE); | |
206 | AliCaloPhotonCuts **analysisClusterCuts = new AliCaloPhotonCuts*[numberOfCuts]; | |
207 | MesonCutList->SetOwner(kTRUE); | |
208 | AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts]; | |
209 | ||
210 | for(Int_t i = 0; i<numberOfCuts; i++){ | |
211 | analysisEventCuts[i] = new AliConvEventCuts(); | |
212 | analysisEventCuts[i]->InitializeCutsFromCutString(eventCutArray[i].Data()); | |
213 | EventCutList->Add(analysisEventCuts[i]); | |
214 | analysisEventCuts[i]->SetFillCutHistograms("",kFALSE); | |
215 | ||
216 | analysisClusterCuts[i] = new AliCaloPhotonCuts(); | |
217 | analysisClusterCuts[i]->InitializeCutsFromCutString(clusterCutArray[i].Data()); | |
218 | ClusterCutList->Add(analysisClusterCuts[i]); | |
219 | analysisClusterCuts[i]->SetFillCutHistograms(""); | |
220 | ||
221 | analysisMesonCuts[i] = new AliConversionMesonCuts(); | |
222 | analysisMesonCuts[i]->InitializeCutsFromCutString(mesonCutArray[i].Data()); | |
223 | MesonCutList->Add(analysisMesonCuts[i]); | |
224 | analysisMesonCuts[i]->SetFillCutHistograms(""); | |
225 | analysisEventCuts[i]->SetAcceptedHeader(HeaderList); | |
226 | } | |
227 | task->SetEventCutList(numberOfCuts,EventCutList); | |
228 | task->SetCaloCutList(numberOfCuts,ClusterCutList); | |
229 | task->SetMesonCutList(numberOfCuts,MesonCutList); | |
230 | task->SetDoMesonAnalysis(kTRUE); | |
231 | task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA | |
232 | task->SetDoClusterQA(enableQAClusterTask); //Attention new switch small for Cluster QA | |
5cade4fc | 233 | task->SetUseTHnSparse(isUsingTHnSparse); |
ee4b3d66 | 234 | |
235 | //connect containers | |
236 | AliAnalysisDataContainer *coutput = | |
237 | mgr->CreateContainer(Form("GammaCalo_%i",trainConfig), TList::Class(), | |
238 | AliAnalysisManager::kOutputContainer,Form("GammaCalo_%i.root",trainConfig)); | |
239 | ||
240 | mgr->AddTask(task); | |
241 | mgr->ConnectInput(task,0,cinput); | |
242 | mgr->ConnectOutput(task,1,coutput); | |
243 | ||
244 | return; | |
245 | ||
246 | } |