ATLAS Offline Software
JfexInputMonitorAlgorithm.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 #
5  '''Function to configure LVL1 JfexInput algorithm in the monitoring system.'''
6 
7  # get the component factory - used for getting the algorithms
8  from AthenaConfiguration.ComponentFactory import CompFactory
9  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10  from AthenaConfiguration.Enums import Format
11  result = ComponentAccumulator()
12 
13  # use L1Calo's special MonitoringCfgHelper
14  from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig import L1CaloMonitorCfgHelper
15  helper = L1CaloMonitorCfgHelper(flags,CompFactory.JfexInputMonitorAlgorithm,'JfexInputMonAlg')
16 
17 
18  #Algorithms needed for the monitoring
19  if flags.Input.Format==Format.BS:
20 
21  #jfex emulated input: EmulatedTowers
22  from L1CaloFEXAlgos.FexEmulatedTowersConfig import jFexEmulatedTowersCfg
23  result.merge(jFexEmulatedTowersCfg(flags))
24 
25 
26  # get any algorithms
27  JfexInputMonAlg = helper.alg
28 
29  # add any steering
30  groupName = 'JfexInputMonitor' # the monitoring group name is also used for the package name
31  JfexInputMonAlg.Grouphist = groupName
32 
33 
34  from math import pi
35 
36  x_phi = []
37  for i in range(67):
38  phi = (-pi- pi/32) + pi/32*i
39  x_phi.append(phi)
40  x_phi = sorted(x_phi)
41 
42 
43  eta_phi_bins = {
44  'xbins': 100, 'xmin': -5, 'xmax': 5,
45  'ybins': x_phi
46  }
47 
48  helper.defineTree('LBNString,Error,EventNumber,TowerId,TowerSource,TowerEta,TowerPhi,TowerCount,RefTowerCount,TowerSat,RefTowerSat,timeSince,timeUntil;errors',
49  "lbnString/string:error/string:eventNumber/l:id/i:source/i:eta/F:phi/F:count/i:ref_count/i:sat/I:ref_sat/I:timeSince/I:timeUntil/I",
50  title="errors tree;LBN;Error",fillGroup="errors")
51  helper.defineHistogram('TowerEta,TowerPhi;h_saturated', title='jFex Saturated DataTowers; #eta; #phi',
52  type='TH2F',fillGroup=groupName,cutmask="TowerSaturated",**eta_phi_bins)
53  helper.defineHistogram('TowerEta,TowerPhi;h_invalidCodes', title='jFex DataTower Invalid Et codes (4095); #eta; #phi',
54  type='TH2F',fillGroup=groupName,cutmask="TowerInvalid",**eta_phi_bins)
55  helper.defineHistogram('TowerEta,TowerPhi;h_emptyCodes', title='jFex DataTower Empty Et codes (0); #eta; #phi',
56  type='TH2F',fillGroup=groupName,cutmask="TowerEmpty",**eta_phi_bins)
57 
58  result.merge(helper.result())
59  return result
60 
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename R::value_type > sorted(const R &r, PROJ proj={})
Helper function to create a sorted vector from an unsorted range.
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
FexEmulatedTowersConfig.jFexEmulatedTowersCfg
def jFexEmulatedTowersCfg(flags, name="jFexEmulatedTowerMaker", writeKey="L1_jFexEmulatedTowers")
Definition: FexEmulatedTowersConfig.py:24
JfexInputMonitorAlgorithm.JfexInputMonitoringConfig
def JfexInputMonitoringConfig(flags)
Definition: JfexInputMonitorAlgorithm.py:4