Skip to content

Commit 2320e66

Browse files
author
Sawan Sawan
committed
applied rapidity cut for rotational mother
1 parent 148b266 commit 2320e66

File tree

1 file changed

+87
-79
lines changed

1 file changed

+87
-79
lines changed

PWGLF/Tasks/Resonances/kstarqa.cxx

Lines changed: 87 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -468,114 +468,122 @@ struct Kstarqa {
468468
ROOT::Math::Boost boost{mother.BoostToCM()}; // boost mother to center of mass frame
469469
fourVecDauCM = boost(daughterSelected); // boost the frame of daughter same as mother
470470

471-
if (std::abs(mother.Rapidity()) < 0.5) {
472-
if (activateTHnSparseCosThStarHelicity) {
473-
auto cosThetaStarHelicity = mother.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(mother.Vect().Mag2()));
471+
// if (std::abs(mother.Rapidity()) < 0.5) {
472+
if (activateTHnSparseCosThStarHelicity) {
473+
auto cosThetaStarHelicity = mother.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(mother.Vect().Mag2()));
474474

475-
if (track1.sign() * track2.sign() < 0) {
476-
if (!isMix) {
475+
if (track1.sign() * track2.sign() < 0) {
476+
if (!isMix) {
477+
if (std::abs(mother.Rapidity()) < 0.5) {
477478
hInvMass.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity);
479+
}
478480

479-
for (int i = 0; i < cRotations; i++) {
480-
theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut);
481+
for (int i = 0; i < cRotations; i++) {
482+
theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / rotationalCut, o2::constants::math::PI + o2::constants::math::PI / rotationalCut);
481483

482-
daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M());
484+
daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M());
483485

484-
motherRot = daughterRot + daughter2;
486+
motherRot = daughterRot + daughter2;
485487

486-
ROOT::Math::Boost boost2{motherRot.BoostToCM()};
487-
daughterRotCM = boost2(daughterRot);
488+
ROOT::Math::Boost boost2{motherRot.BoostToCM()};
489+
daughterRotCM = boost2(daughterRot);
488490

489-
auto cosThetaStarHelicityRot = motherRot.Vect().Dot(daughterRotCM.Vect()) / (std::sqrt(daughterRotCM.Vect().Mag2()) * std::sqrt(motherRot.Vect().Mag2()));
491+
auto cosThetaStarHelicityRot = motherRot.Vect().Dot(daughterRotCM.Vect()) / (std::sqrt(daughterRotCM.Vect().Mag2()) * std::sqrt(motherRot.Vect().Mag2()));
490492

491-
if (calcRotational)
492-
hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarHelicityRot);
493-
}
494-
} else {
495-
hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity);
496-
}
497-
} else {
498-
if (!isMix) {
499-
if (calcLikeSign)
500-
hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity);
493+
if (calcRotational && motherRot.Rapidity() < 0.5)
494+
hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarHelicityRot);
501495
}
496+
} else if (std::abs(mother.Rapidity()) < 0.5) {
497+
hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity);
498+
}
499+
} else {
500+
if (!isMix) {
501+
if (calcLikeSign && std::abs(mother.Rapidity()) < 0.5)
502+
hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity);
502503
}
504+
}
503505

504-
} else if (activateTHnSparseCosThStarProduction) {
505-
normalVec = ROOT::Math::XYZVector(mother.Py(), -mother.Px(), 0.f);
506-
auto cosThetaStarProduction = normalVec.Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(normalVec.Mag2()));
506+
} else if (activateTHnSparseCosThStarProduction) {
507+
normalVec = ROOT::Math::XYZVector(mother.Py(), -mother.Px(), 0.f);
508+
auto cosThetaStarProduction = normalVec.Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(normalVec.Mag2()));
507509

