-
Notifications
You must be signed in to change notification settings - Fork 39
Feature/sungbino likepid into cafmaker #593
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 3 commits
9bea391
2af2c08
3eeef15
2af891e
2651da1
ff96233
264bd4f
4c47688
ad25a04
c48e4bf
4346c58
4309dfe
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -892,6 +892,53 @@ namespace caf | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void FillPlaneLikePID(const anab::ParticleID &particle_id, caf::SRTrkLikePID &srlikepid) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Assign dummy values. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| srlikepid.lambda_muon = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| srlikepid.lambda_pion = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| srlikepid.lambda_proton = 0.; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| srlikepid.pid_ndof = 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. Why do we change from the previous defaults here? The object fills the defaults as -5
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 , |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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 would remove this completely. The values will be set to be the defaults by the default constructor anyway so let's avoid multiple points of maintenance. (See my comment here for more thoughts SBNSoftware/sbnanaobj#168 (comment))
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 , I've removed these lines following your comment in the SBNSoftware/sbnanaobj#168 (comment). Thank you! |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Loop over algorithm scores and extract the ones we want. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Get the ndof from any likelihood pid algorithm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| std::vector<anab::sParticleIDAlgScores> AlgScoresVec = particle_id.ParticleIDAlgScores(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. Capture it by reference, avoid copies (
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. Updated to the suggested change. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (size_t i_algscore=0; i_algscore<AlgScoresVec.size(); i_algscore++){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| anab::sParticleIDAlgScores AlgScore = AlgScoresVec.at(i_algscore); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. Avoid copying the objects, and also compact the notation:
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. Updated to the suggested change. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (AlgScore.fAlgName == "Likelihood"){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (TMath::Abs(AlgScore.fAssumedPdg) == 13) { // lambda_mu | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| srlikepid.lambda_muon = AlgScore.fValue; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| srlikepid.pid_ndof = AlgScore.fNdf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else if (TMath::Abs(AlgScore.fAssumedPdg) == 211) { // lambda_pi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| srlikepid.lambda_pion = AlgScore.fValue; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| srlikepid.pid_ndof = AlgScore.fNdf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else if (TMath::Abs(AlgScore.fAssumedPdg) == 2212) { // lambda_pr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| srlikepid.lambda_proton = AlgScore.fValue; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| srlikepid.pid_ndof = AlgScore.fNdf; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. Since the cases are known integral numbers, it's more efficient to use
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. Updated to the suggested change. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void FillTrackLikePID(const std::vector<art::Ptr<anab::ParticleID>> particleIDs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. Pass the particle ID pointer objects by reference (
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 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| caf::SRTrack& srtrack, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bool allowEmpty) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // get the particle ID's | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (unsigned i = 0; i < particleIDs.size(); i++) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const anab::ParticleID &particle_id = *particleIDs[i]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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. You can compact this avoiding
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. Updated to the suggested change. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (particle_id.PlaneID()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| unsigned plane_id = particle_id.PlaneID().Plane; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assert(plane_id < 3); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FillPlaneLikePID(particle_id, srtrack.likepid[plane_id]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void FillTrackPlaneCalo(const anab::Calorimetry &calo, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const std::vector<art::Ptr<recob::Hit>> &hits, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bool fill_calo_points, float fillhit_rrstart, float fillhit_rrend, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -226,6 +226,10 @@ namespace caf | |||||
| void FillTrackChi2PID(const std::vector<art::Ptr<anab::ParticleID>> particleIDs, | ||||||
| caf::SRTrack& srtrack, | ||||||
| bool allowEmpty = false); | ||||||
| void FillPlaneLikePID(const anab::ParticleID &particle_id, caf::SRTrkLikePID &srlikepid); | ||||||
| void FillTrackLikePID(const std::vector<art::Ptr<anab::ParticleID>> particleIDs, | ||||||
|
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. You forgot the reference:
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 |
||||||
| caf::SRTrack& srtrack, | ||||||
| bool allowEmpty = false); | ||||||
|
|
||||||
| void FillTrackPlaneCalo(const anab::Calorimetry &calo, | ||||||
| const std::vector<art::Ptr<recob::Hit>> &hits, | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.