@@ -116,9 +116,10 @@ struct Chk892Flow {
116116 ConfigurableAxis cfgBinsVtxZ{" cfgBinsVtxZ" , {VARIABLE_WIDTH, -10.0 , -9.0 , -8.0 , -7.0 , -6.0 , -5.0 , -4.0 , -3.0 , -2.0 , -1.0 , 0.0 , 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 , 9.0 , 10.0 }, " Binning of the z-vertex axis" };
117117 Configurable<int > cNbinsDiv{" cNbinsDiv" , 1 , " Integer to divide the number of bins" };
118118 Configurable<int > cNbinsDivQA{" cNbinsDivQA" , 1 , " Integer to divide the number of bins for QA" };
119- ConfigurableAxis cfgAxisV2{" cfgAxisV2" , {200 , -2 , 2 }, " Binning of the v2 axis" };
119+ ConfigurableAxis cfgAxisV2{" cfgAxisV2" , {200 , -1 , 1 }, " Binning of the v2 axis (+-1 for EP method) " };
120120 Configurable<bool > cfgFillAdditionalAxis{" cfgFillAdditionalAxis" , false , " Fill additional axis" };
121121 ConfigurableAxis cfgAxisPhi{" cfgAxisPhi" , {8 , 0 , constants::math::PI}, " Binning of the #phi axis" };
122+ Configurable<bool > cfgUseScalProduct{" cfgUseScalProduct" , false , " Use scalar product method" };
122123
123124 // Event cuts
124125 o2::analysis::CollisonCuts colCuts;
@@ -278,6 +279,12 @@ struct Chk892Flow {
278279 histos.add (" QA/EP/hEPResAC" , " cos(n(A-C))" , {HistType::kTH2D , {centAxis, epAxis}});
279280 histos.add (" QA/EP/hEPResBC" , " cos(n(B-C))" , {HistType::kTH2D , {centAxis, epAxis}});
280281
282+ if (cfgUseScalProduct) {
283+ histos.add (" QA/EP/hEPSPResAB" , " cos(n(A-B))" , {HistType::kTH2D , {centAxis, epAxis}});
284+ histos.add (" QA/EP/hEPSPResAC" , " cos(n(A-C))" , {HistType::kTH2D , {centAxis, epAxis}});
285+ histos.add (" QA/EP/hEPSPResBC" , " cos(n(B-C))" , {HistType::kTH2D , {centAxis, epAxis}});
286+ }
287+
281288 // Rotated background
282289 if (cfgFillRotBkg) {
283290 histos.add (" QA/RotBkg/hRotBkg" , " Rotated angle of rotated background" , HistType::kTH1F , {{360 , 0.0 , o2::constants::math::TwoPI}});
@@ -705,12 +712,23 @@ struct Chk892Flow {
705712 double lEPResAC = std::cos (static_cast <float >(nmode) * (lEPDet - lEPRefC));
706713 double lEPResBC = std::cos (static_cast <float >(nmode) * (lEPRefB - lEPRefC));
707714
715+ // EP method
708716 histos.fill (HIST (" QA/EP/hEPDet" ), lCentrality, lEPDet);
709717 histos.fill (HIST (" QA/EP/hEPB" ), lCentrality, lEPRefB);
710718 histos.fill (HIST (" QA/EP/hEPC" ), lCentrality, lEPRefC);
711719 histos.fill (HIST (" QA/EP/hEPResAB" ), lCentrality, lEPResAB);
712720 histos.fill (HIST (" QA/EP/hEPResAC" ), lCentrality, lEPResAC);
713721 histos.fill (HIST (" QA/EP/hEPResBC" ), lCentrality, lEPResBC);
722+ // Scalar product method
723+ if (cfgUseScalProduct) {
724+ double lEPSPResAB = collision.qvecRe ()[lQvecDetInd] * collision.qvecRe ()[lQvecRefAInd] + collision.qvecIm ()[lQvecDetInd] * collision.qvecIm ()[lQvecRefAInd] * lEPResAB;
725+ double lEPSPResAC = collision.qvecRe ()[lQvecDetInd] * collision.qvecRe ()[lQvecRefBInd] + collision.qvecIm ()[lQvecDetInd] * collision.qvecIm ()[lQvecRefBInd] * lEPResAC;
726+ double lEPSPResBC = collision.qvecRe ()[lQvecRefAInd] * collision.qvecRe ()[lQvecRefBInd] + collision.qvecIm ()[lQvecRefAInd] * collision.qvecIm ()[lQvecRefBInd] * lEPResBC;
727+
728+ histos.fill (HIST (" QA/EP/hEPSPResAB" ), lCentrality, lEPSPResAB);
729+ histos.fill (HIST (" QA/EP/hEPSPResAC" ), lCentrality, lEPSPResAC);
730+ histos.fill (HIST (" QA/EP/hEPSPResBC" ), lCentrality, lEPSPResBC);
731+ }
714732
715733 TLorentzVector lDecayDaughter1, lDecayDaughter2, lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot, lResonanceRot;
716734 std::vector<int > trackIndicies = {};
@@ -861,15 +879,22 @@ struct Chk892Flow {
861879 lDecayDaughter_bach.SetXYZM (bTrack.px (), bTrack.py (), bTrack.pz (), MassPionCharged);
862880 lResoSecondary.SetXYZM (k0sCand.px (), k0sCand.py (), k0sCand.pz (), MassK0Short);
863881 lResoKstar = lResoSecondary + lDecayDaughter_bach;
864-
865- auto lPhiMinusPsiKstar = RecoDecay::constrainAngle (lResoKstar.Phi () - lEPDet, 0.0 , 2 ); // constrain angle to range 0, Pi
866- auto v2Kstar = std::cos (static_cast <float >(nmode) * lPhiMinusPsiKstar);
882+ auto resoPhi = lResoKstar.Phi ();
883+ // EP method
884+ auto lPhiMinusPsiKstar = RecoDecay::constrainAngle (resoPhi - lEPDet, 0.0 , 2 ); // constrain angle to range 0, Pi
885+ auto resoFlowValue = std::cos (static_cast <float >(nmode) * lPhiMinusPsiKstar);
886+ // Scalar product method
887+ if (cfgUseScalProduct) {
888+ float cosNPhi = std::cos (static_cast <float >(nmode) * resoPhi);
889+ float sinNPhi = std::sin (static_cast <float >(nmode) * resoPhi);
890+ resoFlowValue = cosNPhi * collision.qvecRe ()[lQvecDetInd] + sinNPhi * collision.qvecIm ()[lQvecDetInd];
891+ }
867892
868893 // QA plots
869894 if constexpr (!IsMix) {
870895 histos.fill (HIST (" QA/before/KstarRapidity" ), lResoKstar.Rapidity ());
871896 histos.fill (HIST (" QA/before/kstarinvmass" ), lResoKstar.M ());
872- histos.fill (HIST (" QA/before/kstarv2vsinvmass" ), lResoKstar.M (), v2Kstar );
897+ histos.fill (HIST (" QA/before/kstarv2vsinvmass" ), lResoKstar.M (), resoFlowValue );
873898 }
874899
875900 if (lResoKstar.Rapidity () > cKstarMaxRap || lResoKstar.Rapidity () < cKstarMinRap)
@@ -880,11 +905,11 @@ struct Chk892Flow {
880905
881906 histos.fill (HIST (" QA/after/KstarRapidity" ), lResoKstar.Rapidity ());
882907 histos.fill (HIST (" QA/after/kstarinvmass" ), lResoKstar.M ());
883- histos.fill (HIST (" QA/after/kstarv2vsinvmass" ), lResoKstar.M (), v2Kstar );
908+ histos.fill (HIST (" QA/after/kstarv2vsinvmass" ), lResoKstar.M (), resoFlowValue );
884909 if (cfgFillAdditionalAxis) {
885- histos.fill (HIST (" hInvmass_Kstar" ), typeKstar, lCentrality, lResoKstar.Pt (), lResoKstar.M (), v2Kstar , static_cast <float >(nmode) * lPhiMinusPsiKstar);
910+ histos.fill (HIST (" hInvmass_Kstar" ), typeKstar, lCentrality, lResoKstar.Pt (), lResoKstar.M (), resoFlowValue , static_cast <float >(nmode) * lPhiMinusPsiKstar);
886911 } else {
887- histos.fill (HIST (" hInvmass_Kstar" ), typeKstar, lCentrality, lResoKstar.Pt (), lResoKstar.M (), v2Kstar );
912+ histos.fill (HIST (" hInvmass_Kstar" ), typeKstar, lCentrality, lResoKstar.Pt (), lResoKstar.M (), resoFlowValue );
888913 }
889914
890915 if (cfgFillRotBkg) {
@@ -900,13 +925,19 @@ struct Chk892Flow {
900925 lDaughterRot.RotateZ (lRotAngle);
901926 lResonanceRot = lDecayDaughter_bach + lDaughterRot;
902927 }
903- auto lPhiMinusPsiKstar = RecoDecay::constrainAngle (lResonanceRot.Phi () - lEPDet, 0.0 , 2 ); // constrain angle to range 0, Pi
904- auto v2Kstar = std::cos (static_cast <float >(nmode) * lPhiMinusPsiKstar);
928+ resoPhi = lResonanceRot.Phi ();
929+ auto lPhiMinusPsiKstar = RecoDecay::constrainAngle (resoPhi - lEPDet, 0.0 , 2 ); // constrain angle to range 0, Pi
930+ auto resoFlowValue = std::cos (static_cast <float >(nmode) * lPhiMinusPsiKstar);
931+ if (cfgUseScalProduct) {
932+ float cosNPhi = std::cos (static_cast <float >(nmode) * resoPhi);
933+ float sinNPhi = std::sin (static_cast <float >(nmode) * resoPhi);
934+ resoFlowValue = cosNPhi * collision.qvecRe ()[lQvecDetInd] + sinNPhi * collision.qvecIm ()[lQvecDetInd];
935+ }
905936 typeKstar = bTrack.sign () > 0 ? BinType::kKstarP_Rot : BinType::kKstarN_Rot ;
906937 if (cfgFillAdditionalAxis) {
907- histos.fill (HIST (" hInvmass_Kstar" ), typeKstar, lCentrality, lResonanceRot.Pt (), lResonanceRot.M (), v2Kstar , static_cast <float >(nmode) * lPhiMinusPsiKstar);
938+ histos.fill (HIST (" hInvmass_Kstar" ), typeKstar, lCentrality, lResonanceRot.Pt (), lResonanceRot.M (), resoFlowValue , static_cast <float >(nmode) * lPhiMinusPsiKstar);
908939 } else {
909- histos.fill (HIST (" hInvmass_Kstar" ), typeKstar, lCentrality, lResonanceRot.Pt (), lResonanceRot.M (), v2Kstar );
940+ histos.fill (HIST (" hInvmass_Kstar" ), typeKstar, lCentrality, lResonanceRot.Pt (), lResonanceRot.M (), resoFlowValue );
910941 }
911942 }
912943 }
0 commit comments