1 /**************************************************************************
2 * Copyright(c) 1998-2006, 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 /////////////////////////////////////////////////////////////
18 // Base class for AOD reconstructed decay
20 // Author: A.Dainese, andrea.dainese@lnl.infn.it
21 /////////////////////////////////////////////////////////////
23 #include <TDatabasePDG.h>
25 #include <TClonesArray.h>
27 #include "AliVTrack.h"
28 #include "AliExternalTrackParam.h"
29 #include "AliNeutralTrackParam.h"
30 #include "AliAODMCParticle.h"
31 #include "AliAODRecoDecay.h"
33 ClassImp(AliAODRecoDecay)
35 //--------------------------------------------------------------------------
36 AliAODRecoDecay::AliAODRecoDecay() :
39 fOwnSecondaryVtx(0x0),
41 fNProngs(0), fNDCA(0), fNPID(0),
42 fPx(0x0), fPy(0x0), fPz(0x0),
46 fEventNumber(-1),fRunNumber(-1)
49 // Default Constructor
52 //--------------------------------------------------------------------------
53 AliAODRecoDecay::AliAODRecoDecay(AliAODVertex *vtx2,Int_t nprongs,
55 Double_t *px,Double_t *py,Double_t *pz,
59 fOwnSecondaryVtx(0x0),
61 fNProngs(nprongs), fNDCA(0), fNPID(0),
62 fPx(0x0), fPy(0x0), fPz(0x0),
66 fEventNumber(-1),fRunNumber(-1)
69 // Constructor with AliAODVertex for decay vertex
72 fPx = new Double_t[GetNProngs()];
73 fPy = new Double_t[GetNProngs()];
74 fPz = new Double_t[GetNProngs()];
75 fd0 = new Double_t[GetNProngs()];
76 for(Int_t i=0; i<GetNProngs(); i++) {
83 //--------------------------------------------------------------------------
84 AliAODRecoDecay::AliAODRecoDecay(AliAODVertex *vtx2,Int_t nprongs,
89 fOwnSecondaryVtx(0x0),
91 fNProngs(nprongs), fNDCA(0), fNPID(0),
92 fPx(0x0), fPy(0x0), fPz(0x0),
96 fEventNumber(-1),fRunNumber(-1)
99 // Constructor with AliAODVertex for decay vertex and without prongs momenta
102 fd0 = new Double_t[GetNProngs()];
103 for(Int_t i=0; i<GetNProngs(); i++) fd0[i] = d0[i];
105 //--------------------------------------------------------------------------
106 AliAODRecoDecay::AliAODRecoDecay(const AliAODRecoDecay &source) :
108 fSecondaryVtx(source.fSecondaryVtx),
109 fOwnSecondaryVtx(source.fOwnSecondaryVtx),
110 fCharge(source.fCharge),
111 fNProngs(source.fNProngs), fNDCA(source.fNDCA), fNPID(source.fNPID),
112 fPx(0x0), fPy(0x0), fPz(0x0),
116 fEventNumber(source.fEventNumber),fRunNumber(source.fRunNumber)
121 if(source.GetNProngs()>0) {
122 fd0 = new Double32_t[GetNProngs()];
123 memcpy(fd0,source.fd0,GetNProngs()*sizeof(Double32_t));
125 fPx = new Double32_t[GetNProngs()];
126 fPy = new Double32_t[GetNProngs()];
127 fPz = new Double32_t[GetNProngs()];
128 memcpy(fPx,source.fPx,GetNProngs()*sizeof(Double32_t));
129 memcpy(fPy,source.fPy,GetNProngs()*sizeof(Double32_t));
130 memcpy(fPz,source.fPz,GetNProngs()*sizeof(Double32_t));
133 fPID = new Double32_t[fNPID];
134 memcpy(fPID,source.fPID,fNPID*sizeof(Double32_t));
137 fDCA = new Double32_t[fNDCA];
138 memcpy(fDCA,source.fDCA,fNDCA*sizeof(Double32_t));
142 //--------------------------------------------------------------------------
143 AliAODRecoDecay &AliAODRecoDecay::operator=(const AliAODRecoDecay &source)
146 // assignment operator
148 if(&source == this) return *this;
149 fSecondaryVtx = source.fSecondaryVtx;
150 fOwnSecondaryVtx = source.fOwnSecondaryVtx;
151 fCharge = source.fCharge;
152 fNProngs = source.fNProngs;
153 fNDCA = source.fNDCA;
154 fNPID = source.fNPID;
155 fEventNumber = source.fEventNumber;
156 fRunNumber = source.fRunNumber;
157 if(source.GetNProngs()>0) {
158 if(fd0)delete [] fd0;
159 fd0 = new Double32_t[GetNProngs()];
160 memcpy(fd0,source.fd0,GetNProngs()*sizeof(Double32_t));
162 if(fPx) delete [] fPx;
163 fPx = new Double32_t[GetNProngs()];
164 if(fPy) delete [] fPy;
165 fPy = new Double32_t[GetNProngs()];
166 if(fPz) delete [] fPz;
167 fPz = new Double32_t[GetNProngs()];
168 memcpy(fPx,source.fPx,GetNProngs()*sizeof(Double32_t));
169 memcpy(fPy,source.fPy,GetNProngs()*sizeof(Double32_t));
170 memcpy(fPz,source.fPz,GetNProngs()*sizeof(Double32_t));
173 if(fPID) delete [] fPID;
174 fPID = new Double32_t[fNPID];
175 memcpy(fPID,source.fPID,fNPID*sizeof(Double32_t));
178 if(fDCA) delete [] fDCA;
179 fDCA = new Double32_t[fNDCA];
180 memcpy(fDCA,source.fDCA,fNDCA*sizeof(Double32_t));
185 //--------------------------------------------------------------------------
186 AliAODRecoDecay::~AliAODRecoDecay() {
188 // Default Destructor
190 if(fPx) { delete [] fPx; fPx=NULL; }
191 if(fPy) { delete [] fPy; fPy=NULL; }
192 if(fPz) { delete [] fPz; fPz=NULL; }
193 if(fd0) { delete [] fd0; fd0=NULL; }
194 if(fPID) { delete [] fPID; fPID=NULL; }
195 if(fDCA) { delete [] fDCA; fDCA=NULL; }
196 if(fOwnSecondaryVtx) { delete fOwnSecondaryVtx; fOwnSecondaryVtx=NULL; }
198 //----------------------------------------------------------------------------
199 Double_t AliAODRecoDecay::Alpha() const
202 // Armenteros-Podolanski alpha for 2-prong decays
204 if(GetNProngs()!=2) {
205 printf("Can be called only for 2-prong decays");
206 return (Double_t)-99999.;
208 return 1.-2./(1.+QlProng(0)/QlProng(1));
210 //----------------------------------------------------------------------------
211 Double_t AliAODRecoDecay::DecayLength2(Double_t point[3]) const
214 // Decay length assuming it is produced at "point" [cm]
216 return (point[0]-GetSecVtxX())
217 *(point[0]-GetSecVtxX())
218 +(point[1]-GetSecVtxY())
219 *(point[1]-GetSecVtxY())
220 +(point[2]-GetSecVtxZ())
221 *(point[2]-GetSecVtxZ());
223 //----------------------------------------------------------------------------
224 Double_t AliAODRecoDecay::DecayLengthXY(Double_t point[3]) const
227 // Decay length in XY assuming it is produced at "point" [cm]
229 return TMath::Sqrt((point[0]-GetSecVtxX())
230 *(point[0]-GetSecVtxX())
231 +(point[1]-GetSecVtxY())
232 *(point[1]-GetSecVtxY()));
234 //----------------------------------------------------------------------------
235 Double_t AliAODRecoDecay::CosPointingAngle(Double_t point[3]) const
238 // Cosine of pointing angle in space assuming it is produced at "point"
240 TVector3 mom(Px(),Py(),Pz());
241 TVector3 fline(GetSecVtxX()-point[0],
242 GetSecVtxY()-point[1],
243 GetSecVtxZ()-point[2]);
245 Double_t ptot2 = mom.Mag2()*fline.Mag2();
249 Double_t cos = mom.Dot(fline)/TMath::Sqrt(ptot2);
250 if(cos > 1.0) cos = 1.0;
251 if(cos < -1.0) cos = -1.0;
255 //----------------------------------------------------------------------------
256 Double_t AliAODRecoDecay::CosPointingAngleXY(Double_t point[3]) const
259 // Cosine of pointing angle in transverse plane assuming it is produced
262 TVector3 momXY(Px(),Py(),0.);
263 TVector3 flineXY(GetSecVtxX()-point[0],
264 GetSecVtxY()-point[1],
267 Double_t ptot2 = momXY.Mag2()*flineXY.Mag2();
271 Double_t cos = momXY.Dot(flineXY)/TMath::Sqrt(ptot2);
272 if(cos > 1.0) cos = 1.0;
273 if(cos < -1.0) cos = -1.0;
277 //----------------------------------------------------------------------------
278 Double_t AliAODRecoDecay::CosThetaStar(Int_t ip,UInt_t pdgvtx,UInt_t pdgprong0,UInt_t pdgprong1) const
281 // Only for 2-prong decays:
282 // Cosine of decay angle (theta*) in the rest frame of the mother particle
283 // for prong ip (0 or 1) with mass hypotheses pdgvtx for mother particle,
284 // pdgprong0 for prong 0 and pdgprong1 for prong1
286 if(GetNProngs()!=2) {
287 printf("Can be called only for 2-prong decays");
288 return (Double_t)-99999.;
290 Double_t massvtx = TDatabasePDG::Instance()->GetParticle(pdgvtx)->Mass();
292 massp[0] = TDatabasePDG::Instance()->GetParticle(pdgprong0)->Mass();
293 massp[1] = TDatabasePDG::Instance()->GetParticle(pdgprong1)->Mass();
295 Double_t pStar = TMath::Sqrt((massvtx*massvtx-massp[0]*massp[0]-massp[1]*massp[1])*(massvtx*massvtx-massp[0]*massp[0]-massp[1]*massp[1])-4.*massp[0]*massp[0]*massp[1]*massp[1])/(2.*massvtx);
297 Double_t e=E(pdgvtx);
298 Double_t beta = P()/e;
299 Double_t gamma = e/massvtx;
301 Double_t cts = (QlProng(ip)/gamma-beta*TMath::Sqrt(pStar*pStar+massp[ip]*massp[ip]))/pStar;
305 //---------------------------------------------------------------------------
306 Double_t AliAODRecoDecay::Ct(UInt_t pdg,Double_t point[3]) const
309 // Decay time * c assuming it is produced at "point" [cm]
311 Double_t mass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass();
312 return DecayLength(point)*mass/P();
314 //---------------------------------------------------------------------------
315 Double_t AliAODRecoDecay::E2(UInt_t pdg) const
320 Double_t mass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass();
321 return mass*mass+P2();
323 //---------------------------------------------------------------------------
324 Double_t AliAODRecoDecay::E2Prong(Int_t ip,UInt_t pdg) const
327 // Energy of ip-th prong
329 Double_t mass = TDatabasePDG::Instance()->GetParticle(pdg)->Mass();
330 return mass*mass+P2Prong(ip);
332 //--------------------------------------------------------------------------
333 Bool_t AliAODRecoDecay::GetCovarianceXYZPxPyPz(Double_t cv[21]) const {
335 // This function returns the global covariance matrix of the track params
337 // Cov(x,x) ... : cv[0]
338 // Cov(y,x) ... : cv[1] cv[2]
339 // Cov(z,x) ... : cv[3] cv[4] cv[5]
340 // Cov(px,x)... : cv[6] cv[7] cv[8] cv[9]
341 // Cov(py,x)... : cv[10] cv[11] cv[12] cv[13] cv[14]
342 // Cov(pz,x)... : cv[15] cv[16] cv[17] cv[18] cv[19] cv[20]
344 // For XYZ we take the cov of the vertex, for PxPyPz we take the
345 // sum of the covs of PxPyPz from the daughters, for the moment
346 // we set the cov between position and momentum as the sum of
347 // the same cov from the daughters.
351 for(j=0;j<21;j++) cv[j]=0.;
353 if(!GetNDaughters()) {
354 AliError("No daughters available");
359 AliAODVertex *secv=GetSecondaryVtx();
361 AliError("Vertex covariance matrix not available");
364 if(!secv->GetCovMatrix(v)) {
365 AliError("Vertex covariance matrix not available");
369 Double_t p[21]; for(j=0;j<21;j++) p[j]=0.;
371 for(Int_t i=1; i<GetNDaughters(); i++) {
372 AliVTrack *daugh = (AliVTrack*)GetDaughter(i);
374 if(!daugh->GetCovarianceXYZPxPyPz(dcov)) error=kTRUE;
375 for(j=0;j<21;j++) p[j] += dcov[j];
378 AliError("No covariance for at least one daughter");
382 for(j=0; j<21; j++) {
392 //----------------------------------------------------------------------------
393 UChar_t AliAODRecoDecay::GetITSClusterMap() const {
395 // We take the logical AND of the daughters cluster maps
396 // (only if all daughters have the bit for given layer, we set the bit)
400 if(!GetNDaughters()) {
401 AliError("No daughters available");
405 for(Int_t l=0; l<12; l++) { // loop on ITS layers (from here we cannot know how many they are; let's put 12 to be conservative)
407 for(Int_t i=0; i<GetNDaughters(); i++) {
408 AliVTrack *daugh = (AliVTrack*)GetDaughter(i);
409 if(!TESTBIT(daugh->GetITSClusterMap(),l)) bit=0;
411 if(bit) SETBIT(map,l);
416 //--------------------------------------------------------------------------
417 ULong_t AliAODRecoDecay::GetStatus() const {
419 // Same as for ITSClusterMap
423 if(!GetNDaughters()) {
424 AliError("No daughters available");
428 AliVTrack *daugh0 = (AliVTrack*)GetDaughter(0);
429 status = status&(daugh0->GetStatus());
431 for(Int_t i=1; i<GetNDaughters(); i++) {
432 AliVTrack *daugh = (AliVTrack*)GetDaughter(i);
433 status = status&(daugh->GetStatus());
438 //--------------------------------------------------------------------------
439 Bool_t AliAODRecoDecay::PropagateToDCA(const AliVVertex* vtx,Double_t b,Double_t maxd,Double_t dz[2],Double_t covar[3])
441 // compute impact parameters to the vertex vtx and their covariance matrix
442 // b is the Bz, needed to propagate correctly the track to vertex
443 // return kFALSE is something went wrong
445 AliWarning("The AliAODRecoDecay momentum is not updated to the DCA");
449 // convert to AliNeutralTrackParam
450 AliNeutralTrackParam ntp(this);
451 retval = ntp.PropagateToDCA(vtx,b,maxd,dz,covar);
453 // convert to AliExternalTrackParam
454 AliExternalTrackParam etp; etp.CopyFromVTrack(this);
455 retval = etp.PropagateToDCA(vtx,b,maxd,dz,covar);
459 //--------------------------------------------------------------------------
460 Double_t AliAODRecoDecay::ImpParXY(Double_t point[3]) const
463 // Impact parameter in the bending plane of the particle
466 Double_t k = -(GetSecVtxX()-point[0])*Px()-(GetSecVtxY()-point[1])*Py();
468 Double_t dx = GetSecVtxX()-point[0]+k*Px();
469 Double_t dy = GetSecVtxY()-point[1]+k*Py();
470 Double_t absImpPar = TMath::Sqrt(dx*dx+dy*dy);
471 TVector3 mom(Px(),Py(),Pz());
472 TVector3 fline(GetSecVtxX()-point[0],
473 GetSecVtxY()-point[1],
474 GetSecVtxZ()-point[2]);
475 TVector3 cross = mom.Cross(fline);
476 return (cross.Z()>0. ? absImpPar : -absImpPar);
478 //----------------------------------------------------------------------------
479 Double_t AliAODRecoDecay::InvMass2(Int_t npdg,UInt_t *pdg) const
482 // Invariant mass for prongs mass hypotheses in pdg array
484 if(GetNProngs()!=npdg) {
485 printf("npdg != GetNProngs()");
486 return (Double_t)-99999.;
488 Double_t energysum = 0.;
490 for(Int_t i=0; i<GetNProngs(); i++) {
491 energysum += EProng(i,pdg[i]);
494 Double_t mass2 = energysum*energysum-P2();
498 //----------------------------------------------------------------------------
499 Bool_t AliAODRecoDecay::PassInvMassCut(Int_t pdgMom,Int_t npdgDg,UInt_t *pdgDg,Double_t cut) const {
504 Double_t invmass2=InvMass2(npdgDg,pdgDg);
505 Double_t massMom=TDatabasePDG::Instance()->GetParticle(pdgMom)->Mass();
506 Double_t massMom2 = massMom*massMom;
507 Double_t cut2= cut*cut;
510 if(invmass2 > massMom2) {
511 if(invmass2 < cut2 + massMom2 + 2.*cut*massMom) return kTRUE;
513 if(invmass2 > cut2 + massMom2 - 2.*cut*massMom) return kTRUE;
518 //----------------------------------------------------------------------------
519 Double_t AliAODRecoDecay::InvMass2Prongs(Int_t ip1,Int_t ip2,
520 UInt_t pdg1,UInt_t pdg2) const
523 // 2-prong(ip1,ip2) invariant mass for prongs mass hypotheses in pdg1,2
525 Double_t energysum = EProng(ip1,pdg1) + EProng(ip2,pdg2);
526 Double_t psum2 = (PxProng(ip1)+PxProng(ip2))*(PxProng(ip1)+PxProng(ip2))
527 +(PyProng(ip1)+PyProng(ip2))*(PyProng(ip1)+PyProng(ip2))
528 +(PzProng(ip1)+PzProng(ip2))*(PzProng(ip1)+PzProng(ip2));
529 Double_t mass = TMath::Sqrt(energysum*energysum-psum2);
533 //----------------------------------------------------------------------------
534 Int_t AliAODRecoDecay::MatchToMC(Int_t pdgabs, TClonesArray *mcArray,
535 Int_t ndgCk, const Int_t *pdgDg) const
538 // Check if this candidate is matched to a MC signal
540 // If yes, return label (>=0) of the AliAODMCParticle
542 // if ndgCk>0, checks also daughters PDGs
544 Int_t ndg=GetNDaughters();
546 AliError("No daughters available");
550 AliError("Only decays with <10 daughters supported");
553 if(ndgCk>0 && ndgCk!=ndg) {
554 AliError("Wrong number of daughter PDGs passed");
558 Int_t dgLabels[10] = {0};
560 // loop on daughters and write the labels
561 for(Int_t i=0; i<ndg; i++) {
562 AliAODTrack *trk = (AliAODTrack*)GetDaughter(i);
563 dgLabels[i] = trk->GetLabel();
566 return MatchToMC(pdgabs,mcArray,dgLabels,ndg,ndgCk,pdgDg);
568 //----------------------------------------------------------------------------
569 Int_t AliAODRecoDecay::MatchToMC(Int_t pdgabs,TClonesArray *mcArray,
570 Int_t dgLabels[10],Int_t ndg,
571 Int_t ndgCk, const Int_t *pdgDg) const
574 // Check if this candidate is matched to a MC signal
576 // If yes, return label (>=0) of the AliAODMCParticle
579 Int_t labMom[10]={0,0,0,0,0,0,0,0,0,0};
580 Int_t i,j,lab,labMother,pdgMother,pdgPart;
581 AliAODMCParticle *part=0;
582 AliAODMCParticle *mother=0;
583 Double_t pxSumDgs=0.,pySumDgs=0.,pzSumDgs=0.;
584 Bool_t pdgUsed[10]={kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE,kFALSE};
586 // loop on daughter labels
587 for(i=0; i<ndg; i++) {
589 lab = TMath::Abs(dgLabels[i]);
591 printf("daughter with negative label %d\n",lab);
594 part = (AliAODMCParticle*)mcArray->At(lab);
596 printf("no MC particle\n");
600 // check the PDG of the daughter, if requested
602 pdgPart=TMath::Abs(part->GetPdgCode());
603 for(j=0; j<ndg; j++) {
604 if(!pdgUsed[j] && pdgPart==pdgDg[j]) {
611 // for the J/psi, check that the daughters are electrons
613 if(TMath::Abs(part->GetPdgCode())!=11) return -1;
617 while(mother->GetMother()>=0) {
618 labMother=mother->GetMother();
619 mother = (AliAODMCParticle*)mcArray->At(labMother);
621 printf("no MC mother particle\n");
624 pdgMother = TMath::Abs(mother->GetPdgCode());
625 if(pdgMother==pdgabs) {
627 // keep sum of daughters' momenta, to check for mom conservation
628 pxSumDgs += part->Px();
629 pySumDgs += part->Py();
630 pzSumDgs += part->Pz();
632 } else if(pdgMother>pdgabs || pdgMother<10) {
636 if(labMom[i]==-1) return -1; // mother PDG not ok for this daughter
637 } // end loop on daughters
639 // check if the candidate is signal
641 // all labels have to be the same and !=-1
642 for(i=0; i<ndg; i++) {
643 if(labMom[i]==-1) return -1;
644 if(labMom[i]!=labMother) return -1;
647 // check that all daughter PDGs are matched
649 for(i=0; i<ndg; i++) {
650 if(pdgUsed[i]==kFALSE) return -1;
655 // check that the mother decayed in <GetNDaughters()> prongs
656 Int_t ndg2 = TMath::Abs(mother->GetDaughter(1)-mother->GetDaughter(0))+1;
657 printf(" MC daughters %d\n",ndg2);
658 //if(ndg!=GetNDaughters()) return -1;
659 AliAODMCParticle* p1=(AliAODMCParticle*)(mcArray->At(mother->GetDaughter(1)));
660 AliAODMCParticle* p0=(AliAODMCParticle*)(mcArray->At(mother->GetDaughter(0)));
661 printf(">>>>>>>> pdg %d %d %d %d %d %d\n",mother->GetDaughter(0),mother->GetDaughter(1),dgLabels[0],dgLabels[1],p0->GetPdgCode(),p1->GetPdgCode());
664 // the above works only for non-resonant decays,
665 // it's better to check for mom conservation
666 mother = (AliAODMCParticle*)mcArray->At(labMother);
667 Double_t pxMother = mother->Px();
668 Double_t pyMother = mother->Py();
669 Double_t pzMother = mother->Pz();
671 if((TMath::Abs(pxMother-pxSumDgs)/(TMath::Abs(pxMother)+1.e-13)) > 0.00001 &&
672 (TMath::Abs(pyMother-pySumDgs)/(TMath::Abs(pyMother)+1.e-13)) > 0.00001 &&
673 (TMath::Abs(pzMother-pzSumDgs)/(TMath::Abs(pzMother)+1.e-13)) > 0.00001)
678 //---------------------------------------------------------------------------
679 void AliAODRecoDecay::Print(Option_t* /*option*/) const
682 // Print some information
684 printf("AliAODRecoDecay with %d prongs\n",GetNProngs());
685 printf("Secondary Vertex: (%f, %f, %f)\n",GetSecVtxX(),GetSecVtxY(),GetSecVtxZ());
689 //----------------------------------------------------------------------------
690 Double_t AliAODRecoDecay::ProngsRelAngle(Int_t ip1,Int_t ip2) const
693 // Relative angle between two prongs
695 TVector3 momA(PxProng(ip1),PyProng(ip1),PzProng(ip1));
696 TVector3 momB(PxProng(ip2),PyProng(ip2),PzProng(ip2));
698 Double_t angle = momA.Angle(momB);
702 //----------------------------------------------------------------------------
703 Double_t AliAODRecoDecay::QlProng(Int_t ip) const
706 // Longitudinal momentum of prong w.r.t. to total momentum
708 TVector3 mom(PxProng(ip),PyProng(ip),PzProng(ip));
709 TVector3 momTot(Px(),Py(),Pz());
711 return mom.Dot(momTot)/momTot.Mag();
713 //----------------------------------------------------------------------------
714 Double_t AliAODRecoDecay::QtProng(Int_t ip) const
717 // Transverse momentum of prong w.r.t. to total momentum
719 TVector3 mom(PxProng(ip),PyProng(ip),PzProng(ip));
720 TVector3 momTot(Px(),Py(),Pz());
722 return mom.Perp(momTot);
724 //----------------------------------------------------------------------------
725 Double_t AliAODRecoDecay::QlProngFlightLine(Int_t ip,Double_t point[3]) const
728 // Longitudinal momentum of prong w.r.t. to flight line between "point"
731 TVector3 mom(PxProng(ip),PyProng(ip),PzProng(ip));
732 TVector3 fline(GetSecVtxX()-point[0],
733 GetSecVtxY()-point[1],
734 GetSecVtxZ()-point[2]);
736 return mom.Dot(fline)/fline.Mag();
738 //----------------------------------------------------------------------------
739 Double_t AliAODRecoDecay::QtProngFlightLine(Int_t ip,Double_t point[3]) const
742 // Transverse momentum of prong w.r.t. to flight line between "point" and
745 TVector3 mom(PxProng(ip),PyProng(ip),PzProng(ip));
746 TVector3 fline(GetSecVtxX()-point[0],
747 GetSecVtxY()-point[1],
748 GetSecVtxZ()-point[2]);
750 return mom.Perp(fline);
752 //--------------------------------------------------------------------------