Skip to content

fix: reduce string comparisons in ADC decoding, cleanup#1066

Open
baltzell wants to merge 1 commit intodevelopmentfrom
decoder-tt-adc
Open

fix: reduce string comparisons in ADC decoding, cleanup#1066
baltzell wants to merge 1 commit intodevelopmentfrom
decoder-tt-adc

Conversation

@baltzell
Copy link
Collaborator

@baltzell baltzell commented Jan 13, 2026

Note, this assumes unique crate/slot/channel in all /daq/fadc CCDB tables. Now, the first match wins. Previously the last match won. For run 5038, the RF/LTCC::adc banks have a resulting difference, which will be addressed by fixing CCDB tables to be unique.

Note, this was a component of #1051.

@baltzell baltzell added the speed label Jan 13, 2026
@baltzell baltzell mentioned this pull request Jan 13, 2026
@baltzell baltzell changed the title reduce string comparisons, cleanup Reduce string comparisons in ADC decoding, cleanup Jan 13, 2026
@baltzell baltzell marked this pull request as ready for review January 13, 2026 20:43
@baltzell baltzell changed the title Reduce string comparisons in ADC decoding, cleanup fix: reduce string comparisons in ADC decoding, cleanup Jan 13, 2026
@baltzell baltzell force-pushed the decoder-tt-adc branch 2 times, most recently from eb13585 to 9aff614 Compare January 21, 2026 01:21
@baltzell
Copy link
Collaborator Author

baltzell commented Jan 29, 2026

Summary of hipo-diff -s 0,1,2 on the first 10k events from gold runs for PRs #1064, #1065, and #1066 combined, relative to the development branch:

Run Period     , Gold Run , Redecoderingdiff
rga_spring2018 , 4013     , RF/LTCC::adc
rga_fall2018   , 5038     , RF/LTCC::adc
rgk_2018       , 5700     , RF/LTCC::adc
rgb_spring2019 , 6302     , RF/BAND/LTCC::adc
rga_spring2019 , 6666     , RF/LTCC::adc
rgb_fall2019   , 11567    , RF/LTCC::adc
rgf_2020       , 12933    , RF/LTCC::adc
rgm_2021       , 15833    , RF/BAND::adc
rgc_spring2022 , 16600    , RF/LTCC::adc
rgc_fall2022   , 17407    , RF/LTCC::adc
rgc_spring2023 , 17800    , RF/LTCC::adc and RAW::tdc
rgd_2023       , 18779    , BAND/RF/LTCC::adc
rgk_2024       , 19877    , BAND/RF/LTCC::adc
rge_2024       , 20522    , BAND/RF/LTCC::adc and RAW::tdc
rgl_2025       , 23050    , RF/BAND::adc

@baltzell
Copy link
Collaborator Author

baltzell commented Jan 29, 2026

And when CCDB_CONNECTION=sqlite:////work/clas12/users/devita/latest.sqlite:

Run Period     , Gold Run , Redecoderingdiff
rga_spring2018 , 4013     , RF/LTCC::adc
rga_fall2018   , 5038     , RF/LTCC::adc
rgk_2018       , 5700     , RF/LTCC::adc
rgb_spring2019 , 6302     , RF/LTCC::adc
rga_spring2019 , 6666     , RF/LTCC::adc
rgb_fall2019   , 11567    , RF/LTCC::adc
rgf_2020       , 12933    , RF/LTCC::adc
rgm_2021       , 15833    , RF::adc
rgc_spring2022 , 16600    , RF/LTCC::adc
rgc_fall2022   , 17407    , RF/LTCC::adc
rgc_spring2023 , 17800    , RF/LTCC::adc and RAW::tdc
rgd_2023       , 18779    , RF/LTCC::adc
rgk_2024       , 19877    , RF/LTCC::adc
rge_2024       , 20522    , RF/LTCC::adc and RAW::tdc
rgl_2025       , 23050    , RF::adc

@baltzell
Copy link
Collaborator Author

baltzell commented Jan 29, 2026

The LTCC/RF discrepancy is due to /daq/fadc/rf and /daq/fadc/ltcc CCDB tables, crate/slot/channel=19/18/15:

clara2501> ccdb dump /daq/fadc/ltcc | grep -E '19[[:space:]]+18[[:space:]]+15'
  19           18           15           79.6         3            15           50           1280            400
clara2501> ccdb dump /daq/fadc/rf | grep -E '19[[:space:]]+18[[:space:]]+15'
  19           18           15           200          3            15           500          0               400

@baltzell
Copy link
Collaborator Author

