-
Notifications
You must be signed in to change notification settings - Fork 11
Light Calorimetry: Add obj for light calo objects #158
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?
Changes from all commits
d20b9a3
e39af6a
fa0960e
878f4bd
7011f08
6d13a02
3d1aa8c
94bb6d1
e7249f6
234ce58
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 @@ | ||
| #include "sbnobj/Common/Reco/LightCalo.h" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| /** | ||
| * @file sbnobj/Common/Reco/LightCalo.h | ||
| * @brief Defines data structures for light calorimetry products. | ||
| * @author Lynn Tung | ||
| * @date December 2nd, 2025 | ||
| * | ||
| */ | ||
|
|
||
| #ifndef sbnobj_LightCalo_H | ||
| #define sbnobj_LightCalo_H | ||
|
|
||
| #include <limits> | ||
|
|
||
| namespace sbn{ | ||
|
|
||
| /** | ||
| * @brief A simple class to store reconstructed charge, light, and visible energy. | ||
| */ | ||
|
|
||
| class LightCalo { | ||
| public: | ||
|
|
||
| // NaN value to initialize data members | ||
| static constexpr double nan = std::numeric_limits<double>::signaling_NaN(); | ||
|
|
||
| /// @name Reconstructed charge, light, and visible energy data members. | ||
| /// @{ | ||
| double charge = nan; ///< Total charge in a reconstructed interaction (recob::Slice) [# of electrons] | ||
| double light = nan; ///< Total light in a reconstructed interaction (recob::Slice + recob::OpFlash) [# of photons] | ||
| double energy = nan; ///< Total visible energy (sum of charge+light) for a reconstructed interaction [GeV] | ||
| int bestplane = -1; ///< Plane that was used for the total charge | ||
| /// @} | ||
|
|
||
| /** | ||
| * Default constructor. | ||
| */ | ||
| LightCalo() = default; | ||
| LightCalo(double charge, double light, double energy, int bestplane) | ||
| : charge(charge) | ||
| , light(light) | ||
| , energy(energy) | ||
| , bestplane(bestplane) | ||
| {} | ||
|
Comment on lines
+34
to
+43
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 have introduced a value constructor, and I want to make sure you are aware of the implications. I will compare yours with the same class in "plain old data" version, with no user-defined constructor (yours has two: the value constructor and the default one). With your version, it's harder for the user to initialise the object only partially (e.g. initialise In general I recommend POD classes, but that opens for partial initialisation. |
||
| }; | ||
| } | ||
|
|
||
| #endif | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -78,6 +78,22 @@ | |||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Assns<sbn::crt::CRTHit, recob::Track, void>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Wrapper<art::Assns<sbn::crt::CRTHit, recob::Track, void>>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| <class name="sbn::LightCalo"> | ||||||||||||||||||||||||||||||||||||||||||||||
| </class> | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+81
to
+82
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. This needs a checksum and a class version, so that when we change it ROOT knows how to read the old versions. Start with:
Suggested change
then build: it will tell you to build again. Rebuild... at this point you should see a fully successful build. Lastly, commit the new |
||||||||||||||||||||||||||||||||||||||||||||||
| <class name="std::vector<sbn::LightCalo>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Wrapper<sbn::LightCalo>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Wrapper<std::vector<sbn::LightCalo>>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Assns<recob::Slice, sbn::LightCalo>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Wrapper<art::Assns<recob::Slice, sbn::LightCalo>>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Assns<sbn::LightCalo, recob::Slice, void>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Wrapper<art::Assns<sbn::LightCalo, recob::Slice, void>>"/> | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Assns<recob::OpFlash, sbn::LightCalo>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Assns<sbn::LightCalo, recob::OpFlash, void>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Wrapper<art::Assns<recob::OpFlash, sbn::LightCalo>>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
| <class name="art::Wrapper<art::Assns<sbn::LightCalo, recob::OpFlash, void>>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+87
to
+95
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. The
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| <class name="sbn::OpT0Finder"> | ||||||||||||||||||||||||||||||||||||||||||||||
| </class> | ||||||||||||||||||||||||||||||||||||||||||||||
| <class name="std::vector<sbn::OpT0Finder>" /> | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
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.
Since the whole class content is public, I would declare it
struct:It is 100% equivalent, and I think clearer.