Skip to content

Iss407 pedestal refactor - #455

Open
duncanswilmot wants to merge 4 commits into
mainfrom
iss407-pedestal-refactor
Open

Iss407 pedestal refactor#455
duncanswilmot wants to merge 4 commits into
mainfrom
iss407-pedestal-refactor

Conversation

@duncanswilmot

@duncanswilmot duncanswilmot commented Aug 7, 2026

Copy link
Copy Markdown

Opening a PR but may need to do some extra work before merging.

For local pedestal leveling, change baseline TRIM_INV from 0 to 32, add adaptive support for both ECAL and HCAL ROCs, and mask dead channels (i.e., those with 0 standard deviation). Seeing some difficulty leveling for ECAL (see image). May just be running out of range with TRIM_INV, but someone should try to run this on their own to verify behavior.

Note: did not yet test for HCAL

ecal_smm_pedestal_local

@tomeichlersmith tomeichlersmith 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.

This is just a first pass - I have not tried to run it myself yet, but the actual algorithm looks good. I just want to avoid one pitfall and drop one extra local variable that I don't believe is necessary.

Comment thread app/tool/algorithm/local_pedestal_level.cxx
Comment thread app/tool/algorithm/local_pedestal_level.cxx Outdated
@duncanswilmot
duncanswilmot force-pushed the iss407-pedestal-refactor branch from 66d513e to 9393cb4 Compare August 12, 2026 15:51
@duncanswilmot

Copy link
Copy Markdown
Author

I couldn't avoid running into the same issue with variance as standard deviation, so I just attempted to keep is as double the whole way rather than adding new code for a variance function. Does this work?

@tomeichlersmith tomeichlersmith 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.

Can you test that this will ignore channels that we turned off?

You can turn off a channel with

 > ROC
 > POKE
Page: CH_##
Parameter: CHANNEL_OFF
Value: 1

where ## is the channel number you want to turn off on ROC0.

Comment thread app/tool/algorithm/local_pedestal_level.cxx
settings;
for (int i_roc : tgt->roc_ids()) {
for (int ch{0}; ch < 72; ch++) {
if (basedevs[i_roc].at(ch) == 0) {

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
if (basedevs[i_roc].at(ch) == 0) {
if (basedevs[i_roc].at(ch) < 0.1) {

@tomeichlersmith tomeichlersmith linked an issue Aug 25, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pedestal leveling refactor

2 participants