From b8105aa2abec47569712a68c9dd7b4c03567d8cb Mon Sep 17 00:00:00 2001 From: Nathan Baltzell Date: Mon, 2 Nov 2026 16:14:22 -0500 Subject: [PATCH] actually add occupancy banks --- etc/bankdefs/hipo4/occupancy.json | 272 ++++++++++++++++++++++++++++++ etc/bankdefs/util/bankSplit.py | 13 +- 2 files changed, 280 insertions(+), 5 deletions(-) create mode 100644 etc/bankdefs/hipo4/occupancy.json diff --git a/etc/bankdefs/hipo4/occupancy.json b/etc/bankdefs/hipo4/occupancy.json new file mode 100644 index 0000000000..ec02d1efdb --- /dev/null +++ b/etc/bankdefs/hipo4/occupancy.json @@ -0,0 +1,272 @@ +[ + { + "name": "OCC::DC::tdc", + "group": 500, + "item": 10, + "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"} + ] + }, + { + "name": "OCC::DC::tot", + "group": 500, + "item": 11, + "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"} + ] + }, + { + "name": "OCC::ECAL::adc", + "group": 500, + "item": 12, + "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"} + ] + }, + { + "name": "OCC::ECAL::tdc", + "group": 500, + "item": 13, + "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"} + ] + }, + { + "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":"order" , "type":"B", "info":"order"}, + { "name":"hits" , "type":"F", "info":"number of hits"} + ] + }, + { + "name": "OCC::FTOF::tdc", + "group": 500, + "item": 15, + "info": "Occupancy Bank", + "entries": [ + { "name":"sector" , "type":"B", "info":"sector"}, + { "name":"layer" , "type":"B", "info":"layer"}, + { "name":"component" , "type":"S", "info":"component"}, + { "name":"order" , "type":"B", "info":"order"}, + { "name":"hits" , "type":"F", "info":"number of hits"} + ] + }, + { + "name": "OCC::CTOF::adc", + "group": 500, + "item": 16, + "info": "Occupancy Bank", + "entries": [ + { "name":"sector" , "type":"B", "info":"sector"}, + { "name":"layer" , "type":"B", "info":"layer"}, + { "name":"component" , "type":"S", "info":"component"}, + { "name":"order" , "type":"B", "info":"order"}, + { "name":"hits" , "type":"F", "info":"number of hits"} + ] + }, + { + "name": "OCC::CTOF::tdc", + "group": 500, + "item": 17, + "info": "Occupancy Bank", + "entries": [ + { "name":"sector" , "type":"B", "info":"sector"}, + { "name":"layer" , "type":"B", "info":"layer"}, + { "name":"component" , "type":"S", "info":"component"}, + { "name":"order" , "type":"B", "info":"order"}, + { "name":"hits" , "type":"F", "info":"number of hits"} + ] + }, + { + "name": "OCC::HTCC::adc", + "group": 500, + "item": 18, + "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"} + ] + }, + { + "name": "OCC::HTCC::tdc", + "group": 500, + "item": 19, + "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"} + ] + }, + { + "name": "OCC::LTCC::adc", + "group": 500, + "item": 20, + "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"} + ] + }, + { + "name": "OCC::LTCC::tdc", + "group": 500, + "item": 21, + "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"} + ] + }, + { + "name": "OCC::BST::adc", + "group": 500, + "item": 22, + "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"} + ] + }, + { + "name": "OCC::BMT::adc", + "group": 500, + "item": 23, + "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"} + ] + }, + { + "name": "OCC::FTCAL::adc", + "group": 500, + "item": 24, + "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"} + ] + }, + { + "name": "OCC::FTHODO::adc", + "group": 500, + "item": 25, + "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"} + ] + }, + { + "name": "OCC::FTTRK::adc", + "group": 500, + "item": 26, + "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"} + ] + }, + { + "name": "OCC::RICH::tdc", + "group": 500, + "item": 27, + "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"} + ] + }, + { + "name": "OCC::BAND::adc", + "group": 500, + "item": 28, + "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"} + ] + }, + { + "name": "OCC::BAND::tdc", + "group": 500, + "item": 29, + "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"} + ] + }, + { + "name": "OCC::CND::adc", + "group": 500, + "item": 30, + "info": "Occupancy Bank", + "entries": [ + { "name":"sector" , "type":"B", "info":"sector"}, + { "name":"layer" , "type":"B", "info":"layer"}, + { "name":"component" , "type":"S", "info":"component"}, + { "name":"order" , "type":"B", "info":"order"}, + { "name":"hits" , "type":"F", "info":"number of hits"} + ] + }, + { + "name": "OCC::CND::tdc", + "group": 500, + "item": 31, + "info": "Occupancy Bank", + "entries": [ + { "name":"sector" , "type":"B", "info":"sector"}, + { "name":"layer" , "type":"B", "info":"layer"}, + { "name":"component" , "type":"S", "info":"component"}, + { "name":"order" , "type":"B", "info":"order"}, + { "name":"hits" , "type":"F", "info":"number of hits"} + ] + } +] diff --git a/etc/bankdefs/util/bankSplit.py b/etc/bankdefs/util/bankSplit.py index a8449ecf42..ec0ea5bf71 100755 --- a/etc/bankdefs/util/bankSplit.py +++ b/etc/bankdefs/util/bankSplit.py @@ -1,8 +1,9 @@ #!/usr/bin/env python -import json -import sys import os +import sys +import json +import glob # print usage if len(sys.argv)<2: @@ -54,6 +55,9 @@ def create(dirname, banklist): print("Single json files saved in " + workdirectory + singledirectory) +# occupancy banks: +occ = [os.path.basename(x)[:-5] for x in glob.glob('./singles/occupancy/*.json')] + # these should *always* be kept: mc = ["MC::Event", "MC::GenMatch", "MC::Header", "MC::Lund", "MC::Particle", "MC::RecMatch", "MC::True"] tag1 = ["RUN::config", "RAW::epics", "RAW::scaler", "RUN::scaler", "HEL::scaler", "COAT::config", "HEL::flip", "HEL::online", "HEL::decoder"] @@ -83,7 +87,7 @@ def create(dirname, banklist): trig = ["RAW::vtp","HTCC::rec","ECAL::adc","ECAL::calib","ECAL::clusters","ECAL::hits","ECAL::moments","ECAL::peaks","ECAL::tdc","ECAL::trigger"] # accumulate all the DST banks: -dst = rectbai + rectb + mc + tag1 + dets +dst = rectbai + rectb + mc + tag1 + occ + dets dsthb = dst + rechbai + rechb # generate the calib and mon schema: @@ -112,8 +116,7 @@ def create(dirname, banklist): level3 = list(dst) level3.extend(["DC::tdc", "DC::tot", "ECAL::adc", "ECAL::clusters", "FTOF::tdc", "FTOF::adc", "HitBasedTrkg::HBClusters", "HitBasedTrkg::HBTracks", "HTCC::adc", "RF::adc", "RF::tdc", "RUN::rf", "TimeBasedTrkg::TBClusters", "TimeBasedTrkg::TBTracks"]) -import glob - +# Raw bank schema: raw = glob.glob('./singles/data/*.json') raw.extend(glob.glob('./singles/header/*.json')) raw.extend(glob.glob('./singles/tag1/*.json'))