Skip to content

Conversation

@Jjm321814
Copy link

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.

@Jjm321814 Jjm321814 self-assigned this Nov 10, 2025
@Jjm321814 Jjm321814 requested a review from sungbinoh November 10, 2025 15:09
@Jjm321814
Copy link
Author

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

@kjplows
Copy link
Contributor

kjplows commented Nov 12, 2025

Hi @Jjm321814 , is there a required PR in sbndcode to accompany this? If yes, please point me to that PR. Thanks!

@kjplows
Copy link
Contributor

kjplows commented Nov 12, 2025

Also summoning @PetrilloAtWork to take a look if there's time, not sure if ICARUS has something similar to this?

@Jjm321814
Copy link
Author

The related sbndcode changes are in SBNSoftware/sbndcode#871 but they depend on this PR, not the other way around.
This one just moves some struct definitions out of sbndcode and into sbnobj so that it can be imported into sbncode for CAFMaker.

@Jjm321814
Copy link
Author

Adding a comment to each of these to track all 4 related PR.
sbncode: SBNSoftware/sbncode#603
sbndcode: SBNSoftware/sbndcode#871
sbnobj: #155
sbnanaobj: SBNSoftware/sbnanaobj#173

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.

@Jjm321814
Copy link
Author

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.

@Jjm321814
Copy link
Author

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.
A later fix can remove TVector3 from blip processing steps too. May I ask what is the issue with TVector3?

@kjplows kjplows moved this from Open pull requests to Partially reviewed in SBN software development Dec 14, 2025
@kjplows
Copy link
Contributor

kjplows commented Dec 14, 2025

Hi @PetrilloAtWork , it looks like Jacob has implemented all the changes requested. How does the PR look now? Thanks!

@Jjm321814
Copy link
Author

I am happy with how the CAF look coming out of the 4 PR now.

@kjplows
Copy link
Contributor

kjplows commented Jan 15, 2026

Calling reviewers to check if these PRs are OK, @PetrilloAtWork , @henrylay97 , @sungbinoh

Copy link

@sungbinoh sungbinoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good. Thank you very much!

float EndHitTime = -999; ///< Depreciated
float StartTime = -999; ///< Minimum -1 sigma time of a hit in this cluster [us]
float EndTime = -999; ///< Max +1 sigma time of a hit in this cluster [us]
float Timespan = -999; ///< Hit cluster EndTime - StartTime [us]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kjplows
Copy link
Contributor

kjplows commented Jan 21, 2026

Hi @PetrilloAtWork , do the changes look good to you? Thanks!

@kjplows kjplows moved this from Partially reviewed to Testing in SBN software development Jan 21, 2026
@kjplows kjplows moved this from Testing to Partially reviewed in SBN software development Jan 21, 2026
Copy link
Member

@PetrilloAtWork PetrilloAtWork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many, many thanks for adding the documentation!
I have added some suggested changes to its format here and there.
Now that I know isPrimary is a flag, I think the type of that variable should be bool rather than int.
But most important: the new classes still do not show a checksum in classes_def.xml. Either you have forgotten rebuilding and recommitting the changes to it, or the dictionary is not being generated at all (which would be surprising).

Comment on lines 2 to 15
<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> >"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is still amiss... have you rebuilt and then recommitted sbnobj/SBND/Blip/classes_def.xml? These items should show a checksum.

float amp = -9; ///< Amplitude of hit [ADC]
float rms = -9; ///< RMS of hit shape [ticks]
int trkid = -9; ///< track ID from hit-track association object
int shwrid = -9; ///< Depreciated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int shwrid = -9; ///< Depreciated
int shwrid = -9; ///< Deprecated

It's about praying (depreco, I pray it to go away), not price (depretio, I lower the cost).

