9 #include "TDatabasePDG.h"
10 #include "AliRunLoader.h"
17 #include "TLinearFitter.h"
19 #include "TTreeStream.h"
25 #include "AliTracker.h"
27 #include "AliESDtrack.h"
28 #include "AliESDfriend.h"
29 #include "AliESDfriendTrack.h"
30 #include "AliTPCseed.h"
31 #include "AliTPCclusterMI.h"
33 #include "AliKFParticle.h"
34 #include "AliKFVertex.h"
36 #include "AliTrackPointArray.h"
38 #include "AliTPCcalibV0.h"
45 ClassImp(AliTPCcalibV0)
48 AliTPCcalibV0::AliTPCcalibV0() :
64 G__SetCatchException(0);
65 fDebugStream = new TTreeSRedirector("V0debug.root");
66 fPdg = new TDatabasePDG;
69 // create output histograms
70 fTPCdEdx = new TH2F("TPCdEdX", "dE/dX; BetaGamma; TPC signal (a.u.)", 1000, 0.1, 10000, 300, 0, 300);
72 fTPCdEdxPi = new TH2F("TPCdEdXPi","dE/dX; BetaGamma; TPC signal (a.u.)", 1000, 0.1, 10000, 300, 0, 300);
73 fTPCdEdxEl = new TH2F("TPCdEdXEl","dE/dX; BetaGamma; TPC signal (a.u.)", 1000, 0.1, 10000, 300, 0, 300);
74 fTPCdEdxP = new TH2F("TPCdEdXP", "dE/dX; BetaGamma; TPC signal (a.u.)", 1000, 0.1, 10000, 300, 0, 300);
79 AliTPCcalibV0::~AliTPCcalibV0(){
88 void AliTPCcalibV0::ProofSlaveBegin(TList * output)
90 // Called on PROOF - fill output list
94 void AliTPCcalibV0::ProcessESD(AliESD *esd, AliStack *stack){
99 AliKFParticle::SetField(esd->GetMagneticField());
109 void AliTPCcalibV0::MakeMC(){
112 // 1. Select interesting particles
113 // 2. Assign the recosntructed particles
115 //1. Select interesting particles
116 const Float_t kMinP = 0.2;
117 const Float_t kMinPt = 0.1;
118 const Float_t kMaxR = 0.5;
119 const Float_t kMaxTan = 1.2;
120 const Float_t kMaxRad = 150;
122 if (!fParticles) fParticles = new TObjArray;
125 Int_t entries = fStack->GetNtrack();
126 for (Int_t ipart=0; ipart<entries; ipart++){
127 part = fStack->Particle(ipart);
129 if (part->P()<kMinP) continue;
130 if (part->R()>kMaxR) continue;
131 if (TMath::Abs(TMath::Tan(part->Theta()-TMath::Pi()*0.5))>kMaxTan) continue;
132 Bool_t isInteresting = kFALSE;
133 if (part->GetPdgCode()==22) isInteresting =kTRUE;
134 if (part->GetPdgCode()==310) isInteresting =kTRUE;
135 if (part->GetPdgCode()==111) isInteresting =kTRUE;
136 if (TMath::Abs(part->GetPdgCode()==3122)) isInteresting =kTRUE;
139 if (!isInteresting) continue;
140 fParticles->AddLast(new TParticle(*part));
142 if (fParticles->GetEntries()<1) {
148 Int_t sentries=fParticles->GetEntries();;
149 for (Int_t ipart=0; ipart<sentries; ipart++){
150 TParticle *part = (TParticle*)fParticles->At(ipart);
156 Int_t id0 = part->GetDaughter(0);
157 Int_t id1 = part->GetDaughter(1);
158 if (id0>=fStack->GetNtrack() ) id0*=-1;
159 if (id1>=fStack->GetNtrack() ) id1*=-1;
160 Bool_t findable = kTRUE;
161 if (id0<0 || id1<0) findable = kFALSE;
164 p0 = fStack->Particle(id0);
165 if (p0->R()>kMaxRad) findable = kFALSE;
166 if (p0->Pt()<kMinPt) findable = kFALSE;
167 if (p0->Vz()>250) findable= kFALSE;
168 if (TMath::Abs(TMath::Tan(p0->Theta()-TMath::Pi()*0.5))>2) findable=kFALSE;
169 if (fPdg->GetParticle(p0->GetPdgCode())==0) findable =kFALSE;
171 if (fPdg->GetParticle(p0->GetPdgCode())->Charge()==0) charge++;
173 p1 = fStack->Particle(id1);
174 if (p1->R()>kMaxRad) findable = kFALSE;
175 if (p1->Pt()<kMinPt) findable = kFALSE;
176 if (TMath::Abs(p1->Vz())>250) findable= kFALSE;
177 if (TMath::Abs(TMath::Tan(p1->Theta()-TMath::Pi()*0.5))>2) findable=kFALSE;
178 if (fPdg->GetParticle(p1->GetPdgCode())==0) findable = kFALSE;
180 if (fPdg->GetParticle(p1->GetPdgCode())->Charge()==0) charge++;
183 // (*fDebugStream)<<"MC0"<<
185 // "findable="<<findable<<
189 if (!findable) continue;
190 Float_t minpt = TMath::Min(p0->Pt(), p1->Pt());
195 AliKFVertex primVtx(*(fESD->GetPrimaryVertex()));
196 for (Int_t ivertex=0; ivertex<fESD->GetNumberOfV0s(); ivertex++){
197 AliESDv0 * v0 = fESD->GetV0(ivertex);
198 // select coresponding track
199 AliESDtrack * trackN = fESD->GetTrack(v0->GetIndex(0));
200 if (TMath::Abs(trackN->GetLabel())!=id0 && TMath::Abs(trackN->GetLabel())!=id1) continue;
201 AliESDtrack * trackP = fESD->GetTrack(v0->GetIndex(1));
202 if (TMath::Abs(trackP->GetLabel())!=id0 && TMath::Abs(trackP->GetLabel())!=id1) continue;
203 TParticle *pn = fStack->Particle(TMath::Abs(trackN->GetLabel()));
204 TParticle *pp = fStack->Particle(TMath::Abs(trackP->GetLabel()));
207 if ( v0->GetOnFlyStatus()) nnew++;
208 if (!v0->GetOnFlyStatus()) nold++;
209 if (part->GetPdgCode()==22 && TMath::Abs(pn->GetPdgCode())==11 && TMath::Abs(pp->GetPdgCode())==11)
211 if (part->GetPdgCode()==310 && TMath::Abs(pn->GetPdgCode())==211 && TMath::Abs(pp->GetPdgCode())==211)
213 if (part->GetPdgCode()==3122){
214 if (TMath::Abs(pn->GetPdgCode())==210 ) type=2;
217 AliKFParticle *v0kf = Fit(primVtx,v0,pn->GetPdgCode(),pp->GetPdgCode());
218 v0kf->SetProductionVertex( primVtx );
219 AliKFParticle *v0kfc = Fit(primVtx,v0,pn->GetPdgCode(),pp->GetPdgCode());
220 v0kfc->SetProductionVertex( primVtx );
221 v0kfc->SetMassConstraint(fPdg->GetParticle(part->GetPdgCode())->Mass());
222 Float_t chi2 = v0kf->GetChi2();
223 Float_t chi2C = v0kf->GetChi2();
226 (*fDebugStream)<<"MCRC"<<
248 (*fDebugStream)<<"MC"<<
261 fParticles->Delete();
267 void AliTPCcalibV0::MakeV0s(){
271 const Int_t kMinCluster=40;
272 const Float_t kMinR =0;
273 if (! fV0s) fV0s = new TObjArray(10);
278 for (Int_t ivertex=0; ivertex<fESD->GetNumberOfV0s(); ivertex++){
279 AliESDv0 * v0 = fESD->GetV0(ivertex);
280 if (v0->GetOnFlyStatus()) continue;
288 for (Int_t ivertex=0; ivertex<fESD->GetNumberOfV0s(); ivertex++){
289 AliESDv0 * v0 = fESD->GetV0(ivertex);
290 if (!v0->GetOnFlyStatus()) continue;
299 Int_t ntracks = fESD->GetNumberOfTracks();
300 for (Int_t itrack0=0; itrack0<ntracks; itrack0++){
301 AliESDtrack * track0 = fESD->GetTrack(itrack0);
302 if (track0->GetSign()>0) continue;
303 if ( track0->GetTPCNcls()<kMinCluster) continue;
304 if (track0->GetKinkIndex(0)>0) continue;
306 for (Int_t itrack1=0; itrack1<ntracks; itrack1++){
307 AliESDtrack * track1 = fESD->GetTrack(itrack1);
308 if (track1->GetSign()<0) continue;
309 if ( track1->GetTPCNcls()<kMinCluster) continue;
310 if (track1->GetKinkIndex(0)>0) continue;
312 // AliExternalTrackParam param0(*track0);
313 // AliExternalTrackParam param1(*track1);
315 vertex.SetParamN(*track0);
316 vertex.SetParamP(*track1);
318 xyz[0] = fESD->GetPrimaryVertex()->GetXv();
319 xyz[1] = fESD->GetPrimaryVertex()->GetYv();
320 xyz[2] = fESD->GetPrimaryVertex()->GetZv();
322 if (vertex.GetRr()<kMinR) continue;
323 if (vertex.GetDcaV0Daughters()>1.) continue;
324 if (vertex.GetDcaV0Daughters()>0.3*vertex.GetRr()) continue;
325 // if (vertex.GetPointAngle()<0.9) continue;
326 vertex.SetIndex(0,itrack0);
327 vertex.SetIndex(1,itrack1);
328 fV0s->AddLast(new AliV0(vertex));
332 for (Int_t i=0;i<fV0s->GetEntries(); i++) delete fV0s->At(i);
341 // void AliTPCcalibV0::ProcessV0(Int_t ftype){
344 // const Double_t ktimeK0 = 2.684;
345 // const Double_t ktimeLambda = 7.89;
348 // if (! fGammas) fGammas = new TObjArray(10);
350 // Int_t nV0s = fV0s->GetEntries();
351 // if (nV0s==0) return;
352 // AliKFVertex primVtx(*(fESD->GetPrimaryVertex()));
354 // for (Int_t ivertex=0; ivertex<nV0s; ivertex++){
355 // AliESDv0 * v0 = (AliESDv0*)fV0s->At(ivertex);
356 // AliESDtrack * trackN = fESD->GetTrack(v0->GetIndex(0));
357 // AliESDtrack * trackP = fESD->GetTrack(v0->GetIndex(1));
361 // AliKFParticle *v0K0 = Fit(primVtx,v0,211,211);
362 // AliKFParticle *v0Gamma = Fit(primVtx,v0,11,-11);
363 // AliKFParticle *v0Lambda42 = Fit(primVtx,v0,2212,211);
364 // AliKFParticle *v0Lambda24 = Fit(primVtx,v0,211,2212);
365 // //Set production vertex
366 // v0K0->SetProductionVertex( primVtx );
367 // v0Gamma->SetProductionVertex( primVtx );
368 // v0Lambda42->SetProductionVertex( primVtx );
369 // v0Lambda24->SetProductionVertex( primVtx );
370 // Double_t massK0, massGamma, massLambda42,massLambda24, massSigma;
371 // v0K0->GetMass( massK0,massSigma);
372 // v0Gamma->GetMass( massGamma,massSigma);
373 // v0Lambda42->GetMass( massLambda42,massSigma);
374 // v0Lambda24->GetMass( massLambda24,massSigma);
375 // Float_t chi2K0 = v0K0->GetChi2()/v0K0->GetNDF();
376 // Float_t chi2Gamma = v0Gamma->GetChi2()/v0Gamma->GetNDF();
377 // Float_t chi2Lambda42 = v0Lambda42->GetChi2()/v0Lambda42->GetNDF();
378 // Float_t chi2Lambda24 = v0Lambda24->GetChi2()/v0Lambda24->GetNDF();
380 // // Mass Contrained params
382 // AliKFParticle *v0K0C = Fit(primVtx,v0,211,211);
383 // AliKFParticle *v0GammaC = Fit(primVtx,v0,11,-11);
384 // AliKFParticle *v0Lambda42C = Fit(primVtx,v0,2212,211);
385 // AliKFParticle *v0Lambda24C = Fit(primVtx,v0,211,2212);
387 // v0K0C->SetProductionVertex( primVtx );
388 // v0GammaC->SetProductionVertex( primVtx );
389 // v0Lambda42C->SetProductionVertex( primVtx );
390 // v0Lambda24C->SetProductionVertex( primVtx );
392 // v0K0C->SetMassConstraint(fPdg->GetParticle(310)->Mass());
393 // v0GammaC->SetMassConstraint(0);
394 // v0Lambda42C->SetMassConstraint(fPdg->GetParticle(3122)->Mass());
395 // v0Lambda24C->SetMassConstraint(fPdg->GetParticle(-3122)->Mass());
397 // Double_t timeK0, sigmaTimeK0;
398 // Double_t timeLambda42, sigmaTimeLambda42;
399 // Double_t timeLambda24, sigmaTimeLambda24;
400 // v0K0C->GetLifeTime(timeK0, sigmaTimeK0);
401 // //v0K0Gamma->GetLifeTime(timeK0, sigmaTimeK0);
402 // v0Lambda42C->GetLifeTime(timeLambda42, sigmaTimeLambda42);
403 // v0Lambda24C->GetLifeTime(timeLambda24, sigmaTimeLambda24);
407 // Float_t chi2K0C = v0K0C->GetChi2()/v0K0C->GetNDF();
408 // if (chi2K0C<0) chi2K0C=100;
409 // Float_t chi2GammaC = v0GammaC->GetChi2()/v0GammaC->GetNDF();
410 // if (chi2GammaC<0) chi2GammaC=100;
411 // Float_t chi2Lambda42C = v0Lambda42C->GetChi2()/v0Lambda42C->GetNDF();
412 // if (chi2Lambda42C<0) chi2Lambda42C=100;
413 // Float_t chi2Lambda24C = v0Lambda24C->GetChi2()/v0Lambda24C->GetNDF();
414 // if (chi2Lambda24C<0) chi2Lambda24C=100;
416 // Float_t minChi2C=99;
418 // if (chi2K0C<minChi2C) { minChi2C= chi2K0C; type=0;}
419 // if (chi2GammaC<minChi2C) { minChi2C= chi2GammaC; type=1;}
420 // if (chi2Lambda42C<minChi2C) { minChi2C= chi2Lambda42C; type=2;}
421 // if (chi2Lambda24C<minChi2C) { minChi2C= chi2Lambda24C; type=3;}
422 // Float_t minChi2=99;
424 // if (chi2K0<minChi2) { minChi2= chi2K0; type0=0;}
425 // if (chi2Gamma<minChi2) { minChi2= chi2Gamma; type0=1;}
426 // if (chi2Lambda42<minChi2) { minChi2= chi2Lambda42; type0=2;}
427 // if (chi2Lambda24<minChi2) { minChi2= chi2Lambda24; type0=3;}
428 // Float_t betaGammaP = trackN->GetP()/fPdg->GetParticle(-2212)->Mass();
429 // Float_t betaGammaPi = trackN->GetP()/fPdg->GetParticle(-211)->Mass();
430 // Float_t betaGammaEl = trackN->GetP()/fPdg->GetParticle(11)->Mass();
431 // Float_t dedxTeorP = TPCBetheBloch(betaGammaP);
432 // Float_t dedxTeorPi = TPCBetheBloch(betaGammaPi);;
433 // Float_t dedxTeorEl = TPCBetheBloch(betaGammaEl);;
436 // if (minChi2>50) continue;
437 // (*fDebugStream)<<"V0"<<
440 // "trackN.="<<trackN<<
441 // "trackP.="<<trackP<<
443 // "dedxTeorP="<<dedxTeorP<<
444 // "dedxTeorPi="<<dedxTeorPi<<
445 // "dedxTeorEl="<<dedxTeorEl<<
448 // "chi2C="<<minChi2C<<
450 // "v0Gamma.="<<v0Gamma<<
451 // "v0Lambda42.="<<v0Lambda42<<
452 // "v0Lambda24.="<<v0Lambda24<<
454 // "chi20K0.="<<chi2K0<<
455 // "chi2Gamma.="<<chi2Gamma<<
456 // "chi2Lambda42.="<<chi2Lambda42<<
457 // "chi2Lambda24.="<<chi2Lambda24<<
459 // "chi20K0c.="<<chi2K0C<<
460 // "chi2Gammac.="<<chi2GammaC<<
461 // "chi2Lambda42c.="<<chi2Lambda42C<<
462 // "chi2Lambda24c.="<<chi2Lambda24C<<
464 // "v0K0C.="<<v0K0C<<
465 // "v0GammaC.="<<v0GammaC<<
466 // "v0Lambda42C.="<<v0Lambda42C<<
467 // "v0Lambda24C.="<<v0Lambda24C<<
469 // "massK0="<<massK0<<
470 // "massGamma="<<massGamma<<
471 // "massLambda42="<<massLambda42<<
472 // "massLambda24="<<massLambda24<<
474 // "timeK0="<<timeK0<<
475 // "timeLambda42="<<timeLambda42<<
476 // "timeLambda24="<<timeLambda24<<
478 // if (type==1) fGammas->AddLast(v0);
484 // delete v0Lambda42;
485 // delete v0Lambda24;
488 // delete v0Lambda42C;
489 // delete v0Lambda24C;
497 void AliTPCcalibV0::ProcessV0(Int_t ftype){
501 if (! fGammas) fGammas = new TObjArray(10);
503 Int_t nV0s = fV0s->GetEntries();
505 AliKFVertex primVtx(*(fESD->GetPrimaryVertex()));
507 for (Int_t ivertex=0; ivertex<nV0s; ivertex++){
508 AliESDv0 * v0 = (AliESDv0*)fV0s->At(ivertex);
509 AliESDtrack * trackN = fESD->GetTrack(v0->GetIndex(0)); // negative track
510 AliESDtrack * trackP = fESD->GetTrack(v0->GetIndex(1)); // positive track
512 const AliExternalTrackParam * paramInNeg = trackN->GetInnerParam();
513 const AliExternalTrackParam * paramInPos = trackP->GetInnerParam();
515 if (!paramInPos) continue; // in case the inner paramters do not exist
516 if (!paramInNeg) continue;
520 AliKFParticle *v0K0 = Fit(primVtx,v0,-211,211);
521 AliKFParticle *v0Gamma = Fit(primVtx,v0,11,-11);
522 AliKFParticle *v0Lambda42 = Fit(primVtx,v0,-2212,211);
523 AliKFParticle *v0Lambda24 = Fit(primVtx,v0,-211,2212);
524 //Set production vertex
525 v0K0->SetProductionVertex( primVtx );
526 v0Gamma->SetProductionVertex( primVtx );
527 v0Lambda42->SetProductionVertex( primVtx );
528 v0Lambda24->SetProductionVertex( primVtx );
529 Double_t massK0, massGamma, massLambda42,massLambda24, massSigma;
530 v0K0->GetMass( massK0,massSigma);
531 v0Gamma->GetMass( massGamma,massSigma);
532 v0Lambda42->GetMass( massLambda42,massSigma);
533 v0Lambda24->GetMass( massLambda24,massSigma);
534 Float_t chi2K0 = v0K0->GetChi2()/v0K0->GetNDF();
535 Float_t chi2Gamma = v0Gamma->GetChi2()/v0Gamma->GetNDF();
536 Float_t chi2Lambda42 = v0Lambda42->GetChi2()/v0Lambda42->GetNDF();
537 Float_t chi2Lambda24 = v0Lambda24->GetChi2()/v0Lambda24->GetNDF();
539 // Mass Contrained params
541 AliKFParticle *v0K0C = Fit(primVtx,v0,-211,211);
542 AliKFParticle *v0GammaC = Fit(primVtx,v0,11,-11);
543 AliKFParticle *v0Lambda42C = Fit(primVtx,v0,-2212,211); //lambdaBar
544 AliKFParticle *v0Lambda24C = Fit(primVtx,v0,-211,2212); //lambda
546 v0K0C->SetProductionVertex( primVtx );
547 v0GammaC->SetProductionVertex( primVtx );
548 v0Lambda42C->SetProductionVertex( primVtx );
549 v0Lambda24C->SetProductionVertex( primVtx );
551 v0K0C->SetMassConstraint(fPdg->GetParticle(310)->Mass());
552 v0GammaC->SetMassConstraint(0);
553 v0Lambda42C->SetMassConstraint(fPdg->GetParticle(-3122)->Mass());
554 v0Lambda24C->SetMassConstraint(fPdg->GetParticle(3122)->Mass());
556 Double_t timeK0, sigmaTimeK0;
557 Double_t timeLambda42, sigmaTimeLambda42;
558 Double_t timeLambda24, sigmaTimeLambda24;
559 v0K0C->GetLifeTime(timeK0, sigmaTimeK0);
560 //v0K0Gamma->GetLifeTime(timeK0, sigmaTimeK0);
561 v0Lambda42C->GetLifeTime(timeLambda42, sigmaTimeLambda42);
562 v0Lambda24C->GetLifeTime(timeLambda24, sigmaTimeLambda24);
566 Float_t chi2K0C = v0K0C->GetChi2()/v0K0C->GetNDF();
567 if (chi2K0C<0) chi2K0C=100;
568 Float_t chi2GammaC = v0GammaC->GetChi2()/v0GammaC->GetNDF();
569 if (chi2GammaC<0) chi2GammaC=100;
570 Float_t chi2Lambda42C = v0Lambda42C->GetChi2()/v0Lambda42C->GetNDF();
571 if (chi2Lambda42C<0) chi2Lambda42C=100;
572 Float_t chi2Lambda24C = v0Lambda24C->GetChi2()/v0Lambda24C->GetNDF();
573 if (chi2Lambda24C<0) chi2Lambda24C=100;
577 if (chi2K0C<minChi2C) { minChi2C= chi2K0C; type=0;}
578 if (chi2GammaC<minChi2C) { minChi2C= chi2GammaC; type=1;}
579 if (chi2Lambda42C<minChi2C) { minChi2C= chi2Lambda42C; type=2;}
580 if (chi2Lambda24C<minChi2C) { minChi2C= chi2Lambda24C; type=3;}
583 if (chi2K0<minChi2) { minChi2= chi2K0; type0=0;}
584 if (chi2Gamma<minChi2) { minChi2= chi2Gamma; type0=1;}
585 if (chi2Lambda42<minChi2) { minChi2= chi2Lambda42; type0=2;}
586 if (chi2Lambda24<minChi2) { minChi2= chi2Lambda24; type0=3;}
588 // 0 is negative particle; 1 is positive particle
589 Float_t betaGamma0 = 0;
590 Float_t betaGamma1 = 0;
594 betaGamma0 = paramInNeg->GetP()/fPdg->GetParticle(-211)->Mass();
595 betaGamma1 = paramInPos->GetP()/fPdg->GetParticle(211)->Mass();
598 betaGamma0 = paramInNeg->GetP()/fPdg->GetParticle(11)->Mass();
599 betaGamma1 = paramInPos->GetP()/fPdg->GetParticle(-11)->Mass();
602 betaGamma0 = paramInNeg->GetP()/fPdg->GetParticle(-2212)->Mass();
603 betaGamma1 = paramInPos->GetP()/fPdg->GetParticle(211)->Mass();
606 betaGamma0 = paramInNeg->GetP()/fPdg->GetParticle(-211)->Mass();
607 betaGamma1 = paramInPos->GetP()/fPdg->GetParticle(2212)->Mass();
611 // cuts and histogram filling
612 Int_t numCand = 0; // number of particle types which have a chi2 < 10*minChi2
614 if (minChi2C < 2 && ftype == 1) {
616 if (chi2K0C < 10*minChi2C) numCand++;
617 if (chi2GammaC < 10*minChi2C) numCand++;
618 if (chi2Lambda42C < 10*minChi2C) numCand++;
619 if (chi2Lambda24C < 10*minChi2C) numCand++;
622 if (paramInNeg->GetP() > 0.4) fTPCdEdx->Fill(betaGamma0, trackN->GetTPCsignal());
623 if (paramInPos->GetP() > 0.4) fTPCdEdx->Fill(betaGamma1, trackP->GetTPCsignal());
630 if (minChi2>50) continue;
631 (*fDebugStream)<<"V0"<<
637 "betaGamma0="<<betaGamma0<<
638 "betaGamma1="<<betaGamma1<<
643 "v0Gamma.="<<v0Gamma<<
644 "v0Lambda42.="<<v0Lambda42<<
645 "v0Lambda24.="<<v0Lambda24<<
647 "chi20K0.="<<chi2K0<<
648 "chi2Gamma.="<<chi2Gamma<<
649 "chi2Lambda42.="<<chi2Lambda42<<
650 "chi2Lambda24.="<<chi2Lambda24<<
652 "chi20K0c.="<<chi2K0C<<
653 "chi2Gammac.="<<chi2GammaC<<
654 "chi2Lambda42c.="<<chi2Lambda42C<<
655 "chi2Lambda24c.="<<chi2Lambda24C<<
658 "v0GammaC.="<<v0GammaC<<
659 "v0Lambda42C.="<<v0Lambda42C<<
660 "v0Lambda24C.="<<v0Lambda24C<<
663 "massGamma="<<massGamma<<
664 "massLambda42="<<massLambda42<<
665 "massLambda24="<<massLambda24<<
668 "timeLambda42="<<timeLambda42<<
669 "timeLambda24="<<timeLambda24<<
671 if (type==1) fGammas->AddLast(v0);
689 void AliTPCcalibV0::ProcessPI0(){
693 Int_t nentries = fGammas->GetEntries();
694 if (nentries<2) return;
696 Double_t m0[3], m1[3];
697 AliKFVertex primVtx(*(fESD->GetPrimaryVertex()));
698 for (Int_t i0=0; i0<nentries; i0++){
699 AliESDv0 *v00 = (AliESDv0*)fGammas->At(i0);
700 v00->GetPxPyPz (m0[0], m0[1], m0[2]);
701 AliKFParticle *p00 = Fit(primVtx, v00, 11,-11);
702 p00->SetProductionVertex( primVtx );
703 p00->SetMassConstraint(0);
705 for (Int_t i1=i0; i1<nentries; i1++){
706 AliESDv0 *v01 = (AliESDv0*)fGammas->At(i1);
707 v01->GetPxPyPz (m1[0], m1[1], m1[2]);
708 AliKFParticle *p01 = Fit(primVtx, v01, 11,-11);
709 p01->SetProductionVertex( primVtx );
710 p01->SetMassConstraint(0);
711 if (v00->GetIndex(0) != v01->GetIndex(0) &&
712 v00->GetIndex(1) != v01->GetIndex(1)){
713 AliKFParticle pi0( *p00,*p01);
714 pi0.SetProductionVertex(primVtx);
715 Double_t n1 = TMath::Sqrt (m0[0]*m0[0] + m0[1]*m0[1] + m0[2]*m0[2]);
716 Double_t n2 = TMath::Sqrt (m1[0]*m1[0] + m1[1]*m1[1] + m1[2]*m1[2]);
717 Double_t mass = TMath::Sqrt(2.*(n1*n2 - (m0[0]*m1[0] + m0[1]*m1[1] + m0[2]*m1[2])));
718 (*fDebugStream)<<"PI0"<<
737 AliKFParticle * AliTPCcalibV0::Fit(AliKFVertex & primVtx, AliESDv0 *v0, Int_t PDG1, Int_t PDG2){
741 AliKFParticle p1( *(v0->GetParamN()), PDG1 );
742 AliKFParticle p2( *(v0->GetParamP()), PDG2 );
743 AliKFParticle *V0 = new AliKFParticle;
746 V0->SetVtxGuess(x,y,z);
754 Float_t AliTPCcalibV0::TPCBetheBloch(Float_t bg)
757 // Bethe-Bloch energy loss formula
759 const Double_t kp1=0.76176e-1;
760 const Double_t kp2=10.632;
761 const Double_t kp3=0.13279e-4;
762 const Double_t kp4=1.8631;
763 const Double_t kp5=1.9479;
764 Double_t dbg = (Double_t) bg;
765 Double_t beta = dbg/TMath::Sqrt(1.+dbg*dbg);
766 Double_t aa = TMath::Power(beta,kp4);
767 Double_t bb = TMath::Power(1./dbg,kp5);
768 bb=TMath::Log(kp3+bb);
769 return ((Float_t)((kp2-aa-bb)*kp1/aa));
778 TH2F * AliTPCcalibV0::GetHistograms() {
788 void AliTPCcalibV0::BinLogX(TH2F *h) {
792 TAxis *axis = h->GetXaxis();
793 int bins = axis->GetNbins();
795 Double_t from = axis->GetXmin();
796 Double_t to = axis->GetXmax();
797 Double_t *new_bins = new Double_t[bins + 1];
800 Double_t factor = pow(to/from, 1./bins);
802 for (int i = 1; i <= bins; i++) {
803 new_bins[i] = factor * new_bins[i-1];
805 axis->Set(bins, new_bins);