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 **************************************************************************/
17 * author: M.Kalisky@gsi.de
20 * Description: This class allows with purely kinematical cuts
21 * to select clean samples of electrons, pions and protons from the
22 * V0 online finder ESD V0 candidates for PID and dectero resonse
27 #include <TDatabasePDG.h>
30 #include "AliESDtrack.h"
31 #include "AliESDEvent.h"
33 #include "AliKFParticle.h"
34 #include "AliVTrack.h"
35 #include "AliKFVertex.h"
37 #include "AliESDv0KineCuts.h"
39 ClassImp(AliESDv0KineCuts)
41 //____________________________________________________________________
42 AliESDv0KineCuts::AliESDv0KineCuts() :
52 // Default constructor
55 // default gamma cuts values
56 fGcutChi2NDF = 40; // Chi2NF cut value for the AliKFparticle gamma
57 fGcutCosPoint[0] = 0; // cos of the pointing angle [min, max]
58 fGcutCosPoint[1] = 0.02; // cos of the pointing angle [min, max]
59 fGcutDCA[0] = 0.; // DCA between the daughter tracks [min, max]
60 fGcutDCA[1] = 0.25; // DCA between the daughter tracks [min, max]
61 fGcutVertexR[0] = 8.; // radius of the conversion point [min, max]
62 fGcutVertexR[1] = 90.; // radius of the conversion point [min, max]
63 fGcutPsiPair[0] = 0.; // value of the psi pair cut [min, max]
64 fGcutPsiPair[1] = 0.05; // value of the psi pair cut [min, max]
65 fGcutInvMass = 0.05; // upper value on the gamma invariant mass
67 fK0cutChi2NDF = 40; // Chi2NF cut value for the AliKFparticle K0
68 fK0cutCosPoint[0] = 0.; // cos of the pointing angle [min, max]
69 fK0cutCosPoint[1] = 0.02; // cos of the pointing angle [min, max]
70 fK0cutDCA[0] = 0.; // DCA between the daughter tracks [min, max]
71 fK0cutDCA[1] = 0.2; // DCA between the daughter tracks [min, max]
72 fK0cutVertexR[0] = 2.0; // radius of the decay point [min, max]
73 fK0cutVertexR[1] = 30.0; // radius of the decay point [min, max]
74 fK0cutInvMass[0] = 0.486; // invariant mass window
75 fK0cutInvMass[1] = 0.508; // invariant mass window
76 // Lambda & anti-Lambda cut values
77 fLcutChi2NDF = 40; // Chi2NF cut value for the AliKFparticle K0
78 fLcutCosPoint[0] = 0.; // cos of the pointing angle [min, max]
79 fLcutCosPoint[1] = 0.02; // cos of the pointing angle [min, max]
80 fLcutDCA[0] = 0.; // DCA between the daughter tracks [min, max]
81 fLcutDCA[1] = 0.2; // DCA between the daughter tracks [min, max]
82 fLcutVertexR[0] = 2.0; // radius of the decay point [min, max]
83 fLcutVertexR[1] = 40.0; // radius of the decay point [min, max]
84 fLcutInvMass[0] = 1.11; // invariant mass window
85 fLcutInvMass[1] = 1.12; // invariant mass window
88 //____________________________________________________________________
89 AliESDv0KineCuts::~AliESDv0KineCuts(){
97 //____________________________________________________________________
98 AliESDv0KineCuts::AliESDv0KineCuts(const AliESDv0KineCuts &ref):
102 , fPrimaryVertex(0x0)
110 //____________________________________________________________________
111 AliESDv0KineCuts &AliESDv0KineCuts::operator=(const AliESDv0KineCuts &ref){
113 // assignment operator
119 //____________________________________________________________________
120 void AliESDv0KineCuts::Copy(TObject &ref) const {
122 // Performs the copying of the object
127 AliESDv0KineCuts &target = dynamic_cast<AliESDv0KineCuts &>(ref);
129 target.fV0 = dynamic_cast<AliESDv0 *>(fV0->Clone());
134 //____________________________________________________________________
135 Bool_t AliESDv0KineCuts::ProcessV0(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN){
137 // main user function
140 if(!v0) return kFALSE;
142 AliErrorClass("No valid Event pointer available, provide it first");
146 if(!V0CutsCommon(v0)) return kFALSE;
148 const Int_t id = PreselectV0(v0);
150 if(!SingleTrackCuts(v0)) return kFALSE;
156 return CaseGamma(v0, pdgV0, pdgP, pdgN);
158 return CaseK0(v0, pdgV0, pdgP, pdgN);
160 return CaseLambda(v0, pdgV0, pdgP, pdgN, 0);
162 return CaseLambda(v0, pdgV0, pdgP, pdgN, 1);
169 //____________________________________________________________________
170 Bool_t AliESDv0KineCuts::ProcessV0(AliESDv0* const v0, Int_t &pdgP, Int_t &pdgN){
172 // main user function, simplified if the V0 identity is not necessary
175 if(!v0) return kFALSE;
177 AliErrorClass("No valid Event pointer available, provide it first");
182 return ProcessV0(v0, idV0, pdgP, pdgN);
185 //____________________________________________________________________
186 Int_t AliESDv0KineCuts::PreselectV0(AliESDv0* const v0){
188 // Make a preselection (exclusive) of the V0 cadidates based on
192 Float_t ap[2] = {-1., -1.};
195 const Float_t alpha = ap[0];
196 const Float_t qt = ap[1];
199 // - the reagions for different candidates must not overlap
202 const Double_t cutAlphaG = 0.35;
203 const Double_t cutQTG = 0.05;
204 const Double_t cutAlphaG2[2] = {0.6, 0.8};
205 const Double_t cutQTG2 = 0.04;
208 const Float_t cutQTK0[2] = {0.1075, 0.215};
209 const Float_t cutAPK0[2] = {0.199, 0.8}; // parameters for curved QT cut
211 // Lambda & A-Lambda cuts
212 const Float_t cutQTL = 0.03;
213 const Float_t cutAlphaL[2] = {0.35, 0.7};
214 const Float_t cutAlphaAL[2] = {-0.7, -0.35};
215 const Float_t cutAPL[3] = {0.107, -0.69, 0.5}; // parameters fir curved QT cut
218 // Check for Gamma candidates
220 if( (TMath::Abs(alpha) < cutAlphaG) ) return kGamma;
222 // additional region - should help high pT gammas
224 if( (TMath::Abs(alpha) > cutAlphaG2[0]) && (TMath::Abs(alpha) < cutAlphaG2[1]) ) return kGamma;
228 // Check for K0 candidates
229 Float_t q = cutAPK0[0] * TMath::Sqrt(TMath::Abs(1 - alpha*alpha/(cutAPK0[1]*cutAPK0[1])));
230 if( (qt > cutQTK0[0]) && (qt < cutQTK0[1]) && (qt > q) ){
234 // Check for Lambda candidates
235 q = cutAPL[0] * TMath::Sqrt(TMath::Abs(1 - ( (alpha + cutAPL[1]) * (alpha + cutAPL[1]) ) / (cutAPL[2]*cutAPL[2]) ));
236 if( (alpha > cutAlphaL[0]) && (alpha < cutAlphaL[1]) && (qt > cutQTL) && (qt < q) ){
240 // Check for A-Lambda candidates
241 q = cutAPL[0] * TMath::Sqrt(TMath::Abs(1 - ( (alpha - cutAPL[1]) * (alpha - cutAPL[1]) ) / (cutAPL[2]*cutAPL[2]) ));
242 if( (alpha > cutAlphaAL[0]) && (alpha < cutAlphaAL[1]) && (qt > cutQTL) && (qt < q) ){
248 //____________________________________________________________________
249 Bool_t AliESDv0KineCuts::SingleTrackCuts(AliESDv0 * const v0){
251 // apply single track cuts
252 // correct sign not relevat here
255 if(!v0) return kFALSE;
257 Int_t pIndex = 0, nIndex = 0;
258 pIndex = v0->GetPindex();
259 nIndex = v0->GetNindex();
261 d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
262 d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
264 for(Int_t i=0; i<2; ++i){
265 if(!d[i]) return kFALSE;
268 ULong_t status = d[i]->GetStatus();
270 // No. of TPC clusters leave to the users
271 if(d[i]->GetTPCNcls() < 1) return kFALSE;
274 if(!(status & AliESDtrack::kTPCrefit)) return kFALSE;
276 // Chi2 per TPC cluster
277 Int_t nTPCclusters = d[i]->GetTPCNcls();
278 Float_t chi2perTPCcluster = d[i]->GetTPCchi2()/Float_t(nTPCclusters);
279 if(chi2perTPCcluster > 4) return kFALSE;
282 Float_t cRatioTPC = d[i]->GetTPCNclsF() > 0. ? static_cast<Float_t>(d[i]->GetTPCNcls())/static_cast<Float_t> (d[i]->GetTPCNclsF()) : 1.;
283 if(cRatioTPC < 0.6) return kFALSE;
286 if(d[i]->GetKinkIndex(0) != 0) return kFALSE;
292 //____________________________________________________________________
293 Bool_t AliESDv0KineCuts::CaseGamma(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN){
295 // process the gamma conversion candidate
298 if(!v0) return kFALSE;
300 AliVTrack* daughter[2];
301 Int_t pIndex = 0, nIndex = 0;
303 Bool_t sign = CheckSigns(v0);
305 pIndex = v0->GetPindex();
306 nIndex = v0->GetNindex();
309 pIndex = v0->GetNindex();
310 nIndex = v0->GetPindex();
312 daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));
313 daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));
314 if(!daughter[0] || !daughter[1]) return kFALSE;
316 AliKFParticle *kfMother = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kElectron), TMath::Abs(kElectron));
317 if(!kfMother) return kFALSE;
320 d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
321 d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
323 Float_t iMass = v0->GetEffMass(0, 0);
325 // cos pointing angle
326 Double_t cosPoint = v0->GetV0CosineOfPointingAngle();
327 cosPoint = TMath::ACos(cosPoint);
329 // DCA between daughters
330 Double_t dca = v0->GetDcaV0Daughters();
335 Double_t r = TMath::Sqrt(x*x + y*y);
339 if ( GetConvPosXY(d[0], d[1], xy) ){
340 r2 = TMath::Sqrt(xy[0]*xy[0] + xy[1]*xy[1]);
344 Double_t psiPair = PsiPair(v0);
347 Double_t chi2ndf = kfMother->GetChi2()/kfMother->GetNDF();
349 if(kfMother) delete kfMother;
353 if(iMass > fGcutInvMass) return kFALSE;
355 if(chi2ndf > fGcutChi2NDF) return kFALSE;
357 if(cosPoint < fGcutCosPoint[0] || cosPoint > fGcutCosPoint[1]) return kFALSE;
359 if(dca < fGcutDCA[0] || dca > fGcutDCA[1]) return kFALSE;
361 if(r < fGcutVertexR[0] || r > fGcutVertexR[1]) return kFALSE;
363 if(psiPair < fGcutPsiPair[0] || psiPair > fGcutPsiPair[1]) return kFALSE;
379 //____________________________________________________________________
380 Bool_t AliESDv0KineCuts::CaseK0(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN){
382 // process the K0 candidate
385 if(!v0) return kFALSE;
387 AliVTrack* daughter[2];
388 Int_t pIndex = 0, nIndex = 0;
389 Bool_t sign = CheckSigns(v0);
391 pIndex = v0->GetPindex();
392 nIndex = v0->GetNindex();
395 pIndex = v0->GetNindex();
396 nIndex = v0->GetPindex();
399 daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));
400 daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));
401 if(!daughter[0] || !daughter[1]) return kFALSE;
403 AliKFParticle *kfMother = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kPiPlus), TMath::Abs(kPiPlus));
404 if(!kfMother) return kFALSE;
407 d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
408 d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
410 Float_t iMass = v0->GetEffMass(2, 2);
412 // cos pointing angle
413 Double_t cosPoint = v0->GetV0CosineOfPointingAngle();
414 cosPoint = TMath::ACos(cosPoint);
416 // DCA between daughters
417 Double_t dca = v0->GetDcaV0Daughters();
423 Double_t r = TMath::Sqrt(x*x + y*y);
426 Double_t chi2ndf = kfMother->GetChi2()/kfMother->GetNDF();
428 if(kfMother) delete kfMother;
433 if(iMass < fK0cutInvMass[0] || iMass > fK0cutInvMass[1]) return kFALSE;
435 if(chi2ndf > fK0cutChi2NDF) return kFALSE;
437 if(cosPoint < fK0cutCosPoint[0] || cosPoint > fK0cutCosPoint[1]) return kFALSE;
439 if(dca < fK0cutDCA[0] || dca > fK0cutDCA[1]) return kFALSE;
441 if(r < fK0cutVertexR[0] || r > fK0cutVertexR[1]) return kFALSE;
456 //____________________________________________________________________
457 Bool_t AliESDv0KineCuts::CaseLambda(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN, Int_t id){
459 // process teh Lambda and Anti-Lambda candidate
462 if(!v0) return kFALSE;
464 const Double_t cL0mass=TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass(); // PDG lambda mass
466 AliVTrack* daughter[2];
467 Int_t pIndex = 0, nIndex = 0;
468 Float_t mMass[2] = {-1., -1.};
469 Bool_t sign = CheckSigns(v0);
471 pIndex = v0->GetPindex();
472 nIndex = v0->GetNindex();
473 mMass[0] = v0->GetEffMass(4, 2);
474 mMass[1] = v0->GetEffMass(2, 4);
477 pIndex = v0->GetNindex();
478 nIndex = v0->GetPindex();
479 mMass[0] = v0->GetEffMass(2, 4);
480 mMass[1] = v0->GetEffMass(4, 2);
483 daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));
484 daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));
485 if(!daughter[0] || !daughter[1]) return kFALSE;
487 AliKFParticle *kfMother[2] = {0x0, 0x0};
489 kfMother[0] = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kProton), TMath::Abs(kPiPlus));
490 if(!kfMother[0]) return kFALSE;
493 kfMother[1] = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kPiPlus), TMath::Abs(kProton));
494 if(!kfMother[1]) return kFALSE;
496 Float_t dMass[2] = {TMath::Abs(mMass[0] - cL0mass), TMath::Abs(mMass[1] - cL0mass)};
499 d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
500 d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
501 if(!d[0] || !d[1]) return kFALSE;
503 Float_t p[2] = {d[0]->GetP(), d[1]->GetP()};
505 // check the 3 lambda - antilambda variables
506 Int_t check[2] = {-1, -1}; // 0 : lambda, 1 : antilambda
507 // 1) momentum of the daughter particles - proton is expected to have higher momentum than pion
508 check[0] = (p[0] > p[1]) ? 0 : 1;
509 // 2) mass of the mother particle
510 check[1] = (dMass[0] < dMass[1]) ? 0 : 1;
512 // require positive correlation of (1) and (2)
513 if(check[0] != check[1]){
514 if(kfMother[0]) delete kfMother[0];
515 if(kfMother[1]) delete kfMother[1];
519 // now that the check[0] == check[1]
520 const Int_t type = check[0];
522 // require that the input armenteros preselection agree:
523 if(type != id) return kFALSE;
527 iMass = (type == 0) ? v0->GetEffMass(4, 2) : v0->GetEffMass(2, 4);
530 iMass = (type == 0) ? v0->GetEffMass(2, 4) : v0->GetEffMass(4, 2);
533 // cos pointing angle
534 Double_t cosPoint = v0->GetV0CosineOfPointingAngle();
535 cosPoint = TMath::ACos(cosPoint);
537 // DCA between daughters
538 Double_t dca = v0->GetDcaV0Daughters();
543 Double_t r = TMath::Sqrt(x*x + y*y);
545 // proton - pion indices
546 Int_t ix[2] = {0, 1};
553 Double_t chi2ndf = kfMother[type]->GetChi2()/kfMother[type]->GetNDF();
555 if(kfMother[0]) delete kfMother[0];
556 if(kfMother[1]) delete kfMother[1];
562 if(iMass < fLcutInvMass[0] || iMass > fLcutInvMass[1]) return kFALSE;
564 if(chi2ndf > fLcutChi2NDF) return kFALSE;
566 if(cosPoint < fLcutCosPoint[0] || cosPoint > fLcutCosPoint[1]) return kFALSE;
568 if(dca < fLcutDCA[0] || dca > fLcutDCA[1]) return kFALSE;
570 if(r < fLcutVertexR[0] || r > fLcutVertexR[1]) return kFALSE;
599 //____________________________________________________________________
600 Bool_t AliESDv0KineCuts::V0CutsCommon(const AliESDv0 * const v0){
602 // V0 cuts common to all V0s
605 AliESDtrack* dN, *dP;
607 dP = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(v0->GetPindex()));
608 dN = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(v0->GetNindex()));
610 if(!dN || !dP) return kFALSE;
612 Int_t qP = dP->Charge();
613 Int_t qN = dN->Charge();
615 if((qP*qN) != -1) return kFALSE;
619 //____________________________________________________________________
620 void AliESDv0KineCuts::Armenteros(AliESDv0* const v0, Float_t val[2]){
622 // computes the Armenteros variables for given V0
623 // fills the histogram
624 // returns the values via "val"
627 Double_t mn[3] = {0,0,0};
628 Double_t mp[3] = {0,0,0};
629 Double_t mm[3] = {0,0,0};
632 v0->GetNPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter
633 v0->GetPPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter
636 v0->GetPPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter
637 v0->GetNPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter
639 v0->GetPxPyPz(mm[0],mm[1],mm[2]); //reconstructed cartesian momentum components of mother
641 TVector3 vecN(mn[0],mn[1],mn[2]);
642 TVector3 vecP(mp[0],mp[1],mp[2]);
643 TVector3 vecM(mm[0],mm[1],mm[2]);
645 Double_t thetaP = acos((vecP * vecM)/(vecP.Mag() * vecM.Mag()));
646 Double_t thetaN = acos((vecN * vecM)/(vecN.Mag() * vecM.Mag()));
648 Double_t alfa = ((vecP.Mag())*cos(thetaP)-(vecN.Mag())*cos(thetaN))/
649 ((vecP.Mag())*cos(thetaP)+(vecN.Mag())*cos(thetaN)) ;
650 Double_t qt = vecP.Mag()*sin(thetaP);
655 //____________________________________________________________________
656 Bool_t AliESDv0KineCuts::CheckSigns(AliESDv0* const v0){
658 // check wheter the sign was correctly applied to
659 // V0 daughter tracks
662 Bool_t correct = kFALSE;
664 Int_t pIndex = 0, nIndex = 0;
665 pIndex = v0->GetPindex();
666 nIndex = v0->GetNindex();
669 d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
670 d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
673 sign[0] = (int)d[0]->GetSign();
674 sign[1] = (int)d[1]->GetSign();
676 if(-1 == sign[0] && 1 == sign[1]){
685 //____________________________________________________________________
686 void AliESDv0KineCuts::SetEvent(AliESDEvent* const event){
688 // direct setter of ESD event
691 AliErrorClass("Invalid input event pointer");
696 //____________________________________________________________________
697 void AliESDv0KineCuts::SetEvent(AliVEvent* const event){
699 // Set the current working ESD event
702 AliErrorClass("Invalid input event pointer");
706 SetEvent(dynamic_cast<AliESDEvent*>(event));
708 //________________________________________________________________
709 Double_t AliESDv0KineCuts::PsiPair(AliESDv0* const v0) {
711 // Angle between daughter momentum plane and plane
714 if(!fEvent) return -1.;
716 Float_t magField = fEvent->GetMagneticField();
721 pIndex = v0->GetPindex();
722 nIndex = v0->GetNindex();
725 pIndex = v0->GetNindex();
726 nIndex = v0->GetPindex();
730 AliESDtrack* daughter[2];
732 daughter[0] = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(pIndex));
733 daughter[1] = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(nIndex));
736 v0->GetXYZ(x,y,z);//Reconstructed coordinates of V0; to be replaced by Markus Rammler's method in case of conversions!
738 Double_t mn[3] = {0,0,0};
739 Double_t mp[3] = {0,0,0};
742 v0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;
743 v0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter;
746 Double_t deltat = 1.;
747 deltat = TMath::ATan(mp[2]/(TMath::Sqrt(mp[0]*mp[0] + mp[1]*mp[1])+1.e-13)) - TMath::ATan(mn[2]/(TMath::Sqrt(mn[0]*mn[0] + mn[1]*mn[1])+1.e-13));//difference of angles of the two daughter tracks with z-axis
749 Double_t radiussum = TMath::Sqrt(x*x + y*y) + 50;//radius to which tracks shall be propagated
751 Double_t momPosProp[3];
752 Double_t momNegProp[3];
754 AliExternalTrackParam pt(*daughter[0]), nt(*daughter[1]);
756 Double_t psiPair = 4.;
758 if(nt.PropagateTo(radiussum,magField) == 0)//propagate tracks to the outside
760 if(pt.PropagateTo(radiussum,magField) == 0)
762 pt.GetPxPyPz(momPosProp);//Get momentum vectors of tracks after propagation
763 nt.GetPxPyPz(momNegProp);
766 TMath::Sqrt(momNegProp[0]*momNegProp[0]+momNegProp[1]*momNegProp[1]+momNegProp[2]*momNegProp[2]);//absolute momentum value of negative daughter
768 TMath::Sqrt(momPosProp[0]*momPosProp[0]+momPosProp[1]*momPosProp[1]+momPosProp[2]*momPosProp[2]);//absolute momentum value of positive daughter
770 Double_t scalarproduct =
771 momPosProp[0]*momNegProp[0]+momPosProp[1]*momNegProp[1]+momPosProp[2]*momNegProp[2];//scalar product of propagated positive and negative daughters' momenta
773 Double_t chipair = TMath::ACos(scalarproduct/(pEle*pPos));//Angle between propagated daughter tracks
775 psiPair = TMath::Abs(TMath::ASin(deltat/chipair));
779 //___________________________________________________________________
780 Bool_t AliESDv0KineCuts::GetConvPosXY(AliESDtrack * const ptrack, AliESDtrack * const ntrack, Double_t convpos[2]){
782 // recalculate the gamma conversion XY postition
785 const Double_t b = fEvent->GetMagneticField();
787 Double_t helixcenterpos[2];
788 GetHelixCenter(ptrack,b,ptrack->Charge(),helixcenterpos);
790 Double_t helixcenterneg[2];
791 GetHelixCenter(ntrack,b,ntrack->Charge(),helixcenterneg);
793 Double_t poshelix[6];
794 ptrack->GetHelixParameters(poshelix,b);
795 Double_t posradius = TMath::Abs(1./poshelix[4]);
797 Double_t neghelix[6];
798 ntrack->GetHelixParameters(neghelix,b);
799 Double_t negradius = TMath::Abs(1./neghelix[4]);
801 Double_t xpos = helixcenterpos[0];
802 Double_t ypos = helixcenterpos[1];
803 Double_t xneg = helixcenterneg[0];
804 Double_t yneg = helixcenterneg[1];
806 convpos[0] = (xpos*negradius + xneg*posradius)/(negradius+posradius);
807 convpos[1] = (ypos*negradius+ yneg*posradius)/(negradius+posradius);
811 //___________________________________________________________________
812 Bool_t AliESDv0KineCuts::GetHelixCenter(AliESDtrack * const track, Double_t b,Int_t charge, Double_t center[2]){
814 // computes the center of the track helix
817 Double_t pi = TMath::Pi();
820 track->GetHelixParameters(helix,b);
822 Double_t xpos = helix[5];
823 Double_t ypos = helix[0];
824 Double_t radius = TMath::Abs(1./helix[4]);
825 Double_t phi = helix[2];
832 Double_t xpoint = radius * TMath::Cos(phi);
833 Double_t ypoint = radius * TMath::Sin(phi);
857 center[0] = xpos + xpoint;
858 center[1] = ypos + ypoint;
862 //___________________________________________________________________
863 AliKFParticle *AliESDv0KineCuts::CreateMotherParticle(const AliVTrack* const pdaughter, const AliVTrack* const ndaughter, Int_t pspec, Int_t nspec){
865 // Creates a mother particle
867 AliKFParticle pkfdaughter(*pdaughter, pspec);
868 AliKFParticle nkfdaughter(*ndaughter, nspec);
871 // Create the mother particle
872 AliKFParticle *m = new AliKFParticle(pkfdaughter, nkfdaughter);
874 if(TMath::Abs(kElectron) == pspec && TMath::Abs(kElectron) == nspec) m->SetMassConstraint(0, 0.001);
875 else if(TMath::Abs(kPiPlus) == pspec && TMath::Abs(kPiPlus) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(), 0.);
876 else if(TMath::Abs(kProton) == pspec && TMath::Abs(kPiPlus) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass(), 0.);
877 else if(TMath::Abs(kPiPlus) == pspec && TMath::Abs(kProton) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass(), 0.);
879 AliErrorClass("Wrong daughter ID - mass constraint can not be set");
882 AliKFVertex improvedVertex = *fPrimaryVertex;
883 improvedVertex += *m;
884 m->SetProductionVertex(improvedVertex);
887 // mother particle will not be added to primary vertex but only to its copy
888 // as this confilcts with calling
889 // m->SetPrimaryVertex() function and
890 // subsequently removing the mother particle afterwards
891 // Source: Sergey Gorbunov