Skip to content

Iss407 pedestal refactor - #455

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

Iss407 pedestal refactor#455
duncanswilmot wants to merge 7 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
Comment thread app/tool/algorithm/local_pedestal_level.cxx Outdated
@tomeichlersmith tomeichlersmith linked an issue Aug 25, 2026 that may be closed by this pull request
@duncanswilmot

Copy link
Copy Markdown
Author

Now comparing stdev to 0.1 and printing out ignored channels.
Seem to be losing some extra channels when I turn off CH_0 with POKE

  • Before turning off CH_0
CH_0_before_poke
  • After turning off CH_0
CH_0_after_poke

@tomeichlersmith

Copy link
Copy Markdown
Member

I'm not too surprised other channels are getting ignored (they probably correspond to the channels missing from your initial plot), but the additional channels getting ignored after turning off ch_0 is worrying. Can you repeat the test a few times to make sure? Also, do a daq.pedestal run in between each test run of pedestal leveling so we can see which channels we expect to be ignored manually.

@duncanswilmot

Copy link
Copy Markdown
Author

Reproduced a couple times. The data were wonky on this run, but should still show the channels we expect to be dead.

ecal_smm_pedestal_test

@tomeichlersmith

Copy link
Copy Markdown
Member

Ok, the EcalModule follows this mapping

const std::vector<std::pair<int, int>> EcalModule::ROC_ERX_MAPPING_DAQ = {
{9, 10}, {5, 6}, {0, 1}, {11, 8}, {7, 4}, {3, 2}};

ROC2 ends up in the first 2 links with its halves in the correct order, but your code does not report ignoring channels 7 and 9 (but they are absent from the plot of Link 0 implying they have uniform pedestals). Your code reports ignoring channel 12 which is also absent from the Link 0 plot.

This tells me either your code is not working as you are assuming it works or the hardware is unstable and channels are floating into/out of "working". In either case, I think this needs more careful study. I don't really care if the hardware has some channels permanently broken (that's actually helpful for testing this feature), what does matter is that it is changing. If the hardware is actually unstable at this level, that is very bad for our setup at UMN making it difficult to test any kind of EcalSMM development.

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