baltzell commented Jan 29, 2026

And the RAW::tdc discrepancy looks like this:

* NODE * group =  20000, item =  12, type = 11, size =       63
         crate :         20        60        64        64        64        64        64
          slot :         20        16        16        16        16        16        16
       channel :         15        20         8         8         8         8         8
         order :         83       -16       -46        52      -106       -13        84
           TDC :        114         0         0         0         0         0         0

* NODE * group =  20000, item =  12, type = 11, size =       63
         crate :         60        20        64        64        64        64        64
          slot :         16        20        16        16        16        16        16
       channel :         20        15         8         8         8         8         8
         order :        -16        83       -46        52      -106       -13        84
           TDC :        114         0         0         0         0         0         0

If it ends up in RAW::tdc/adc, then it's not found in CCDB. So, this one must originate from #1065.

@baltzell
Copy link
Collaborator Author

baltzell commented Jan 29, 2026

The RF::adc-only discrepancy for RG-M looks like this:

Bank.show RF::adc
* NODE * group =  21700, item =  11, type = 11, size =       30
        sector :          1         1
         layer :          1         1
     component :          3         4
         order :          0         0
           ADC :       9479       261
          time :    95.1250  132.5000
           ped :        971      2674

* NODE * group =  21700, item =  11, type = 11, size =       30
        sector :          1         1
         layer :          1         1
     component :          3         4
         order :          0         0
           ADC :      10371     34556
          time :     0.0000    0.0000
           ped :        200       200

Maybe/hopefully this will be explained by picking up the pedestal/threshold form /daq/fadc/ltcc in the former case.

@baltzell
Copy link
Collaborator Author

Bank.show LTCC::adc
* NODE * group =  21600, item =  11, type = 11, size =       15
        sector :          5
         layer :          1
     component :          1
         order :          0
           ADC :         96
          time :   118.5625
           ped :        199

* NODE * group =  21600, item =  11, type = 11, size =       15
        sector :          5
         layer :          1
     component :          1
         order :          0
           ADC :          0
          time :     0.0000
           ped :        199

@baltzell
Copy link
Collaborator Author

baltzell commented Jan 31, 2026

Another overlap in /daq/fadc/ec and /daq/fadc/ltcc for slot 18, channels 12-15, crates 1, 7, 13, 19, 25, 31 (one for each sector). As /daq/tt/ec doesn't contain these overlapping channels, they should probably be disabled in /daq/fadc/ec by setting one of their indices to bogus.

@baltzell
Copy link
Collaborator Author

baltzell commented Feb 2, 2026

After disabling channels 12-15 on all slot 8s in /daq/fadc/ec, the only remaining difference is RF::adc (RF2?), e.g.

* NODE * group =  21700, item =  11, type = 11, size =       30
        sector :          1         1
         layer :          1         1
     component :          3         4
         order :          0         0
           ADC :      24706     44899
          time :     0.0000   31.4375
           ped :        200       200
* NODE * group =  21700, item =  11, type = 11, size =       30
        sector :          1         1
         layer :          1         1
     component :          3         4
         order :          0         0
           ADC :      24706      6378
          time :     0.0000    0.0000
           ped :        200      1754

@baltzell
Copy link
Collaborator Author

baltzell commented Feb 2, 2026

/daq/fadc/ftof is sharing with /daq/fadc/rf for crate/slot/channel 23/16/15

@baltzell
Copy link
Collaborator Author

baltzell commented Feb 2, 2026

So, after fixing /daq/fadc/ftof and /daq/fadc/ec for crate/slot/channel overlaps, and /daq/tt/band in #1064, and also the RAW::adc/tdc.order software fix in #1084 ...

The first 10k events from each "gold" run's .00001 file are identical between the main branch and redecodering2 (which is the sum of pull requests #1064, #1065, #1066):

Run Period     , Gold Run , `hipo-diff -s 0,1,2`
rga_spring2018 , 4013     , Ok
rga_fall2018   , 5038     , Ok
rgk_2018       , 5700     , Ok
rgb_spring2019 , 6302     , Ok
rga_spring2019 , 6666     , Ok
rgb_fall2019   , 11567    , Ok
rgf_2020       , 12933    , Ok
rgm_2021       , 15833    , Ok
rgc_spring2022 , 16600    , Ok
rgc_fall2022   , 17407    , Ok
rgc_spring2023 , 17800    , Ok
rgd_2023       , 18779    , Ok
rgk_2024       , 19877    , Ok
rge_2024       , 20522    , Ok
rgl_2025       , 23050    , Ok

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.

1 participant