]>
Commit | Line | Data |
---|---|---|
f5ec6c30 | 1 | //DEFINITION OF A FEW CONSTANTS |
2 | const Double_t ymin = -2.1 ; | |
3 | const Double_t ymax = 2.1 ; | |
4 | const Double_t ptmin_0_4 = 0.0 ; | |
5 | const Double_t ptmax_0_4 = 4.0 ; | |
6 | const Double_t ptmin_4_8 = 4.0 ; | |
7 | const Double_t ptmax_4_8 = 8.0 ; | |
8 | const Double_t ptmin_8_10 = 8.0 ; | |
9 | const Double_t ptmax_8_10 = 10.0 ; | |
10 | const Double_t cosmin = -1.05; | |
11 | const Double_t cosmax = 1.05; | |
12 | const Double_t cTmin = 0; // micron | |
13 | const Double_t cTmax = 500; // micron | |
14 | const Double_t dcamin = 0; // micron | |
15 | const Double_t dcamax = 500; // micron | |
16 | const Double_t d0min = -1000; // micron | |
17 | const Double_t d0max = 1000; // micron | |
18 | const Double_t d0xd0min = -100000; // micron | |
19 | const Double_t d0xd0max = 100000; // micron | |
20 | const Int_t mintrackrefsTPC = 2 ; | |
21 | const Int_t mintrackrefsITS = 3 ; | |
22 | const Int_t charge = 1 ; | |
23 | const Int_t PDG = 421; | |
24 | const Int_t minclustersTPC = 50 ; | |
25 | // cuts | |
26 | const Double_t ptmin = 0.1; | |
27 | const Double_t ptmax = 9999.; | |
28 | const Double_t etamin = -0.9; | |
29 | const Double_t etamax = 0.9; | |
30 | const Int_t minITSClusters = 5; | |
31 | ||
32 | //---------------------------------------------------- | |
33 | ||
34 | AliCFHeavyFlavourTaskMultiVarMultiStep *AddTaskCFMultiVarMultiStep() | |
35 | { | |
36 | ||
37 | //CONTAINER DEFINITION | |
38 | Info("AliCFHeavyFlavourTaskMultiVarMultiStep","SETUP CONTAINER"); | |
39 | //the sensitive variables (6 in this example), their indices | |
40 | UInt_t ipt = 0; | |
41 | UInt_t iy = 1; | |
42 | UInt_t icosThetaStar = 2; | |
43 | UInt_t ipTpi = 3; | |
44 | UInt_t ipTk = 4; | |
45 | UInt_t icT = 5; | |
46 | UInt_t idca = 6; | |
47 | UInt_t id0pi = 7; | |
48 | UInt_t id0K = 8; | |
49 | UInt_t id0xd0 = 9; | |
50 | UInt_t ipointing = 10; | |
51 | ||
52 | //Setting up the container grid... | |
53 | UInt_t nstep = 6; //number of selection steps: MC, Acceptance, Reco (no cuts), RecoAcceptance, RecoITSClusters (RecoAcceptance included), RecoPPR (RecoAcceptance+RecoITSCluster included) | |
54 | const Int_t nvar = 11 ; //number of variables on the grid:pt, y, cosThetaStar, pTpi, pTk, cT, dca, d0pi, d0K, d0xd0, cosPointingAngle | |
55 | const Int_t nbin0_0_4 = 8 ; //bins in pt from 0 to 4 GeV | |
56 | const Int_t nbin0_4_8 = 4 ; //bins in pt from 4 to 8 GeV | |
57 | const Int_t nbin0_8_10 = 1 ; //bins in pt from 8 to 10 GeV | |
58 | const Int_t nbin1 = 42 ; //bins in y | |
59 | const Int_t nbin2 = 42 ; //bins in cosThetaStar | |
60 | const Int_t nbin3_0_4 = 8 ; //bins in ptPi from 0 to 4 GeV | |
61 | const Int_t nbin3_4_8 = 4 ; //bins in ptPi from 4 to 8 GeV | |
62 | const Int_t nbin3_8_10 = 1 ; //bins in ptPi from 8 to 10 GeV | |
63 | const Int_t nbin4_0_4 = 8 ; //bins in ptKa from 0 to 4 GeV | |
64 | const Int_t nbin4_4_8 = 4 ; //bins in ptKa from 4 to 8 GeV | |
65 | const Int_t nbin4_8_10 = 1 ; //bins in ptKa from 8 to 10 GeV | |
66 | const Int_t nbin5 = 24 ; //bins in cT | |
67 | const Int_t nbin6 = 24 ; //bins in dca | |
68 | const Int_t nbin7 = 100 ; //bins in d0pi | |
69 | const Int_t nbin8 = 100 ; //bins in d0K | |
70 | const Int_t nbin9 = 80 ; //bins in d0xd0 | |
71 | const Int_t nbin10 = 1050 ; //bins in cosPointingAngle | |
72 | ||
73 | //arrays for the number of bins in each dimension | |
74 | Int_t iBin[nvar]; | |
75 | iBin[0]=nbin0_0_4+nbin0_4_8+nbin0_8_10; | |
76 | iBin[1]=nbin1; | |
77 | iBin[2]=nbin2; | |
78 | iBin[3]=nbin3_0_4+nbin3_4_8+nbin3_8_10; | |
79 | iBin[4]=nbin4_0_4+nbin4_4_8+nbin4_8_10; | |
80 | iBin[5]=nbin5; | |
81 | iBin[6]=nbin6; | |
82 | iBin[7]=nbin7; | |
83 | iBin[8]=nbin8; | |
84 | iBin[9]=nbin9; | |
85 | iBin[10]=nbin10; | |
86 | ||
87 | //arrays for lower bounds : | |
88 | Double_t *binLim0=new Double_t[iBin[0]+1]; | |
89 | Double_t *binLim1=new Double_t[iBin[1]+1]; | |
90 | Double_t *binLim2=new Double_t[iBin[2]+1]; | |
91 | Double_t *binLim3=new Double_t[iBin[3]+1]; | |
92 | Double_t *binLim4=new Double_t[iBin[4]+1]; | |
93 | Double_t *binLim5=new Double_t[iBin[5]+1]; | |
94 | Double_t *binLim6=new Double_t[iBin[6]+1]; | |
95 | Double_t *binLim7=new Double_t[iBin[7]+1]; | |
96 | Double_t *binLim8=new Double_t[iBin[8]+1]; | |
97 | Double_t *binLim9=new Double_t[iBin[9]+1]; | |
98 | Double_t *binLim10=new Double_t[iBin[10]+1]; | |
99 | ||
100 | // checking limits | |
101 | if (ptmax_0_4 != ptmin_4_8) { | |
102 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","max lim 1st range != min lim 2nd range, please check!"); | |
103 | } | |
104 | if (ptmax_4_8 != ptmin_8_10) { | |
105 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","max lim 2nd range != min lim 3rd range, please check!"); | |
106 | } | |
107 | ||
108 | // values for bin lower bounds | |
109 | // pt | |
110 | for(Int_t i=0; i<=nbin0_0_4; i++) binLim0[i]=(Double_t)ptmin_0_4 + (ptmax_0_4-ptmin_0_4)/nbin0_0_4*(Double_t)i ; | |
111 | if (binLim0[nbin0_0_4] != ptmin_4_8) { | |
112 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for pt - 1st range - differs from expected!\n"); | |
113 | } | |
114 | for(Int_t i=0; i<=nbin0_4_8; i++) binLim0[i+nbin0_0_4]=(Double_t)ptmin_4_8 + (ptmax_4_8-ptmin_4_8)/nbin0_4_8*(Double_t)i ; | |
115 | if (binLim0[nbin0_0_4+nbin0_4_8] != ptmin_8_10) { | |
116 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for pt - 2nd range - differs from expected!\n"); | |
117 | } | |
118 | for(Int_t i=0; i<=nbin0_8_10; i++) binLim0[i+nbin0_0_4+nbin0_4_8]=(Double_t)ptmin_8_10 + (ptmax_8_10-ptmin_8_10)/nbin0_8_10*(Double_t)i ; | |
119 | ||
120 | // y | |
121 | for(Int_t i=0; i<=nbin1; i++) binLim1[i]=(Double_t)ymin + (ymax-ymin) /nbin1*(Double_t)i ; | |
122 | ||
123 | // cosThetaStar | |
124 | for(Int_t i=0; i<=nbin2; i++) binLim2[i]=(Double_t)cosmin + (cosmax-cosmin) /nbin2*(Double_t)i ; | |
125 | ||
126 | // ptPi | |
127 | for(Int_t i=0; i<=nbin3_0_4; i++) binLim3[i]=(Double_t)ptmin_0_4 + (ptmax_0_4-ptmin_0_4)/nbin3_0_4*(Double_t)i ; | |
128 | if (binLim3[nbin3_0_4] != ptmin_4_8) { | |
129 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for ptPi - 1st range - differs from expected!"); | |
130 | } | |
131 | for(Int_t i=0; i<=nbin3_4_8; i++) binLim3[i+nbin3_0_4]=(Double_t)ptmin_4_8 + (ptmax_4_8-ptmin_4_8)/nbin3_4_8*(Double_t)i ; | |
132 | if (binLim3[nbin3_0_4+nbin3_4_8] != ptmin_8_10) { | |
133 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for ptPi - 2nd range - differs from expected!\n"); | |
134 | } | |
135 | for(Int_t i=0; i<=nbin3_8_10; i++) binLim3[i+nbin3_0_4+nbin3_4_8]=(Double_t)ptmin_8_10 + (ptmax_8_10-ptmin_8_10)/nbin3_8_10*(Double_t)i ; | |
136 | ||
137 | // ptKa | |
138 | for(Int_t i=0; i<=nbin4_0_4; i++) binLim4[i]=(Double_t)ptmin_0_4 + (ptmax_0_4-ptmin_0_4)/nbin4_0_4*(Double_t)i ; | |
139 | if (binLim4[nbin4_0_4] != ptmin_4_8) { | |
140 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for ptKa - 1st range - differs from expected!"); | |
141 | } | |
142 | for(Int_t i=0; i<=nbin4_4_8; i++) binLim4[i+nbin4_0_4]=(Double_t)ptmin_4_8 + (ptmax_4_8-ptmin_4_8)/nbin4_4_8*(Double_t)i ; | |
143 | if (binLim4[nbin4_0_4+nbin4_4_8] != ptmin_8_10) { | |
144 | Error("AliCFHeavyFlavourTaskMultiVarMultiStep","Calculated bin lim for ptKa - 2nd range - differs from expected!\n"); | |
145 | } | |
146 | for(Int_t i=0; i<=nbin4_8_10; i++) binLim4[i+nbin4_0_4+nbin4_4_8]=(Double_t)ptmin_8_10 + (ptmax_8_10-ptmin_8_10)/nbin4_8_10*(Double_t)i ; | |
147 | ||
148 | // cT | |
149 | for(Int_t i=0; i<=nbin5; i++) binLim5[i]=(Double_t)cTmin + (cTmax-cTmin) /nbin5*(Double_t)i ; | |
150 | ||
151 | // dca | |
152 | for(Int_t i=0; i<=nbin6; i++) binLim6[i]=(Double_t)dcamin + (dcamax-dcamin) /nbin6*(Double_t)i ; | |
153 | ||
154 | // d0pi | |
155 | for(Int_t i=0; i<=nbin7; i++) binLim7[i]=(Double_t)d0min + (d0max-d0min) /nbin7*(Double_t)i ; | |
156 | ||
157 | // d0K | |
158 | for(Int_t i=0; i<=nbin8; i++) binLim8[i]=(Double_t)d0min + (d0max-d0min) /nbin8*(Double_t)i ; | |
159 | ||
160 | // d0xd0 | |
161 | for(Int_t i=0; i<=nbin9; i++) binLim9[i]=(Double_t)d0xd0min + (d0xd0max-d0xd0min) /nbin9*(Double_t)i ; | |
162 | ||
163 | // cosPointingAngle | |
164 | for(Int_t i=0; i<=nbin10; i++) binLim10[i]=(Double_t)cosmin + (cosmax-cosmin) /nbin10*(Double_t)i ; | |
165 | ||
166 | // debugging printings | |
167 | //Info("AliCFHeavyFlavourTaskMultiVarMultiStep","Printing lower limits for bins in pt"); | |
168 | //for (Int_t i =0; i<= iBin[0]; i++){ | |
169 | // Info("AliCFHeavyFlavourTaskMultiVarMultiStep",Form("i-th bin, lower limit = %f", binLim0[i])); | |
170 | //} | |
171 | //Info("Printing lower limits for bins in ptPi"); | |
172 | //for (Int_t i =0; i<= iBin[3]; i++){ | |
173 | // Info("AliCFHeavyFlavourTaskMultiVarMultiStep",Form("i-th bin, lower limit = %f", binLim3[i])); | |
174 | //} | |
175 | //Info("Printing lower limits for bins in ptKa"); | |
176 | //for (Int_t i =0; i<= iBin[4]; i++){ | |
177 | // Info("AliCFHeavyFlavourTaskMultiVarMultiStep",Form("i-th bin, lower limit = %f", binLim4[i])); | |
178 | // } | |
179 | ||
180 | //one "container" for MC | |
181 | AliCFContainer* container = new AliCFContainer("container","container for tracks",nstep,nvar,iBin); | |
182 | //setting the bin limits | |
183 | container -> SetBinLimits(ipt,binLim0); | |
184 | container -> SetBinLimits(iy,binLim1); | |
185 | container -> SetBinLimits(icosThetaStar,binLim2); | |
186 | container -> SetBinLimits(ipTpi,binLim3); | |
187 | container -> SetBinLimits(ipTk,binLim4); | |
188 | container -> SetBinLimits(icT,binLim5); | |
189 | container -> SetBinLimits(idca,binLim6); | |
190 | container -> SetBinLimits(id0pi,binLim7); | |
191 | container -> SetBinLimits(id0K,binLim8); | |
192 | container -> SetBinLimits(id0xd0,binLim9); | |
193 | container -> SetBinLimits(ipointing,binLim10); | |
194 | ||
195 | //CREATE THE CUTS ----------------------------------------------- | |
196 | ||
197 | // Gen-Level kinematic cuts | |
198 | AliCFTrackKineCuts *mcKineCuts = new AliCFTrackKineCuts("mcKineCuts","MC-level kinematic cuts"); | |
199 | // mcKineCuts->SetPtRange(ptmin,ptmax); | |
200 | // mcKineCuts->SetRapidityRange(ymin,ymax); | |
201 | // mcKineCuts->SetChargeMC(charge); | |
202 | ||
203 | //Particle-Level cuts: | |
204 | AliCFParticleGenCuts* mcGenCuts = new AliCFParticleGenCuts("mcGenCuts","MC particle generation cuts"); | |
205 | //mcGenCuts->SetRequireIsPrimary(); | |
206 | mcGenCuts->SetRequirePdgCode(PDG, kTRUE); // kTRUE set in order to include D0_bar | |
207 | mcGenCuts->SetAODMC(1); //special flag for reading MC in AOD tree (important) | |
208 | ||
209 | // Acceptance cuts: | |
210 | AliCFAcceptanceCuts* accCuts = new AliCFAcceptanceCuts("accCuts", "Acceptance cuts"); | |
211 | //accCuts->SetMinNHitITS(3); | |
212 | //accCuts->SetMinNHitTPC(2); | |
213 | AliCFTrackKineCuts *kineAccCuts = new AliCFTrackKineCuts("kineAccCuts","Kine-Acceptance cuts"); | |
214 | kineAccCuts->SetPtRange(ptmin,ptmax); | |
215 | kineAccCuts->SetEtaRange(etamin,etamax); | |
216 | ||
217 | // Rec-Level kinematic cuts | |
218 | AliCFTrackKineCuts *recKineCuts = new AliCFTrackKineCuts("recKineCuts","rec-level kine cuts"); | |
219 | // recKineCuts->SetPtRange(ptmin,ptmax); | |
220 | // recKineCuts->SetRapidityRange(ymin,ymax); | |
221 | // recKineCuts->SetChargeRec(charge); | |
222 | ||
223 | AliCFTrackQualityCuts *recQualityCuts = new AliCFTrackQualityCuts("recQualityCuts","rec-level quality cuts"); | |
224 | //recQualityCuts->SetStatus(AliESDtrack::kITSrefit); | |
225 | ||
226 | AliCFTrackIsPrimaryCuts *recIsPrimaryCuts = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts","rec-level isPrimary cuts"); | |
227 | //recIsPrimaryCuts->SetAODType(AliAODTrack::kPrimary); | |
228 | ||
229 | printf("CREATE MC KINE CUTS\n"); | |
230 | TObjArray* mcList = new TObjArray(0) ; | |
231 | mcList->AddLast(mcKineCuts); | |
232 | mcList->AddLast(mcGenCuts); | |
233 | ||
234 | printf("CREATE ACCEPTANCE CUTS\n"); | |
235 | TObjArray* accList = new TObjArray(0) ; | |
236 | accList->AddLast(kineAccCuts); | |
237 | ||
238 | printf("CREATE RECONSTRUCTION CUTS\n"); | |
239 | TObjArray* recList = new TObjArray(0) ; | |
240 | recList->AddLast(recKineCuts); | |
241 | recList->AddLast(recQualityCuts); | |
242 | recList->AddLast(recIsPrimaryCuts); | |
243 | ||
244 | //CREATE THE INTERFACE TO CORRECTION FRAMEWORK USED IN THE TASK | |
245 | printf("CREATE INTERFACE AND CUTS\n"); | |
246 | AliCFManager* man = new AliCFManager() ; | |
247 | man->SetParticleContainer (container); | |
248 | man->SetParticleCutsList(0 , mcList); // MC | |
249 | man->SetParticleCutsList(1 , accList); // Acceptance | |
250 | man->SetParticleCutsList(2 , recList); // AOD | |
251 | man->SetParticleCutsList(3 , recList); // AOD in Acceptance | |
252 | man->SetParticleCutsList(4 , recList); // AOD with required n. of ITS clusters | |
253 | man->SetParticleCutsList(5 , recList); // AOD Reco (PPR cuts implemented in Task) | |
254 | ||
255 | // Get the pointer to the existing analysis manager via the static access method. | |
256 | //============================================================================== | |
257 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
258 | if (!mgr) { | |
259 | ::Error("AddTaskCompareHF", "No analysis manager to connect to."); | |
260 | return NULL; | |
261 | } | |
262 | //CREATE THE TASK | |
263 | printf("CREATE TASK\n"); | |
264 | // create the task | |
265 | AliCFHeavyFlavourTaskMultiVarMultiStep *task = new AliCFHeavyFlavourTaskMultiVarMultiStep("AliCFHeavyFlavourTaskMultiVarMultiStep"); | |
266 | task->SetFillFromGenerated(kFALSE); | |
267 | task->SetMinITSClusters(minITSClusters); | |
268 | task->SetCFManager(man); //here is set the CF manager | |
269 | ||
270 | // Create and connect containers for input/output | |
271 | ||
272 | // ------ input data ------ | |
273 | AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); | |
274 | ||
275 | // ----- output data ----- | |
276 | ||
277 | //slot 0 : default output tree (by default handled by AliAnalysisTaskSE) | |
278 | AliAnalysisDataContainer *coutput0 = mgr->CreateContainer("ctree0", TTree::Class(),AliAnalysisManager::kOutputContainer,"output.root"); | |
279 | ||
280 | //now comes user's output objects : | |
281 | ||
282 | // output TH1I for event counting | |
283 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist0", TH1I::Class(),AliAnalysisManager::kOutputContainer,"output.root"); | |
284 | // output Correction Framework Container (for acceptance & efficiency calculations) | |
285 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("ccontainer0", AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,"output.root"); | |
286 | ||
287 | mgr->AddTask(task); | |
288 | ||
289 | mgr->ConnectInput(task,0,mgr->GetCommonInputContainer()); | |
290 | mgr->ConnectOutput(task,0,coutput0); | |
291 | mgr->ConnectOutput(task,1,coutput1); | |
292 | mgr->ConnectOutput(task,2,coutput2); | |
293 | ||
294 | return task; | |
295 | } | |
296 |