1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //----------------------------------------------------------------------------
17 // Implementation of the D0toKpi class
19 // Note: the two decay tracks are labelled: 0 (positive track)
22 // Origin: A. Dainese andrea.dainese@pd.infn.it
23 //----------------------------------------------------------------------------
24 #include <Riostream.h>
28 #include <TPaveLabel.h>
31 #include "AliD0toKpi.h"
35 //----------------------------------------------------------------------------
36 AliD0toKpi::AliD0toKpi() {
37 // Default constructor
76 fWgtAD0=fWgtAD0bar=fWgtBD0=fWgtBD0bar=fWgtCD0=fWgtCD0bar=fWgtDD0=fWgtDD0bar=0;
79 //----------------------------------------------------------------------------
80 AliD0toKpi::AliD0toKpi(Int_t ev,Int_t trkNum[2],
81 Double_t v1[3],Double_t v2[3],
83 Double_t mom[6],Double_t d0[2]) {
89 fTrkNum[0] = trkNum[0];
90 fTrkNum[1] = trkNum[1];
122 fWgtAD0=fWgtAD0bar=fWgtBD0=fWgtBD0bar=fWgtCD0=fWgtCD0bar=fWgtDD0=fWgtDD0bar=0;
124 //----------------------------------------------------------------------------
125 AliD0toKpi::~AliD0toKpi() {}
126 //____________________________________________________________________________
127 AliD0toKpi::AliD0toKpi( const AliD0toKpi& d0toKpi):TObject(d0toKpi) {
128 // dummy copy constructor
130 //----------------------------------------------------------------------------
131 void AliD0toKpi::ApplyPID(TString pidScheme) {
133 const char *tofparampbpb = strstr(pidScheme.Data(),"TOFparam_PbPb");
134 const char *tofparampp = strstr(pidScheme.Data(),"TOFparam_pp");
136 if((tofparampbpb || tofparampp) && fPdg[0]==0) {
137 printf("AliD0toKpi::ApplyPID :\n Warning: TOF parameterized PID can be used only for simulation!\n");
142 // tagging of the positive track
143 if(TMath::Abs(fPdg[0])==211 || TMath::Abs(fPdg[0])==13
144 || TMath::Abs(fPdg[0])==11) { // pion,muon,electron
145 fTagPi[0] = LinearInterpolation(PChild(0),kPiBins_PbPb,kPiBinWidth_PbPb,kPiTagPi_PbPb);
146 fTagNid[0] = 1.-fTagPi[0];
150 if(TMath::Abs(fPdg[0])==321) { // kaon
151 fTagKa[0] = LinearInterpolation(PChild(0),kKBins_PbPb,kKBinWidth_PbPb,kKTagK_PbPb);
152 fTagNid[0] = LinearInterpolation(PChild(0),kKBins_PbPb,kKBinWidth_PbPb,kKTagNid_PbPb);
153 if((fTagNid[0]+fTagKa[0])>1.) fTagNid[0] = 1.-fTagKa[0];
154 fTagPi[0] = 1.-fTagNid[0]-fTagKa[0];
157 if(TMath::Abs(fPdg[0])==2212) { // proton
158 fTagPr[0] = LinearInterpolation(PChild(0),kPBins_PbPb,kPBinWidth_PbPb,kPTagP_PbPb);
159 fTagNid[0] = LinearInterpolation(PChild(0),kPBins_PbPb,kPBinWidth_PbPb,kPTagNid_PbPb);
160 if((fTagNid[0]+fTagPr[0])>1.) fTagNid[0] = 1.-fTagPr[0];
161 fTagPi[0] = 1.-fTagNid[0]-fTagPr[0];
164 // tagging of the negative track
165 if(TMath::Abs(fPdg[1])==211 || TMath::Abs(fPdg[1])==13
166 || TMath::Abs(fPdg[1])==11) { // pion,muon,electron
167 fTagPi[1] = LinearInterpolation(PChild(1),kPiBins_PbPb,kPiBinWidth_PbPb,kPiTagPi_PbPb);
168 fTagNid[1] = 1.-fTagPi[1];
172 if(TMath::Abs(fPdg[1])==321) { // kaon
173 fTagKa[1] = LinearInterpolation(PChild(1),kKBins_PbPb,kKBinWidth_PbPb,kKTagK_PbPb);
174 fTagNid[1] = LinearInterpolation(PChild(1),kKBins_PbPb,kKBinWidth_PbPb,kKTagNid_PbPb);
175 if((fTagNid[1]+fTagKa[1])>1.) fTagNid[1] = 1.-fTagKa[1];
176 fTagPi[1] = 1.-fTagNid[1]-fTagKa[1];
179 if(TMath::Abs(fPdg[1])==2212) { // proton
180 fTagPr[1] = LinearInterpolation(PChild(1),kPBins_PbPb,kPBinWidth_PbPb,kPTagP_PbPb);
181 fTagNid[1] = LinearInterpolation(PChild(1),kPBins_PbPb,kPBinWidth_PbPb,kPTagNid_PbPb);
182 if((fTagNid[1]+fTagPr[1])>1.) fTagNid[1] = 1.-fTagPr[1];
183 fTagPi[1] = 1.-fTagNid[1]-fTagPr[1];
190 // tagging of the positive track
191 if(TMath::Abs(fPdg[0])==211 || TMath::Abs(fPdg[0])==13
192 || TMath::Abs(fPdg[0])==11) { // pion,muon,electron
193 fTagPi[0] = LinearInterpolation(PChild(0),kPiBins_pp,kPiBinWidth_pp,kPiTagPi_pp);
194 fTagNid[0] = 1.-fTagPi[0];
198 if(TMath::Abs(fPdg[0])==321) { // kaon
199 fTagKa[0] = LinearInterpolation(PChild(0),kKBins_pp,kKBinWidth_pp,kKTagK_pp);
200 fTagNid[0] = LinearInterpolation(PChild(0),kKBins_pp,kKBinWidth_pp,kKTagNid_pp);
201 if((fTagNid[0]+fTagKa[0])>1.) fTagNid[0] = 1.-fTagKa[0];
202 fTagPi[0] = 1.-fTagNid[0]-fTagKa[0];
205 if(TMath::Abs(fPdg[0])==2212) { // proton
206 fTagPr[0] = LinearInterpolation(PChild(0),kPBins_pp,kPBinWidth_pp,kPTagP_pp);
207 fTagNid[0] = LinearInterpolation(PChild(0),kPBins_pp,kPBinWidth_pp,kPTagNid_pp);
208 if((fTagNid[0]+fTagPr[0])>1.) fTagNid[0] = 1.-fTagPr[0];
209 fTagPi[0] = 1.-fTagNid[0]-fTagPr[0];
212 // tagging of the negative track
213 if(TMath::Abs(fPdg[1])==211 || TMath::Abs(fPdg[1])==13
214 || TMath::Abs(fPdg[1])==11) { // pion,muon,electron
215 fTagPi[1] = LinearInterpolation(PChild(1),kPiBins_pp,kPiBinWidth_pp,kPiTagPi_pp);
216 fTagNid[1] = 1.-fTagPi[1];
220 if(TMath::Abs(fPdg[1])==321) { // kaon
221 fTagKa[1] = LinearInterpolation(PChild(1),kKBins_pp,kKBinWidth_pp,kKTagK_pp);
222 fTagNid[1] = LinearInterpolation(PChild(1),kKBins_pp,kKBinWidth_pp,kKTagNid_pp);
223 if((fTagNid[1]+fTagKa[1])>1.) fTagNid[1] = 1.-fTagKa[1];
224 fTagPi[1] = 1.-fTagNid[1]-fTagKa[1];
227 if(TMath::Abs(fPdg[1])==2212) { // proton
228 fTagPr[1] = LinearInterpolation(PChild(1),kPBins_pp,kPBinWidth_pp,kPTagP_pp);
229 fTagNid[1] = LinearInterpolation(PChild(1),kPBins_pp,kPBinWidth_pp,kPTagNid_pp);
230 if((fTagNid[1]+fTagPr[1])>1.) fTagNid[1] = 1.-fTagPr[1];
231 fTagPi[1] = 1.-fTagNid[1]-fTagPr[1];
238 //----------------------------------------------------------------------------
239 Double_t AliD0toKpi::ChildrenRelAngle() const {
240 // relative angle between K and pi
242 TVector3 mom0(fPx[0],fPy[0],fPz[0]);
243 TVector3 mom1(fPx[1],fPy[1],fPz[1]);
245 Double_t angle = mom0.Angle(mom1);
249 //----------------------------------------------------------------------------
250 void AliD0toKpi::ComputeWgts() {
251 // calculate the weights for PID
254 // assignement of the weights from PID
255 fWgtAD0 = fTagKa[1]*(fTagPi[0]+fTagNid[0]);
256 fWgtAD0bar = fTagKa[0]*(fTagPi[1]+fTagNid[1]);
257 fWgtBD0 = fTagPi[0]*fTagNid[1];
258 fWgtBD0bar = fTagPi[1]*fTagNid[0];
259 fWgtCD0 = fTagNid[0]*fTagNid[1];
260 fWgtCD0bar = fTagNid[0]*fTagNid[1];
261 fWgtDD0 = 1.-fWgtAD0-fWgtBD0-fWgtCD0;
262 fWgtDD0bar = 1.-fWgtAD0bar-fWgtBD0bar-fWgtCD0bar;
265 cerr<<fWgtAD0<<" "<<fWgtAD0bar<<endl;
266 cerr<<fWgtBD0<<" "<<fWgtBD0bar<<endl;
267 cerr<<fWgtCD0<<" "<<fWgtCD0bar<<endl;
269 if(fWgtAD0<0.) cerr<<"AliD0toKpi::ComputeWgts() Negative weight!!!\n";
270 if(fWgtAD0bar<0.) cerr<<"AliD0toKpi::ComputeWgts() Negative weight!!!\n";
271 if(fWgtBD0<0.) cerr<<"AliD0toKpi::ComputeWgts() Negative weight!!!\n";
272 if(fWgtBD0bar<0.) cerr<<"AliD0toKpi::ComputeWgts() Negative weight!!!\n";
273 if(fWgtCD0<0.) cerr<<"AliD0toKpi::ComputeWgts() Negative weight!!!\n";
274 if(fWgtCD0bar<0.) cerr<<"AliD0toKpi::ComputeWgts() Negative weight!!!\n";
279 //----------------------------------------------------------------------------
280 void AliD0toKpi::CorrectWgt4BR(Double_t factor) {
281 // correct weights of background from charm
284 fWgtAD0bar *= factor;
286 fWgtBD0bar *= factor;
288 fWgtCD0bar *= factor;
290 fWgtDD0bar *= factor;
294 //----------------------------------------------------------------------------
295 Double_t AliD0toKpi::CosPointing() const {
296 // cosine of pointing angle in space
298 TVector3 mom(Px(),Py(),Pz());
299 TVector3 flight(fV2x-fV1x,fV2y-fV1y,fV2z-fV1z);
301 Double_t pta = mom.Angle(flight);
303 return TMath::Cos(pta);
305 //----------------------------------------------------------------------------
306 Double_t AliD0toKpi::CosPointingXY() const {
307 // cosine of pointing angle in transverse plane
309 TVector3 momXY(Px(),Py(),0.);
310 TVector3 flightXY(fV2x-fV1x,fV2y-fV1y,0.);
312 Double_t ptaXY = momXY.Angle(flightXY);
314 return TMath::Cos(ptaXY);
316 //----------------------------------------------------------------------------
317 void AliD0toKpi::CosThetaStar(Double_t &ctsD0,Double_t &ctsD0bar) const {
318 // cosine of decay angle in the D0 rest frame
320 Double_t pStar = TMath::Sqrt(TMath::Power(kMD0*kMD0-kMK*kMK-kMPi*kMPi,2.)-4.*kMK*kMK*kMPi*kMPi)/(2.*kMD0);
322 Double_t beta = P()/Energy();
323 Double_t gamma = Energy()/kMD0;
325 ctsD0 = (Ql(1)/gamma-beta*TMath::Sqrt(pStar*pStar+kMK*kMK))/pStar;
326 // if(ctsD0 > 1.) { cerr<<"AliD0toKpi::CosThetaStar: > 1 "<<ctsD0<<"!\n"; }
327 // if(ctsD0 < -1.) { cerr<<"AliD0toKpi::CosThetaStar: < -1 "<<ctsD0<<"!\n"; }
329 ctsD0bar = (Ql(0)/gamma-beta*TMath::Sqrt(pStar*pStar+kMK*kMK))/pStar;
330 // if(ctsD0bar > 1.) { cerr<<"AliD0toKpi::CosThetaStar: > 1 "<<ctsD0bar<<"!\n"; }
331 // if(ctsD0bar < -1.) { cerr<<"AliD0toKpi::CosThetaStar: < -1 "<<ctsD0bar<<"!\n";}
335 //----------------------------------------------------------------------------
336 Double_t AliD0toKpi::Eta() const {
337 // pseudorapidity of the D0
339 Double_t theta = TMath::Pi()/2.-TMath::ATan2(Pz(),Pt());
340 Double_t eta = -TMath::Log(TMath::Tan(theta/2.));
343 //----------------------------------------------------------------------------
344 Double_t AliD0toKpi::EtaChild(Int_t child) const {
345 // pseudorapidity of the decay tracks
347 Double_t theta = TMath::Pi()/2.-TMath::ATan2(fPz[child],PtChild(child));
348 Double_t eta = -TMath::Log(TMath::Tan(theta/2.));
351 //----------------------------------------------------------------------------
352 void AliD0toKpi::GetWgts(Double_t &WgtD0,Double_t &WgtD0bar,TString sample)
354 // returns the weights for pid
356 const char *sampleA = strstr(sample.Data(),"A");
357 const char *sampleB = strstr(sample.Data(),"B");
358 const char *sampleC = strstr(sample.Data(),"C");
359 const char *sampleD = strstr(sample.Data(),"D");
360 const char *sampleABCD = strstr(sample.Data(),"ABCD");
361 const char *sampleABC = strstr(sample.Data(),"ABC");
362 const char *sampleBC = strstr(sample.Data(),"BC");
364 if(sampleA) { WgtD0 = fWgtAD0; WgtD0bar = fWgtAD0bar; }
365 if(sampleB) { WgtD0 = fWgtBD0; WgtD0bar = fWgtBD0bar; }
366 if(sampleC) { WgtD0 = fWgtCD0; WgtD0bar = fWgtCD0bar; }
367 if(sampleD) { WgtD0 = fWgtDD0; WgtD0bar = fWgtDD0bar; }
369 WgtD0 = fWgtAD0+fWgtBD0+fWgtCD0+fWgtDD0;
370 WgtD0bar = fWgtAD0bar+fWgtBD0bar+fWgtCD0bar+fWgtDD0bar;
373 WgtD0 = fWgtAD0+fWgtBD0+fWgtCD0;
374 WgtD0bar = fWgtAD0bar+fWgtBD0bar+fWgtCD0bar;
377 WgtD0 = fWgtBD0+fWgtCD0;
378 WgtD0bar = fWgtBD0bar+fWgtCD0bar;
383 if(fMum[0]==421) WgtD0bar = 0.;
384 if(fMum[0]==-421) WgtD0 = 0.;
389 //----------------------------------------------------------------------------
390 void AliD0toKpi::InvMass(Double_t &mD0,Double_t &mD0bar) const {
391 // invariant mass as D0 and as D0bar
396 energy[1] = TMath::Sqrt(kMK*kMK+PChild(1)*PChild(1));
397 energy[0] = TMath::Sqrt(kMPi*kMPi+PChild(0)*PChild(0));
399 mD0 = TMath::Sqrt((energy[0]+energy[1])*(energy[0]+energy[1])-P()*P());
403 energy[0] = TMath::Sqrt(kMK*kMK+PChild(0)*PChild(0));
404 energy[1] = TMath::Sqrt(kMPi*kMPi+PChild(1)*PChild(1));
406 mD0bar = TMath::Sqrt((energy[0]+energy[1])*(energy[0]+energy[1])-P()*P());
411 //----------------------------------------------------------------------------
412 Double_t AliD0toKpi::Ql(Int_t child) const {
413 // longitudinal momentum of decay tracks w.r.t. to D0 momentum
416 TVector3 mom(fPx[child],fPy[child],fPz[child]);
417 TVector3 momD(Px(),Py(),Pz());
419 qL = mom.Dot(momD)/momD.Mag();
423 //----------------------------------------------------------------------------
424 Double_t AliD0toKpi::Qt() const {
425 // transverse momentum of decay tracks w.r.t. to D0 momentum
427 TVector3 mom0(fPx[0],fPy[0],fPz[0]);
428 TVector3 momD(Px(),Py(),Pz());
430 return mom0.Perp(momD);
432 //----------------------------------------------------------------------------
433 Bool_t AliD0toKpi::Select(const Double_t* cuts,Int_t& okD0,Int_t& okD0bar)
436 // This function compares the D0 with a set of cuts:
438 // cuts[0] = inv. mass half width [GeV]
439 // cuts[1] = dca [micron]
440 // cuts[2] = cosThetaStar
441 // cuts[3] = pTK [GeV/c]
442 // cuts[4] = pTPi [GeV/c]
443 // cuts[5] = d0K [micron] upper limit!
444 // cuts[6] = d0Pi [micron] upper limit!
445 // cuts[7] = d0d0 [micron^2]
446 // cuts[8] = cosThetaPoint
448 // If the D0/D0bar doesn't pass the cuts it sets the weights to 0
449 // If neither D0 nor D0bar pass the cuts return kFALSE
451 Double_t mD0,mD0bar,ctsD0,ctsD0bar;
454 if(PtChild(1) < cuts[3] || PtChild(0) < cuts[4]) okD0 = 0;
455 if(PtChild(0) < cuts[3] || PtChild(1) < cuts[4]) okD0bar = 0;
456 if(!okD0 && !okD0bar) return kFALSE;
458 if(TMath::Abs(Getd0Child(1)) > cuts[5] ||
459 TMath::Abs(Getd0Child(0)) > cuts[6]) okD0 = 0;
460 if(TMath::Abs(Getd0Child(0)) > cuts[6] ||
461 TMath::Abs(Getd0Child(1)) > cuts[5]) okD0bar = 0;
462 if(!okD0 && !okD0bar) return kFALSE;
464 if(GetDCA() > cuts[1]) { okD0 = okD0bar = 0; return kFALSE; }
467 if(TMath::Abs(mD0-kMD0) > cuts[0]) okD0 = 0;
468 if(TMath::Abs(mD0bar-kMD0) > cuts[0]) okD0bar = 0;
469 if(!okD0 && !okD0bar) return kFALSE;
471 CosThetaStar(ctsD0,ctsD0bar);
472 if(TMath::Abs(ctsD0) > cuts[2]) okD0 = 0;
473 if(TMath::Abs(ctsD0bar) > cuts[2]) okD0bar = 0;
474 if(!okD0 && !okD0bar) return kFALSE;
476 if(ProdImpParams() > cuts[7]) { okD0 = okD0bar = 0; return kFALSE; }
478 if(CosPointing() < cuts[8]) { okD0 = okD0bar = 0; return kFALSE; }
482 //-----------------------------------------------------------------------------
483 void AliD0toKpi::SetPIDresponse(Double_t resp0[5],Double_t resp1[5]) {
484 // Set combined PID detector response probabilities
486 fPIDrespEl[0] = resp0[0];
487 fPIDrespEl[1] = resp1[0];
488 fPIDrespMu[0] = resp0[1];
489 fPIDrespMu[1] = resp1[1];
490 fPIDrespPi[0] = resp0[2];
491 fPIDrespPi[1] = resp1[2];
492 fPIDrespKa[0] = resp0[3];
493 fPIDrespKa[1] = resp1[3];
494 fPIDrespPr[0] = resp0[4];
495 fPIDrespPr[1] = resp1[4];
499 //-----------------------------------------------------------------------------
500 void AliD0toKpi::DrawPIDinTOF(TString pidScheme) const {
501 // Draw parameterized PID probabilities in TOF
503 const char *tofparampbpb = strstr(pidScheme.Data(),"TOFparam_PbPb");
504 const char *tofparampp = strstr(pidScheme.Data(),"TOFparam_pp");
506 TH2F* framePi = new TH2F("framePi","Tag probabilities for PIONS",2,0,2.5,2,0,1);
507 framePi->SetXTitle("p [GeV/c]");
508 framePi->SetStats(0);
509 TH2F* frameK = new TH2F("frameK","Tag probabilities for KAONS",2,0,2.5,2,0,1);
510 frameK->SetXTitle("p [GeV/c]");
512 TH2F* frameP = new TH2F("frameP","Tag probabilities for PROTONS",2,0,4.5,2,0,1);
513 frameP->SetXTitle("p [GeV/c]");
516 TH1F* hPiPi = new TH1F("hPiPi","Tag probabilities for PIONS",kPiBins_PbPb,0,2.5);
517 TH1F* hPiNid = new TH1F("hPiNid","Tag probabilities for PIONS",kPiBins_PbPb,0,2.5);
519 TH1F* hKK = new TH1F("hKK","Tag probabilities for KAONS",kKBins_PbPb,0,2.5);
520 TH1F* hKNid = new TH1F("hKNid","Tag probabilities for KAONS",kKBins_PbPb,0,2.5);
521 TH1F* hKPi = new TH1F("hKPi","Tag probabilities for KAONS",kKBins_PbPb,0,2.5);
523 TH1F* hPP = new TH1F("hPP","Tag probabilities for PROTONS",kPBins_PbPb,0,4.5);
524 TH1F* hPNid = new TH1F("hPNid","Tag probabilities for PROTONS",kPBins_PbPb,0,4.5);
525 TH1F* hPPi = new TH1F("hPPi","Tag probabilities for PROTONS",kPBins_PbPb,0,4.5);
530 for(Int_t i=1; i<=kPiBins_PbPb; i++) {
531 hPiPi->SetBinContent(i,kPiTagPi_PbPb[i-1]);
532 hPiNid->SetBinContent(i,kPiTagPi_PbPb[i-1]+kPiTagNid_PbPb[i-1]);
534 hKK->SetBinContent(i,kKTagK_PbPb[i-1]);
535 hKPi->SetBinContent(i,kKTagK_PbPb[i-1]+kKTagPi_PbPb[i-1]);
536 hKNid->SetBinContent(i,kKTagK_PbPb[i-1]+kKTagPi_PbPb[i-1]+kKTagNid_PbPb[i-1]);
538 for(Int_t i=1; i<=kPBins_PbPb; i++) {
539 hPP->SetBinContent(i,kPTagP_PbPb[i-1]);
540 hPPi->SetBinContent(i,kPTagP_PbPb[i-1]+kPTagPi_PbPb[i-1]);
541 hPNid->SetBinContent(i,kPTagP_PbPb[i-1]+kPTagPi_PbPb[i-1]+kPTagNid_PbPb[i-1]);
544 } else if(tofparampp) {
546 for(Int_t i=1; i<=kPiBins_pp; i++) {
547 hPiPi->SetBinContent(i,kPiTagPi_pp[i-1]);
548 hPiNid->SetBinContent(i,kPiTagPi_pp[i-1]+kPiTagNid_pp[i-1]);
550 hKK->SetBinContent(i,kKTagK_pp[i-1]);
551 hKPi->SetBinContent(i,kKTagK_pp[i-1]+kKTagPi_pp[i-1]);
552 hKNid->SetBinContent(i,kKTagK_pp[i-1]+kKTagPi_pp[i-1]+kKTagNid_pp[i-1]);
554 for(Int_t i=1; i<=kPBins_pp; i++) {
555 hPP->SetBinContent(i,kPTagP_pp[i-1]);
556 hPPi->SetBinContent(i,kPTagP_pp[i-1]+kPTagPi_pp[i-1]);
557 hPNid->SetBinContent(i,kPTagP_pp[i-1]+kPTagPi_pp[i-1]+kPTagNid_pp[i-1]);
563 TCanvas* c = new TCanvas("c","Parameterized PID in TOF",0,0,1000,400);
567 hPiNid->SetFillColor(18); hPiNid->Draw("same");
568 hPiPi->SetFillColor(4); hPiPi->Draw("same");
569 TPaveLabel* pav1 = new TPaveLabel(1,.2,1.4,.3,"#pi");
570 pav1->SetBorderSize(0);
572 TPaveLabel* pav2 = new TPaveLabel(1,.8,1.8,.9,"non-id");
573 pav2->SetBorderSize(0);
578 hKNid->SetFillColor(18); hKNid->Draw("same");
579 hKPi->SetFillColor(4); hKPi->Draw("same");
580 hKK->SetFillColor(7); hKK->Draw("same");
581 TPaveLabel* pav3 = new TPaveLabel(1,.2,1.5,.3,"K");
582 pav3->SetBorderSize(0);
584 TPaveLabel* pav4 = new TPaveLabel(1,.8,1.8,.9,"non-id");
585 pav4->SetBorderSize(0);
587 TPaveLabel* pav5 = new TPaveLabel(.4,.5,.8,.6,"#pi");
588 pav5->SetBorderSize(0);
593 hPNid->SetFillColor(18); hPNid->Draw("same");
594 hPPi->SetFillColor(4); hPPi->Draw("same");
595 hPP->SetFillColor(3); hPP->Draw("same");
596 TPaveLabel* pav6 = new TPaveLabel(1,.2,1.5,.3,"p");
597 pav6->SetBorderSize(0);
599 TPaveLabel* pav7 = new TPaveLabel(1,.8,2.6,.9,"non-id");
600 pav7->SetBorderSize(0);
602 TPaveLabel* pav8 = new TPaveLabel(.2,.5,1,.6,"#pi");
603 pav8->SetBorderSize(0);
609 //----------------------------------------------------------------------------
610 Double_t AliD0toKpi::LinearInterpolation(Double_t p,Int_t nBins,Double_t Bin,
611 const Double_t *values) const {
612 // a linear interpolation method
619 } else if(p>=(nBins-0.5)*Bin) {
620 slope = (2*values[nBins-1]-values[nBins-2]-values[nBins-3])/Bin/2;
621 value = values[nBins-2]+slope*(p-Bin*(nBins-1.5));
623 for(Int_t i=0; i<nBins; i++) {
625 slope = (values[i]-values[i-1])/Bin;
626 value = values[i-1]+slope*(p-Bin*(i-0.5));
632 if(value<0.) value=0.;
633 if(value>1.) value=1.;
637 //----------------------------------------------------------------------------
645 //____________________________________________________________________________
646 void AliD0toKpi::SetPtWgts4pp() {
647 // Correct pt distribution in order to reproduce MNR pt slope
648 // (for pp generated with PYTHIA min. bias)
650 if(TMath::Abs(fMum[0]) != 421 && TMath::Abs(fMum[1]) != 421 &&
651 TMath::Abs(fMum[0]) != 411 && TMath::Abs(fMum[1]) != 411) return;
654 ptWgt = 2.05-0.47*Pt()+0.02*Pt()*Pt();
655 if(Pt() >= 5.) ptWgt = 0.56*TMath::Exp(-0.12*Pt());
668 //____________________________________________________________________________