Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ec76532
CHG: Speed optimizations
zoglauer Apr 27, 2026
fc91b21
Merge pull request #2 from zoglauer/feature/strip_pairing_speedup
julianmgerber Apr 27, 2026
fe0a54e
Merge remote-tracking branch 'upstream/develop/em'
May 14, 2026
d73b58b
Included option to save QA-flagged events
ckierans Apr 14, 2026
1edeef3
Fixed missing lines after cherry pick
ckierans May 19, 2026
87c75ae
Button layout
ckierans May 19, 2026
a1ab750
Merge remote-tracking branch 'upstream/develop/em'
Jun 2, 2026
6097e47
Merge remote-tracking branch 'upstream/develop/em'
Jun 3, 2026
2879859
Merge remote-tracking branch 'upstream/develop/em'
Jul 22, 2026
d96b0ec
Separate out NN and triggered strips when collecting strip pairing st…
Jul 23, 2026
633cf5d
commenting
Jul 23, 2026
a872494
function to collect NN strip hits
Jul 23, 2026
cc35e5e
Assign Nearest Neighbor function in strip pairing. Created new "addne…
Jul 24, 2026
14bce2e
bug fixes
Jul 24, 2026
6a721e8
adding variable to tell if nearest neighbors are included in strip hits
Jul 24, 2026
a9fb662
comment
Jul 24, 2026
e0c430e
Read out NN strip hits into .dat file
Jul 28, 2026
ae7d555
Changing how nearest neighbor is referenced
Jul 28, 2026
14330c2
Adding flag for ambiguous neighbors
Jul 28, 2026
83a0cc1
forgot to initialize new variable
Jul 28, 2026
b5243d3
Update variable/function names
Jul 28, 2026
25551a4
Edit MStripHit parse function to account for new .dat readout
Jul 28, 2026
9f7b813
Merge remote-tracking branch 'carolyn/qa_option'
Aug 4, 2026
dc40418
Revert "Merge remote-tracking branch 'carolyn/qa_option'"
Aug 5, 2026
1fd176a
Merge remote-tracking branch 'upstream/develop/em'
Aug 5, 2026
0dc4d82
Merge branch 'main' into StripPairingNN
Aug 5, 2026
293e36e
Fixing bugs from merge
Aug 5, 2026
8adf152
Editing error message in MStripHit Parse
Aug 5, 2026
29383fe
Merge remote-tracking branch 'upstream/develop/em'
Aug 31, 2026
6a78116
Merge remote-tracking branch 'upstream/develop/em'
Sep 21, 2026
5a30de1
Merge branch 'main' into StripPairingNN
Sep 21, 2026
a9ba3ea
commenting
Sep 21, 2026
81fa180
fix bug in GetNearestNeighborStripHit function
Sep 21, 2026
3f01a01
using 'include nn' tag from HDF loader module
Sep 21, 2026
78f621d
just iterating thru SH to check if there are neighbors
Sep 22, 2026
0a9c722
commenting
Sep 22, 2026
696fee1
change StripHits to TriggeredStripHits where relevant
Sep 22, 2026
15841ca
fix big in streamdat
Sep 22, 2026
cd5a457
Merge remote-tracking branch 'upstream/develop/em'
Sep 22, 2026
faabfaa
Merge branch 'main' into StripPairingNN
Sep 22, 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
12 changes: 10 additions & 2 deletions include/MHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,19 @@ class MHit

// Strip hits:

//! Return the number of strip hits
//! Return the number of triggered strip hits
unsigned int GetNStripHits() const { return m_StripHits.size(); }
//! Return strip hit i or nullptr if i is out of bounds
//! Ownership stays elsewhere
//! This includes only triggered strip hits
MStripHit* GetStripHit(unsigned int i);
//! Add a strip hit
//! Return nearest neighbor strip hit i or nullptr if i is out of bounds
MStripHit* GetNearestNeighborStripHit(unsigned int i);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm wondering about any potential confusion/overlap with NN strip hits listed here vs in the StripHit list that then have the IsNearestNeightbor flag. Do we expect NN strip hits to also be listed in the standard GetStripHit list or is that now exclusively for triggered strips? If so, let's make that clear.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

GetStripHit from the MHit class should only be triggered strip hits. However, the GetStripHit function in MReadOutAssembly (for the whole event) would have both triggered and NN strips. I added some comments to clarify

//! Add a triggered strip hit
//! Ownership stays elsewhere
void AddStripHit(MStripHit* StripHit);
//! Add a nearest neighbor strip hit
void AddNearestNeighborStripHit(MStripHit* StripHit);
//! Remove strip hit i without deleting it
void RemoveStripHit(unsigned int i);
//! Remove a strip hit without deleting it
Expand Down Expand Up @@ -172,6 +177,9 @@ class MHit
//! List of strip hits contributing to this hit
//! Ownership stays elsewhere
vector<MStripHit*> m_StripHits;

//! List of nearest neighbor strip hits associated with this hit
vector<MStripHit*> m_NearestNeighborStripHits;

//! Position of the hit
MVector m_Position;
Expand Down
11 changes: 9 additions & 2 deletions include/MModuleStripPairingMultiRoundChiSquare.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,14 @@ class MModuleStripPairingMultiRoundChiSquare : public MModule
//! Function to apply charge trapping correction
float ChargeTrappingCorrection(unsigned int d, const vector<vector<MStripHit*>>& StripHits);

