Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions etc/bankdefs/util/bankSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ def create(dirname, banklist):
print('Invalid JSON: '+filename)
sys.exit(1)
# loop over banks in the json file
banknames = []
for bank in datastore:
bankname = bank['name']
file = open(workdirectory + singledirectory + bankname + ".json", 'w')
file.write(json.dumps([bank], sort_keys=True, indent=4))
file.close
banknames.append(bankname)
create(filename[:-5]+"/", set(banknames))

print("Single json files saved in " + workdirectory + singledirectory)

# these should *always* be kept:
Expand Down Expand Up @@ -109,11 +113,13 @@ def create(dirname, banklist):
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

rgl = glob.glob('./singles/full/ALERT*.json')
rgl.extend(glob.glob('./singles/full/AHDC*.json'))
rgl.extend(glob.glob('./singles/full/ATOF*.json'))
rgl = [os.path.basename(x)[:-5] for x in rgl]
rgl.remove('AHDC::wf')

calib.extend(rgl)
mon.extend(rgl)
dst.extend(rgl)
Expand Down
Loading