@@ -279,8 +279,8 @@ struct HfTaskDstarPolarisationInJet {
279279 // / \param numTpcClsMin is the minimum number of TPC clusters of the daughter tracks
280280 // / \param nMuons is the number of muons from daughter decays
281281 // / \param isPartRecoDstar is a flag indicating if it is a partly reconstructed Dstar meson (MC only)
282- template <charm_polarisation::DecayChannel channel, bool withMl, bool doMc>
283- void fillRecoHistos (charm_polarisation::CosThetaStarType cosThetaStarType, float invMassCharmHad, float ptCharmHad, float rapCharmHad, float invMassD0, float cosThetaStar, std::array<float , 3 > outputMl, int isRotatedCandidate, int8_t origin, float ptBhadMother, float absEtaMin, int numItsClsMin, int numTpcClsMin, int8_t nMuons, bool isPartRecoDstar, float zParallel, float jetPt)
282+ template <bool withMl, bool doMc>
283+ void fillRecoHistos (charm_polarisation::CosThetaStarType cosThetaStarType, float invMassCharmHad, float ptCharmHad, float rapCharmHad, float invMassD0, float cosThetaStar, const std::array<float , 3 >& outputMl, int isRotatedCandidate, int8_t origin, float ptBhadMother, float absEtaMin, int numItsClsMin, int numTpcClsMin, int8_t nMuons, bool isPartRecoDstar, float zParallel, float jetPt)
284284 {
285285
286286 if (cosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { // Helicity
@@ -662,15 +662,15 @@ struct HfTaskDstarPolarisationInJet {
662662 // / \param candidates are the selected candidates
663663 // / \param bkgRotationId is the id for the background rotation
664664 // / \return true if candidate in signal region
665- template <charm_polarisation::DecayChannel channel, bool withMl, bool doMc, typename Jet, typename Cand>
666- bool runPolarisationAnalysis (Jet const & jet, Cand const & candidate, int bkgRotationId)
665+ template <bool withMl, bool doMc, typename Jet, typename Cand>
666+ bool runPolarisationAnalysis (charm_polarisation::DecayChannel channel, Jet const & jet, Cand const & candidate, int bkgRotationId)
667667 {
668668 bool isCandidateInSignalRegion{false };
669669 int8_t origin{RecoDecay::OriginType::None};
670670 float ptBhadMother{-1 .f };
671671 bool partRecoDstar{false };
672672 if constexpr (doMc) {
673- if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) {
673+ if (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) {
674674 partRecoDstar = std::abs (candidate.flagMcMatchRec ()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPiPi0 && std::abs (candidate.flagMcMatchRecCharm ()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0;
675675 bool signalDstar = std::abs (candidate.flagMcMatchRec ()) == hf_decay::hf_cand_dstar::DecayChannelMain::DstarToPiKPi && std::abs (candidate.flagMcMatchRecCharm ()) == hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK;
676676 if (!signalDstar && (!partRecoDstar || !activatePartRecoDstar)) { // this candidate is not signal and not partially reconstructed signal, skip
@@ -698,7 +698,7 @@ struct HfTaskDstarPolarisationInJet {
698698 std::array<float , 3 > threeVecCand{};
699699 int isRotatedCandidate = 0 ; // currently meaningful only for Lc->pKpi
700700
701- if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) {
701+ if (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) {
702702 // Dstar analysis
703703 // polarization measured from the soft-pion daughter (*)
704704
@@ -792,17 +792,17 @@ struct HfTaskDstarPolarisationInJet {
792792 if (activateTHnSparseCosThStarHelicity) {
793793 // helicity
794794 cosThetaStarHelicity = helicityVec.Dot (threeVecDauCM) / std::sqrt (threeVecDauCM.Mag2 ()) / std::sqrt (helicityVec.Mag2 ());
795- fillRecoHistos<channel, withMl, doMc>(charm_polarisation::CosThetaStarType::Helicity, invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarHelicity, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
795+ fillRecoHistos<withMl, doMc>(charm_polarisation::CosThetaStarType::Helicity, invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarHelicity, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
796796 }
797797 if (activateTHnSparseCosThStarProduction) {
798798 // production
799799 cosThetaStarProduction = normalVec.Dot (threeVecDauCM) / std::sqrt (threeVecDauCM.Mag2 ()) / std::sqrt (normalVec.Mag2 ());
800- fillRecoHistos<channel, withMl, doMc>(charm_polarisation::CosThetaStarType::Production, invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarProduction, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
800+ fillRecoHistos<withMl, doMc>(charm_polarisation::CosThetaStarType::Production, invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarProduction, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
801801 }
802802 if (activateTHnSparseCosThStarJetAxis) {
803803 // jet axis
804804 cosThetaStarJet = jetaxisVec.Dot (threeVecDauCM) / std::sqrt (threeVecDauCM.Mag2 ()) / std::sqrt (jetaxisVec.Mag2 ());
805- fillRecoHistos<channel, withMl, doMc>(charm_polarisation::CosThetaStarType::JetAxis, invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarJet, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
805+ fillRecoHistos<withMl, doMc>(charm_polarisation::CosThetaStarType::JetAxis, invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarJet, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
806806 }
807807 } // / end loop over mass hypotheses
808808
@@ -826,9 +826,9 @@ struct HfTaskDstarPolarisationInJet {
826826 auto groupedDstarjets = jets.sliceBy (dstarJetsPerCollision, thisCollId);
827827 for (const auto & jet : groupedDstarjets) {
828828 for (const auto & dstarCandidate : jet.candidates_as <aod::CandidatesDstarData>()) {
829- runPolarisationAnalysis<charm_polarisation::DecayChannel::DstarToDzeroPi, false , false >( jet, dstarCandidate, 0 );
829+ runPolarisationAnalysis<false , false >( charm_polarisation::DecayChannel::DstarToDzeroPi, jet, dstarCandidate, 0 );
830830 for (int iRotation{1 }; iRotation <= nBkgRotations; ++iRotation) {
831- runPolarisationAnalysis<charm_polarisation::DecayChannel::DstarToDzeroPi, false , false >( jet, dstarCandidate, iRotation);
831+ runPolarisationAnalysis<false , false >( charm_polarisation::DecayChannel::DstarToDzeroPi, jet, dstarCandidate, iRotation);
832832 }
833833 break ; // hf jet should have only one Dstar candidate but for safety
834834 }
@@ -850,9 +850,9 @@ struct HfTaskDstarPolarisationInJet {
850850 auto groupedDstarJets = jets.sliceBy (dstarJetsPerCollision, thisCollId);
851851 for (const auto & jet : groupedDstarJets) {
852852 for (const auto & dstarCandidate : jet.candidates_as <aod::CandidatesDstarData>()) {
853- runPolarisationAnalysis<charm_polarisation::DecayChannel::DstarToDzeroPi, true , false >( jet, dstarCandidate, 0 );
853+ runPolarisationAnalysis<true , false >( charm_polarisation::DecayChannel::DstarToDzeroPi, jet, dstarCandidate, 0 );
854854 for (int iRotation{1 }; iRotation <= nBkgRotations; ++iRotation) {
855- runPolarisationAnalysis<charm_polarisation::DecayChannel::DstarToDzeroPi, true , false >( jet, dstarCandidate, iRotation);
855+ runPolarisationAnalysis<true , false >( charm_polarisation::DecayChannel::DstarToDzeroPi, jet, dstarCandidate, iRotation);
856856 }
857857 break ; // hf jet should have only one Dstar candidate but for safety
858858 }
@@ -876,7 +876,7 @@ struct HfTaskDstarPolarisationInJet {
876876 const auto dstarMcDJetsPerCollision = mcdJets.sliceBy (dstarMCDJetsPerCollisionPreslice, collision.globalIndex ());
877877 for (const auto & mcdJet : dstarMcDJetsPerCollision) {
878878 for (const auto & mcdDstarCand : mcdJet.candidates_as <aod::CandidatesDstarMCD>()) {
879- runPolarisationAnalysis<charm_polarisation::DecayChannel::DstarToDzeroPi, false , true >( mcdJet, mcdDstarCand, 0 );
879+ runPolarisationAnalysis<false , true >( charm_polarisation::DecayChannel::DstarToDzeroPi, mcdJet, mcdDstarCand, 0 );
880880 break ;
881881 }
882882 }
@@ -900,7 +900,7 @@ struct HfTaskDstarPolarisationInJet {
900900 const auto dstarMcdJetsPerCollision = mcdJets.sliceBy (dstarMCDJetsPerCollisionPreslice, collision.globalIndex ());
901901 for (const auto & mcdJet : dstarMcdJetsPerCollision) {
902902 for (const auto & mcdDstarCand : mcdJet.candidates_as <aod::CandidatesDstarMCD>()) {
903- runPolarisationAnalysis<charm_polarisation::DecayChannel::DstarToDzeroPi, true , true >( mcdJet, mcdDstarCand, 0 );
903+ runPolarisationAnalysis<true , true >( charm_polarisation::DecayChannel::DstarToDzeroPi, mcdJet, mcdDstarCand, 0 );
904904 }
905905 }
906906 }
0 commit comments