508-
if (track1.sign() * track2.sign() < 0) {
509-
if (!isMix) {
510+
if (track1.sign() * track2.sign() < 0) {
511+
if (!isMix) {
512+
if (std::abs(mother.Rapidity()) < 0.5) {
510513
hInvMass.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarProduction);
511-
for (int i = 0; i < cRotations; i++) {
512-
theta2 = rn->Uniform(0, o2::constants::math::PI);
513-
daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M());
514-
515-
motherRot = daughterRot + daughter2;
516-
if (calcRotational)
517-
hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarProduction);
518-
}
519-
} else {
520-
hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarProduction);
521514
}
522-
} else {
523-
if (!isMix) {
524-
if (calcLikeSign)
525-
hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarProduction);
515+
for (int i = 0; i < cRotations; i++) {
516+
theta2 = rn->Uniform(0, o2::constants::math::PI);
517+
daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M());
518+
519+
motherRot = daughterRot + daughter2;
520+
if (calcRotational && abs(motherRot.Rapidity()) < 0.5)
521+
hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarProduction);
526522
}
523+
} else if (std::abs(mother.Rapidity()) < 0.5) {
524+
hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarProduction);
525+
}
526+
} else {
527+
if (!isMix) {
528+
if (calcLikeSign && std::abs(mother.Rapidity()) < 0.5)
529+
hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarProduction);
527530
}
528-
} else if (activateTHnSparseCosThStarBeam) {
529-
beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f);
530-
auto cosThetaStarBeam = beamVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2());
531+
}
532+
} else if (activateTHnSparseCosThStarBeam) {
533+
beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f);
534+
auto cosThetaStarBeam = beamVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2());
531535

532-
if (track1.sign() * track2.sign() < 0) {
533-
if (!isMix) {
536+
if (track1.sign() * track2.sign() < 0) {
537+
if (!isMix) {
538+
if (std::abs(mother.Rapidity()) < 0.5) {
534539
hInvMass.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam);
535-
for (int i = 0; i < cRotations; i++) {
536-
theta2 = rn->Uniform(0, o2::constants::math::PI);
537-
daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M());
540+
}
541+
for (int i = 0; i < cRotations; i++) {
542+
theta2 = rn->Uniform(0, o2::constants::math::PI);
543+
daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M());
538544

539-
motherRot = daughterRot + daughter2;
540-
if (calcRotational)
541-
hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarBeam);
542-
}
543-
} else {
544-
hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam);
545+
motherRot = daughterRot + daughter2;
546+
if (calcRotational && std::abs(motherRot.Rapidity()) < 0.5)
547+
hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarBeam);
545548
}
546-
} else {
547-
if (calcLikeSign)
548-
hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam);
549+
} else if (std::abs(mother.Rapidity()) < 0.5) {
550+
hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam);
549551
}
550-
} else if (activateTHnSparseCosThStarRandom) {
551-
auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI);
552-
auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI);
552+
} else {
553+
if (calcLikeSign && std::abs(mother.Rapidity()) < 0.5)
554+
hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam);
555+
}
556+
} else if (activateTHnSparseCosThStarRandom) {
557+
auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI);
558+
auto thetaRandom = gRandom->Uniform(0.f, constants::math::PI);
553559

554-
randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom));
555-
auto cosThetaStarRandom = randomVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2());
560+
randomVec = ROOT::Math::XYZVector(std::sin(thetaRandom) * std::cos(phiRandom), std::sin(thetaRandom) * std::sin(phiRandom), std::cos(thetaRandom));
561+
auto cosThetaStarRandom = randomVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2());
556562

557-
if (track1.sign() * track2.sign() < 0) {
558-
if (!isMix) {
563+
if (track1.sign() * track2.sign() < 0) {
564+
if (!isMix) {
565+
if (std::abs(mother.Rapidity()) < 0.5) {
559566
hInvMass.fill(HIST("h3KstarInvMassUnlikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom);
560-
for (int i = 0; i < cRotations; i++) {
561-
theta2 = rn->Uniform(0, o2::constants::math::PI);
562-
daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M());
563-
564-
motherRot = daughterRot + daughter2;
565-
if (calcRotational)
566-
hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarRandom);
567-
}
568-
} else {
569-
hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom);
570567
}
571-
} else {
572-
if (!isMix) {
573-
if (calcLikeSign)
574-
hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom);
568+
for (int i = 0; i < cRotations; i++) {
569+
theta2 = rn->Uniform(0, o2::constants::math::PI);
570+
daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M());
571+
572+
motherRot = daughterRot + daughter2;
573+
if (calcRotational && std::abs(motherRot.Rapidity()) < 0.5)
574+
hInvMass.fill(HIST("h3KstarInvMassRotated"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarRandom);
575575
}
576+
} else if (std::abs(mother.Rapidity()) < 0.5) {
577+
hInvMass.fill(HIST("h3KstarInvMassMixed"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom);
578+
}
579+
} else {
580+
if (!isMix) {
581+
if (calcLikeSign && std::abs(mother.Rapidity()) < 0.5)
582+
hInvMass.fill(HIST("h3KstarInvMasslikeSign"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom);
576583
}
577584
}
578585
}
586+
// }
579587
}
580588

581589
// int counter = 0;

0 commit comments

Comments
 (0)