ATLAS Offline Software
TrigAFPSidHypoMonitoring.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 def TrigAFPSidHypoMonitoring(configFlags):
4  from AthenaMonitoring import AthMonitorCfgHelper
5  monConfig = AthMonitorCfgHelper(configFlags, 'TrigAFPSidHypoMonitoring')
6 
7  from AthenaConfiguration.ComponentFactory import CompFactory
8  alg = monConfig.addAlgorithm( CompFactory.TrigAFPSidHypoMonitoringAlg, 'TrigAFPSidHypoMonitoring')
9  # will read it from menu in the future
10  alg.Chains = ["all", "AFP", "HLT_mb_afprec_L1CEP-CjJ50"]
11 
12  mbtsGroup = monConfig.addGroup(alg, 'AFPCoarse', topPath='HLT/MBAFPCoarse/')
13  mbtsGroup.defineHistogram('TrigCounts', title='Trigger counts;;Event rate',
14  xbins=len(alg.Chains), xmin=0, xmax=len(alg.Chains), xlabels=list(alg.Chains))
15  mbtsGroup.defineHistogram('xDiff', title='xLocal diff online-offline', xbins=101, xmin=-10, xmax=10)
16  mbtsGroup.defineHistogram('yDiff', title='yLocal diff online-offline', xbins=101, xmin=-10, xmax=10)
17  mbtsGroup.defineHistogram('xDiff;xDiffWideRange', title='xLocal diff online-offline large scale', xbins=101, xmin=-100, xmax=100)
18  mbtsGroup.defineHistogram('yDiff;yDiffWideRange', title='yLocal diff online-offline large scale', xbins=101, xmin=-100, xmax=100)
19 
20  return monConfig.result()
21 
22 if __name__ == '__main__':
23  # Setup logs
24  from AthenaCommon.Constants import DEBUG
25  # Set the Athena configuration flags
26  from AthenaConfiguration.AllConfigFlags import initConfigFlags
27  flags = initConfigFlags()
28 
29  flags.Output.HISTFileName = 'TestMonitorOutput.root'
30  flags.fillFromArgs()
31  flags.lock()
32 
33  # Initialize configuration object, add accumulator, merge, and run.
34  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
35  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
36  cfg = MainServicesCfg(flags)
37  cfg.merge(PoolReadCfg(flags))
38  cfg.merge(TrigAFPSidHypoMonitoring(flags))
39 
40  cfg.getEventAlgo('TrigAFPSidHypoMonitoring').OutputLevel = DEBUG
41  cfg.printConfig(withDetails=True) # set True for exhaustive info
42  with open("cfg.pkl", "wb") as f:
43  cfg.store(f)
44 
45  cfg.run()
46  # to run:
47  # python -m TrigMinBiasMonitoring.TrigAFPSidHypoMonitoring --filesInput=
TrigAFPSidHypoMonitoring
Definition: TrigAFPSidHypoMonitoring.py:1
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
Trk::open
@ open
Definition: BinningType.h:40
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
TrigAFPSidHypoMonitoring.TrigAFPSidHypoMonitoring
def TrigAFPSidHypoMonitoring(configFlags)
Definition: TrigAFPSidHypoMonitoring.py:3