Skip to content

Updated CLUE clustering to pull RoC values from CSV file, if available.#2053

Open
cjbarton151 wants to merge 2 commits into
trunkfrom
iss1885-CLUEgeomlinking
Open

Updated CLUE clustering to pull RoC values from CSV file, if available.#2053
cjbarton151 wants to merge 2 commits into
trunkfrom
iss1885-CLUEgeomlinking

Conversation

@cjbarton151

@cjbarton151 cjbarton151 commented May 21, 2026

Copy link
Copy Markdown
Contributor

I am updating ldmx-sw, here are the details.

What are the issues that this addresses?

This resolves #1885

When calculating... Something (not sure what and it doesn't say in the code), the CLUE algorithm has been relying on a hardcoded array of containment radii defined in CLUE.h. These values are outdated and, like most hardcoded values, at risk of becoming outdated again even if we update them.

With this PR, if possible, the hardcoded array will be replaced with values pulled from a CSV file stored in Ecal/Data. To do this, the path to the selected CSV file is passed through the EcalClusterProducer, just like the rest of the parameters used in CLUE. If there is no CSV file path defined, the program defaults to using the hardcoded values. If the file path is somehow faulty, the program exits with an error. I considered downgrading this to a warning, followed by defaulting to the hardcoded values, but I think an exception is more appropriate.

Only two disclaimers this time:

  1. the array in question is a vector of doubles. The file reading algorithm is designed for floats. As far as I can tell, this doesn't affect anything in the results.
    (as an aside: it turns out that there's some thorny issue related to localization that messes up stod and stof when operating in a country where decimal places are denoted by ',' instead of '.' and I spent way too much time diving into this rabbit hole)
  2. The RoC array as implemented in CLUE is a 1D array, while in the EcalVetoProcessor (from which I adapted the CSV file reading) uses a 2D array. Each row in the CSV file is valid for a different containment region. I made the assumption that the RoC values used in CLUE are only for the minimum angle range, from 0 to 10 degrees.

Check List

  • I successfully compiled ldmx-sw with my developments.
  • I read, understood and follow the coding rules.
  • I ran my developments and the following shows that they are successful.

Ran without crashing, RoC values were updated (when setting ECalClusterProducer.nbr_of_layers to a value >1, which I don't think any of the CI tests do anyway)

@cjbarton151 cjbarton151 self-assigned this May 21, 2026
@cjbarton151 cjbarton151 requested a review from tvami May 21, 2026 17:54
@github-actions

Copy link
Copy Markdown
Contributor

Validation Results

Some validation samples failed! ❌

Sample Status
deep_ecal_gun ✅ PASS
eat_signal ✅ PASS
ecal_pn ✅ PASS
hcal ✅ PASS
inclusive ✅ PASS
it_pileup ✅ PASS
kaon_enhanced ✅ PASS
reduced_ldmx ✅ PASS
signal ✅ PASS
signal_target_al ✅ PASS
target_genie ✅ PASS
target_pn_lyso ✅ PASS
target_ti_en ✅ PASS
wab_lhe ✅ PASS
cascade_history ❌ FAIL

@tvami tvami left a comment

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.

Great thanks a lot!

@tvami tvami requested a review from bryngemark May 22, 2026 01:05
@cjbarton151 cjbarton151 force-pushed the iss1885-CLUEgeomlinking branch from 7beaa23 to 34831bc Compare May 26, 2026 20:38
@tvami

tvami commented May 27, 2026

Copy link
Copy Markdown
Member

/run-validation

@github-actions

Copy link
Copy Markdown
Contributor

The validation workflow is running here: https://github.com/LDMX-Software/ldmx-sw/actions/runs/26490893162.

@github-actions

Copy link
Copy Markdown
Contributor

Validation Results

All validation samples passed! ✅

Sample Status
cascade_history ✅ PASS
deep_ecal_gun ✅ PASS
eat_signal ✅ PASS
ecal_pn ✅ PASS
hcal ✅ PASS
inclusive ✅ PASS
it_pileup ✅ PASS
kaon_enhanced ✅ PASS
reduced_ldmx ✅ PASS
signal ✅ PASS
signal_target_al ✅ PASS
target_genie ✅ PASS
target_pn_lyso ✅ PASS
target_ti_en ✅ PASS
wab_lhe ✅ PASS

cascade_history:

  • Text Differences Between Logs
  • Timing for cascade_history: gold=6434s, new=6438s
  • Timing within 0% of gold (tolerance 10%)

deep_ecal_gun:

  • Text Differences Between Logs
  • Timing for deep_ecal_gun: gold=4309

eat_signal:

  • Timing for eat_signal: gold=1342

ecal_pn:

  • Text Differences Between Logs
  • Timing for ecal_pn: gold=6854

hcal:

  • Text Differences Between Logs
  • Timing for hcal: gold=860

inclusive:

  • Text Differences Between Logs
  • Timing for inclusive: gold=6936

it_pileup:

  • Text Differences Between Logs
  • Timing for it_pileup: gold=574

kaon_enhanced:

  • Text Differences Between Logs
  • Timing for kaon_enhanced: gold=3294

reduced_ldmx:

  • Text Differences Between Logs
  • Timing for reduced_ldmx: gold=2347

signal:

  • Text Differences Between Logs
  • Timing for signal: gold=1253

signal_target_al:

  • Text Differences Between Logs
  • Timing for signal_target_al: gold=1057

target_genie:

  • Text Differences Between Logs
  • Timing for target_genie: gold=7215

target_pn_lyso:

  • Text Differences Between Logs
  • Timing for target_pn_lyso: gold=6704

target_ti_en:

  • Text Differences Between Logs
  • Timing for target_ti_en: gold=3272

wab_lhe:

  • Text Differences Between Logs
  • Timing for wab_lhe: gold=7513

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Look up ecal layer weights in CLUE

2 participants