* Most attributes are grabbed directly from the recob::hit, but some, like charge, involve extra processing.
*/
struct HitInfo {
int hitid = -9; ///< Index of hit in recob::hit vector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the correct capitalisation enables Doxygen to create cross-references:

Suggested change
int hitid = -9; ///< Index of hit in recob::hit vector
int hitid = -9; ///< Index of hit in recob::Hit vector

int tpc = -9; ///< TPC containing hit. From geo::WireID
int plane = -9; ///< Plane containing hit. From geo::WireID
int wire = -9; ///< Wire containing hit. From geo::WireID
int chan = -9; ///< Channel ID containing hit. From recob::Hit->Channel()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should enable Doxygen to make a cross-reference:

Suggested change
int chan = -9; ///< Channel ID containing hit. From recob::Hit->Channel()
int chan = -9; ///< Channel ID containing hit. From recob::Hit::Channel()

int clustid = -9; ///< If this hit gets gathered into a cluster, what is the index of that cluster. All hits should be in a track or a cluster
int blipid = -9; ///< If this hit gets gathered into a blip, what is the index of that blip.
bool ismatch = false; ///< Depreciated
float integralADC = -999; ///< Integral area from the recob::hit [ADCs-ticks]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
float integralADC = -999; ///< Integral area from the recob::hit [ADCs-ticks]
float integralADC = -999; ///< Integral area from the recob::Hit [ADCs-ticks]

Comment on lines 151 to 152
std::set<int> HitIDs; ///< Index of the recob::hit objects making up this cluster
std::set<int> Wires; ///< Set of geo::wireIDs contributing hits to this cluster
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::set<int> HitIDs; ///< Index of the recob::hit objects making up this cluster
std::set<int> Wires; ///< Set of geo::wireIDs contributing hits to this cluster
std::set<int> HitIDs; ///< Index of the recob::Hit objects making up this cluster
std::set<int> Wires; ///< Set of geo::WireID contributing hits to this cluster

std::set<int> Wires; ///< Set of geo::wireIDs contributing hits to this cluster
std::set<int> Chans; ///< Set of raw::ChannelID_t contributing hits to this cluster
std::set<int> G4IDs; ///< simb::MCParticle track ID contributing hits to this cluster
std::map<int,geo::Point_t> IntersectLocations; ///< Internal reconstruction variable for recording where hit-clusters on different planes would overlap //used to be TVector3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above:

Suggested change
std::map<int,geo::Point_t> IntersectLocations; ///< Internal reconstruction variable for recording where hit-clusters on different planes would overlap //used to be TVector3
std::map<int,geo::Point_t> IntersectLocations; ///< Internal reconstruction variable for recording where hit-clusters on different planes would overlap

Comment on lines 173 to 180
float TimeTick = -999; ///< Average time of hitclusters making up blips. [tpc tick]
/*!
Hit cluster time is the charge-weighted average of the hit-peak times for hits in the cluster
*/
float Time = -999; ///< Average time of hitclusters making up blips. [us]
/*!
Hit cluster time is the charge-weighted average of the hit-peak times for hits in the cluster
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More Doxygen-y:

Suggested change
float TimeTick = -999; ///< Average time of hitclusters making up blips. [tpc tick]
/*!
Hit cluster time is the charge-weighted average of the hit-peak times for hits in the cluster
*/
float Time = -999; ///< Average time of hitclusters making up blips. [us]
/*!
Hit cluster time is the charge-weighted average of the hit-peak times for hits in the cluster
*/
/**
* @brief Average time of hitclusters making up blips. [tpc tick]
*
* Hit cluster time is the charge-weighted average of the hit-peak times for hits in the cluster.
*/
float TimeTick = -999;
/**
* @brief Average time of hitclusters making up blips. [us]
*
* Hit cluster time is the charge-weighted average of the hit-peak times for hits in the cluster.
*/
float Time = -999;

Comment on lines 185 to 188
float ProxTrkDist = -9; ///< 3-D distance to closest track, assuming the blip was concident with event trigger [cm]
/*!
for properly flash matched out-of-time tracks this distance will be wrong! The blips have no such flash matching ability as of yet
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
float ProxTrkDist = -9; ///< 3-D distance to closest track, assuming the blip was concident with event trigger [cm]
/*!
for properly flash matched out-of-time tracks this distance will be wrong! The blips have no such flash matching ability as of yet
*/
/**
* @brief 3-D distance to closest track, assuming the blip was coincident with event trigger [cm]
*
* For properly flash matched out-of-time tracks this distance will be wrong!
* The blips have no such flash matching ability as of yet.
*/
float ProxTrkDist = -9;

Comment on lines 191 to 194
/*!
please note the blip X position is unreliable, so these distance and 3-d position derived variables may be incorrect
*/
geo::Point_t Position; ///< 3D position vector. Reconstructed with wrong t0! [cm]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*!
please note the blip X position is unreliable, so these distance and 3-d position derived variables may be incorrect
*/
geo::Point_t Position; ///< 3D position vector. Reconstructed with wrong t0! [cm]
/**
* @brief 3D position vector. Reconstructed with wrong t0! [cm]
*
* Please note the blip X position is unreliable,
* so these distance and 3-d position derived variables may be incorrect.
*/
geo::Point_t Position;

@Jjm321814
Copy link
Author

Thanks, all the doxygen comments were accepted and implemented now.

@Jjm321814
Copy link
Author

The checksum may be from pushing from my computer rather than a gpvm. Let me try to fix it

@Jjm321814
Copy link
Author

Not sure whats going on with the checksums. Blip class and TrueBlip both get a checksum though. Otherwise all the outputs look good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Partially reviewed

Development

Successfully merging this pull request may close these issues.

6 participants