@@ -184,8 +184,8 @@ struct HigherMassResonances {
184184 ROOT ::Math::XYZVector randomVec, beamVec, normalVec;
185185 ROOT ::Math::XYZVectorF v1_CM, zaxis_HE, yaxis_HE, xaxis_HE;
186186 // ROOT::Math::XYZVector threeVecDauCM, helicityVec, randomVec, beamVec, normalVec;
187- ROOT ::Math::XYZVector zBeam; // ẑ: beam direction in lab frame
188- double BeamMomentum = TMath::Sqrt (13600 * 13600 / 4 - 0.938 * 0.938 ); // GeV
187+ ROOT ::Math::XYZVector zBeam; // ẑ: beam direction in lab frame
188+ double BeamMomentum = std::sqrt (13600 * 13600 / 4 - 0.938 * 0.938 ); // GeV
189189 ROOT ::Math::PxPyPzEVector Beam1{0 ., 0 ., -BeamMomentum, 13600 . / 2 .};
190190 ROOT ::Math::PxPyPzEVector Beam2{0 ., 0 ., BeamMomentum, 13600 . / 2 .};
191191 ROOT ::Math::XYZVectorF Beam1_CM, Beam2_CM;
@@ -652,75 +652,97 @@ struct HigherMassResonances {
652652 angle_phi += 2 * TMath::Pi (); // ensure phi is in [0, 2pi]
653653 }
654654
655- if (std::abs (mother.Rapidity ()) < 0.5 ) {
656- if (config.activateTHnSparseCosThStarHelicity ) {
657- // helicityVec = mother.Vect(); // 3 vector of mother in COM frame
658- // auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2()));
659- auto cosThetaStarHelicity = mother.Vect ().Dot (fourVecDauCM.Vect ()) / (std::sqrt (fourVecDauCM.Vect ().Mag2 ()) * std::sqrt (mother.Vect ().Mag2 ()));
660- if (!isMix) {
655+ // if (std::abs(mother.Rapidity()) < 0.5) {
656+ if (config.activateTHnSparseCosThStarHelicity ) {
657+ // helicityVec = mother.Vect(); // 3 vector of mother in COM frame
658+ // auto cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / (std::sqrt(threeVecDauCM.Mag2()) * std::sqrt(helicityVec.Mag2()));
659+ auto cosThetaStarHelicity = mother.Vect ().Dot (fourVecDauCM.Vect ()) / (std::sqrt (fourVecDauCM.Vect ().Mag2 ()) * std::sqrt (mother.Vect ().Mag2 ()));
660+ if (!isMix) {
661+ if (std::abs (mother.Rapidity ()) < 0.5 ) {
661662 hglue.fill (HIST (" h3glueInvMassDS" ), multiplicity, mother.Pt (), mother.M (), cosThetaStarHelicity, angle_phi);
663+ }
662664
663- for (int i = 0 ; i < config.cRotations ; i++) {
664- theta2 = rn->Uniform (o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut , o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut );
665-
666- 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 ());
665+ for (int i = 0 ; i < config.cRotations ; i++) {
666+ theta2 = rn->Uniform (o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut , o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut );
667667
668- motherRot = daughterRot + daughter2 ;
668+ 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 ()) ;
669669
670- ROOT ::Math::Boost boost2{motherRot.BoostToCM ()};
671- daughterRotCM = boost2 (daughterRot);
670+ motherRot = daughterRot + daughter2;
672671
673- auto cosThetaStarHelicityRot = motherRot.Vect ().Dot (daughterRotCM.Vect ()) / (std::sqrt (daughterRotCM.Vect ().Mag2 ()) * std::sqrt (motherRot.Vect ().Mag2 ()));
672+ ROOT ::Math::Boost boost2{motherRot.BoostToCM ()};
673+ daughterRotCM = boost2 (daughterRot);
674674
675+ auto cosThetaStarHelicityRot = motherRot.Vect ().Dot (daughterRotCM.Vect ()) / (std::sqrt (daughterRotCM.Vect ().Mag2 ()) * std::sqrt (motherRot.Vect ().Mag2 ()));
676+ if (motherRot.Rapidity () < 0.5 )
675677 hglue.fill (HIST (" h3glueInvMassRot" ), multiplicity, motherRot.Pt (), motherRot.M (), cosThetaStarHelicityRot, angle_phi);
676- }
677- } else {
678+ }
679+ } else {
680+ if (std::abs (mother.Rapidity ()) < 0.5 ) {
678681 hglue.fill (HIST (" h3glueInvMassME" ), multiplicity, mother.Pt (), mother.M (), cosThetaStarHelicity, angle_phi);
679682 }
680- } else if (config.activateTHnSparseCosThStarProduction ) {
681- normalVec = ROOT::Math::XYZVector (mother.Py (), -mother.Px (), 0 .f );
682- auto cosThetaStarProduction = normalVec.Dot (fourVecDauCM.Vect ()) / (std::sqrt (fourVecDauCM.Vect ().Mag2 ()) * std::sqrt (normalVec.Mag2 ()));
683- if (!isMix) {
683+ }
684+ } else if (config.activateTHnSparseCosThStarProduction ) {
685+ normalVec = ROOT::Math::XYZVector (mother.Py (), -mother.Px (), 0 .f );
686+ auto cosThetaStarProduction = normalVec.Dot (fourVecDauCM.Vect ()) / (std::sqrt (fourVecDauCM.Vect ().Mag2 ()) * std::sqrt (normalVec.Mag2 ()));
687+ if (!isMix) {
688+ if (std::abs (mother.Rapidity ()) < 0.5 ) {
684689 hglue.fill (HIST (" h3glueInvMassDS" ), multiplicity, mother.Pt (), mother.M (), cosThetaStarProduction, angle_phi);
685- for (int i = 0 ; i < config.cRotations ; i++) {
686- theta2 = rn->Uniform (o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut , o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut );
687- motherRot = ROOT::Math::PxPyPzMVector (mother.Px () * std::cos (theta2) - mother.Py () * std::sin (theta2), mother.Px () * std::sin (theta2) + mother.Py () * std::cos (theta2), mother.Pz (), mother.M ());
690+ }
691+ for (int i = 0 ; i < config.cRotations ; i++) {
692+ theta2 = rn->Uniform (o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut , o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut );
693+ motherRot = ROOT::Math::PxPyPzMVector (mother.Px () * std::cos (theta2) - mother.Py () * std::sin (theta2), mother.Px () * std::sin (theta2) + mother.Py () * std::cos (theta2), mother.Pz (), mother.M ());
694+ if (std::abs (motherRot.Rapidity ()) < 0.5 ) {
688695 hglue.fill (HIST (" h3glueInvMassRot" ), multiplicity, motherRot.Pt (), motherRot.M (), cosThetaStarProduction, angle_phi);
689696 }
690- } else {
697+ }
698+ } else {
699+ if (std::abs (mother.Rapidity ()) < 0.5 ) {
691700 hglue.fill (HIST (" h3glueInvMassME" ), multiplicity, mother.Pt (), mother.M (), cosThetaStarProduction, angle_phi);
692701 }
693- } else if (config.activateTHnSparseCosThStarBeam ) {
694- beamVec = ROOT::Math::XYZVector (0 .f , 0 .f , 1 .f );
695- auto cosThetaStarBeam = beamVec.Dot (fourVecDauCM.Vect ()) / std::sqrt (fourVecDauCM.Vect ().Mag2 ());
696- if (!isMix) {
702+ }
703+ } else if (config.activateTHnSparseCosThStarBeam ) {
704+ beamVec = ROOT::Math::XYZVector (0 .f , 0 .f , 1 .f );
705+ auto cosThetaStarBeam = beamVec.Dot (fourVecDauCM.Vect ()) / std::sqrt (fourVecDauCM.Vect ().Mag2 ());
706+ if (!isMix) {
707+ if (std::abs (mother.Rapidity ()) < 0.5 ) {
697708 hglue.fill (HIST (" h3glueInvMassDS" ), multiplicity, mother.Pt (), mother.M (), cosThetaStarBeam, angle_phi);
698- for (int i = 0 ; i < config.cRotations ; i++) {
699- theta2 = rn->Uniform (o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut , o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut );
700- motherRot = ROOT::Math::PxPyPzMVector (mother.Px () * std::cos (theta2) - mother.Py () * std::sin (theta2), mother.Px () * std::sin (theta2) + mother.Py () * std::cos (theta2), mother.Pz (), mother.M ());
709+ }
710+ for (int i = 0 ; i < config.cRotations ; i++) {
711+ theta2 = rn->Uniform (o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut , o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut );
712+ motherRot = ROOT::Math::PxPyPzMVector (mother.Px () * std::cos (theta2) - mother.Py () * std::sin (theta2), mother.Px () * std::sin (theta2) + mother.Py () * std::cos (theta2), mother.Pz (), mother.M ());
713+ if (std::abs (motherRot.Rapidity ()) < 0.5 ) {
701714 hglue.fill (HIST (" h3glueInvMassRot" ), multiplicity, motherRot.Pt (), motherRot.M (), cosThetaStarBeam, angle_phi);
702715 }
703- } else {
716+ }
717+ } else {
718+ if (std::abs (mother.Rapidity ()) < 0.5 ) {
704719 hglue.fill (HIST (" h3glueInvMassME" ), multiplicity, mother.Pt (), mother.M (), cosThetaStarBeam, angle_phi);
705720 }
706- } else if (config.activateTHnSparseCosThStarRandom ) {
707- auto phiRandom = gRandom ->Uniform (0 .f , constants::math::TwoPI);
708- auto thetaRandom = gRandom ->Uniform (0 .f , constants::math::PI );
709-
710- randomVec = ROOT::Math::XYZVector (std::sin (thetaRandom) * std::cos (phiRandom), std::sin (thetaRandom) * std::sin (phiRandom), std::cos (thetaRandom));
711- auto cosThetaStarRandom = randomVec.Dot (fourVecDauCM.Vect ()) / std::sqrt (fourVecDauCM.Vect ().Mag2 ());
712- if (!isMix) {
721+ }
722+ } else if (config.activateTHnSparseCosThStarRandom ) {
723+ auto phiRandom = gRandom ->Uniform (0 .f , constants::math::TwoPI);
724+ auto thetaRandom = gRandom ->Uniform (0 .f , constants::math::PI );
725+
726+ randomVec = ROOT::Math::XYZVector (std::sin (thetaRandom) * std::cos (phiRandom), std::sin (thetaRandom) * std::sin (phiRandom), std::cos (thetaRandom));
727+ auto cosThetaStarRandom = randomVec.Dot (fourVecDauCM.Vect ()) / std::sqrt (fourVecDauCM.Vect ().Mag2 ());
728+ if (!isMix) {
729+ if (std::abs (mother.Rapidity ()) < 0.5 ) {
713730 hglue.fill (HIST (" h3glueInvMassDS" ), multiplicity, mother.Pt (), mother.M (), cosThetaStarRandom, angle_phi);
714- for (int i = 0 ; i < config.cRotations ; i++) {
715- theta2 = rn->Uniform (o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut , o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut );
716- motherRot = ROOT::Math::PxPyPzMVector (mother.Px () * std::cos (theta2) - mother.Py () * std::sin (theta2), mother.Px () * std::sin (theta2) + mother.Py () * std::cos (theta2), mother.Pz (), mother.M ());
731+ }
732+ for (int i = 0 ; i < config.cRotations ; i++) {
733+ theta2 = rn->Uniform (o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut , o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut );
734+ motherRot = ROOT::Math::PxPyPzMVector (mother.Px () * std::cos (theta2) - mother.Py () * std::sin (theta2), mother.Px () * std::sin (theta2) + mother.Py () * std::cos (theta2), mother.Pz (), mother.M ());
735+ if (std::abs (motherRot.Rapidity ()) < 0.5 ) {
717736 hglue.fill (HIST (" h3glueInvMassRot" ), multiplicity, motherRot.Pt (), motherRot.M (), cosThetaStarRandom, angle_phi);
718737 }
719- } else {
738+ }
739+ } else {
740+ if (std::abs (mother.Rapidity ()) < 0.5 ) {
720741 hglue.fill (HIST (" h3glueInvMassME" ), multiplicity, mother.Pt (), mother.M (), cosThetaStarRandom, angle_phi);
721742 }
722743 }
723744 }
745+ // }
724746 }
725747
726748 void processSE (EventCandidates::iterator const & collision, TrackCandidates const & /* tracks*/ , aod::V0Datas const & V0s)
0 commit comments