@@ -410,12 +410,14 @@ struct TaskPi0FlowEMC {
410410 // / \param pt is the transverse momentum of the candidate
411411 // / \param cent is the centrality of the collision
412412 // / \param sp is the scalar product
413+ template <const int histType>
413414 void fillThn (float & mass,
414415 float & pt,
415416 float & cent,
416417 float & sp)
417418 {
418- registry.fill (HIST (" hSparsePi0Flow" ), mass, pt, cent, sp);
419+ static constexpr std::string_view HistTypes[2 ] = {" hSparsePi0Flow" , " hSparseBkgFlow" };
420+ registry.fill (HIST (HistTypes[histType]), mass, pt, cent, sp);
419421 }
420422
421423 // / Get the centrality
@@ -689,7 +691,7 @@ struct TaskPi0FlowEMC {
689691 if (mesonConfig.enableTanThetadPhi ) {
690692 float dTheta = photon1.Theta () - photon3.Theta ();
691693 float dPhi = photon1.Phi () - photon3.Phi ();
692- if (mesonConfig.minTanThetadPhi > std::fabs (getAngleDegree (std::atan (dTheta / dPhi)))) {
694+ if (mesonConfig.enableTanThetadPhi && mesonConfig. minTanThetadPhi > std::fabs (getAngleDegree (std::atan (dTheta / dPhi)))) {
693695 registry.fill (HIST (" hSparseBkgFlow" ), mother1.M (), mother1.Pt (), cent, scalprodCand1);
694696 }
695697 } else {
@@ -712,7 +714,7 @@ struct TaskPi0FlowEMC {
712714 if (mesonConfig.enableTanThetadPhi ) {
713715 float dTheta = photon2.Theta () - photon3.Theta ();
714716 float dPhi = photon2.Phi () - photon3.Phi ();
715- if (mesonConfig.minTanThetadPhi > std::fabs (getAngleDegree (std::atan (dTheta / dPhi)))) {
717+ if (mesonConfig.enableTanThetadPhi && mesonConfig. minTanThetadPhi > std::fabs (getAngleDegree (std::atan (dTheta / dPhi)))) {
716718 registry.fill (HIST (" hSparseBkgFlow" ), mother2.M (), mother2.Pt (), cent, scalprodCand2);
717719 }
718720 } else {
@@ -772,7 +774,7 @@ struct TaskPi0FlowEMC {
772774 if (mesonConfig.enableTanThetadPhi ) {
773775 float dTheta = photon1.Theta () - photon3.Theta ();
774776 float dPhi = photon1.Phi () - photon3.Phi ();
775- if (mesonConfig.minTanThetadPhi > std::fabs (getAngleDegree (std::atan (dTheta / dPhi)))) {
777+ if (mesonConfig.enableTanThetadPhi && mesonConfig. minTanThetadPhi > std::fabs (getAngleDegree (std::atan (dTheta / dPhi)))) {
776778 registry.fill (HIST (" hSparseCalibBack" ), mother1.M (), mother1.E () / 2 ., cent);
777779 }
778780 } else {
@@ -790,7 +792,7 @@ struct TaskPi0FlowEMC {
790792 if (mesonConfig.enableTanThetadPhi ) {
791793 float dTheta = photon2.Theta () - photon3.Theta ();
792794 float dPhi = photon2.Phi () - photon3.Phi ();
793- if (mesonConfig.minTanThetadPhi > std::fabs (getAngleDegree (std::atan (dTheta / dPhi)))) {
795+ if (mesonConfig.enableTanThetadPhi && mesonConfig. minTanThetadPhi > std::fabs (getAngleDegree (std::atan (dTheta / dPhi)))) {
794796 registry.fill (HIST (" hSparseCalibBack" ), mother2.M (), mother2.E () / 2 ., cent);
795797 }
796798 } else {
@@ -806,6 +808,7 @@ struct TaskPi0FlowEMC {
806808 // / Compute the scalar product
807809 // / \param collision is the collision with the Q vector information and event plane
808810 // / \param meson are the selected candidates
811+ template <const int histType>
809812 void runFlowAnalysis (CollsWithQvecs::iterator const & collision, ROOT::Math::PtEtaPhiMVector const & meson)
810813 {
811814 auto [xQVec, yQVec] = getQvec (collision, qvecDetector);
@@ -823,7 +826,7 @@ struct TaskPi0FlowEMC {
823826 scalprodCand = scalprodCand / h1SPResolution->GetBinContent (h1SPResolution->FindBin (cent + epsilon));
824827 }
825828
826- fillThn (massCand, ptCand, cent, scalprodCand);
829+ fillThn<histType> (massCand, ptCand, cent, scalprodCand);
827830 return ;
828831 }
829832
@@ -950,7 +953,7 @@ struct TaskPi0FlowEMC {
950953 continue ;
951954 }
952955 registry.fill (HIST (" hClusterCuts" ), 6 );
953- runFlowAnalysis (collision, vMeson);
956+ runFlowAnalysis< 0 > (collision, vMeson);
954957 }
955958 if (cfgDoRotation) {
956959 if (nColl % cfgDownsampling.value == 0 ) {
@@ -1030,12 +1033,12 @@ struct TaskPi0FlowEMC {
10301033 registry.fill (HIST (" hTanThetaPhi" ), vMeson.M (), getAngleDegree (std::atan (dTheta / dPhi)));
10311034 registry.fill (HIST (" hAlphaPt" ), (v1.E () - v2.E ()) / (v1.E () + v2.E ()), vMeson.Pt ());
10321035 }
1033- if (mesonConfig.minTanThetadPhi > std::fabs (getAngleDegree (std::atan (dTheta / dPhi)))) {
1036+ if (mesonConfig.enableTanThetadPhi && mesonConfig. minTanThetadPhi > std::fabs (getAngleDegree (std::atan (dTheta / dPhi)))) {
10341037 registry.fill (HIST (" hClusterCuts" ), 5 );
10351038 continue ;
10361039 }
10371040 registry.fill (HIST (" hClusterCuts" ), 6 );
1038- runFlowAnalysis (c1, vMeson);
1041+ runFlowAnalysis< 1 > (c1, vMeson);
10391042 }
10401043 }
10411044 }
0 commit comments