-
Notifications
You must be signed in to change notification settings - Fork 14
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
Merged
kjplows
merged 11 commits into
SBNSoftware:develop
from
sungbinoh:feature/sungbino_likepid_into_cafmaker
Nov 21, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
aae18a6
Adding SRTrkLikePID for likelihod based PID
sungbinoh efc6a8d
More updates for TrkLikePID
sungbinoh c599296
updating SRTrkLikePID to SRTrkLikelihoodPID
sungbinoh 1f8c899
more updates for SRTrkLikelihoodPID
sungbinoh 69f7b45
removing void SRTrkLikelihoodPID::setDefault()
sungbinoh bacfd71
removing void SRTrkLikelihoodPID::setDefault()
sungbinoh 6907b18
Following Gianluca's comments
sungbinoh 82276e3
Update sbnanaobj/StandardRecord/classes_def.xml
sungbinoh f26feaf
Update sbnanaobj/StandardRecord/classes_def.xml
sungbinoh 8420aeb
Merge branch 'develop' into feature/sungbino_likepid_into_cafmaker
kjplows a4d4562
Merge branch 'develop' into feature/sungbino_likepid_into_cafmaker
kjplows File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /** | ||
| * @file sbnanaobj/StandardRecord/SRTrkLikelihoodPID.cxx | ||
| * @brief An `SRTrkLikelihoodPID` is a high level track ParticlePID object for | ||
| * for larana LikelihoodPIDAlg results. | ||
| * @author Sungbin Oh ([email protected]) | ||
| */ | ||
|
|
||
| #include "sbnanaobj/StandardRecord/SRTrkLikelihoodPID.h" | ||
|
|
||
| #include "sbnanaobj/StandardRecord/SRConstants.h" | ||
|
|
||
| namespace caf | ||
| { | ||
|
|
||
| SRTrkLikelihoodPID::SRTrkLikelihoodPID(): | ||
| pdg(-999), | ||
| pid_ndof(-99), | ||
| lambda_muon(caf::kSignalingNaN), | ||
| lambda_pion(caf::kSignalingNaN), | ||
| lambda_proton(caf::kSignalingNaN) | ||
| { } | ||
|
|
||
| void SRTrkLikelihoodPID::setDefault() | ||
| { | ||
| pdg = 0; | ||
| pid_ndof = -5; | ||
| lambda_muon = -5.0; | ||
| lambda_pion = -5.0; | ||
| lambda_proton = -5.0; | ||
| } | ||
|
|
||
| } // end namespace caf | ||
| //////////////////////////////////////////////////////////////////////// | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /** | ||
| * @file sbnanaobj/StandardRecord/SRTrkLikelihoodPID.h | ||
| * @brief An `SRTrkLikelihoodPID` is a high level track ParticlePID object for | ||
| * for larana LikelihoodPIDAlg results. | ||
| * @author Sungbin Oh ([email protected]) | ||
| */ | ||
| #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(); | ||
|
|
||
| int pdg; ///< Likelihood PID pdg | ||
| int pid_ndof; ///< Number of degress of freedom in likelihood PID | ||
| 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 | ||
| ////////////////////////////////////////////////////////////////////////////// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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
setDefault()function, it doesn't appear to be used anywhere?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.
Hi @henrylay97 , no problem at all!
I've removed the other two places setting the default values, also removing
void SRTrkLikelihoodPID::setDefault().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 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 (
setDefault()).Without the former, if code omits an initialisation we end up with random values in the data files, and when we try comparing two versions of data we may see red-herring differences because of that.