-
Notifications
You must be signed in to change notification settings - Fork 16
Adding SRTrkLikelihoodPID class into the StandardRecord #168
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
Changes from 4 commits
aae18a6
efc6a8d
c599296
1f8c899
69f7b45
bacfd71
6907b18
82276e3
f26feaf
8420aeb
a4d4562
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||||||||||||||
| //////////////////////////////////////////////////////////////////////// | ||||||||||||||||||||||||
| // \file SRTrkLikelihoodPID.cxx | ||||||||||||||||||||||||
| // \brief An SRTrkLikelihoodPID is a high level track ParticlePID object for | ||||||||||||||||||||||||
| // for larana LikelihoodPIDAlg results. | ||||||||||||||||||||||||
| //////////////////////////////////////////////////////////////////////// | ||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please turn this into a Doxygen comment and add your name for glory/blame:
Suggested change
(you can add your e-mail in the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated following the suggested change.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good! If you can fix the repeated "for" in the brief description it's even better. |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #include "sbnanaobj/StandardRecord/SRTrkLikelihoodPID.h" | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #include <limits> | ||||||||||||||||||||||||
|
PetrilloAtWork marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| namespace caf | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| SRTrkLikelihoodPID::SRTrkLikelihoodPID(): | ||||||||||||||||||||||||
| pdg(-999), | ||||||||||||||||||||||||
| pid_ndof(-99), | ||||||||||||||||||||||||
| lambda_muon(std::numeric_limits<float>::signaling_NaN()), | ||||||||||||||||||||||||
| lambda_pion(std::numeric_limits<float>::signaling_NaN()), | ||||||||||||||||||||||||
| lambda_proton(std::numeric_limits<float>::signaling_NaN()) | ||||||||||||||||||||||||
|
PetrilloAtWork marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||
| { } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| SRTrkLikelihoodPID::~SRTrkLikelihoodPID(){ } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| void SRTrkLikelihoodPID::setDefault() | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| pdg = -5; | ||||||||||||||||||||||||
|
PetrilloAtWork marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||
| pid_ndof = -5; | ||||||||||||||||||||||||
| lambda_muon = -5.0; | ||||||||||||||||||||||||
| lambda_pion = -5.0; | ||||||||||||||||||||||||
| lambda_proton = -5.0; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
+15
to
+30
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry to be picky. I still don't like that we have default values set in 3 places. In the default constructor, in the setDefault function and in the corresponding sbncode PR they get set explicitly when making the object. I like the defaults used in the default constructor here so my suggestion is to remove the other two instances completely. For this PR this means removing the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @henrylay97 , no problem at all!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like it either, but there was a rationale that aimed to distinguish data that was never initialised (values from constructor), and the data that was defaulted by the user ( |
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| } // end namespace caf | ||||||||||||||||||||||||
| //////////////////////////////////////////////////////////////////////// | ||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||||||||||||||||
| //////////////////////////////////////////////////////////////////////// | ||||||||||||||||||||
| // \file SRTrkLikelihoodPID.h | ||||||||||||||||||||
| //////////////////////////////////////////////////////////////////////// | ||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please turn this comment block into Doxygen format:
Suggested change
(like in the class implementation file)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to the suggested change. |
||||||||||||||||||||
| #ifndef SRTRKLIKELIHOODPID_H | ||||||||||||||||||||
| #define SRTRKLIKELIHOODPID_H | ||||||||||||||||||||
|
|
||||||||||||||||||||
| namespace caf | ||||||||||||||||||||
| { | ||||||||||||||||||||
| /// Track PID from dE/dx v. likelihood from dE/dx PDF measured with residual range-based kinetic energy and hit pitch | ||||||||||||||||||||
| class SRTrkLikelihoodPID | ||||||||||||||||||||
| { | ||||||||||||||||||||
| public: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| SRTrkLikelihoodPID(); | ||||||||||||||||||||
| virtual ~SRTrkLikelihoodPID(); | ||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the destructor, since it does not do anything (
Suggested change
[edit] I guess that's
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing the destructor in both |
||||||||||||||||||||
|
|
||||||||||||||||||||
| int pdg; ///< Likelihood PID pdg | ||||||||||||||||||||
| int pid_ndof; ///< Number of degress of freedom in likelihood PID | ||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the space |
||||||||||||||||||||
| float lambda_muon; ///< Sum of -lnL/L_max (muon hypothesis) | ||||||||||||||||||||
| float lambda_pion; ///< Sum of -lnL/L_max (charged pion hypothesis) | ||||||||||||||||||||
| float lambda_proton; ///< Sum of -lnL/L_max (proton hypothesis) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| void setDefault(); | ||||||||||||||||||||
| }; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| } // end namespace | ||||||||||||||||||||
|
|
||||||||||||||||||||
| #endif // SRTRKLIKELIHOODPID_H | ||||||||||||||||||||
| ////////////////////////////////////////////////////////////////////////////// | ||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.