@@ -124,12 +124,10 @@ struct HfTaskDstarPolarisationInJet {
124124 eventSelectionBits = jetderiveddatautilities::initialiseEventSelectionBits (eventSelections.value );
125125
126126 // / check process functions
127- std::array<int , 4 > processes = {doprocessDstar, doprocessDstarWithMl, doprocessDstarMc, doprocessDstarMcWithMl};
128- const int nProcesses = std::accumulate (processes.begin (), processes.end (), 0 );
129- if (nProcesses > 1 ) {
127+ if (doprocessDstar + doprocessDstarWithMl + doprocessDstarMc + doprocessDstarMcWithMl > 1 ) {
130128 LOGP (fatal, " Only one process function should be enabled at a time, please check your configuration" );
131129 }
132- if (nProcesses == 0 ) {
130+ if (doprocessDstar + doprocessDstarWithMl + doprocessDstarMc + doprocessDstarMcWithMl == 0 ) {
133131 LOGP (fatal, " No process function enabled" );
134132 }
135133
@@ -284,11 +282,11 @@ struct HfTaskDstarPolarisationInJet {
284282 // / \param numTpcClsMin is the minimum number of TPC clusters of the daughter tracks
285283 // / \param nMuons is the number of muons from daughter decays
286284 // / \param isPartRecoDstar is a flag indicating if it is a partly reconstructed Dstar meson (MC only)
287- template <charm_polarisation::DecayChannel channel, bool withMl, bool doMc, charm_polarisation::CosThetaStarType cosThetaStarType >
288- void fillRecoHistos (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)
285+ template <charm_polarisation::DecayChannel channel, bool withMl, bool doMc>
286+ 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)
289287 {
290288
291- if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { // Helicity
289+ if (cosThetaStarType == charm_polarisation::CosThetaStarType::Helicity) { // Helicity
292290 if constexpr (!doMc) { // data
293291 if constexpr (withMl) { // with ML
294292 if (activateTrackingSys) {
@@ -383,7 +381,7 @@ struct HfTaskDstarPolarisationInJet {
383381 }
384382 }
385383 }
386- } else if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::Production) { // Production
384+ } else if (cosThetaStarType == charm_polarisation::CosThetaStarType::Production) { // Production
387385 if constexpr (!doMc) { // data
388386 if constexpr (withMl) { // with ML
389387 if (activateTrackingSys) {
@@ -478,7 +476,7 @@ struct HfTaskDstarPolarisationInJet {
478476 }
479477 }
480478 }
481- } else if constexpr (cosThetaStarType == charm_polarisation::CosThetaStarType::JetAxis) { // JetAxis
479+ } else if (cosThetaStarType == charm_polarisation::CosThetaStarType::JetAxis) { // JetAxis
482480 if constexpr (!doMc) { // data
483481 if constexpr (withMl) { // with ML
484482 if (activateTrackingSys) {
@@ -576,6 +574,7 @@ struct HfTaskDstarPolarisationInJet {
576574 }
577575 }
578576
577+ // / TODO: To be implemented
579578 // / \param ptCharmHad is the pt of the particle
580579 // / \param rapCharmHad is the rapidity of the particle
581580 // / \param cosThetaStar is the cosThetaStar of the particle
@@ -646,6 +645,7 @@ struct HfTaskDstarPolarisationInJet {
646645 return false ;
647646 }
648647
648+ // / TODO: To be implemented
649649 // / \param daughter is the daughter particle
650650 // / \param ptMin is the minimum pt
651651 // / \param etaMax is the maximum eta
@@ -662,10 +662,9 @@ struct HfTaskDstarPolarisationInJet {
662662 return true ;
663663 }
664664
665+ // / \param jet is the jet containing the candidates
665666 // / \param candidates are the selected candidates
666667 // / \param bkgRotationId is the id for the background rotation
667- // / \param particles are the generated particles
668- // / \param tracks are the reconstructed tracks
669668 // / \return true if candidate in signal region
670669 template <charm_polarisation::DecayChannel channel, bool withMl, bool doMc, typename Jet, typename Cand>
671670 bool runPolarisationAnalysis (Jet const & jet, Cand const & candidate, int bkgRotationId)
@@ -700,6 +699,7 @@ struct HfTaskDstarPolarisationInJet {
700699 float massDau{0 .f }, invMassCharmHad{0 .f }, invMassCharmHadForSparse{0 .f }, invMassD0{0 .f };
701700 float rapidity{-999 .f };
702701 std::array<float , 3 > outputMl{-1 .f , -1 .f , -1 .f };
702+ std::array<float , 3 > threeVecCand{};
703703 int isRotatedCandidate = 0 ; // currently meaningful only for Lc->pKpi
704704
705705 if constexpr (channel == charm_polarisation::DecayChannel::DstarToDzeroPi) {
@@ -717,7 +717,7 @@ struct HfTaskDstarPolarisationInJet {
717717 pxDau = threeVecSoftPi[0 ];
718718 pyDau = threeVecSoftPi[1 ];
719719 pzDau = threeVecSoftPi[2 ];
720- std::array< float , 3 > threeVecCand = RecoDecay::pVec (threeVecSoftPi, threeVecD0Prong0, threeVecD0Prong1);
720+ threeVecCand = RecoDecay::pVec (threeVecSoftPi, threeVecD0Prong0, threeVecD0Prong1);
721721 pxCharmHad = threeVecCand[0 ];
722722 pyCharmHad = threeVecCand[1 ];
723723 pzCharmHad = threeVecCand[2 ];
@@ -734,7 +734,7 @@ struct HfTaskDstarPolarisationInJet {
734734 pxDau = candidate.pxProng1 ();
735735 pyDau = candidate.pyProng1 ();
736736 pzDau = candidate.pzProng1 ();
737- std::array< float , 3 > threeVecCand = RecoDecay::pVec (std::array{candidate.pxProng1 (), candidate.pyProng1 (), candidate.pzProng1 ()},
737+ threeVecCand = RecoDecay::pVec (std::array{candidate.pxProng1 (), candidate.pyProng1 (), candidate.pzProng1 ()},
738738 std::array{candidate.pyProng0Charm (), candidate.pxProng0Charm (), candidate.pzProng0Charm ()},
739739 std::array{candidate.pxProng1Charm (), candidate.pyProng1Charm (), candidate.pzProng1Charm ()});
740740 pxCharmHad = threeVecCand[0 ];
@@ -796,17 +796,17 @@ struct HfTaskDstarPolarisationInJet {
796796 if (activateTHnSparseCosThStarHelicity) {
797797 // helicity
798798 cosThetaStarHelicity = helicityVec.Dot (threeVecDauCM) / std::sqrt (threeVecDauCM.Mag2 ()) / std::sqrt (helicityVec.Mag2 ());
799- fillRecoHistos<channel, withMl, doMc, charm_polarisation::CosThetaStarType::Helicity>( invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarHelicity, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
799+ fillRecoHistos<channel, withMl, doMc>( charm_polarisation::CosThetaStarType::Helicity, invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarHelicity, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
800800 }
801801 if (activateTHnSparseCosThStarProduction) {
802802 // production
803803 cosThetaStarProduction = normalVec.Dot (threeVecDauCM) / std::sqrt (threeVecDauCM.Mag2 ()) / std::sqrt (normalVec.Mag2 ());
804- fillRecoHistos<channel, withMl, doMc, charm_polarisation::CosThetaStarType::Production>( invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarProduction, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
804+ fillRecoHistos<channel, withMl, doMc>( charm_polarisation::CosThetaStarType::Production, invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarProduction, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
805805 }
806806 if (activateTHnSparseCosThStarJetAxis) {
807807 // jet axis
808808 cosThetaStarJet = jetaxisVec.Dot (threeVecDauCM) / std::sqrt (threeVecDauCM.Mag2 ()) / std::sqrt (jetaxisVec.Mag2 ());
809- fillRecoHistos<channel, withMl, doMc, charm_polarisation::CosThetaStarType::JetAxis>( invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarJet, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
809+ fillRecoHistos<channel, withMl, doMc>( charm_polarisation::CosThetaStarType::JetAxis, invMassCharmHadForSparse, ptCharmHad, rapidity, invMassD0, cosThetaStarJet, outputMl, isRotatedCandidate, origin, ptBhadMother, absEtaTrackMin, numItsClsMin, numTpcClsMin, nMuons, partRecoDstar, zParallel, jetPt);
810810 }
811811 } // / end loop over mass hypotheses
812812
0 commit comments