@@ -222,9 +222,9 @@ class FemtoDreamContainer
222222 // / Initialize the histograms for pairs with 3D component in divided qn bins
223223 template <typename T>
224224 void init_base_3Dqn (const std::string& folderName, const std::string& femtoDKout, const std::string& femtoDKside, const std::string& femtoDKlong,
225- T& femtoDKoutAxis, T& femtoDKsideAxis, T& femtoDKlongAxis, T& mTAxi4D , T& multPercentileAxis4D, T& qnAxis, T& pairPhiAxis, bool storeEProt )
225+ T& femtoDKoutAxis, T& femtoDKsideAxis, T& femtoDKlongAxis, T& mTAxi4D , T& multPercentileAxis4D, T& qnAxis, T& pairPhiAxis)
226226 {
227- if (storeEProt ) {
227+ if (mStoreEProt ) {
228228 // DK_x, DK_y, DK_z are the EP-rotated (B-frame) axes; DK_y is out-of-plane (||B).
229229 mHistogramRegistry ->add ((folderName + " /relPair3dEProtRmTMultPercentileQnPairphi" ).c_str (), " ; DK_{x} (GeV/#it{c}); DK_{y} (GeV/#it{c}); DK_{z} (GeV/#it{c}); #it{m}_{T} (GeV/#it{c}); Centrality; qn; #varphi_{pair} - #Psi_{EP}" , o2::framework::HistType::kTHnSparseF , {femtoDKoutAxis, femtoDKsideAxis, femtoDKlongAxis, mTAxi4D , multPercentileAxis4D, qnAxis, pairPhiAxis});
230230 } else {
@@ -278,12 +278,12 @@ class FemtoDreamContainer
278278 std::string folderName = static_cast <std::string>(mFolderSuffix [mEventType ]) + static_cast <std::string>(o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kRecon ]) + static_cast <std::string>(" _3Dqn" );
279279
280280 init_base_3Dqn (folderName, femtoObsDKout, femtoObsDKside, femtoObsDKlong,
281- mom1Axis, mom2Axis, mom3Axis, mTAxis4D , multPercentileAxis4D, qnAxis, pairPhiAxis, mStoreEProt );
281+ mom1Axis, mom2Axis, mom3Axis, mTAxis4D , multPercentileAxis4D, qnAxis, pairPhiAxis);
282282
283283 if (isMC) {
284284 folderName = static_cast <std::string>(mFolderSuffix [mEventType ]) + static_cast <std::string>(o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth ]) + static_cast <std::string>(" _3Dqn" );
285285 init_base_3Dqn (folderName, femtoObsDKout, femtoObsDKside, femtoObsDKlong,
286- mom1Axis, mom2Axis, mom3Axis, mTAxis4D , multPercentileAxis4D, qnAxis, pairPhiAxis, mStoreEProt );
286+ mom1Axis, mom2Axis, mom3Axis, mTAxis4D , multPercentileAxis4D, qnAxis, pairPhiAxis);
287287 init_3Dqn_MC (folderName, femtoObsDKout, femtoObsDKside, femtoObsDKlong,
288288 DKoutAxis, DKsideAxis, DKlongAxis, smearingByOrigin);
289289 }
@@ -518,42 +518,21 @@ class FemtoDreamContainer
518518 }
519519 }
520520
521- // / Signed φ_pair − Ψ_EP (same as FemtoDreamMath::getPairPhiEP but without the final |·|); used as the B-frame rotation angle.
522- template <typename T1 , typename T2 >
523- static float getPairPhiEPSigned (const T1 & part1, const float mass1, const T2 & part2, const float mass2, const float Psi_ep)
524- {
525- const ROOT ::Math::PtEtaPhiMVector vecpart1 (part1.pt (), part1.eta (), part1.phi (), mass1);
526- const ROOT ::Math::PtEtaPhiMVector vecpart2 (part2.pt (), part2.eta (), part2.phi (), mass2);
527- const ROOT ::Math::PtEtaPhiMVector trackSum = vecpart1 + vecpart2;
528- return TVector2::Phi_mpi_pi (trackSum.Phi () - Psi_ep);
529- }
530-
531- // / Signed counterpart of the plane-calibrated (two-event-plane) FemtoDreamMath::getPairPhiEP.
532- template <typename T1 , typename T2 >
533- static float getPairPhiEPSigned (const T1 & part1, const float mass1, const T2 & part2, const float mass2, const float Psi_ep1, const float Psi_ep2)
521+ // / Pass a pair to the container and compute all the relevant observables in divided qn bins
522+ template <o2::aod::femtodreamMCparticle::MCType mc>
523+ void setPair_3Dqn_base (const float femtoDKout, const float femtoDKside, const float femtoDKlong, const float mT , const float multPercentile, const float myQnBin, const float pairPhiEP)
534524 {
535- const ROOT ::Math::PtEtaPhiMVector vecpart1 (part1.pt (), part1.eta (), part1.phi (), mass1);
536- const ROOT ::Math::PtEtaPhiMVector vecpart2 (part2.pt (), part2.eta (), part2.phi (), mass2);
537- const float psidiff = Psi_ep2 - Psi_ep1;
538- const float newPhi2 = TVector2::Phi_mpi_pi (vecpart2.Phi () - psidiff);
539- const ROOT ::Math::PtEtaPhiMVector vecpart2_calibd (vecpart2.Pt (), vecpart2.Eta (), newPhi2, vecpart2.M ());
540- const ROOT ::Math::PtEtaPhiMVector trackSum = vecpart1 + vecpart2_calibd;
541- return TVector2::Phi_mpi_pi (trackSum.Phi () - Psi_ep1);
525+ mHistogramRegistry ->fill (HIST (mFolderSuffix [mEventType ]) + HIST (o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST (" _3Dqn" ) + HIST (" /relPair3dRmTMultPercentileQnPairphi" ), femtoDKout, femtoDKside, femtoDKlong, mT , multPercentile, myQnBin, pairPhiEP);
542526 }
543527
544- // / Pass a pair to the container and compute all the relevant observables in divided qn bins
528+ // / EP-rotated (B-frame) version: rotate (out, side) by the signed φ_pair − Ψ_EP so DK_y is out-of-plane (||B); DK_z unchanged.
545529 template <o2::aod::femtodreamMCparticle::MCType mc>
546- void setPair_3Dqn_base (const float femtoDKout, const float femtoDKside, const float femtoDKlong, const float mT , const float multPercentile, const float myQnBin, const float pairPhiEP, bool storeEProt, const float pairPhiEPforRot)
530+ void setPair_3Dqn_base (const float femtoDKout, const float femtoDKside, const float femtoDKlong, const float mT , const float multPercentile, const float myQnBin, const float pairPhiEP, const float pairPhiEPforRot)
547531 {
548- if (storeEProt) {
549- // Rotate (out, side) by the signed φ_pair − Ψ_EP so DK_y is out-of-plane (||B); DK_z unchanged.
550- const float DKx = femtoDKout * std::cos (pairPhiEPforRot) - femtoDKside * std::sin (pairPhiEPforRot);
551- const float DKy = femtoDKout * std::sin (pairPhiEPforRot) + femtoDKside * std::cos (pairPhiEPforRot);
552- const float DKz = femtoDKlong;
553- mHistogramRegistry ->fill (HIST (mFolderSuffix [mEventType ]) + HIST (o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST (" _3Dqn" ) + HIST (" /relPair3dEProtRmTMultPercentileQnPairphi" ), DKx, DKy, DKz, mT , multPercentile, myQnBin, pairPhiEP);
554- } else {
555- mHistogramRegistry ->fill (HIST (mFolderSuffix [mEventType ]) + HIST (o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST (" _3Dqn" ) + HIST (" /relPair3dRmTMultPercentileQnPairphi" ), femtoDKout, femtoDKside, femtoDKlong, mT , multPercentile, myQnBin, pairPhiEP);
556- }
532+ const float DKx = femtoDKout * std::cos (pairPhiEPforRot) - femtoDKside * std::sin (pairPhiEPforRot);
533+ const float DKy = femtoDKout * std::sin (pairPhiEPforRot) + femtoDKside * std::cos (pairPhiEPforRot);
534+ const float DKz = femtoDKlong;
535+ mHistogramRegistry ->fill (HIST (mFolderSuffix [mEventType ]) + HIST (o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST (" _3Dqn" ) + HIST (" /relPair3dEProtRmTMultPercentileQnPairphi" ), DKx, DKy, DKz, mT , multPercentile, myQnBin, pairPhiEP);
557536 }
558537
559538 // / Called by setPair_3Dqn only in case of Monte Carlo truth
@@ -583,10 +562,14 @@ class FemtoDreamContainer
583562 const float mT = FemtoDreamMath::getmT (part1, mMassOne , part2, mMassTwo );
584563
585564 const float pairPhiEP = FemtoDreamMath::getPairPhiEP (part1, mMassOne , part2, mMassTwo , eventPlane);
586- const float pairPhiEPforRot = mStoreEProt ? getPairPhiEPSigned (part1, mMassOne , part2, mMassTwo , eventPlane) : 0 .f ;
565+ const float pairPhiEPforRot = mStoreEProt ? FemtoDreamMath:: getPairPhiEPSigned (part1, mMassOne , part2, mMassTwo , eventPlane) : 0 .f ;
587566
588567 if (mHistogramRegistry ) {
589- setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kRecon >(DKout, DKside, DKlong, mT , multPercentile, myQnBin, pairPhiEP, mStoreEProt , pairPhiEPforRot);
568+ if (mStoreEProt ) {
569+ setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kRecon >(DKout, DKside, DKlong, mT , multPercentile, myQnBin, pairPhiEP, pairPhiEPforRot);
570+ } else {
571+ setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kRecon >(DKout, DKside, DKlong, mT , multPercentile, myQnBin, pairPhiEP);
572+ }
590573
591574 if constexpr (isMC) {
592575 if (part1.has_fdMCParticle () && part2.has_fdMCParticle ()) {
@@ -598,10 +581,14 @@ class FemtoDreamContainer
598581 }
599582 const float mTMC = FemtoDreamMath::getmT (part1.fdMCParticle (), mMassOne , part2.fdMCParticle (), mMassTwo );
600583 const float pairPhiEPMC = FemtoDreamMath::getPairPhiEP (part1.fdMCParticle (), mMassOne , part2.fdMCParticle (), mMassTwo , eventPlane);
601- const float pairPhiEPMCforRot = mStoreEProt ? getPairPhiEPSigned (part1.fdMCParticle (), mMassOne , part2.fdMCParticle (), mMassTwo , eventPlane) : 0 .f ;
584+ const float pairPhiEPMCforRot = mStoreEProt ? FemtoDreamMath:: getPairPhiEPSigned (part1.fdMCParticle (), mMassOne , part2.fdMCParticle (), mMassTwo , eventPlane) : 0 .f ;
602585
603586 if (std::abs (part1.fdMCParticle ().pdgMCTruth ()) == mPDGOne && std::abs (part2.fdMCParticle ().pdgMCTruth ()) == mPDGTwo ) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates
604- setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kTruth >(k3dMC[1 ], k3dMC[2 ], k3dMC[3 ], mTMC , multPercentile, myQnBin, pairPhiEPMC, mStoreEProt , pairPhiEPMCforRot);
587+ if (mStoreEProt ) {
588+ setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kTruth >(k3dMC[1 ], k3dMC[2 ], k3dMC[3 ], mTMC , multPercentile, myQnBin, pairPhiEPMC, pairPhiEPMCforRot);
589+ } else {
590+ setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kTruth >(k3dMC[1 ], k3dMC[2 ], k3dMC[3 ], mTMC , multPercentile, myQnBin, pairPhiEPMC);
591+ }
605592 setPair_3Dqn_MC (k3dMC, k3d, part1.fdMCParticle ().partOriginMCTruth (), part2.fdMCParticle ().partOriginMCTruth (), smearingByOrigin);
606593 } else {
607594 mHistogramRegistry ->fill (HIST (mFolderSuffix [mEventType ]) + HIST (o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth ]) + HIST (" /hFakePairsCounter" ), 0 );
@@ -630,10 +617,14 @@ class FemtoDreamContainer
630617 const float mT = FemtoDreamMath::getmT (part1, mMassOne , part2, mMassTwo );
631618
632619 const float pairPhiEP = FemtoDreamMath::getPairPhiEP (part1, mMassOne , part2, mMassTwo , EP1 , EP2 );
633- const float pairPhiEPforRot = mStoreEProt ? getPairPhiEPSigned (part1, mMassOne , part2, mMassTwo , EP1 , EP2 ) : 0 .f ;
620+ const float pairPhiEPforRot = mStoreEProt ? FemtoDreamMath:: getPairPhiEPSigned (part1, mMassOne , part2, mMassTwo , EP1 , EP2 ) : 0 .f ;
634621
635622 if (mHistogramRegistry ) {
636- setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kRecon >(DKout, DKside, DKlong, mT , multPercentile, myQnBin, pairPhiEP, mStoreEProt , pairPhiEPforRot);
623+ if (mStoreEProt ) {
624+ setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kRecon >(DKout, DKside, DKlong, mT , multPercentile, myQnBin, pairPhiEP, pairPhiEPforRot);
625+ } else {
626+ setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kRecon >(DKout, DKside, DKlong, mT , multPercentile, myQnBin, pairPhiEP);
627+ }
637628
638629 if constexpr (isMC) {
639630 if (part1.has_fdMCParticle () && part2.has_fdMCParticle ()) {
@@ -645,10 +636,14 @@ class FemtoDreamContainer
645636 }
646637 const float mTMC = FemtoDreamMath::getmT (part1.fdMCParticle (), mMassOne , part2.fdMCParticle (), mMassTwo );
647638 const float pairPhiEPMC = FemtoDreamMath::getPairPhiEP (part1.fdMCParticle (), mMassOne , part2.fdMCParticle (), mMassTwo , EP1 , EP2 );
648- const float pairPhiEPMCforRot = mStoreEProt ? getPairPhiEPSigned (part1.fdMCParticle (), mMassOne , part2.fdMCParticle (), mMassTwo , EP1 , EP2 ) : 0 .f ;
639+ const float pairPhiEPMCforRot = mStoreEProt ? FemtoDreamMath:: getPairPhiEPSigned (part1.fdMCParticle (), mMassOne , part2.fdMCParticle (), mMassTwo , EP1 , EP2 ) : 0 .f ;
649640
650641 if (std::abs (part1.fdMCParticle ().pdgMCTruth ()) == mPDGOne && std::abs (part2.fdMCParticle ().pdgMCTruth ()) == mPDGTwo ) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates
651- setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kTruth >(k3dMC[1 ], k3dMC[2 ], k3dMC[3 ], mTMC , multPercentile, myQnBin, pairPhiEPMC, mStoreEProt , pairPhiEPMCforRot);
642+ if (mStoreEProt ) {
643+ setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kTruth >(k3dMC[1 ], k3dMC[2 ], k3dMC[3 ], mTMC , multPercentile, myQnBin, pairPhiEPMC, pairPhiEPMCforRot);
644+ } else {
645+ setPair_3Dqn_base<o2::aod::femtodreamMCparticle::MCType::kTruth >(k3dMC[1 ], k3dMC[2 ], k3dMC[3 ], mTMC , multPercentile, myQnBin, pairPhiEPMC);
646+ }
652647 setPair_3Dqn_MC (k3dMC, k3d, part1.fdMCParticle ().partOriginMCTruth (), part2.fdMCParticle ().partOriginMCTruth (), smearingByOrigin);
653648 } else {
654649 mHistogramRegistry ->fill (HIST (mFolderSuffix [mEventType ]) + HIST (o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth ]) + HIST (" /hFakePairsCounter" ), 0 );
0 commit comments