-
Notifications
You must be signed in to change notification settings - Fork 14
Feature/adding blip to caf #173
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
base: develop
Are you sure you want to change the base?
Conversation
|
Okay I think all the comments across each PR is now at least partly addressed, and the code compiles and seems to make sensible output when I run it. |
|
Hi @PetrilloAtWork , it looks like Jacob has implemented all the changes requested. How does the PR look now? Thanks! |
PetrilloAtWork
left a comment
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.
classes_def.xml needs to be fixes.
I am recommending the renaming of one of the classes.
I have follow up on a couple of the comments, and added a few more.
| <class name="caf::SRBlip" ClassVersion="11"> | ||
| <version ClassVersion="11" checksum="2097549339"/> | ||
| <version ClassVersion="10" checksum="3364148027"/> | ||
| </class> | ||
|
|
||
| <class name="caf::SRBlipHitClust" ClassVersion="12"> | ||
| <version ClassVersion="12" checksum="1544666038"/> | ||
| <version ClassVersion="11" checksum="3137900176"/> | ||
| <version ClassVersion="10" checksum="1233871129"/> | ||
| </class> | ||
|
|
||
| <class name="caf::SRBlipTrueBlip" ClassVersion="11"> | ||
| <version ClassVersion="11" checksum="451846977"/> | ||
| <version ClassVersion="10" checksum="984259034"/> | ||
| </class> |
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.
A single PR should increment a class version only by one unit.
These classes also list intermediate versions.
One way is to remove the checksums and let ROOT Cling do its job again (by building the library twice):
| <class name="caf::SRBlip" ClassVersion="11"> | |
| <version ClassVersion="11" checksum="2097549339"/> | |
| <version ClassVersion="10" checksum="3364148027"/> | |
| </class> | |
| <class name="caf::SRBlipHitClust" ClassVersion="12"> | |
| <version ClassVersion="12" checksum="1544666038"/> | |
| <version ClassVersion="11" checksum="3137900176"/> | |
| <version ClassVersion="10" checksum="1233871129"/> | |
| </class> | |
| <class name="caf::SRBlipTrueBlip" ClassVersion="11"> | |
| <version ClassVersion="11" checksum="451846977"/> | |
| <version ClassVersion="10" checksum="984259034"/> | |
| </class> | |
| <class name="caf::SRBlip" ClassVersion="10" /> | |
| <class name="caf::SRBlipHitClust" ClassVersion="10" /> | |
| <class name="caf::SRBlipTrueBlip" ClassVersion="10" /> |
An alternative is to fix it by hand by keeping the latest checksum but naming it "version 10":
| <class name="caf::SRBlip" ClassVersion="11"> | |
| <version ClassVersion="11" checksum="2097549339"/> | |
| <version ClassVersion="10" checksum="3364148027"/> | |
| </class> | |
| <class name="caf::SRBlipHitClust" ClassVersion="12"> | |
| <version ClassVersion="12" checksum="1544666038"/> | |
| <version ClassVersion="11" checksum="3137900176"/> | |
| <version ClassVersion="10" checksum="1233871129"/> | |
| </class> | |
| <class name="caf::SRBlipTrueBlip" ClassVersion="11"> | |
| <version ClassVersion="11" checksum="451846977"/> | |
| <version ClassVersion="10" checksum="984259034"/> | |
| </class> | |
| <class name="caf::SRBlip" ClassVersion="10"> | |
| <version ClassVersion="10" checksum="2097549339"/> | |
| </class> | |
| <class name="caf::SRBlipHitClust" ClassVersion="10"> | |
| <version ClassVersion="10" checksum="1544666038"/> | |
| </class> | |
| <class name="caf::SRBlipTrueBlip" ClassVersion="10"> | |
| <version ClassVersion="10" checksum="451846977"/> | |
| </class> |
It would be good to rebuild after this change too, for added safety.
sbnanaobj/StandardRecord/SRBlip.h
Outdated
| /*! | ||
| please note the blip X position is unreliable, so these distance and 3-d position derived variables may be incorrect | ||
| */ | ||
| SRVector3D position; ///< 3D position vector. Reconstructed with wrong t0! [cm] |
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.
Aggregate initialisation should work here:
| SRVector3D position; ///< 3D position vector. Reconstructed with wrong t0! [cm] | |
| SRVector3D position { -999., -999., -999. }; ///< 3D position vector. Reconstructed with wrong t0! [cm] |
(if compiler complains about narrowing, you may need to explicitly use float constants, like in -999.0f).
This will allow the removal of the default constructor.
Also, z -999 [cm] is almost within ICARUS detector, and it's not a particularly crazy value. If you don't like the default (NaN), use a more extreme value (e.g. -9999. is well outside SBN-FD).
sbnanaobj/StandardRecord/SRBlip.h
Outdated
| class SRBlip | ||
| { | ||
| public: |
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.
Hmm... that means that the scores would be the only private members, and you would need a specific accessor only for that. That makes the data members asymmetric. Alternatively, you'd have to set all data private and provide one accessor per data member, which is tedious.
I would rather suggest that the new scores be a public data member of a new custom type, say, SRBlipScores (side effect is that this one can still be a struct), and that the sorting be handled within the custom type.
sbnanaobj/StandardRecord/SRBlip.h
Outdated
| /*! | ||
| please note the blip X position is unreliable, so these distance and 3-d position derived variables may be incorrect | ||
| */ | ||
| SRVector3D position; ///< 3D position vector. Reconstructed with wrong t0! [cm] |
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.
"wrong t0" is maybe too strong... "assuming the blip was coincident with event trigger", for the slice happening at trigger time that ends up the right time (provided that the blip is not a delayed product of some decay of long-wandering particle).
I can't think of a better way to say that compactly though, so if you want to keep it as is, I am also fine with that.
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.
Updated to -- "Reconstructed assuming that the blip was coincident with the event trigger"
| * That blip reconstruction applies cuts to overall blip size/spread | ||
| * A single TrueBlip will be constructed for energy depositions within TrueBlipMergeDist (fcl set 0.3 cm by default) | ||
| */ | ||
| struct SRBlipTrueBlip { |
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.
Something that I missed from the previous run: SRBlipTrueBlip... isn't there too much Blip in it? SRTrueBlip should be descriptive enough and consistent with, e.g., SRTrueParticle.
Please seriously consider renaming this one.
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.
Updated to SRTrueBlip
sbnanaobj/StandardRecord/SRBlip.cxx
Outdated
| @@ -0,0 +1,20 @@ | |||
| /** | |||
| * @file SRBlip.h | |||
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.
This is the wrong file name (Doxygen will go crazy):
| * @file SRBlip.h | |
| * @file SRBlip.cxx |
(and yes, I did mistype it in my suggestion)
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 earlier comment suggested eliminating this file so I am trying that first.
sbnanaobj/StandardRecord/SRBlip.h
Outdated
| /*! | ||
| for properly flash matched out-of-time tracks this distance will be wrong! The blips have no such flash matching ability as of yet | ||
| */ | ||
| int proxTrkID=caf::kUninitializedInt; ///< index of the of closest track, assuming the blip was concident with event trigger |
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.
Typo:
| int proxTrkID=caf::kUninitializedInt; ///< index of the of closest track, assuming the blip was concident with event trigger | |
| int proxTrkID=caf::kUninitializedInt; ///< index of the of closest track, assuming the blip was coincident with event trigger |
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.
Fixed both typo of coincident
sbnanaobj/StandardRecord/SRBlip.h
Outdated
| float EnergyESTAR; // Energy (ESTAR method from ArgoNeuT) [GeV] | ||
| float EnergyPSTAR; // Energy (PSTAR method similar with ESTAR method from ArgoNeuT) [GeV] | ||
| float ProxTrkDist; // Distance to cloest track | ||
| int ProxTrkID; // ID of closest track |
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.
So maybe just add in parentheses " (recob::Track::ID())" to the documentation?
| std::vector<int> hitIDs; ///< Index of the recob::hit objects making up this cluster. Size should match nHits | ||
| std::vector<int> wires; ///< Set of geo::wireIDs contributing hits to this cluster. Size should match nWires |
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.
Using the exact name if the classes will help Doxygen cross-link.
| std::vector<int> hitIDs; ///< Index of the recob::hit objects making up this cluster. Size should match nHits | |
| std::vector<int> wires; ///< Set of geo::wireIDs contributing hits to this cluster. Size should match nWires | |
| std::vector<int> hitIDs; ///< Index of the `recob::Hit` objects making up this cluster. Size should match `nHits`. | |
| std::vector<int> wires; ///< Set of `geo::WireID` contributing hits to this cluster. Size should match `nWires`. |
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.
Updated these. Are the ` necessary? I also added them to the simb::MCParticle and raw::channelID references
|
Noticed the flat caf wasn't generated correctly so I used mrb z and recompiled. Now the compilation finishes and the output CAF + FlatCAF look good. |
|
Calling reviewers to check if these PRs are OK, @PetrilloAtWork , @henrylay97 , @sungbinoh |
sungbinoh
left a comment
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.
Everything looks very good. Thank a lot for the huge efforts!
| float time = caf::kSignalingNaN; ///< charge-weighted average hit-peak-times for this hit-cluster [us] | ||
| float startTime = caf::kSignalingNaN; ///< Minimum -1 sigma time of a hit in this cluster [us] | ||
| float endTime = caf::kSignalingNaN; ///< Max +1 sigma time of a hit in this cluster [us] | ||
| float timespan = caf::kSignalingNaN; ///< Hit cluster EndTime - StartTime [us] |
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.
In general I would say it's better practice not to store things like this as separate variables given it is fully defined by two other variables. Instead have a member function that returns the difference between the start and end time. There may well be other examples of similar occurrences.
I'm not going to hold the PR up for this, but something to think about for future.

Added classes to hold blip information in CAF format.
This results in the normal amount of CAF code duplication and replaces a few std::map and std::set objects in the LArSoft side with vectors.
This PR is independent of the associated ones in sbnobj, sbndcode, and sbncode.