-
Notifications
You must be signed in to change notification settings - Fork 11
Feature/adding blip to caf #155
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
|
An associated branch in sbndcode (also feature/AddingBlipToCAF) has the updated libraries linking necessary to point here. Once this one is in a release we can delete the file copies in sbndcode |
|
Hi @Jjm321814 , is there a required PR in sbndcode to accompany this? If yes, please point me to that PR. Thanks! |
|
Also summoning @PetrilloAtWork to take a look if there's time, not sure if ICARUS has something similar to this? |
|
The related sbndcode changes are in SBNSoftware/sbndcode#871 but they depend on this PR, not the other way around. |
|
Adding a comment to each of these to track all 4 related PR. The changes to sbnobj, and sbnanaobj are fully independent of any other changes, so they can be approved first. sbndcode changes rely on sbnobj, so it will have to wait for the first approval. A later simple PR will delete the (now duplicated) class files in the BlipUtils folder here sbncode changes rely on both sbnobj and sbnanaobj, so that will have to wait for both of the first two approvals. |
|
Accidentally ran with the wrong blip tag and still produced a CAF file in sbndcode area, so I expect it will work with ICARUS but I can not test it. |
|
Nope nothing is broken, just had a sbndcode area setup with an earlier LArSoft release that was causing me issues. I'll get back to the comments here |
sbnobj/SBND/Blip/BlipDataTypes.h
Outdated
| float dYZ = -9; // Approximate length scale in YZ space [cm] | ||
|
|
||
| // Plane/cluster-specific information | ||
| blip::HitClust clusters[kNplanes]; |
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.
Consider:
| blip::HitClust clusters[kNplanes]; | |
| std::array<blip::HitClust, kNplanes> clusters; |
That object provides a size() member that is useful in user code.
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
sbnobj/SBND/Blip/CMakeLists.txt
Outdated
| @@ -0,0 +1,11 @@ | |||
| cet_make_library( LIBRARY_NAME sbndobj_BlipDataTypes | |||
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.
| cet_make_library( LIBRARY_NAME sbndobj_BlipDataTypes | |
| cet_make_library( |
Library names are very hard to guess. A verbose but effective strategy is to leave it the default, which makes it easily predictable. And the most used convention guarantees at least the first element to be the repository the library belongs to ("sbndobj"?). I request it does not start with sbndobj, which is misleading, and strongly recommend to leave this library name the default:
- in
CMakeLists.txtlink lists, people will have to write the annoyingly longsbnobj::SBND_Blip(could actually be worse); - when you
#include "sbnobj/SBND/Blip/BlipDataTypes.h", you know that the library you need to add follows the path of the header (other example:links to#include "lardataobj/RecoBase/Hit.h" #include "nusimdata/SimulationBase/MCParticle.h"
lardataobj::RecoBaseandnusimdata::SimulationBase. Presto.)
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 the library name here and in relevant include locations.
| #ifndef BLIPDATATYPE | ||
| #define BLIPDATATYPE | ||
| #include "lardataobj/RecoBase/Hit.h" | ||
| #include "nusimdata/SimulationBase/MCParticle.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.
If TVector3 is going to stay, #include "TVector3.h".
Much better if a much better data type is chosen though.
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.
TVector3 was removed from here. It only remains as a temporary variable in some steps of sbndcode processing
sbnobj/SBND/Blip/classes.h
Outdated
| template class art::Assns<blip::Blip,recob::Hit,void>; | ||
| template class art::Wrapper<art::Assns<blip::Blip,recob::Hit,void> >; | ||
| template class art::Assns<blip::Blip,recob::SpacePoint,void>; | ||
| template class art::Wrapper<art::Assns<blip::Blip,recob::SpacePoint,void> >; |
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 don't need to bother specifying the void association metadata explicitly — it's a bit distracting, so I suggest the removal. Also, when you instantiate an art::Wrapper<T>, you also implicitly trigger the instantiation of T, so the others are redundant. This works because this is C++; classes_def.xml still needs all of them, unfortunately. Finally, the "partner association" instantiation is also not needed.
| template class art::Wrapper<art::Assns<blip::Blip,recob::SpacePoint,void> >; | |
| template class art::Wrapper<std::vector<blip::Blip> >; | |
| template class art::Wrapper<art::Assns<blip::Blip,recob::Hit> >; | |
| template class art::Wrapper<art::Assns<blip::Blip,recob::SpacePoint> >; |
I think the map instantiation is also not needed — I am not sure where it comes from, so I might be wrong.
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.
Removed voids and the map. Seems to build still
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.
In addition to the previous comments, I have added some on files I had missed.
| <class name="art::Wrapper<std::vector<blip::Blip> >"/> | ||
| <class name="blip::Blip"/> | ||
| <class name="std::vector<blip::Blip>"/> | ||
| <class name="blip::HitClust"/> | ||
| <class name="vector<blip::HitClust>"/> | ||
| <class name="art::Wrapper<std::vector<blip::HitClust> >"/> | ||
| <class name="blip::TrueBlip"/> | ||
| <class name="std::map<int,TVector3>"/> | ||
| <class name="art::Assns<blip::Blip,recob::Hit,void>"/> | ||
| <class name="art::Assns<recob::Hit, blip::Blip,void>"/> | ||
| <class name="art::Assns<blip::Blip,recob::SpacePoint,void>"/> | ||
| <class name="art::Wrapper<art::Assns<blip::Blip,recob::Hit,void> >"/> | ||
| <class name="art::Wrapper<art::Assns<recob::Hit,blip::Blip,void> >"/> | ||
| <class name="art::Wrapper<art::Assns<blip::Blip,recob::SpacePoint,void> >"/> |
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.
Some of these need to have ROOT I/O schema evolution enabled, that means that ROOT creates enough stuff so that old data can be read with newer code.
To do that, a class version needs to be added to the simple object (not std::vector, art::Assns etc.) and then the build needs to be run again. In that way, ROOT will extract and save the checksum of the current version of the class, and will do that again in the future each time the class changes.
This change is required.
| <class name="art::Wrapper<std::vector<blip::Blip> >"/> | |
| <class name="blip::Blip"/> | |
| <class name="std::vector<blip::Blip>"/> | |
| <class name="blip::HitClust"/> | |
| <class name="vector<blip::HitClust>"/> | |
| <class name="art::Wrapper<std::vector<blip::HitClust> >"/> | |
| <class name="blip::TrueBlip"/> | |
| <class name="std::map<int,TVector3>"/> | |
| <class name="art::Assns<blip::Blip,recob::Hit,void>"/> | |
| <class name="art::Assns<recob::Hit, blip::Blip,void>"/> | |
| <class name="art::Assns<blip::Blip,recob::SpacePoint,void>"/> | |
| <class name="art::Wrapper<art::Assns<blip::Blip,recob::Hit,void> >"/> | |
| <class name="art::Wrapper<art::Assns<recob::Hit,blip::Blip,void> >"/> | |
| <class name="art::Wrapper<art::Assns<blip::Blip,recob::SpacePoint,void> >"/> | |
| <class name="art::Wrapper<std::vector<blip::Blip> >"/> | |
| <class name="blip::Blip" ClassVersion="10" /> | |
| <class name="std::vector<blip::Blip>"/> | |
| <class name="blip::HitClust" ClassVersion="10" /> | |
| <class name="vector<blip::HitClust>"/> | |
| <class name="art::Wrapper<std::vector<blip::HitClust> >"/> | |
| <class name="blip::TrueBlip" ClassVersion="10" /> | |
| <class name="std::map<int,TVector3>"/> | |
| <class name="art::Assns<blip::Blip,recob::Hit,void>"/> | |
| <class name="art::Assns<recob::Hit, blip::Blip,void>"/> | |
| <class name="art::Assns<blip::Blip,recob::SpacePoint,void>"/> | |
| <class name="art::Wrapper<art::Assns<blip::Blip,recob::Hit,void> >"/> | |
| <class name="art::Wrapper<art::Assns<recob::Hit,blip::Blip,void> >"/> | |
| <class name="art::Wrapper<art::Assns<blip::Blip,recob::SpacePoint,void> >"/> |
Again, where is std::map<int,TVector3> needed?
Also, I don't know if the order matters here. In case, put the simplest objects first.
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 map is used to record intersection points of induction/collection plane wires for interplane matching. IntersectLocations in the HitClust struct. I am updating it to geo::point_t in accordance with the other suggestions
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 with class version labels, and removed std::map. Its not saved to the event so its not needed here.
sbnobj/SBND/Blip/CMakeLists.txt
Outdated
| lardataobj::RecoBase | ||
| nusimdata::SimulationBase | ||
| ) | ||
| art_dictionary(DICTIONARY_LIBRARIES sbndobj_BlipDataTypes) |
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 this with the fixed library name)
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 here and in other repo
sbnobj/SBND/Blip/classes.h
Outdated
|
|
||
| // data-products | ||
| // lardataobj | ||
| //#include "lardata/Utilities/AssociationUtil.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 one is spurious here:
| //#include "lardata/Utilities/AssociationUtil.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.
Removed this
sbnobj/SBND/Blip/classes.h
Outdated
| // lardataobj | ||
| //#include "lardata/Utilities/AssociationUtil.h" | ||
| #include "canvas/Persistency/Common/Assns.h" | ||
| #include "lardataobj/RecoBase/PFParticle.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.
Unused:
| #include "lardataobj/RecoBase/PFParticle.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.
Removed
sbnobj/SBND/Blip/classes.h
Outdated
| #include "canvas/Persistency/Common/Assns.h" | ||
| #include "lardataobj/RecoBase/PFParticle.h" | ||
| #include "lardataobj/RecoBase/Hit.h" | ||
| #include "nusimdata/SimulationBase/MCTruth.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.
Also not needed:
| #include "nusimdata/SimulationBase/MCTruth.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.
Removed
|
All the suggestions here have been committed. Every struct has doxygen comments, TVector3 has been generally replaced, and the few housekeeping comments have been accepted. |
|
Hi @PetrilloAtWork , it looks like Jacob has implemented all the changes requested. How does the PR look now? Thanks! |
This is part of a large array of PR to add blip objects to CAF files.
Previously the key blip structs were defined in sbndcode and this PR simply moves them to sbnobj.