]>
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 | |
9 | Bool_t doWeighting = kFALSE //enable Weighting | |
10 | ) { | |
11 | ||
12 | // ================= Load Librariers ================================= | |
13 | gSystem->Load("libCore.so"); | |
14 | gSystem->Load("libTree.so"); | |
15 | gSystem->Load("libGeom.so"); | |
16 | gSystem->Load("libVMC.so"); | |
17 | gSystem->Load("libPhysics.so"); | |
18 | gSystem->Load("libMinuit"); | |
19 | gSystem->Load("libSTEERBase"); | |
20 | gSystem->Load("libESD"); | |
21 | gSystem->Load("libAOD"); | |
22 | gSystem->Load("libANALYSIS"); | |
23 | gSystem->Load("libANALYSISalice"); | |
24 | gSystem->Load("libPWGGAGammaConv.so"); | |
25 | gSystem->Load("libCDB.so"); | |
26 | gSystem->Load("libSTEER.so"); | |
27 | gSystem->Load("libSTEERBase.so"); | |
28 | gSystem->Load("libTENDER.so"); | |
29 | gSystem->Load("libTENDERSupplies.so"); | |
30 | ||
31 | // ================== GetAnalysisManager =============================== | |
32 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
33 | if (!mgr) { | |
34 | Error(Form("AddTask_GammaConvV1_%i",trainConfig), "No analysis manager found."); | |
35 | return ; | |
36 | } | |
37 | ||
38 | // ================== GetInputEventHandler ============================= | |
39 | AliVEventHandler *inputHandler=mgr->GetInputEventHandler(); | |
40 | ||
41 | //========= Add PID Reponse to ANALYSIS manager ==== | |
42 | if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){ | |
43 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); | |
44 | AddTaskPIDResponse(isMC,1,0,4,0,"",1,1,4); | |
45 | } | |
46 | ||
47 | //========= Set Cutnumber for V0Reader ================================ | |
48 | TString cutnumber = "1000000000084001001500000000"; | |
49 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
50 | ||
51 | //========= Add V0 Reader to ANALYSIS manager if not yet existent ===== | |
52 | if( !(AliV0ReaderV1*)mgr->GetTask("V0ReaderV1") ){ | |
53 | AliV0ReaderV1 *fV0ReaderV1 = new AliV0ReaderV1("V0ReaderV1"); | |
54 | ||
55 | fV0ReaderV1->SetUseOwnXYZCalculation(kTRUE); | |
56 | fV0ReaderV1->SetCreateAODs(kFALSE);// AOD Output | |
57 | fV0ReaderV1->SetUseAODConversionPhoton(kTRUE); | |
58 | ||
59 | if (!mgr) { | |
60 | Error("AddTask_V0ReaderV1", "No analysis manager found."); | |
61 | return; | |
62 | } | |
63 | ||
64 | // Set AnalysisCut Number | |
65 | AliConversionCuts *fCuts=NULL; | |
66 | if(cutnumber!=""){ | |
67 | fCuts= new AliConversionCuts(cutnumber.Data(),cutnumber.Data()); | |
68 | fCuts->SetPreSelectionCutFlag(kTRUE); | |
69 | if(fCuts->InitializeCutsFromCutString(cutnumber.Data())){ | |
70 | fV0ReaderV1->SetConversionCuts(fCuts); | |
71 | fCuts->SetFillCutHistograms("",kTRUE); | |
72 | } | |
73 | } | |
74 | if(inputHandler->IsA()==AliAODInputHandler::Class()){ | |
75 | // AOD mode | |
76 | fV0ReaderV1->SetDeltaAODBranchName(Form("GammaConv_%s_gamma",cutnumberAODBranch.Data())); | |
77 | } | |
78 | fV0ReaderV1->Init(); | |
79 | ||
80 | AliLog::SetGlobalLogLevel(AliLog::kFatal); | |
81 | ||
82 | //connect input V0Reader | |
83 | mgr->AddTask(fV0ReaderV1); | |
84 | mgr->ConnectInput(fV0ReaderV1,0,cinput); | |
85 | ||
86 | } | |
87 | ||
88 | //================================================ | |
89 | //========= Add task to the ANALYSIS manager ===== | |
90 | //================================================ | |
91 | AliAnalysisTaskGammaConvCalo *task=NULL; | |
92 | task= new AliAnalysisTaskGammaConvCalo(Form("GammaConvCalo_%i",trainConfig)); | |
93 | task->SetIsHeavyIon(1); | |
94 | task->SetIsMC(isMC); | |
95 | // Cut Numbers to use in Analysis | |
96 | Int_t numberOfCuts = 5; | |
97 | ||
98 | TString *cutarray = new TString[numberOfCuts]; | |
99 | TString *clustercutarray = new TString[numberOfCuts]; | |
100 | TString *mesonCutArray = new TString[numberOfCuts]; | |
101 | ||
102 | // meson cuts | |
103 | // 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 | |
104 | ||
9df9736d | 105 | if (trainConfig == 1){ // EMCAL clusters |
8bdca7f1 | 106 | cutarray[ 0] = "6010001002092970028250400000"; clustercutarray[0] = "10000040022030000"; mesonCutArray[ 0] = "01525065000000"; // 0-5% |
107 | cutarray[ 1] = "6120001002092970028250400000"; clustercutarray[1] = "10000040022030000"; mesonCutArray[ 1] = "01525065000000"; // 5-10% | |
108 | cutarray[ 2] = "5010001002092970028250400000"; clustercutarray[2] = "10000040022030000"; mesonCutArray[ 2] = "01525065000000"; // 0-10% | |
109 | cutarray[ 3] = "5240001002092970028250400000"; clustercutarray[3] = "10000040022030000"; mesonCutArray[ 3] = "01525065000000"; // 20-40% | |
110 | cutarray[ 4] = "5250001002092970028250400000"; clustercutarray[4] = "10000040022030000"; mesonCutArray[ 4] = "01525065000000"; // 20-50% | |
9df9736d | 111 | } else if (trainConfig == 2){ // PHOS clusters |
112 | cutarray[ 0] = "6010001002092970028250400000"; clustercutarray[0] = "20000040022030000"; mesonCutArray[ 0] = "01525065000000"; // 0-5% | |
113 | cutarray[ 1] = "6120001002092970028250400000"; clustercutarray[1] = "20000040022030000"; mesonCutArray[ 1] = "01525065000000"; // 5-10% | |
114 | cutarray[ 2] = "5010001002092970028250400000"; clustercutarray[2] = "20000040022030000"; mesonCutArray[ 2] = "01525065000000"; // 0-10% | |
115 | cutarray[ 3] = "5240001002092970028250400000"; clustercutarray[3] = "20000040022030000"; mesonCutArray[ 3] = "01525065000000"; // 20-40% | |
116 | cutarray[ 4] = "5250001002092970028250400000"; clustercutarray[4] = "20000040022030000"; mesonCutArray[ 4] = "01525065000000"; // 20-50% | |
117 | ||
118 | ||
8bdca7f1 | 119 | } else { |
120 | Error(Form("GammaConvCalo_%i",trainConfig), "wrong trainConfig variable no cuts have been specified for the configuration"); | |
121 | return; | |
122 | } | |
123 | ||
124 | TList *ConvCutList = new TList(); | |
125 | TList *MesonCutList = new TList(); | |
126 | ||
127 | TList *HeaderList = new TList(); | |
128 | if (periodName.CompareTo("LHC13d2")==0){ | |
129 | TObjString *Header1 = new TObjString("pi0_1"); | |
130 | HeaderList->Add(Header1); | |
131 | // TObjString *Header3 = new TObjString("eta_2"); | |
132 | // HeaderList->Add(Header3); | |
133 | ||
134 | } else if (periodName.CompareTo("LHC12a17x_fix")==0){ | |
135 | TObjString *Header1 = new TObjString("PARAM"); | |
136 | HeaderList->Add(Header1); | |
137 | } else if (periodName.CompareTo("LHC14a1a")==0){ | |
138 | if (headerSelectionInt == 1){ | |
139 | TObjString *Header1 = new TObjString("pi0_1"); | |
140 | HeaderList->Add(Header1); | |
141 | } else if (headerSelectionInt == 2){ | |
142 | TObjString *Header1 = new TObjString("eta_2"); | |
143 | HeaderList->Add(Header1); | |
144 | } else { | |
145 | TObjString *Header1 = new TObjString("pi0_1"); | |
146 | HeaderList->Add(Header1); | |
147 | TObjString *Header2 = new TObjString("eta_2"); | |
148 | HeaderList->Add(Header2); | |
149 | } | |
150 | } else if (periodName.CompareTo("LHC14a1b")==0 || periodName.CompareTo("LHC14a1c")==0){ | |
151 | TObjString *Header1 = new TObjString("BOX"); | |
152 | HeaderList->Add(Header1); | |
153 | } | |
154 | ||
155 | ConvCutList->SetOwner(kTRUE); | |
156 | AliConversionCuts **analysisCuts = new AliConversionCuts*[numberOfCuts]; | |
157 | ClusterCutList->SetOwner(kTRUE); | |
158 | AliCaloPhotonCuts **analysisClusterCuts = new AliCaloPhotonCuts*[numberOfCuts]; | |
159 | MesonCutList->SetOwner(kTRUE); | |
160 | AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts]; | |
161 | ||
162 | for(Int_t i = 0; i<numberOfCuts; i++){ | |
163 | analysisCuts[i] = new AliConversionCuts(); | |
164 | ||
165 | if ( trainConfig == 1){ | |
166 | if (periodName.CompareTo("LHC14a1a") ==0 || periodName.CompareTo("LHC14a1b") ==0 || periodName.CompareTo("LHC14a1c") ==0 ){ | |
167 | if ( i == 0 && doWeighting) analysisCuts[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"); | |
168 | if ( i == 1 && doWeighting) analysisCuts[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"); | |
169 | if ( i == 2 && doWeighting) analysisCuts[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"); | |
170 | if ( i == 3 && doWeighting) analysisCuts[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"); | |
171 | if ( i == 4 && doWeighting) analysisCuts[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"); | |
172 | } | |
173 | } | |
174 | analysisCuts[i]->InitializeCutsFromCutString(cutarray[i].Data()); | |
175 | if (periodName.CompareTo("LHC14a1b") ==0 || periodName.CompareTo("LHC14a1c") ==0 ){ | |
176 | if (headerSelectionInt == 1) analysisCuts[i]->SetAddedSignalPDGCode(111); | |
177 | if (headerSelectionInt == 2) analysisCuts[i]->SetAddedSignalPDGCode(221); | |
178 | } | |
179 | ConvCutList->Add(analysisCuts[i]); | |
180 | ||
181 | analysisClusterCuts[i] = new AliCaloPhotonCuts(); | |
182 | analysisClusterCuts[i]->InitializeCutsFromCutString(clustercutarray[i].Data()); | |
183 | ClusterCutList->Add(analysisClusterCuts[i]); | |
184 | analysisClusterCuts[i]->SetFillCutHistograms(""); | |
185 | ||
186 | analysisCuts[i]->SetFillCutHistograms("",kFALSE); | |
187 | analysisMesonCuts[i] = new AliConversionMesonCuts(); | |
188 | analysisMesonCuts[i]->InitializeCutsFromCutString(mesonCutArray[i].Data()); | |
189 | MesonCutList->Add(analysisMesonCuts[i]); | |
190 | analysisMesonCuts[i]->SetFillCutHistograms(""); | |
191 | analysisCuts[i]->SetAcceptedHeader(HeaderList); | |
192 | } | |
193 | ||
194 | task->SetConversionCutList(numberOfCuts,ConvCutList); | |
195 | task->SetCaloCutList(numberOfCuts,ClusterCutList); | |
196 | task->SetMesonCutList(numberOfCuts,MesonCutList); | |
197 | task->SetMoveParticleAccordingToVertex(kTRUE); | |
198 | task->SetDoMesonAnalysis(kTRUE); | |
199 | task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA | |
200 | task->SetDoPhotonQA(enableQAPhotonTask); //Attention new switch small for Photon QA | |
201 | ||
202 | //connect containers | |
203 | AliAnalysisDataContainer *coutput = | |
204 | mgr->CreateContainer(Form("GammaConvCalo_%i",trainConfig), TList::Class(), | |
205 | AliAnalysisManager::kOutputContainer,Form("GammaConvCalo_%i.root",trainConfig)); | |
206 | ||
207 | mgr->AddTask(task); | |
208 | mgr->ConnectInput(task,0,cinput); | |
209 | mgr->ConnectOutput(task,1,coutput); | |
210 | ||
211 | return; | |
212 | ||
213 | } |