]>
Commit | Line | Data |
---|---|---|
c683985a | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /* $Id$ */ | |
17 | ||
18 | //////////////////////////////////////////////////////////////////////// | |
19 | // | |
20 | // Base class for cuts on Associated tracks for HF Correlation analysis | |
21 | // | |
22 | // Author: S.Bjelogrlic (Utrecht) sandro.bjelogrlic@cern.ch | |
23 | //////////////////////////////////////////////////////////////////////// | |
24 | #include <Riostream.h> | |
25 | #include "AliHFAssociatedTrackCuts.h" | |
26 | #include "AliAODPidHF.h" | |
27 | #include "AliESDtrackCuts.h" | |
28 | #include "AliESDtrack.h" | |
29 | #include "AliESDVertex.h" | |
30 | #include "AliAODv0.h" | |
31 | #include "AliAODVertex.h" | |
32 | #include "AliAODMCParticle.h" | |
33 | #include "AliAnalysisManager.h" | |
34 | #include "AliInputEventHandler.h" | |
35 | #include "TString.h" | |
36 | ||
37 | using std::cout; | |
38 | using std::endl; | |
39 | ||
40 | ClassImp(AliHFAssociatedTrackCuts) | |
41 | ||
42 | //-------------------------------------------------------------------------- | |
43 | AliHFAssociatedTrackCuts::AliHFAssociatedTrackCuts(): | |
44 | AliAnalysisCuts(), | |
45 | fESDTrackCuts(0), | |
46 | fPidObj(0), | |
47 | fEffWeights(0), | |
48 | ||
49 | fTrigEffWeightsvspt(0), | |
50 | fTrigEffWeightsvsptB(0), | |
51 | fTrigEffWeights(0), | |
52 | fTrigEffWeightsB(0), | |
53 | fPoolMaxNEvents(0), | |
54 | fPoolMinNTracks(0), | |
55 | fMinEventsToMix(0), | |
56 | fNzVtxBins(0), | |
57 | fNzVtxBinsDim(0), | |
58 | fZvtxBins(0), | |
59 | fNCentBins(0), | |
60 | fNCentBinsDim(0), | |
61 | fCentBins(0), | |
62 | ||
63 | fNofMCEventType(0), | |
64 | fMCEventType(0), | |
65 | ||
66 | fNTrackCuts(0), | |
67 | fAODTrackCuts(0), | |
68 | fTrackCutsNames(0), | |
69 | fNvZeroCuts(0), | |
70 | fAODvZeroCuts(0), | |
71 | fvZeroCutsNames(0), | |
72 | fBit(-1), | |
73 | fCharge(0), | |
74 | fDescription("") | |
75 | ||
76 | { | |
77 | // | |
78 | //default constructor | |
79 | // | |
80 | // | |
81 | //default constructor | |
82 | // | |
83 | ||
84 | } | |
85 | ||
86 | //-------------------------------------------------------------------------- | |
87 | AliHFAssociatedTrackCuts::AliHFAssociatedTrackCuts(const char* name, const char* title): | |
88 | AliAnalysisCuts(name,title), | |
89 | fESDTrackCuts(0), | |
90 | fPidObj(0), | |
91 | fEffWeights(0), | |
92 | fTrigEffWeightsvspt(0), | |
93 | fTrigEffWeightsvsptB(0), | |
94 | fTrigEffWeights(0), | |
95 | fTrigEffWeightsB(0), | |
96 | fPoolMaxNEvents(0), | |
97 | fPoolMinNTracks(0), | |
98 | fMinEventsToMix(0), | |
99 | fNzVtxBins(0), | |
100 | fNzVtxBinsDim(0), | |
101 | fZvtxBins(0), | |
102 | fNCentBins(0), | |
103 | fNCentBinsDim(0), | |
104 | fCentBins(0), | |
105 | ||
106 | fNofMCEventType(0), | |
107 | fMCEventType(0), | |
108 | ||
109 | fNTrackCuts(0), | |
110 | fAODTrackCuts(0), | |
111 | fTrackCutsNames(0), | |
112 | fNvZeroCuts(0), | |
113 | fAODvZeroCuts(0), | |
114 | fvZeroCutsNames(0), | |
115 | fBit(-1), | |
116 | fCharge(0), | |
117 | fDescription("") | |
118 | ||
119 | { | |
120 | // | |
121 | //default constructor | |
122 | // | |
123 | ||
124 | } | |
125 | //-------------------------------------------------------------------------- | |
126 | AliHFAssociatedTrackCuts::AliHFAssociatedTrackCuts(const AliHFAssociatedTrackCuts &source) : | |
127 | AliAnalysisCuts(source), | |
128 | fESDTrackCuts(source.fESDTrackCuts), | |
129 | fPidObj(source.fPidObj), | |
130 | fEffWeights(source.fEffWeights), | |
131 | fTrigEffWeightsvspt(source.fTrigEffWeightsvspt), | |
132 | fTrigEffWeightsvsptB(source.fTrigEffWeightsvsptB), | |
133 | fTrigEffWeights(source.fTrigEffWeights), | |
134 | fTrigEffWeightsB(source.fTrigEffWeightsB), | |
135 | ||
136 | fPoolMaxNEvents(source.fPoolMaxNEvents), | |
137 | fPoolMinNTracks(source.fPoolMinNTracks), | |
138 | fMinEventsToMix(source.fMinEventsToMix), | |
139 | fNzVtxBins(source.fNzVtxBins), | |
140 | fNzVtxBinsDim(source.fNzVtxBinsDim), | |
141 | fZvtxBins(source.fZvtxBins), | |
142 | fNCentBins(source.fNCentBins), | |
143 | fNCentBinsDim(source.fNCentBinsDim), | |
144 | fCentBins(source.fCentBins), | |
145 | ||
146 | fNofMCEventType(source.fNofMCEventType), | |
147 | fMCEventType(source.fMCEventType), | |
148 | ||
149 | fNTrackCuts(source.fNTrackCuts), | |
150 | fAODTrackCuts(source.fAODTrackCuts), | |
151 | fTrackCutsNames(source.fTrackCutsNames), | |
152 | fNvZeroCuts(source.fNvZeroCuts), | |
153 | fAODvZeroCuts(source.fAODvZeroCuts), | |
154 | fvZeroCutsNames(source.fvZeroCutsNames), | |
155 | fBit(source.fBit), | |
156 | fCharge(source.fCharge), | |
157 | fDescription(source.fDescription) | |
158 | { | |
159 | // | |
160 | // copy constructor | |
161 | // | |
162 | ||
163 | ||
164 | AliInfo("AliHFAssociatedTrackCuts::Copy constructor "); | |
165 | if(source.fESDTrackCuts) AddTrackCuts(source.fESDTrackCuts); | |
166 | if(source.fAODTrackCuts) SetAODTrackCuts(source.fAODTrackCuts); | |
167 | if(source.fAODvZeroCuts) SetAODvZeroCuts(source.fAODvZeroCuts); | |
168 | if(source.fPidObj) SetPidHF(source.fPidObj); | |
169 | if(source.fEffWeights) SetEfficiencyWeightMap(source.fEffWeights); | |
170 | if(source.fTrigEffWeightsvspt) SetTriggerEffWeightMapvspt(source.fTrigEffWeightsvspt); | |
171 | if(source.fTrigEffWeightsvsptB) SetTriggerEffWeightMapvsptB(source.fTrigEffWeightsvsptB); | |
172 | if(source.fTrigEffWeights) SetTriggerEffWeightMap(source.fTrigEffWeights); | |
173 | if(source.fTrigEffWeightsB)SetTriggerEffWeightMapB(source.fTrigEffWeightsB); | |
174 | ||
175 | ||
176 | } | |
177 | //-------------------------------------------------------------------------- | |
178 | AliHFAssociatedTrackCuts &AliHFAssociatedTrackCuts::operator=(const AliHFAssociatedTrackCuts &source) | |
179 | { | |
180 | // | |
181 | // assignment operator | |
182 | // | |
183 | if(&source == this) return *this; | |
184 | ||
185 | AliAnalysisCuts::operator=(source); | |
186 | fESDTrackCuts=source.fESDTrackCuts; | |
187 | fPidObj=source.fPidObj; | |
188 | fEffWeights=source.fEffWeights; | |
189 | fTrigEffWeightsvspt=source.fTrigEffWeightsvspt; | |
190 | fTrigEffWeightsvsptB=source.fTrigEffWeightsvsptB; | |
191 | fTrigEffWeights=source.fTrigEffWeights; | |
192 | fTrigEffWeightsB=source.fTrigEffWeightsB; | |
193 | fNTrackCuts=source.fNTrackCuts; | |
194 | fAODTrackCuts=source.fAODTrackCuts; | |
195 | fTrackCutsNames=source.fTrackCutsNames; | |
196 | fNvZeroCuts=source.fNvZeroCuts; | |
197 | fAODvZeroCuts=source.fAODvZeroCuts; | |
198 | fvZeroCutsNames=source.fvZeroCutsNames; | |
199 | fBit=source.fBit; | |
200 | fCharge=source.fCharge; | |
201 | ||
202 | return *this; | |
203 | ||
204 | } | |
205 | ||
206 | ||
207 | //-------------------------------------------------------------------------- | |
208 | AliHFAssociatedTrackCuts::~AliHFAssociatedTrackCuts() | |
209 | { | |
210 | if(fESDTrackCuts) {delete fESDTrackCuts; fESDTrackCuts = 0;} | |
211 | if(fPidObj) {delete fPidObj; fPidObj = 0;} | |
212 | if(fEffWeights){delete fEffWeights;fEffWeights=0;} | |
213 | if(fTrigEffWeightsvspt){delete fTrigEffWeightsvspt;fTrigEffWeightsvspt=0;} | |
214 | if(fTrigEffWeightsvsptB){delete fTrigEffWeightsvsptB;fTrigEffWeightsvsptB=0;} | |
215 | if(fTrigEffWeights){delete fTrigEffWeights;fTrigEffWeights=0;} | |
216 | if(fTrigEffWeightsB){delete fTrigEffWeightsB;fTrigEffWeightsB=0;} | |
217 | if(fZvtxBins) {delete[] fZvtxBins; fZvtxBins=0;} | |
218 | if(fCentBins) {delete[] fCentBins; fCentBins=0;} | |
219 | if(fAODTrackCuts) {delete[] fAODTrackCuts; fAODTrackCuts=0;} | |
220 | if(fTrackCutsNames) {delete[] fTrackCutsNames; fTrackCutsNames=0;} | |
221 | if(fAODvZeroCuts){delete[] fAODvZeroCuts; fAODvZeroCuts=0;} | |
222 | if(fvZeroCutsNames) {delete[] fvZeroCutsNames; fvZeroCutsNames=0;} | |
223 | ||
224 | ||
225 | } | |
226 | //-------------------------------------------------------------------------- | |
227 | Bool_t AliHFAssociatedTrackCuts::IsInAcceptance() | |
228 | { | |
229 | printf("Careful: method AliHFAssociatedTrackCuts::IsInAcceptance is not implemented yet \n"); | |
230 | return kFALSE; | |
231 | } | |
232 | //-------------------------------------------------------------------------- | |
233 | Bool_t AliHFAssociatedTrackCuts::IsHadronSelected(AliAODTrack * track,const AliESDVertex *primary, Double_t magfield) | |
234 | { | |
235 | ||
236 | AliESDtrack esdtrack(track); | |
237 | if(primary){// needed to calculate impact parameters | |
238 | // needed to calculate the impact parameters | |
239 | esdtrack.RelateToVertex(primary,magfield,3.); | |
240 | } | |
241 | // set the TPC cluster info | |
242 | esdtrack.SetTPCClusterMap(track->GetTPCClusterMap()); | |
243 | esdtrack.SetTPCSharedMap(track->GetTPCSharedMap()); | |
244 | esdtrack.SetTPCPointsF(track->GetTPCNclsF()); | |
245 | ||
246 | if(!fESDTrackCuts->IsSelected(&esdtrack)) return kFALSE; | |
247 | ||
248 | if(fBit>-1 && !track->TestFilterBit(fBit)) return kFALSE; // check the filter bit | |
249 | ||
250 | return kTRUE; | |
251 | ||
252 | } | |
253 | ||
254 | //-------------------------------------------------------------------------- | |
255 | Bool_t AliHFAssociatedTrackCuts::CheckHadronKinematic(Double_t pt, Double_t d0) | |
256 | { | |
257 | ||
258 | ||
259 | ||
260 | if(pt < fAODTrackCuts[0]) return kFALSE; | |
261 | if(pt > fAODTrackCuts[1]) return kFALSE; | |
262 | if(d0 < fAODTrackCuts[2]) return kFALSE; | |
263 | if(d0 > fAODTrackCuts[3]) return kFALSE; | |
264 | ||
265 | return kTRUE; | |
266 | ||
267 | ||
268 | } | |
269 | //-------------------------------------------------------------------------- | |
270 | ||
271 | Bool_t AliHFAssociatedTrackCuts::Charge(Short_t charge, AliAODTrack* track) | |
272 | {// charge is the charge to compare to (for example, a daughter of a D meson) | |
273 | ||
274 | if(!fCharge) return kTRUE; // if fCharge is set to 0 (no selection on the charge), returns always true | |
275 | if(track->Charge()!= fCharge*charge) return kFALSE; | |
276 | return kTRUE; | |
277 | } | |
278 | ||
279 | //-------------------------------------------------------------------------- | |
280 | Bool_t AliHFAssociatedTrackCuts::CheckKaonCompatibility(AliAODTrack * track, Bool_t useMc, TClonesArray* mcArray, Int_t method) | |
281 | { | |
282 | Bool_t isKaon = kFALSE; | |
283 | ||
284 | if(useMc) { // on MC | |
285 | Int_t hadLabel = track->GetLabel(); | |
286 | if(hadLabel < 0) return kFALSE; | |
287 | AliAODMCParticle* hadron = dynamic_cast<AliAODMCParticle*>(mcArray->At(hadLabel)); | |
288 | if(hadron){ | |
289 | Int_t pdg = TMath::Abs(hadron->GetPdgCode()); | |
290 | if (pdg == 321) isKaon = kTRUE; | |
291 | } | |
292 | } | |
293 | ||
294 | if(!useMc) { // on DATA | |
295 | switch(method) { | |
296 | case(1): { | |
297 | Bool_t isKTPC=kFALSE; | |
298 | Bool_t isPiTPC=kFALSE; | |
299 | Bool_t isPTPC=kFALSE; | |
300 | Bool_t isKTOF=kFALSE; | |
301 | Bool_t isPiTOF=kFALSE; | |
302 | Bool_t isPTOF=kFALSE; | |
303 | ||
304 | Bool_t KaonHyp = kFALSE; | |
305 | Bool_t PionHyp = kFALSE; | |
306 | Bool_t ProtonHyp = kFALSE; | |
307 | ||
308 | if(fPidObj->CheckStatus(track,"TOF")) { | |
309 | isKTOF=fPidObj->IsKaonRaw(track,"TOF"); | |
310 | isPiTOF=fPidObj->IsPionRaw(track,"TOF"); | |
311 | isPTOF=fPidObj->IsProtonRaw(track,"TOF"); | |
312 | } | |
313 | if(fPidObj->CheckStatus(track,"TPC")){ | |
314 | isKTPC=fPidObj->IsKaonRaw(track,"TPC"); | |
315 | isPiTPC=fPidObj->IsPionRaw(track,"TPC"); | |
316 | isPTPC=fPidObj->IsProtonRaw(track,"TPC"); | |
317 | } | |
318 | ||
319 | if (isKTOF && isKTPC) KaonHyp = kTRUE; | |
320 | if (isPiTOF && isPiTPC) PionHyp = kTRUE; | |
321 | if (isPTOF && isPTPC) ProtonHyp = kTRUE; | |
322 | ||
323 | if(KaonHyp && !PionHyp && !ProtonHyp) isKaon = kTRUE; | |
324 | break; | |
325 | } | |
326 | case(2): { | |
327 | if(fPidObj->MakeRawPid(track,3)>=1) isKaon = kTRUE; | |
328 | break; | |
329 | } | |
330 | } | |
331 | } | |
332 | ||
333 | return isKaon; | |
334 | ||
335 | } | |
336 | //-------------------------------------------------------------------------- | |
337 | Bool_t AliHFAssociatedTrackCuts::IsKZeroSelected(AliAODv0 *vzero, AliAODVertex *vtx1) | |
338 | { | |
339 | ||
340 | if(vzero->DcaV0Daughters()>fAODvZeroCuts[0]) return kFALSE; | |
341 | if(vzero->Chi2V0()>fAODvZeroCuts[1]) return kFALSE; | |
342 | if(vzero->DecayLength(vtx1) < fAODvZeroCuts[2]) return kFALSE; | |
343 | if(vzero->DecayLength(vtx1) > fAODvZeroCuts[3]) return kFALSE; | |
344 | if(vzero->OpenAngleV0() > fAODvZeroCuts[4]) return kFALSE; | |
345 | if(vzero->Pt() < fAODvZeroCuts[5]) return kFALSE; | |
346 | if(TMath::Abs(vzero->Eta()) > fAODvZeroCuts[6]) return kFALSE; | |
347 | ||
348 | ||
349 | return kTRUE; | |
350 | } | |
351 | //-------------------------------------------------------------------------- | |
352 | Bool_t *AliHFAssociatedTrackCuts::IsMCpartFromHF(Int_t label, TClonesArray*mcArray){ | |
353 | // Check origin in MC | |
354 | ||
355 | AliAODMCParticle* mcParticle; | |
356 | Int_t pdgCode = -1; | |
357 | ||
358 | Bool_t isCharmy = kFALSE; | |
359 | Bool_t isBeauty = kFALSE; | |
360 | Bool_t isD = kFALSE; | |
361 | Bool_t isB = kFALSE; | |
362 | ||
363 | Bool_t *originvect = new Bool_t[4]; | |
364 | ||
365 | originvect[0] = kFALSE; | |
366 | originvect[1] = kFALSE; | |
367 | originvect[2] = kFALSE; | |
368 | originvect[3] = kFALSE; | |
369 | ||
370 | if (label<0) return originvect; | |
371 | ||
372 | while(pdgCode!=2212){ // loops back to the collision to check the particle source | |
373 | ||
374 | mcParticle = dynamic_cast<AliAODMCParticle*>(mcArray->At(label)); | |
375 | if(!mcParticle) {AliError("NO MC PARTICLE"); break;} | |
376 | pdgCode = TMath::Abs(mcParticle->GetPdgCode()); | |
377 | ||
378 | label = mcParticle->GetMother(); | |
379 | ||
380 | ||
381 | if((pdgCode>=400 && pdgCode <500) || (pdgCode>=4000 && pdgCode<5000 )) isD = kTRUE; | |
382 | if((pdgCode>=500 && pdgCode <600) || (pdgCode>=5000 && pdgCode<6000 )) {isD = kFALSE; isB = kTRUE;} | |
383 | ||
384 | ||
385 | if(pdgCode == 4) isCharmy = kTRUE; | |
386 | if(pdgCode == 5) {isBeauty = kTRUE; isCharmy = kFALSE;} | |
387 | if(label<0) break; | |
388 | ||
389 | } | |
390 | ||
391 | ||
392 | originvect[0] = isCharmy; | |
393 | originvect[1] = isBeauty; | |
394 | originvect[2] = isD; | |
395 | originvect[3] = isB; | |
396 | ||
397 | ||
398 | return originvect; | |
399 | } | |
400 | ||
401 | //-------------------------------------------------------------------------- | |
402 | Bool_t AliHFAssociatedTrackCuts::InvMassDstarRejection(AliAODRecoDecayHF2Prong* d, AliAODTrack *track, Int_t hypD0) const { | |
403 | // | |
404 | // Calculates invmass of track+D0 and rejects if compatible with D* | |
405 | // (to remove pions from D*) | |
406 | // | |
407 | Double_t nsigma = 3.; | |
408 | ||
409 | Double_t mD0, mD0bar; | |
410 | d->InvMassD0(mD0,mD0bar); | |
411 | ||
412 | Double_t invmassDstar1 = 0, invmassDstar2 = 0; | |
413 | Double_t e1Pi = d->EProng(0,211), e2K = d->EProng(1,321); //hyp 1 (pi,K) - D0 | |
414 | Double_t e1K = d->EProng(0,321), e2Pi = d->EProng(1,211); //hyp 2 (K,pi) - D0bar | |
415 | Double_t psum2 = (d->Px()+track->Px())*(d->Px()+track->Px()) | |
416 | +(d->Py()+track->Py())*(d->Py()+track->Py()) | |
417 | +(d->Pz()+track->Pz())*(d->Pz()+track->Pz()); | |
418 | ||
419 | switch(hypD0) { | |
420 | case 1: | |
421 | invmassDstar1 = TMath::Sqrt(pow(e1Pi+e2K+track->E(0.1396),2.)-psum2); | |
422 | if ((TMath::Abs(invmassDstar1-mD0)-0.14543) < nsigma*800.*pow(10.,-6.)) return kFALSE; | |
423 | break; | |
424 | case 2: | |
425 | invmassDstar2 = TMath::Sqrt(pow(e2Pi+e1K+track->E(0.1396),2.)-psum2); | |
426 | if ((TMath::Abs(invmassDstar2-mD0bar)-0.14543) < nsigma*800.*pow(10.,-6.)) return kFALSE; | |
427 | break; | |
428 | case 3: | |
429 | invmassDstar1 = TMath::Sqrt(pow(e1Pi+e2K+track->E(0.1396),2.)-psum2); | |
430 | invmassDstar2 = TMath::Sqrt(pow(e2Pi+e1K+track->E(0.1396),2.)-psum2); | |
431 | if ((TMath::Abs(invmassDstar1-mD0)-0.14543) < nsigma*800.*pow(10.,-6.)) return kFALSE; | |
432 | if ((TMath::Abs(invmassDstar2-mD0bar)-0.14543) < nsigma*800.*pow(10.,-6.)) return kFALSE; | |
433 | break; | |
434 | } | |
435 | ||
436 | return kTRUE; | |
437 | } | |
438 | //________________________________________________________ | |
439 | void AliHFAssociatedTrackCuts::SetMCEventTypes(Int_t *MCEventTypeArray) | |
440 | // set the array of event types you want to process in MonteCarlo (gluon splitting, pair production etc.) | |
441 | { | |
442 | if(!fMCEventType) fMCEventType = new Int_t[fNofMCEventType]; | |
443 | ||
444 | for(Int_t k=0; k<fNofMCEventType; k++){ | |
445 | fMCEventType[k] = MCEventTypeArray[k]; | |
446 | } | |
447 | return; | |
448 | } | |
449 | ||
450 | //________________________________________________________ | |
451 | void AliHFAssociatedTrackCuts::SetAODTrackCuts(Float_t *cutsarray) | |
452 | { | |
453 | if(!fAODTrackCuts) fAODTrackCuts = new Float_t[fNTrackCuts]; | |
454 | for(Int_t i =0; i<fNTrackCuts; i++){ | |
455 | fAODTrackCuts[i] = cutsarray[i]; | |
456 | } | |
457 | SetTrackCutsNames(); | |
458 | return; | |
459 | } | |
460 | //________________________________________________________ | |
461 | void AliHFAssociatedTrackCuts::SetTrackCutsNames(/*TString *namearray*/){ | |
462 | ||
463 | fTrackCutsNames = new TString[4]; | |
464 | fTrackCutsNames[0]= "associated track:: pt min [GeV/c]................: "; | |
465 | fTrackCutsNames[1]= "associated track:: pt max [GeV/c]................: "; | |
466 | fTrackCutsNames[2]= "associated track:: d0 min [cm]...................: "; | |
467 | fTrackCutsNames[3]= "associated track:: d0 max [cm]...................: "; | |
468 | ||
469 | ||
470 | ||
471 | return; | |
472 | } | |
473 | //-------------------------------------------------------------------------- | |
474 | void AliHFAssociatedTrackCuts::SetAODvZeroCuts(Float_t *cutsarray) | |
475 | { | |
476 | ||
477 | ||
478 | if(!fAODvZeroCuts) fAODvZeroCuts = new Float_t[fNvZeroCuts]; | |
479 | for(Int_t i =0; i<fNvZeroCuts; i++){ | |
480 | fAODvZeroCuts[i] = cutsarray[i]; | |
481 | } | |
482 | SetvZeroCutsNames(); | |
483 | return; | |
484 | } | |
485 | //-------------------------------------------------------------------------- | |
486 | void AliHFAssociatedTrackCuts::SetvZeroCutsNames(/*TString *namearray*/){ | |
487 | ||
488 | fvZeroCutsNames = new TString[7]; | |
489 | fvZeroCutsNames[0] = "vZero:: max DCA between two daughters [cm].......: "; | |
490 | fvZeroCutsNames[1] = "vZero:: max fit Chi Square between two daughters.: "; | |
491 | fvZeroCutsNames[2] = "vZero:: min decay length [cm]....................: "; | |
492 | fvZeroCutsNames[3] = "vZero:: max decay length [cm]....................: "; | |
493 | fvZeroCutsNames[4] = "vZero:: max opening angle between daughters [rad]: "; | |
494 | fvZeroCutsNames[5] = "vZero:: pt min [Gev/c]...........................: "; | |
495 | fvZeroCutsNames[6] = "vZero:: |Eta| range <............................: "; | |
496 | ||
497 | ||
498 | return; | |
499 | } | |
500 | ||
501 | //-------------------------------------------------------------------------- | |
502 | void AliHFAssociatedTrackCuts::SetPidAssociated() | |
503 | { | |
504 | //setting PidResponse | |
505 | if(fPidObj->GetOldPid()==kFALSE && fPidObj->GetPidResponse()==0x0){ | |
506 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
507 | AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler(); | |
508 | AliPIDResponse *pidResp=inputHandler->GetPIDResponse(); | |
509 | fPidObj->SetPidResponse(pidResp); | |
510 | } | |
511 | } | |
512 | //-------------------------------------------------------------------------- | |
513 | ||
514 | void AliHFAssociatedTrackCuts::Print(Option_t *option) const | |
515 | { | |
516 | /// overloaded from TObject: print info | |
517 | if (strcmp(option, "parameters")==0) { | |
518 | PrintPoolParameters(); | |
519 | return; | |
520 | } else if (strcmp(option, "selectedMC")==0) { | |
521 | PrintSelectedMCevents(); | |
522 | return; | |
523 | } | |
524 | PrintAll(); | |
525 | } | |
526 | ||
527 | //-------------------------------------------------------------------------- | |
528 | Int_t AliHFAssociatedTrackCuts::GetPoolBin(Double_t multorcent, Double_t zVtx) const | |
529 | { | |
530 | ||
531 | Int_t poolbin = -1; | |
532 | Int_t centbin = -1; | |
533 | Int_t zvtxbin = -1; | |
534 | ||
535 | ||
536 | if(multorcent <fCentBins[0]) return poolbin; | |
537 | if(zVtx <fZvtxBins[0]) return poolbin; | |
538 | ||
539 | ||
540 | for (Int_t i=0;i<fNCentBins;i++){ | |
541 | if(multorcent<fCentBins[i+1]) { | |
542 | centbin=i; | |
543 | break; | |
544 | } | |
545 | } | |
546 | ||
547 | for (Int_t i=0;i<fNzVtxBins;i++){ | |
548 | if(zVtx<fZvtxBins[i+1]) { | |
549 | zvtxbin=i; | |
550 | break; | |
551 | } | |
552 | } | |
553 | ||
554 | poolbin = centbin + zvtxbin*fNzVtxBins; | |
555 | ||
556 | return poolbin; | |
557 | } | |
558 | //-------------------------------------------------------------------------- | |
559 | void AliHFAssociatedTrackCuts::PrintAll() const | |
560 | { | |
561 | ||
562 | if(fDescription){ | |
563 | printf("================================================="); | |
564 | printf("\nAdditional description\n"); | |
565 | std::cout << fDescription << std::endl; | |
566 | printf("\n"); | |
567 | } | |
568 | printf("\n================================================="); | |
569 | if(fESDTrackCuts){ | |
570 | printf("\nCuts for the associated track: \n \n"); | |
571 | ||
572 | printf("ITS Refit........................................: %s\n",fESDTrackCuts->GetRequireITSRefit() ? "Yes" : "No"); | |
573 | printf("TPC Refit........................................: %s\n",fESDTrackCuts->GetRequireTPCRefit() ? "Yes" : "No"); | |
574 | printf("ITS SA...........................................: %s\n",fESDTrackCuts->GetRequireITSStandAlone() ? "Yes" : "No"); | |
575 | printf("TPC SA...........................................: %s\n",fESDTrackCuts->GetRequireTPCStandAlone() ? "Yes" : "No"); | |
576 | printf("Min number of ITS clusters.......................: %d\n",fESDTrackCuts->GetMinNClustersITS()); | |
577 | printf("Min number of TPC clusters.......................: %d\n",fESDTrackCuts->GetMinNClusterTPC()); | |
578 | Int_t spd = fESDTrackCuts->GetClusterRequirementITS(AliESDtrackCuts::kSPD); | |
579 | if(spd==0) std::cout << "SPD..............................................: kOff" << std::endl; | |
580 | if(spd==1) std::cout << "SPD..............................................: kNone" << std::endl; | |
581 | if(spd==2) std::cout << "SPD..............................................: kAny" << std::endl; | |
582 | if(spd==3) std::cout << "SPD..............................................: kFirst" << std::endl; | |
583 | if(spd==4) std::cout << "SPD..............................................: kOnlyFirst" << std::endl; | |
584 | if(spd==5) std::cout << "SPD..............................................: kSecond" << std::endl; | |
585 | if(spd==6) std::cout << "SPD..............................................: kOnlySecond" << std::endl; | |
586 | if(spd==7) std::cout << "SPD..............................................: kBoth" << std::endl; | |
587 | } | |
588 | else printf("\nNo Cuts for Associated Tracks\n"); | |
589 | std::cout << "Filter Bit.......................................: " << fBit << std::endl; | |
590 | std::cout << "Charge...........................................: " << fCharge << std::endl; | |
591 | ||
592 | if(fAODTrackCuts){ | |
593 | for(Int_t j=0;j<fNTrackCuts;j++){ | |
594 | std::cout << fTrackCutsNames[j] << fAODTrackCuts[j] << std::endl; | |
595 | } | |
596 | } | |
597 | ||
598 | if(fAODvZeroCuts){ | |
599 | printf("\n"); | |
600 | printf("================================================="); | |
601 | printf("\nCuts for the K0 candidates: \n \n"); | |
602 | for(Int_t k=0;k<fNvZeroCuts;k++){ | |
603 | std::cout << fvZeroCutsNames[k] << fAODvZeroCuts[k] << std::endl; | |
604 | } | |
605 | } | |
606 | else printf("\nNo Cuts for the K0 candidates\n"); | |
607 | std::cout << " " << std::endl; | |
608 | PrintPoolParameters(); | |
609 | PrintSelectedMCevents(); | |
610 | ||
611 | } | |
612 | ||
613 | //-------------------------------------------------------------------------- | |
614 | void AliHFAssociatedTrackCuts::PrintPoolParameters() const | |
615 | { | |
616 | printf("================================================="); | |
617 | printf("\nEvent Pool settings: \n \n"); | |
618 | ||
619 | printf("Number of zVtx Bins: %d\n", fNzVtxBins); | |
620 | printf("\nzVtx Bins:\n"); | |
621 | //Double_t zVtxbinLims[fNzVtxBins+1] = fNzVtxBins; | |
622 | for(Int_t k=0; k<fNzVtxBins; k++){ | |
623 | printf("Bin %d..............................................: %.1f - %.1f cm\n", k, fZvtxBins[k], fZvtxBins[k+1]); | |
624 | } | |
625 | printf("\n"); | |
626 | printf("\nNumber of Centrality(multiplicity) Bins: %d\n", fNCentBins); | |
627 | printf("\nCentrality(multiplicity) Bins:\n"); | |
628 | for(Int_t k=0; k<fNCentBins; k++){ | |
629 | printf("Bin %d..............................................: %.1f - %.1f\n", k, fCentBins[k], fCentBins[k+1]); | |
630 | } | |
631 | ||
632 | ||
633 | ||
634 | } | |
635 | //-------------------------------------------------------------------------- | |
636 | ||
637 | Double_t AliHFAssociatedTrackCuts::GetTrackWeight(Double_t pt, Double_t eta,Double_t zvtx){ | |
638 | if(!fEffWeights)return 1.; | |
639 | ||
640 | Int_t bin=fEffWeights->FindBin(pt,eta,zvtx); | |
641 | if(fEffWeights->IsBinUnderflow(bin)||fEffWeights->IsBinOverflow(bin))return 1.; | |
642 | return fEffWeights->GetBinContent(bin); | |
643 | ||
644 | } | |
645 | ||
646 | ||
647 | //-------------------------------------------------------------------------- | |
648 | Double_t AliHFAssociatedTrackCuts::GetTrigWeight(Double_t pt, Double_t mult){ | |
649 | ||
650 | ||
651 | ||
652 | if(fTrigEffWeightsvspt){ | |
653 | Int_t bin=fTrigEffWeightsvspt->FindBin(pt); | |
654 | if(fTrigEffWeightsvspt->IsBinUnderflow(bin)||fTrigEffWeightsvspt->IsBinOverflow(bin))return 1.; | |
655 | return fTrigEffWeightsvspt->GetBinContent(bin); | |
656 | ||
657 | } | |
658 | ||
659 | if(fTrigEffWeights){ | |
660 | Int_t bin=fTrigEffWeights->FindBin(pt,mult); | |
661 | if(fTrigEffWeights->IsBinUnderflow(bin)||fTrigEffWeights->IsBinOverflow(bin))return 1.; | |
662 | return fTrigEffWeights->GetBinContent(bin); | |
663 | ||
664 | } | |
665 | ||
666 | //if(!fTrigEffWeights && !fTrigEffWeightsvspt)return 1.; | |
667 | ||
668 | return 1.; | |
669 | ||
670 | } | |
671 | ||
672 | //-------------------------------------------------------------------------- | |
673 | Double_t AliHFAssociatedTrackCuts::GetTrigWeightB(Double_t pt, Double_t mult){ | |
674 | ||
675 | if(fTrigEffWeightsvsptB){ | |
676 | Int_t bin=fTrigEffWeightsvsptB->FindBin(pt); | |
677 | if(fTrigEffWeightsvsptB->IsBinUnderflow(bin)||fTrigEffWeightsvsptB->IsBinOverflow(bin))return 1.; | |
678 | return fTrigEffWeightsvsptB->GetBinContent(bin); | |
679 | ||
680 | } | |
681 | ||
682 | if(fTrigEffWeightsB){ | |
683 | Int_t bin=fTrigEffWeightsB->FindBin(pt,mult); | |
684 | if(fTrigEffWeightsB->IsBinUnderflow(bin)||fTrigEffWeightsB->IsBinOverflow(bin))return 1.; | |
685 | return fTrigEffWeightsB->GetBinContent(bin); | |
686 | ||
687 | } | |
688 | ||
689 | // if(!fTrigEffWeightsB && !fTrigEffWeightsvsptB)return 1.; | |
690 | return 1; | |
691 | } | |
692 | //-------------------------------------------------------------------------- | |
693 | void AliHFAssociatedTrackCuts::PrintSelectedMCevents() const | |
694 | { | |
695 | printf("\n================================================="); | |
696 | ||
697 | printf("\nSelected MC events: \n \n"); | |
698 | printf("Number of selected events: %d\n",fNofMCEventType); | |
699 | ||
700 | for(Int_t k=0; k<fNofMCEventType; k++){ | |
701 | if(fMCEventType[k]==28) printf("=> Flavour excitation \n"); | |
702 | if(fMCEventType[k]==53) printf("=> Pair creation \n"); | |
703 | if(fMCEventType[k]==68) printf("=> Gluon splitting \n"); | |
704 | } | |
705 | ||
706 | printf("\n"); | |
707 | for(Int_t k=0; k<fNofMCEventType; k++){ | |
708 | printf("MC process code %d \n",fMCEventType[k]); | |
709 | } | |
710 | ||
711 | printf("\n"); | |
712 | ||
713 | ||
714 | ||
715 | ||
716 | } | |
717 | ||
718 |