Skip to content
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
528d5cc
First try at adding blip data structure
Jjm321814 Oct 28, 2025
1b1114b
Adjusted unit
Jjm321814 Oct 29, 2025
62f6efb
Updated includes
Jjm321814 Oct 29, 2025
06497ed
Missing ;
Jjm321814 Oct 29, 2025
a1441e6
Missing #endif
Jjm321814 Oct 29, 2025
8563371
added destructor def
Jjm321814 Oct 29, 2025
9c71906
Putting blip entry in standard record class
Jjm321814 Oct 30, 2025
1540dc9
Updated classes_def entries
Jjm321814 Oct 31, 2025
5151a16
removing typedef
Jjm321814 Oct 31, 2025
7f9599b
Removed destructor
Jjm321814 Oct 31, 2025
4442c5d
ideas that didn't fix compilation
Oct 31, 2025
4563cf9
trying to simplify my SRBlip object
Jjm321814 Oct 31, 2025
7f06505
trying different checksum stuff
Jjm321814 Nov 5, 2025
fcf5303
Putting back destructor
Jjm321814 Nov 5, 2025
780bb3a
guessing at some checksums
Jjm321814 Nov 5, 2025
a5088b8
Trying to simplify build
Jjm321814 Nov 5, 2025
a8668d0
replacing tvector3d with SRVector3D:
Jjm321814 Nov 5, 2025
3d28c4d
remove guess at checksum
Jjm321814 Nov 5, 2025
7e01d42
finally got mrb to give me the magic number
Nov 5, 2025
7fb37cc
putting back the structs in blips
Jjm321814 Nov 5, 2025
142a08f
Replaced TVector3d
Jjm321814 Nov 5, 2025
4665846
Trying one struct at a time
Jjm321814 Nov 5, 2025
4bb677b
Changed some name scheme and includes
Jjm321814 Nov 5, 2025
7ad0a53
Another try
Jjm321814 Nov 5, 2025
1560a43
trying other indef
Jjm321814 Nov 5, 2025
bbcffe8
Adding a empty line
Jjm321814 Nov 5, 2025
041a6eb
Removing all pair information
Jjm321814 Nov 5, 2025
ebdbf7b
Maybe its mad about the array
Jjm321814 Nov 5, 2025
89317d4
Removing both structs but keeping include
Jjm321814 Nov 5, 2025
8684ef7
The machine has given us new checksums
Nov 5, 2025
79eb63c
Maybe with check sums it will work
Jjm321814 Nov 5, 2025
9029703
Changed to a vector rather than array
Jjm321814 Nov 5, 2025
b29d341
Hey a real compiler issue
Jjm321814 Nov 5, 2025
572cbad
Hey a real compiler issue
Jjm321814 Nov 5, 2025
2a6c0c3
Hey a real compiler issue
Jjm321814 Nov 5, 2025
f2a292d
reverting previous change
Jjm321814 Nov 5, 2025
3325f3b
removed std::pair objects to get proxy to work
Nov 6, 2025
db811ed
fixing merge conflict
Nov 10, 2025
21d0ab6
Compiled version
Nov 10, 2025
7f18fef
Merge branch 'develop' into feature/AddingBlipToCAF
Nov 13, 2025
04018f6
Changing default values
Nov 20, 2025
6b744a9
Removed depreciated variables and moved over comments
Jjm321814 Nov 30, 2025
009e568
missed one save
Jjm321814 Nov 30, 2025
849aaeb
Trying a different syntax for construction
Jjm321814 Nov 30, 2025
013839e
Trying a different syntax for construction
Jjm321814 Nov 30, 2025
f12e772
Trying a different syntax for construction
Jjm321814 Nov 30, 2025
f5a5bca
Changed defaults
Jjm321814 Nov 30, 2025
a610c83
Changed to camelcase
Jjm321814 Nov 30, 2025
368fb1a
Change the array
Jjm321814 Nov 30, 2025
8e880ee
Comment alignment
Jjm321814 Nov 30, 2025
8486049
Alignment
Jjm321814 Dec 1, 2025
8b76963
fixing class versions
Dec 1, 2025
87333a5
Merge branch 'develop' into feature/AddingBlipToCAF
Dec 1, 2025
8ce7a3a
Updated class version
Dec 1, 2025
b96866a
Minor updates to const var location and comments
Jjm321814 Dec 15, 2025
b45980c
Minor updates to const var
Jjm321814 Dec 15, 2025
ef4554e
Adjusted position initilization
Jjm321814 Jan 9, 2026
41645a2
responding to comments on class version, documentation linking, and s…
Jjm321814 Jan 9, 2026
c0fdfa2
Missed two name changes
Jjm321814 Jan 9, 2026
9e6c3e4
Updating checksums
Jjm321814 Jan 9, 2026
20082f0
Updated position constructor call
Jjm321814 Jan 14, 2026
aade1bb
Updated position constructor call
Jjm321814 Jan 14, 2026
6075123
Updated position constructor call
Jjm321814 Jan 14, 2026
9b8cdbc
Maybe I have to cast things as float?
Jjm321814 Jan 14, 2026
990624c
Other constructor just doesn't work for some reason. I will take the …
Jjm321814 Jan 14, 2026
bb1863c
tweak to comments
Jjm321814 Feb 10, 2026
22595b2
fixed doxygen comment
Jjm321814 Feb 16, 2026
9fedd3e
Merge branch 'develop' into feature/AddingBlipToCAF
Jjm321814 Feb 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions sbnanaobj/StandardRecord/SRBlip.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
////////////////////////////////////////////////////////////////////////
// \file SRBlip.cxx
// \brief SRBlip object for localized energy deposits in bulk LAr
// \author $Author: jmclaughlin2@illinoistech.edu
////////////////////////////////////////////////////////////////////////

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Convert this header into Doxygen format.

