Skip to content

add occupancy bookkeeping class and HIPO banks - #1378

Open
baltzell wants to merge 47 commits into
developmentfrom
occupancy
Open

add occupancy bookkeeping class and HIPO banks#1378
baltzell wants to merge 47 commits into
developmentfrom
occupancy

Conversation

@baltzell

@baltzell baltzell commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

To reduce the calibration data volume from detector hit banks, this adds:

  • occupancy bank schemas
  • thread-safe OccupanceTable bookkeeping class with I/O helpers for standard indexed HIPO banks
  • OccupanceEngine ready for all standard clas12 detectors.

The new occupancy banks currently look like this:

        "name": "OCC::FTOF::adc",
        "group": 500,
        "item": 14,
        "info": "Occupancy Bank",
        "entries": [
            { "name":"sector"    , "type":"B", "info":"sector"},
            { "name":"layer"     , "type":"B", "info":"layer"},
            { "name":"component" , "type":"S", "info":"component"},
            { "name":"hits"      , "type":"F", "info":"number of hits"}
  • Finalize occupancy bank naming
  • Bank group number
  • Use FilteredBank for order-hijacking by denoising
  • Check index count for all detectors
  • Check for missing detectors
  • Ignore bank rows with negative indices
  • YAML variable, occupancyPrescale

The main consumer of these new occupancy banks is clas12-timeline.

Depends on #1380, #1381, #1382, #1383.

@baltzell
baltzell force-pushed the occupancy branch 4 times, most recently from 7df1707 to bf9ad64 Compare August 12, 2026 21:00
@baltzell baltzell changed the title add occupancy class add occupancy bookkeeping class and HIPO banks Aug 13, 2026
@baltzell
baltzell marked this pull request as ready for review August 13, 2026 22:21
@baltzell
baltzell marked this pull request as draft August 14, 2026 21:28
@baltzell
baltzell marked this pull request as ready for review August 18, 2026 18:00
Comment thread etc/bankdefs/hipo4/occupancy.json
Comment on lines +195 to +214
new OccupanceTable(schema,"DC::tot"),
new OccupanceTable(schema,"DC::tdc"),
new OccupanceTable(schema,"ECAL::adc"),
new OccupanceTable(schema,"ECAL::tdc"),
new OccupanceTable(schema,"FTOF::adc"),
new OccupanceTable(schema,"FTOF::tdc"),
new OccupanceTable(schema,"CTOF::adc"),
new OccupanceTable(schema,"CTOF::tdc"),
new OccupanceTable(schema,"HTCC::adc"),
new OccupanceTable(schema,"HTCC::tdc"),
new OccupanceTable(schema,"LTCC::adc"),
new OccupanceTable(schema,"LTCC::tdc"),
new OccupanceTable(schema,"BST::adc"),
new OccupanceTable(schema,"BMT::adc"),
new OccupanceTable(schema,"FTCAL::adc"),
new OccupanceTable(schema,"FTHODO::adc"),
new OccupanceTable(schema,"FTTRK::adc"),
new OccupanceTable(schema,"RICH::tdc"),
new OccupanceTable(schema,"BAND::adc"),
new OccupanceTable(schema,"BAND::tdc"),

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.

Is there any way to avoid the DRY violation here, and read occupancy.json somehow?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That could surely be done.

@baltzell baltzell added the calib label Aug 25, 2026
@baltzell

baltzell commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

Negative indices definitely doesn't work:

java.lang.IllegalArgumentException: Index value out of range (0–65535) : -119
	at org.jlab.utils.groups.IndexedList.validateIndex(IndexedList.java:86)
	at org.jlab.utils.groups.IndexedList.add(IndexedList.java:99)
	at org.jlab.utils.groups.IndexedTable.addEntry(IndexedTable.java:95)
	at org.jlab.detector.calib.utils.OccupanceTable.fill(OccupanceTable.java:82)

Probably this means the addEntry isn't being used for translation tables in the decoder (there's a string-based alternative) ....

@baltzell

baltzell commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

Nope, IndexedTables in decoding always have positive indices (they're defined only by CCDB tables), and addEntryFromString has the same issue with negatives. The negative is created on bank writing.

Note, the swaps service will throw an exception for RICH's layer>128 hits.

@c-dilks

c-dilks commented Aug 25, 2026

Copy link
Copy Markdown
Member

Some info about group and item here on pp. 11 ff. of Mathieu's HIPO spec writeup:

https://code.jlab.org/ouillon/hipo4j/-/raw/691447f5a212a23a9561055cb9985e104828794f/specification/hipo-file-format.pdf?inline=false

(CC @raffaelladevita)

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.

3 participants