-
Notifications
You must be signed in to change notification settings - Fork 615
[PWGHF,PWGJE] Add D* spin alignment jet analysis task #12436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
O2 linter results: ❌ 3 errors, |
Please consider the following formatting changes to AliceO2Group#12436
| template <charm_polarisation::DecayChannel channel, bool withMl, bool doMc, typename Jet, typename Cand> | ||
| bool runPolarisationAnalysis(Jet const& jet, Cand const& candidate, int bkgRotationId) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is channel a template argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed channel from the templated argument list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about others? like withMl and doMc, should I move them as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you can remove them in this case, because you need the flagMcMatchRec, mlScores columns whose availability depends on the table subscriptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it fine now?
| threeVecCand = RecoDecay::pVec(std::array{candidate.pxProng1(), candidate.pyProng1(), candidate.pzProng1()}, | ||
| std::array{candidate.pyProng0Charm(), candidate.pxProng0Charm(), candidate.pzProng0Charm()}, | ||
| std::array{candidate.pxProng1Charm(), candidate.pyProng1Charm(), candidate.pzProng1Charm()}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you use the candidate momentum directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use candidate momentum directly now.
| 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) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The amount of parameters makes the function calls super error-prone.
It would be much safer to pass a const& to a single object, like a struct or a map.
Even better would be to remove the function completely by simplifying the body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep fillRecoHistos since it is called several times for different cases (also in view to extend the task to other particles, such as Lc, it would be good to keep it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use struct pass parameters.
|
This PR has not been updated in the last 30 days. Is it still needed? Unless further action is taken, it will be closed in 5 days. |
Please consider the following formatting changes to AliceO2Group#12436
|
@vkucera I have updated the code, Could you please review it again when you are free? |
| /// \param numTpcClsMin is the minimum number of TPC clusters of the daughter tracks | ||
| /// \param nMuons is the number of muons from daughter decays | ||
| /// \param isPartRecoDstar is a flag indicating if it is a partly reconstructed Dstar meson (MC only) | ||
| void fillRecoHistos(charm_polarisation::CosThetaStarType cosThetaStarType, bool withMl, bool doMc, bool isPartRecoDstar, HfHistoInput& recoHistoInput) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| void fillRecoHistos(charm_polarisation::CosThetaStarType cosThetaStarType, bool withMl, bool doMc, bool isPartRecoDstar, HfHistoInput& recoHistoInput) | |
| void fillRecoHistos(charm_polarisation::CosThetaStarType cosThetaStarType, bool withMl, bool doMc, bool isPartRecoDstar, HfHistoInput const& recoHistoInput) |
| /// \param invMassCharmHad is the invariant-mass of the candidate | ||
| /// \param ptCharmHad is the pt of the candidate | ||
| /// \param rapCharmHad is the rapidity of the candidate | ||
| /// \param invMassD0 is the invariant-mass of the D0 daugher (only for D*+) | ||
| /// \param cosThetaStar is the cosThetaStar of the candidate | ||
| /// \param outputMl is the array with ML output scores | ||
| /// \param isRotatedCandidate is a flag that keeps the info of the rotation of the candidate for bkg studies | ||
| /// \param origin is the MC origin | ||
| /// \param ptBhadMother is the pt of the b-hadron mother (only in case of non-prompt) | ||
| /// \param absEtaMin is the minimum absolute eta of the daughter tracks | ||
| /// \param numItsClsMin is the minimum number of ITS clusters of the daughter tracks | ||
| /// \param numTpcClsMin is the minimum number of TPC clusters of the daughter tracks | ||
| /// \param nMuons is the number of muons from daughter decays | ||
| /// \param isPartRecoDstar is a flag indicating if it is a partly reconstructed Dstar meson (MC only) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the documentation
| } | ||
| if (activateTHnSparseCosThStarHelicity) { | ||
| // helicity | ||
| cosThetaStarHelicity = helicityVec.Dot(threeVecDauCM) / std::sqrt(threeVecDauCM.Mag2()) / std::sqrt(helicityVec.Mag2()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You only need one sqrt.
| Configurable<float> minRotAngleMultByPi{"minRotAngleMultByPi", 5. / 6, "Minimum angle rotation for track rotation, to be multiplied by pi"}; | ||
| Configurable<float> maxRotAngleMultByPi{"maxRotAngleMultByPi", 7. / 6, "Maximum angle rotation for track rotation, to be multiplied by pi"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Put the attributes
Min,Maxat the end. - The name suggests that the value is the product of the rotation angle and Pi, however the help string suggests that it is the ratio of the angle and Pi.
- You define a default value for a
floatasdouble/int. Make it consistent.
| std::array<float, 3> threeVecSoftPi{candidate.pxProng1() * std::cos(bkgRotAngle) - candidate.pyProng1() * std::sin(bkgRotAngle), candidate.pxProng1() * std::sin(bkgRotAngle) + candidate.pyProng1() * std::cos(bkgRotAngle), candidate.pzProng1()}; // we rotate the soft pion | ||
| std::array<float, 3> threeVecD0Prong0{candidate.pxProng0Charm(), candidate.pyProng0Charm(), candidate.pzProng0Charm()}; | ||
| std::array<float, 3> threeVecD0Prong1{candidate.pxProng1Charm(), candidate.pyProng1Charm(), candidate.pzProng1Charm()}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scope is wrong. These are used only inside the if (bkgRotationId > 0) block.
| std::array<float, 3> threeVecSoftPi{candidate.pxProng1() * std::cos(bkgRotAngle) - candidate.pyProng1() * std::sin(bkgRotAngle), candidate.pxProng1() * std::sin(bkgRotAngle) + candidate.pyProng1() * std::cos(bkgRotAngle), candidate.pzProng1()}; // we rotate the soft pion | ||
| std::array<float, 3> threeVecD0Prong0{candidate.pxProng0Charm(), candidate.pyProng0Charm(), candidate.pzProng0Charm()}; | ||
| std::array<float, 3> threeVecD0Prong1{candidate.pxProng1Charm(), candidate.pyProng1Charm(), candidate.pzProng1Charm()}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| std::array<float, 3> threeVecSoftPi{candidate.pxProng1() * std::cos(bkgRotAngle) - candidate.pyProng1() * std::sin(bkgRotAngle), candidate.pxProng1() * std::sin(bkgRotAngle) + candidate.pyProng1() * std::cos(bkgRotAngle), candidate.pzProng1()}; // we rotate the soft pion | |
| std::array<float, 3> threeVecD0Prong0{candidate.pxProng0Charm(), candidate.pyProng0Charm(), candidate.pzProng0Charm()}; | |
| std::array<float, 3> threeVecD0Prong1{candidate.pxProng1Charm(), candidate.pyProng1Charm(), candidate.pzProng1Charm()}; | |
| const std::array threeVecSoftPi{candidate.pxProng1() * std::cos(bkgRotAngle) - candidate.pyProng1() * std::sin(bkgRotAngle), candidate.pxProng1() * std::sin(bkgRotAngle) + candidate.pyProng1() * std::cos(bkgRotAngle), candidate.pzProng1()}; // we rotate the soft pion | |
| const std::array threeVecD0Prong0{candidate.pxProng0Charm(), candidate.pyProng0Charm(), candidate.pzProng0Charm()}; | |
| const std::array threeVecD0Prong1{candidate.pxProng1Charm(), candidate.pyProng1Charm(), candidate.pzProng1Charm()}; |
| /// \param candidates are the selected candidates | ||
| /// \param bkgRotationId is the id for the background rotation | ||
| /// \return true if candidate in signal region | ||
| template <bool withMl, bool doMc, typename Jet, typename Cand> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| template <bool withMl, bool doMc, typename Jet, typename Cand> | |
| template <bool WithMl, bool DoMc, typename Jet, typename Cand> |
| # or submit itself to any jurisdiction. | ||
| # or submit itself to any jurisdiction. | ||
|
|
||
| add_subdirectory(Tasks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the end the new task should go in the PWGJE directory, since it's input are JE tables.
|
This PR has not been updated in the last 30 days. Is it still needed? Unless further action is taken, it will be closed in 5 days. |
For now, the task include data and Reco-level MC analysis only.