Suggested change
////////////////////////////////////////////////////////////////////////
// \file SRBlip.cxx
// \brief SRBlip object for localized energy deposits in bulk LAr
// \author $Author: jmclaughlin2@illinoistech.edu
////////////////////////////////////////////////////////////////////////
/**
* @file SRBlip.h
* @brief SRBlip object for localized energy deposits in bulk LAr
* @author jmclaughlin2@illinoistech.edu
*/

(the full name would be also nice to add in the @author line, if you are ok with that)


#include "sbnanaobj/StandardRecord/SRBlip.h"


namespace caf
{
SRBlip::SRBlip()
{
ID = -9; // Blip ID / index

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@PetrilloAtWork and @JosiePaton can comment but I believe there are some pre-defined defaults in CAF-land? Plus I believe -5 is often used as long as it is unphysical.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same comment for other objs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated most values to -5. For time of blips/hits -5 is a physical value, so I left it at -999. For the time tick I think index 0 is time 0, but I am not sure so I left that at -999 as well.

isValid = false; // Blip passes basic checks
Cryostat = -9; // Cryostat
TPC = -9; // TPC
NPlanes = -9; // Num. matched planes
MaxWireSpan = -9; // Maximum span of wires on any plane cluster
TimeTick = -999; // Readout time [ticks]
Time = -999; // Drift time [us]
Charge = -9; // Charge on calorimetry plane (electrons)
Energy = -999; // Energy (const dE/dx, fcl-configurable)
EnergyESTAR = -999; // Energy (ESTAR method from ArgoNeuT)
EnergyPSTAR = -999; // Energy (PSTAR method similar with ESTAR method from ArgoNeuT)
ProxTrkDist = -9; // Distance to cloest track
ProxTrkID = -9; // ID of closest track
inCylinder = false; // Is it in a cone/cylinder region?
Position.SetX(-999); //3d X Position [cm]
Position.SetY(-999); //3d Y Position [cm]
Position.SetZ(-999); //3d Z Position [cm]
SigmaYZ = -9.; // Uncertainty in YZ intersect [cm]
dX = -9; // Equivalent length along drift direction [cm]
dYZ = -9; // Approximate length scale in YZ space [cm]
}
SRBlip::~SRBlip()
{
}

}
44 changes: 44 additions & 0 deletions sbnanaobj/StandardRecord/SRBlip.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
////////////////////////////////////////////////////////////////////////
// \file SRBlip.h
// \brief SRBlip object for localized energy deposits in bulk LAr
// \author $Author: jmclaughlin2@illinoistech.edu
////////////////////////////////////////////////////////////////////////
Comment thread
PetrilloAtWork marked this conversation as resolved.
Outdated
#ifndef SRBLIP_H
#define SRBLIP_H
#include "sbnanaobj/StandardRecord/SRVector3D.h"
#include "sbnanaobj/StandardRecord/SRBlipHitClust.h"
#include "sbnanaobj/StandardRecord/SRBlipTrueBlip.h"
#include "sbnanaobj/StandardRecord/SRCVNScore.h"
Comment thread
PetrilloAtWork marked this conversation as resolved.
Outdated

