3 from AthenaConfiguration.ComponentFactory 
import CompFactory
 
    4 from AthenaMonitoringKernel.GenericMonitoringTool 
import GenericMonitoringTool
 
    8    m = CompFactory.HLTResultMTMaker(name)
 
   11    from libpyeformat_helper 
import SourceIdentifier,SubDetector
 
   13       SubDetector.TDAQ_CALO_CLUSTER_PROC_ROI,
 
   14       SubDetector.TDAQ_CALO_JET_PROC_ROI,
 
   17       SubDetector.TDAQ_CALO_TOPO_PROC,
 
   18       SubDetector.TDAQ_CALO_DIGITAL_PROC,
 
   19       SubDetector.TDAQ_CALO_FEAT_EXTRACT_ROI,
 
   22    for subdetId 
in subdets:
 
   23       m.ExtraSubDets.append( 
int(subdetId) )
 
   25    def addROBs(dest,subdet,modules):
 
   26       for moduleId 
in modules:
 
   27          dest.append(SourceIdentifier(subdet,moduleId).
code())
 
   30    addROBs(m.ExtraROBs, SubDetector.TDAQ_CALO_CLUSTER_PROC_ROI, [0xa8, 0xa9, 0xaa, 0xab])
 
   31    addROBs(m.ExtraROBs, SubDetector.TDAQ_CALO_JET_PROC_ROI,     [0xac, 0xad])
 
   32    addROBs(m.ExtraROBs, SubDetector.TDAQ_MUON_CTP_INTERFACE,    [0x01])
 
   33    addROBs(m.ExtraROBs, SubDetector.TDAQ_CTP,                   [0x01])
 
   34    addROBs(m.ExtraROBs, SubDetector.TDAQ_CALO_TOPO_PROC,        [0x81, 0x91, 0x82, 0x92])
 
   38    m.MonTool.defineHistogram(
'TIME_makeResult', path=
'EXPERT', type=
'TH1F', title=
'makeResult() call time;Time [ms];Events',
 
   39                              xbins=200, xmin=0, xmax=50 )
 
   40    m.MonTool.defineHistogram(
'TIME_makeResult_extRange', path=
'EXPERT', type=
'TH1F', title=
'makeResult() call time;Time [ms];Events',
 
   41                              xbins=200, xmin=0, xmax=50, opt=
'kCanRebin' )
 
   42    m.MonTool.defineHistogram(
'PEB_RemovedROBs_SubDet', path=
'EXPERT', type=
'TH1F',
 
   43                              title=
'SubDet ID of ROBs removed from PEB streams because disabled in DetMask;;Entries',
 
   44                              xbins=80, xmin=0, xmax=80)
 
   45    m.MonTool.defineHistogram(
'PEB_RemovedSubDets', path=
'EXPERT', type=
'TH1F',
 
   46                              title=
'SubDetectors removed from PEB streams because disabled in DetMask;;Entries',
 
   47                              xbins=80, xmin=0, xmax=80)
 
   53    from TrigEDMConfig.DataScoutingInfo 
import getFullHLTResultID
 
   55    TriggerEDMSerialiserTool = CompFactory.TriggerEDMSerialiserTool  
 
   57    def addCollection(self, typeNameAux, moduleIds, allowTruncation=False):
 
   59               ','.
join([f
"{id}" for id 
in moduleIds])]
 
   61          defs.append(
'allowTruncation')
 
   62       self.CollectionsToSerialize.
append( 
';'.
join(defs) )
 
   64    def addCollectionToMainResult(self, typeNameAux, allowTruncation=False):
 
   67    def addCollectionListToResults(self, typeNameAuxList, moduleIds, allowTruncation=False):
 
   68       for typeNameAux 
in typeNameAuxList:
 
   69          self.addCollection(typeNameAux, moduleIds, allowTruncation)
 
   71    def addCollectionListToMainResult(self, typeNameAuxList, allowTruncation=False):
 
   72       self.addCollectionListToResults(typeNameAuxList, [
getFullHLTResultID()], allowTruncation)
 
   75    TriggerEDMSerialiserTool.addCollection = addCollection
 
   76    TriggerEDMSerialiserTool.addCollectionToMainResult = addCollectionToMainResult
 
   77    TriggerEDMSerialiserTool.addCollectionListToResults = addCollectionListToResults
 
   78    TriggerEDMSerialiserTool.addCollectionListToMainResult = addCollectionListToMainResult
 
   83    from TrigEDMConfig.TriggerEDMRun3 
import tpMap
 
   84    tpTool = CompFactory.TrigSerTPTool()
 
   85    tpTool.TPMap = 
tpMap()
 
   86    serialiser.TPTool = tpTool
 
   88    from TrigEDMConfig.DataScoutingInfo 
import TruncationThresholds 
as truncThresholds
 
   89    serialiser.TruncationThresholds = truncThresholds
 
   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)
 
  111    stmaker = CompFactory.StreamTagMakerTool(name)
 
  119    bitsmaker = CompFactory.TriggerBitsMakerTool(name)
 
  125    alg = CompFactory.DecisionSummaryMakerAlg(name)
 
  127    alg.MonTool.defineHistogram(
'RoIsDEta', path=
'EXPERT', type=
'TH1F',
 
  128                                title=
'Change of RoI eta position between initial and final RoI;delta eta;N final RoIs',
 
  129                                xbins=51, xmin=-1.02, xmax=1.02)
 
  130    alg.MonTool.defineHistogram(
'RoIsDPhi', path=
'EXPERT', type=
'TH1F',
 
  131                                title=
'Change of RoI phi position between initial and final RoI;delta phi;N final RoIs',
 
  132                                xbins=51, xmin=-1.02, xmax=1.02)
 
  133    alg.MonTool.defineHistogram(
'RoIsDZed', path=
'EXPERT', type=
'TH1F',
 
  134                                title=
'Change of RoI z position between initial and final RoI;delta z;N final RoIs',
 
  135                                xbins=51, xmin=-204, xmax=204)