3 from AthenaCommon.Logging
import logging
4 log = logging.getLogger(__name__)
9 def __init__(self, l1menu = None, outputFile = None, bgsOutputFile = None, inputFile = None ):
19 log.warning(
"Can't write json file since no name was provided")
25 json.dump(confObj, fh, indent = 4
if pretty
else None, separators=(
',',
': '))
32 json.dump(confObj, fh, indent = 4
if pretty
else None, separators=(
',',
': '))
42 "name": self.
menu.menuName,
44 "items": self.
menu.items.json(),
49 confObj[
"thresholds"][
"internal"] = {
51 "names": [ f
"BGRP{bg.internalNumber}" for bg
in self.
menu.ctp.bunchGroupSet.bunchGroups] + \
52 [ f
"RNDM{i}" for i
in range(0,len(self.
menu.ctp.random.names)) ],
53 "randoms": { f
"RNDM{i}": {
"cut" : c }
for i,c
in enumerate( self.
menu.ctp.random.cuts ) }
57 confObj[
"thresholds"].update( self.
menu.thresholds.json() )
60 confObj[
"thresholds"][
"legacyCalo"] = self.
menu.thresholds.jsonLegacy()
63 confObj[
"topoAlgorithms"] = self.
menu.topoAlgos.json()
66 confObj[
"boards"] = self.
menu.boards.json()
69 confObj[
"connectors"] = self.
menu.connectors.json()
72 confObj[
"ctp"] = self.
menu.ctp.json()
79 "filetype":
"bunchgroupset",
80 "name": self.
menu.menuName,
81 "bunchGroups": self.
menu.ctp.bunchGroupSet.json()