18#include <TDatabasePDG.h>
20#include "KFParticle.h"
43 SetTracks(pair.GetFirstDaughter(), pair.GetFirstDaughterPid(), pair.GetSecondDaughter(), pair.GetSecondDaughterPid());
57 SetTracks(particle1, pid1, particle2, pid2);
81 const Double_t cpid1 = TDatabasePDG::Instance()->GetParticle(pid1)->Charge() * 3;
82 const Double_t cpid2 = TDatabasePDG::Instance()->GetParticle(pid2)->Charge() * 3;
89 if (particle1->
Charge() == cpid2) {
93 if (particle2->
Charge() == cpid1) {
133 if (mother1 && mother2 && (mother1Id == mother2Id))
fWeight = particle1->
GetWeight();
150 Float_t* par1 = kf1.Parameters();
154 par1[3] = particle1->
GetPx();
155 par1[4] = particle1->
GetPy();
156 par1[5] = particle1->
GetPz();
162 Float_t* par2 = kf2.Parameters();
166 par2[3] = particle2->
GetPx();
167 par2[4] = particle2->
GetPy();
168 par2[5] = particle2->
GetPz();
174 fPair.AddDaughter(kf1);
175 fPair.AddDaughter(kf2);
184 Double_t px1 =
fD1.GetPx();
185 Double_t py1 =
fD1.GetPy();
186 Double_t pz1 =
fD1.GetPz();
187 Double_t px2 =
fD2.GetPx();
188 Double_t py2 =
fD2.GetPy();
189 Double_t pz2 =
fD2.GetPz();
190 const Double_t d1Mass = TDatabasePDG::Instance()->GetParticle(
fPid1)->Mass();
191 const Double_t d2Mass = TDatabasePDG::Instance()->GetParticle(
fPid2)->Mass();
194 TLorentzVector p1Mom(px1, py1, pz1, TMath::Sqrt(px1 * px1 + py1 * py1 + pz1 * pz1 + d1Mass * d1Mass));
195 TLorentzVector p2Mom(px2, py2, pz2, TMath::Sqrt(px2 * px2 + py2 * py2 + pz2 * pz2 + d2Mass * d2Mass));
197 TLorentzVector motherMom = p1Mom + p2Mom;
271 Int_t qD1 =
fD1.GetQ();
273 TVector3 momNeg((qD1 < 0 ?
fD1.GetPx() :
fD2.GetPx()), (qD1 < 0 ?
fD1.GetPy() :
fD2.GetPy()),
274 (qD1 < 0 ?
fD1.GetPz() :
fD2.GetPz()));
275 TVector3 momPos((qD1 < 0 ?
fD2.GetPx() :
fD1.GetPx()), (qD1 < 0 ?
fD2.GetPy() :
fD1.GetPy()),
276 (qD1 < 0 ?
fD2.GetPz() :
fD1.GetPz()));
277 TVector3 momTot(
Px(),
Py(),
Pz());
279 Double_t lQlNeg = momNeg.Dot(momTot) / momTot.Mag();
280 Double_t lQlPos = momPos.Dot(momTot) / momTot.Mag();
282 return ((lQlPos - lQlNeg) / (lQlPos + lQlNeg));
291 Int_t qD1 =
fD1.GetQ();
293 TVector3 momNeg((qD1 < 0 ?
fD1.GetPx() :
fD2.GetPx()), (qD1 < 0 ?
fD1.GetPy() :
fD2.GetPy()),
294 (qD1 < 0 ?
fD1.GetPz() :
fD2.GetPz()));
295 TVector3 momTot(
Px(),
Py(),
Pz());
297 return (momNeg.Perp(momTot));
307 Double_t px1 = -9999., py1 = -9999., pz1 = -9999.;
308 Double_t px2 = -9999., py2 = -9999., pz2 = -9999.;
311 if (
fD1.GetQ() > 0) {
331 if (
fD1.GetQ() > 0) {
351 Double_t px = px1 + px2;
352 Double_t py = py1 + py2;
353 Double_t pz = pz1 + pz2;
354 Double_t dppair = TMath::Sqrt(px * px + py * py + pz * pz);
357 Double_t pl = dppair;
358 Double_t ux = px / pl;
359 Double_t uy = py / pl;
360 Double_t uz = pz / pl;
361 Double_t ax = uy / TMath::Sqrt(ux * ux + uy * uy);
362 Double_t ay = -ux / TMath::Sqrt(ux * ux + uy * uy);
377 Double_t vpx = pyep * pzem - pzep * pyem;
378 Double_t vpy = pzep * pxem - pxep * pzem;
379 Double_t vpz = pxep * pyem - pyep * pxem;
380 Double_t vp =
sqrt(vpx * vpx + vpy * vpy + vpz * vpz);
384 Double_t vx = vpx / vp;
385 Double_t vy = vpy / vp;
386 Double_t vz = vpz / vp;
389 Double_t wx = uy * vz - uz * vy;
390 Double_t wy = uz * vx - ux * vz;
397 Double_t cosPhiV = wx * ax + wy * ay;
398 Double_t phiv = TMath::ACos(cosPhiV);
friend fvec sqrt(const fvec &a)
ClassImp(PairAnalysisPairKF) PairAnalysisPairKF
static void SetKFParticleFromStsTrack(CbmStsTrack *track, KFParticle *particle, Int_t pdg=211, Bool_t firstPoint=kTRUE)
int32_t GetMotherId() const
int32_t GetPdgCode() const
static PairAnalysisMC * Instance()
CbmMCTrack * GetMCTrackFromMCEvent(Int_t label) const
void SetTracks(PairAnalysisTrack *const particle1, Int_t pid1, PairAnalysisTrack *const particle2, Int_t pid2)
void SetMCTracks(const CbmMCTrack *const particle1, const CbmMCTrack *const particle2)
virtual Double_t Pz() const
virtual ~PairAnalysisPairKF()
Double_t GetArmPt() const
void GetThetaPhiCM(Double_t &thetaHE, Double_t &phiHE, Double_t &thetaCS, Double_t &phiCS) const
virtual Double_t Px() const
Double_t PhivPair(Double_t MagField) const
Double_t GetArmAlpha() const
virtual Double_t Py() const
Double_t PsiPair(Double_t MagField) const
virtual void GetThetaPhiCM(Double_t &thetaHE, Double_t &phiHE, Double_t &thetaCS, Double_t &phiCS) const =0
CbmStsTrack * GetStsTrack() const
CbmMCTrack * GetMCTrack() const
Double_t GetWeight() const