51def TriggerEDMSerialiserToolCfg(flags, name="Serialiser"):
52
53 from TrigEDMConfig.DataScoutingInfo import getFullHLTResultID
54
55 TriggerEDMSerialiserTool = CompFactory.TriggerEDMSerialiserTool
56
57 def addCollection(self, typeNameAux, moduleIds, allowTruncation=False):
58 defs = [typeNameAux,
59 ','.join([f"{id}" for id in moduleIds])]
60 if allowTruncation:
61 defs.append('allowTruncation')
62 self.CollectionsToSerialize.append( ';'.join(defs) )
63
64 def addCollectionToMainResult(self, typeNameAux, allowTruncation=False):
65 self.addCollection(typeNameAux, [getFullHLTResultID()], allowTruncation)
66
67 def addCollectionListToResults(self, typeNameAuxList, moduleIds, allowTruncation=False):
68 for typeNameAux in typeNameAuxList:
69 self.addCollection(typeNameAux, moduleIds, allowTruncation)
70
71 def addCollectionListToMainResult(self, typeNameAuxList, allowTruncation=False):
72 self.addCollectionListToResults(typeNameAuxList, [getFullHLTResultID()], allowTruncation)
73
74
75 TriggerEDMSerialiserTool.addCollection = addCollection
76 TriggerEDMSerialiserTool.addCollectionToMainResult = addCollectionToMainResult
77 TriggerEDMSerialiserTool.addCollectionListToResults = addCollectionListToResults
78 TriggerEDMSerialiserTool.addCollectionListToMainResult = addCollectionListToMainResult
79
80
82
83 from TrigEDMConfig.TriggerEDMRun3 import tpMap
84 tpTool = CompFactory.TrigSerTPTool()
85 tpTool.TPMap = tpMap()
86 serialiser.TPTool = tpTool
87
88 from TrigEDMConfig.DataScoutingInfo import TruncationThresholds as truncThresholds
89 serialiser.TruncationThresholds = truncThresholds
90
91
93 for prefix in ['', 'Allowed']:
94 serialiser.MonTool.defineHistogram(f'{prefix}Truncation_ModuleId', path='EXPERT', type='TH1F',
95 title='Module IDs of truncated HLT results;Module ID;Num of truncated results',
96 xbins=20, xmin=0, xmax=20)
97 serialiser.MonTool.defineHistogram(f'{prefix}Truncation_TotalSize', path='EXPERT', type='TH1F',
98 title='Total size of truncated HLT result;Size [kB];Num of truncated results',
99 xbins=200, xmin=0, xmax=5000)
100 serialiser.MonTool.defineHistogram(f'{prefix}Truncation_LargestName', path='EXPERT', type='TH1F',
101 title='Name of the largest collection;;Num of truncated results',
102 xbins=1, xmin=0, xmax=1)
103 serialiser.MonTool.defineHistogram(f'{prefix}Truncation_LargestSize', path='EXPERT', type='TH1F',
104 title='Size of the largest collection;Size [kB];Num of truncated results',
105 xbins=200, xmin=0, xmax=5000)
106
107 return serialiser
108