namespace caf
{
const int kNplanes = 3;
Comment thread
PetrilloAtWork marked this conversation as resolved.
Outdated
class SRBlip
Comment thread
PetrilloAtWork marked this conversation as resolved.
Outdated
{
public:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All data members are public, so I recommend this to be declared a struct:

Suggested change
class SRBlip
{
public:
struct SRBlip
{

(no need for public: any more, since that's struct's default).
Some rational about that in [CF-159].

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We have some plans to add sorted score information for blip flash matching in the future, so I would like this to remain a class in anticipation of that future work being done

Copy link
Copy Markdown
Member

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.

SRBlip();
virtual ~SRBlip();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please reshape the class so that:

  • destructor is removed ([CF-151])
  • initialisation of each data member is done at declaration time (for example: int ID = -5; // Blip ID / index) ([CF-155]);
    • once that is done, the default constructor is superfluous: remove it.
  • use the standard default constants when possible: caf::kUninitializedInt and caf::kSignalingNaN for integral and real data types respectively (they are defined in sbnanaobj/StandardRecord/SRConstants.h); exception: caf::kUninitializedInt value is -1, so if for a quantity -1 is a valid value, do not use that constant (does not look like there is such case here).
    Example:
    cpp float EnergyESTAR = caf::kUninitializedInt; ///< Energy (ESTAR method from ArgoNeuT) [GeV]
  • CAF data members are "drinking camelcase" ([NV-05]); for example, cryostat, TPC, nPlanes, maxWireSpan...
  • turn all the comments into Doxygen documentation (///< to attach documentation to the previous symbol, /// to attach to the next one).
    • note that single-line descriptions look better in the rendered documentation when they have a period at the end of the line.
  • graphically align the comments to the same column, or put them immediately after the semicolon (with one space).
  • the memory layout of this class is slightly fragmented: consider putting the two bool values close ([CF-152]).

After all this, the .cxx file will be basically empty. You can omit it altogether, or leave it there (up to you).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • Destructor is removed
  • I can't figure out how to initialize the SRVector3D Position; without an explicit constructor. I have moved most of the initialization into declaration, so the constructor now just assigns -999 to x,y,z positions.
  • Changed most default values
  • Changed to camelcase
  • comments are updated. I'll check punctuation
  • Updated the alignment of comments
  • I like the current bool placement because the latter is connected to the tracks conceptually, so its easier to process the object logically that way. The first bool could be eliminated, as it should always be true.

Right now the .cxx just assigns the position values. I don't know how to avoid that.

int ID = -9; // Blip ID / index
bool isValid = false; // Blip passes basic checks
int Cryostat = -9; // Cryostat
int TPC = -9; // TPC
int NPlanes = -9; // Num. matched planes
int MaxWireSpan = -9; // Maximum span of wires on any plane cluster
float TimeTick = -999; // Readout time [ticks]
float Time = -999; // Drift time [us]
float Charge = -9; // Charge on calorimetry plane
float Energy = -999; // Energy (const dE/dx, fcl-configurable) [GeV]
float EnergyESTAR = -999; // Energy (ESTAR method from ArgoNeuT) [GeV]
float EnergyPSTAR = -999; // Energy (PSTAR method similar with ESTAR method from ArgoNeuT) [GeV]
float ProxTrkDist = -9; // Distance to cloest track
int ProxTrkID = -9; // ID of closest track
bool inCylinder = false; // Is it in a cone/cylinder region?
SRVector3D Position; // 3D position TVector3
Comment thread
PetrilloAtWork marked this conversation as resolved.
Outdated
float SigmaYZ = -9.; // Uncertainty in YZ intersect [cm]
float dX = -9; // Equivalent length along drift direction [cm]
float dYZ = -9; // Approximate length scale in YZ space [cm]
SRBlipHitClust clusters[kNplanes]; // Plane/cluster-specific information
SRBlipTrueBlip truthBlip; // Truth-matched energy deposition

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Defaults are set in the constructor, can remove them from here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same comment to other objs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For blips I removed these from here. The others are just structs so I kept the values in the header file.

};
}
#endif
53 changes: 53 additions & 0 deletions sbnanaobj/StandardRecord/SRBlipHitClust.h
Comment thread
PetrilloAtWork marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
////////////////////////////////////////////////////////////////////////
// \file SRBlipHitClust.h
// \brief SRBlipHitClust struct contains information on hit clusters on each plane used to form a SRBlip
// \author $Author: jmclaughlin2@illinoistech.edu
////////////////////////////////////////////////////////////////////////
#ifndef SBNANAOBJ_STANDARDRECORD_SRBLIPHITCLUST_H
#define SBNANAOBJ_STANDARDRECORD_SRBLIPHITCLUST_H
#include <map>
#include <set>
Comment thread
PetrilloAtWork marked this conversation as resolved.
Outdated
#include "sbnanaobj/StandardRecord/SRVector3D.h"

namespace caf
{
struct SRBlipHitClust {
Comment thread
PetrilloAtWork marked this conversation as resolved.
Outdated
int ID = -9;
bool isValid = false;
int CenterChan = -999;
int CenterWire = -999;
bool isTruthMatched = false;
bool isMerged = false;
bool isMatched = false;
int DeadWireSep = 99;
int Cryostat = -9;
int TPC = -9;
int Plane = -9;
int NHits = -9;
int NWires = -9;
float ADCs = -999;
float Amplitude = -999;
float Charge = -999;
float SigmaCharge = -999;
float TimeTick = -999;
float Time = -999;
float StartHitTime = -999;
float EndHitTime = -999;
float StartTime = -999;
float EndTime = -999;
float Timespan = -999;
float RMS = -999;
int StartWire = -999;
int EndWire = -999;
int NPulseTrainHits = -9;
float GoodnessOfFit = -999;
int BlipID = -9;
int EdepID = -9;
std::vector<int> HitIDs;
std::vector<int> Wires;
std::vector<int> Chans;
std::vector<int> G4IDs;
//std::map<int,SRVector3D> IntersectLocations; //intermediate step used for matching
};
}
#endif
32 changes: 32 additions & 0 deletions sbnanaobj/StandardRecord/SRBlipTrueBlip.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
////////////////////////////////////////////////////////////////////////
// \file SRBlipTrueBlip.h
// \brief SRBlipTrueBlip struct for localized energy deposits in bulk LAr. MC Truth information
// \author $Author: jmclaughlin2@illinoistech.edu
////////////////////////////////////////////////////////////////////////
#ifndef SBNANAOBJ_STANDARDRECORD_SRBLIPTRUEBLIP_H
#define SBNANAOBJ_STANDARDRECORD_SRBLIPTRUEBLIP_H
#include "sbnanaobj/StandardRecord/SRVector3D.h"

namespace caf
{

struct SRBlipTrueBlip {
Comment thread
PetrilloAtWork marked this conversation as resolved.
Outdated
int ID = -9; // unique blip ID
int Cryostat = -9; // Cryostat ID
int TPC = -9; // TPC ID
float Time = -9; // time of particle interaction
int TimeTick = -9; // time tick
float DriftTime = -9; // drift time [us]
float Energy = 0; // energy dep [GeV]
int DepElectrons = 0; // deposited electrons
int NumElectrons = 0; // electrons reaching wires
int LeadG4ID = -9; // lead G4 track ID
int LeadG4Index = -9; // lead G4 track index
int LeadG4PDG = -9; // lead G4 PDG
float LeadCharge = -9; // lead G4 charge dep
SRVector3D Position; // XYZ position
//std::map<int,float> G4ChargeMap; //intermediate processing step not needed for CAF
//std::map<int,float> G4PDGMap;
};
}
#endif
2 changes: 2 additions & 0 deletions sbnanaobj/StandardRecord/StandardRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "sbnanaobj/StandardRecord/SRTrigger.h"
#include "sbnanaobj/StandardRecord/SRInteractionDLP.h"
#include "sbnanaobj/StandardRecord/SRInteractionTruthDLP.h"
#include "sbnanaobj/StandardRecord/SRBlip.h"

/// Common Analysis Files
namespace caf
Expand Down Expand Up @@ -66,6 +67,7 @@ namespace caf
bool pass_flashtrig = false; ///< Whether this Record passed the Flash Trigger requirement
SRSBNDFrameShiftInfo sbnd_frames; ///< List of Frame Shift in event in unit [ns] (SBND)
SRSBNDTimingInfo sbnd_timings; ///< List of Timing Info in event in UNIX timestamp format(SBND)
std::vector<SRBlip> blips; ///Blips are small O(mm) depositions in LAr, made from recob::hits

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
std::vector<SRBlip> blips; ///Blips are small O(mm) depositions in LAr, made from recob::hits
std::vector<SRBlip> blips; ///< Blips are small O(mm) depositions in LAr, made from recob::Hit


int ndlp = 0; ///< Number of reco DLP (ML) interactions.
std::vector<SRInteractionDLP> dlp; ///< Reco DLP (ML) interactions.
Expand Down
22 changes: 20 additions & 2 deletions sbnanaobj/StandardRecord/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
<!-- art::Wrappers for these products are defined in CAFMaker -->

<lcgdict>
<class name="caf::StandardRecord" ClassVersion="15">
<version ClassVersion="15" checksum="1805006132"/>
<class name="caf::StandardRecord" ClassVersion="17">
<version ClassVersion="17" checksum="1651571235"/>
<version ClassVersion="16" checksum="3738947418"/>
<version ClassVersion="15" checksum="2636549707"/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only need to retain the most recent checksum and set it to version 15

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated to reflect this change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Surprisingly the changes to default values don't seem to impact the checksum?

<version ClassVersion="14" checksum="1860171062"/>
<version ClassVersion="13" checksum="1979816256"/>
<version ClassVersion="12" checksum="3984422068"/>
Expand Down Expand Up @@ -320,8 +322,21 @@
<version ClassVersion="10" checksum="4159815756"/>
</class>

<class name="caf::SRBlip" ClassVersion="10">
<version ClassVersion="10" checksum="3364148027"/>
</class>

<class name="caf::SRBlipHitClust" ClassVersion="10">
<version ClassVersion="10" checksum="1233871129"/>
</class>

<class name="caf::SRBlipTrueBlip" ClassVersion="10">
<version ClassVersion="10" checksum="984259034"/>
</class>

<!--<class name="caf::SRLorentzVector" /> -->

<class name="std::vector<int>" />
<class name="std::vector<caf::SRSlice>" />
<class name="std::vector<caf::SRFakeReco>" />
<class name="std::vector<caf::SRFakeRecoParticle>" />
Expand Down Expand Up @@ -350,6 +365,9 @@
<class name="std::vector<caf::SRTrigger>" />
<class name="std::vector<caf::SRPFP>" />
<class name="std::vector<caf::SRCVNScore>" />
<class name="std::vector<caf::SRBlip>" />
<class name="std::vector<caf::SRBlipHitClust>" />
<class name="std::vector<caf::SRBlipTrueBlip>" />

<class name="caf::SRCRTHitTruth" ClassVersion="10">
<version ClassVersion="10" checksum="3618232749"/>
Expand Down