//! Divide an event's strip hits by detector and LV/HV side
vector<vector<vector<MStripHit*>>> CollectStripHits(MReadOutAssembly* Event);
//! Divide an event's triggered strip hits by detector and LV/HV side
vector<vector<vector<MStripHit*>>> CollectTriggeredStripHits(MReadOutAssembly* Event);

//! Divide an event's nearest neighbor strip hits by detector and LV/HV side
vector<vector<vector<MStripHit*>>> CollectNearestNeighborStripHits(MReadOutAssembly* Event);

//! Assign nearest neighbor strip hits to their associated hits
void AssignNearestNeighbors(MReadOutAssembly* Event);

//! Read in strip hits on each side for each detector and perform quality selections
bool EventSelection(MReadOutAssembly* Event, const vector<vector<vector<MStripHit*>>>& StripHits);
Expand All @@ -97,6 +103,7 @@ class MModuleStripPairingMultiRoundChiSquare : public MModule

//! Evaluate the reduced chi square for all possible strip pairings
tuple<vector<vector<unsigned int>>, vector<vector<unsigned int>>, double> EvaluateAllCombinations(unsigned int d, const vector<vector<vector<vector<vector<unsigned int>>>>>& Combinations, const vector<vector<vector<MStripHit*>>>& StripHits);

//! Create hits
bool CreateHits(unsigned int d, MReadOutAssembly* Event, const vector<vector<vector<MStripHit*>>>& StripHits, const vector<vector<unsigned int>>& BestLVSideCombo, const vector<vector<unsigned int>>& BestHVSideCombo);
//! Return the order of indices resulting from sorting a vector
Expand Down
12 changes: 10 additions & 2 deletions include/MStripHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,13 @@ class MStripHit
void IsNearestNeighbor(bool NearestNeighbor) { m_IsNearestNeighbor = NearestNeighbor; }
//! Return whether the strip is a nearest-neighbor hit
bool IsNearestNeighbor() const { return m_IsNearestNeighbor; }

//! Set whether the strip has passed the fast threshold

//! Set if this is an ambiguous neighbor (ie. associated with multiple hits)
void IsAmbiguousNearestNeighbor(bool AmbiguousNearestNeighbor) { m_IsAmbiguousNearestNeighbor = AmbiguousNearestNeighbor; }
//! Return boolean indicating whether strip is an ambiguous nearest neighbor (default is false for triggered strips)
bool IsAmbiguousNearestNeighbor() const { return m_IsAmbiguousNearestNeighbor; }

//! Set the Fast Timing flag
void HasFastTiming(bool FastTiming) { m_HasFastTiming = FastTiming; }
//! Return whether the strip has passed the fast threshold
bool HasFastTiming() const { return m_HasFastTiming; }
Expand Down Expand Up @@ -200,6 +205,9 @@ class MStripHit
bool m_IsGuardRing;
//! True if the hit is a nearest neighbor hit
bool m_IsNearestNeighbor;
//! True if the nearest neighbor strip hit is associated with multiple strip paired hits
bool m_IsAmbiguousNearestNeighbor;

//! True if the hit has fast timing
bool m_HasFastTiming;
//! True if the hit has calibrated timing
Expand Down
37 changes: 37 additions & 0 deletions src/MHit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void MHit::Clear()
m_EnergyResolution = g_DoubleNotDefined;

m_StripHits.clear();
m_NearestNeighborStripHits.clear();
m_Origins.clear();

m_CrossTalk = false;
Expand Down Expand Up @@ -114,6 +115,24 @@ MStripHit* MHit::GetStripHit(unsigned int i)
////////////////////////////////////////////////////////////////////////////////


MStripHit* MHit::GetNearestNeighborStripHit(unsigned int i)
{
// Return strip hit i

if (i < m_NearestNeighborStripHits.size()) {
return m_NearestNeighborStripHits[i];
}

if (g_Verbosity >= c_Error) cout<<"Error in MHit::GetNearestNeighborStripHit: Strip hit index "<<i<<" is out of bounds: "<<m_NearestNeighborStripHits.size()<<" strip hits available"<<endl;

return nullptr;
}


////////////////////////////////////////////////////////////////////////////////



void MHit::AddStripHit(MStripHit* StripHit)
{
// Add a strip hit
Expand All @@ -129,6 +148,21 @@ void MHit::AddStripHit(MStripHit* StripHit)
////////////////////////////////////////////////////////////////////////////////


void MHit::AddNearestNeighborStripHit(MStripHit* StripHit)
{
// Add a strip hit

if (StripHit != nullptr) {
m_NearestNeighborStripHits.push_back(StripHit);
} else {
if (g_Verbosity >= c_Error) cout<<"Error in MHit::AddNearestNeighborStripHit: Strip hit is nullptr"<<endl;
}
}


////////////////////////////////////////////////////////////////////////////////


void MHit::RemoveStripHit(unsigned int i)
{
// Remove a strip hit without deleting it
Expand Down Expand Up @@ -177,6 +211,9 @@ bool MHit::StreamDat(ostream& S, int Version)
for (auto SH : m_StripHits) {
SH->StreamDat(S, 0);
}
for (auto SH : m_NearestNeighborStripHits) {
SH->StreamDat(S, 0);
}
} else {
if (g_Verbosity >= c_Error) cout<<"Error in MHit::StreamDat: Stream version "<<Version<<" not handled"<<endl;
return false;
Expand Down
Loading
Loading