ATLAS Offline Software
Functions
TileCalCellMonAlg Namespace Reference

Functions

def TileCalCellMonAlgConfig (flags, **kwargs)
 

Function Documentation

◆ TileCalCellMonAlgConfig()

def TileCalCellMonAlg.TileCalCellMonAlgConfig (   flags,
**  kwargs 
)
Function to configure TileCalCellMonAlg algorithm in the monitoring system.

Definition at line 12 of file TileCalCellMonAlg.py.

12 def TileCalCellMonAlgConfig(flags, **kwargs):
13  ''' Function to configure TileCalCellMonAlg algorithm in the monitoring system.'''
14 
15  kwargs.setdefault('MonGroupName', 'TileEventFiter')
16  kwargs.setdefault('useBeamBackgroundRemoval', False)
17  kwargs.setdefault('useLArNoisyAlg', False)
18  kwargs.setdefault('useLArCollisionFilterTool', False)
19 
20  if not (flags.Common.isOnline == 'online' or flags.Input.isMC):
21  kwargs.setdefault('useReadyFilterTool', True)
22  kwargs.setdefault('useBadLBTool', False) # FIXME: when new LArBadLBFilterTool config is ready
23  else:
24  kwargs.setdefault('useReadyFilterTool', False)
25  kwargs.setdefault('useBadLBTool', False)
26 
27  from AthenaCommon.SystemOfUnits import MeV
28  kwargs.setdefault('EnergyThreshold', 300.0 * MeV)
29 
30  from AthenaMonitoring import AthMonitorCfgHelper
31  helper = AthMonitorCfgHelper(flags,'TileCalMonCfg')
32 
33  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
34  cfg = LArGMCfg(flags)
35 
36  from TileGeoModel.TileGMConfig import TileGMCfg
37  cfg.merge(TileGMCfg(flags))
38 
39  from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
40  cfg.merge(CaloNoiseCondAlgCfg(flags))
41 
42  if kwargs['useLArCollisionFilterTool']:
43  from LArCellRec.LArCollisionTimeConfig import LArCollisionTimeCfg
44  cfg.merge(LArCollisionTimeCfg(flags))
45 
46  if kwargs['useReadyFilterTool'] and 'ReadyFilterTool' not in kwargs:
47  from AthenaMonitoring.AtlasReadyFilterConfig import AtlasReadyFilterCfg
48  readyFilterTool = cfg.popToolsAndMerge(AtlasReadyFilterCfg(flags))
49  kwargs['ReadyFilterTool'] = readyFilterTool
50 
51  from AthenaConfiguration.ComponentFactory import CompFactory
52  tileCalCellMonAlg = helper.addAlgorithm(CompFactory.TileCalCellMonAlg, 'TileCalCellMonAlg')
53 
54  for k, v in kwargs.items():
55  setattr(tileCalCellMonAlg, k, v)
56 
57  binLabels = ["TotalEvents", "ATLAS Ready", "with Good LAr LB", "with No LAr Collision",
58  "with No Beam Background", "with No Trigger Filter","with No LArError"]
59 
60  if not tileCalCellMonAlg.useReadyFilterTool:
61  binLabels[1] = "ATLAS Ready-OFF"
62  if not tileCalCellMonAlg.useBadLBTool:
63  binLabels[2] = "Good LAr LB-OFF"
64  if not tileCalCellMonAlg.useLArCollisionFilterTool:
65  binLabels[3] = "LAr collision-OFF"
66  if not tileCalCellMonAlg.useBeamBackgroundRemoval:
67  binLabels[4] = "Beam backgr.-OFF"
68  if not tileCalCellMonAlg.useLArNoisyAlg:
69  binLabels[5] = "LAr Error Veto-OFF"
70 
71  topPath = '/CaloMonitoring/TileCellMon_NoTrigSel/General/'
72  tileFilterGroup = helper.addGroup(tileCalCellMonAlg, tileCalCellMonAlg.MonGroupName, topPath)
73 
74  from CaloMonitoring.CaloMonAlgBase import CaloBaseHistConfig
75  CaloBaseHistConfig(tileFilterGroup, 'Summary/', binLabels)
76 
77  # 1) Configure histogram with TileCalCellMonAlg algorithm execution time
78  executeTimeGroup = helper.addGroup(tileCalCellMonAlg, 'TileCalCellMonExecuteTime', topPath)
79  executeTimeGroup.defineHistogram('TIME_execute', path = 'Summary', type='TH1F',
80  title = 'Time for execute TileCalCellMonAlg algorithm;time [#mus]',
81  xbins = 100, xmin = 0, xmax = 100000)
82 
83  # 2) Configure histograms with occupancy maps over threshold (4 noise sigma) per Tile sample
84  samplesWithoutE = ['A', 'BC', 'D', '']
85  noiseEtaPhiArray = helper.addArray([len(samplesWithoutE)], tileCalCellMonAlg, 'CellsNoiseXEtaVSPhi', topPath = topPath)
86  for postfix, tool in noiseEtaPhiArray.Tools.items():
87  sample = samplesWithoutE[int( postfix.split('_')[1] )]
88  title = ('Number of Tile Cells %s' % sample) + ' with E > 4 sigma (DB);#eta;#phi'
89  name = 'eta,phi;CellsNoiseXEtaVSPhi' + (sample + 'cells' if sample else '')
90  tool.defineHistogram(name, title = title, type = 'TH2F',
91  xbins = 17, xmin = -1.7, xmax = 1.7,
92  ybins = 64, ymin = -3.14, ymax = 3.14)
93 
94  # 3) Configure histogram with number of 4 sigma seeds per Tile hash ID
95  noiseHashGroup = helper.addGroup(tileCalCellMonAlg, 'CellsXNoiseXHash', topPath)
96  noiseHashGroup.defineHistogram('hash;CellsXNoiseXHash', path = '', type='TH1F',
97  title = 'Number of 4 sigma seeds per hash;Tile Cell Hash ID;Events',
98  xbins = 5184, xmin = -0.5, xmax = 5183.5)
99 
100  # 4) Configure histogram with Tile cell energy/noise (DB) ratio
101  noiseHashGroup = helper.addGroup(tileCalCellMonAlg, 'CellsNoiseTile', topPath)
102  noiseHashGroup.defineHistogram('noise;CellsNoiseTile', path = '', type='TH1F',
103  title = 'Energy/Noise (DB) of TileCal;Cell Energy / sigma (DB);Events',
104  xbins = 200, xmin = -10.0, xmax = 10.0)
105 
106  # 5) Configure histogram with mean Tile cell noise (DB) vs eta
107  noiseEtaGroup = helper.addGroup(tileCalCellMonAlg, 'CellsNoiseXEta', topPath)
108  noiseEtaGroup.defineHistogram('eta,noise;CellsNoiseXEta', path = '', type='TProfile',
109  title = 'Tile Cell noise #sigma (DB) vs #eta;#eta;Mean Cell noise (DB) [MeV]',
110  xbins = 17, xmin = -1.7, xmax = 1.7)
111 
112  # 6) Configure histogram with mean Tile cell noise (DB) vs phi
113  noisePhiGroup = helper.addGroup(tileCalCellMonAlg, 'CellsNoiseXPhi', topPath)
114  noisePhiGroup.defineHistogram('phi,noise;CellsNoiseXPhi', path = '', type='TProfile',
115  title = 'Tile Cell noise #sigma (DB) vs #phi;#phi;Mean Cell noise (DB) [MeV]',
116  xbins = 64, xmin = -3.14, xmax = 3.14)
117 
118  # 7) Configure histogram with number of Tile cell over threshold
119  nCellsGroup = helper.addGroup(tileCalCellMonAlg, 'CellsXN', topPath)
120  nCellsGroup.defineHistogram('nCells;CellsXN', path = '', type='TH1F',
121  title = 'Number of Tile Cells over threshold;Number of Tile Cells; Events',
122  xbins = 250, xmin = 0, xmax = 500)
123 
124  # 8) Configure histogram with Tile cell energy in GeV
125  energyGroup = helper.addGroup(tileCalCellMonAlg, 'CellsXE', topPath)
126  energyGroup.defineHistogram('energy;CellsXE', path = '', type='TH1F',
127  title = 'Energy of Tile Cells;Tile Cell Energy [GeV]; Events',
128  xbins = 50, xmin = 0, xmax = 20)
129 
130  # 9) Configure histogram with mean Tile cell energy in GeV vs eta
131  energyEtaGroup = helper.addGroup(tileCalCellMonAlg, 'CellsXEta', topPath)
132  energyEtaGroup.defineHistogram('eta,energy;CellsXEta', path = '', type='TProfile',
133  title = 'Tile Cell Energy vs #eta;#eta;Mean Cell Energy [GeV]',
134  xbins = 17, xmin = -1.7, xmax = 1.7)
135 
136  # 10) Configure histogram with mean Tile cell energy in GeV vs phi
137  energyPhiGroup = helper.addGroup(tileCalCellMonAlg, 'CellsXPhi', topPath)
138  energyPhiGroup.defineHistogram('phi,energy;CellsXPhi', path = '', type='TProfile',
139  title = 'Tile Cell Energy vs #phi;#phi;Mean Cell Energy [GeV]',
140  xbins = 64, xmin = -3.14, xmax = 3.14)
141 
142  # 11) Configure histogram with mean Tile cell energy in GeV vs tower
143  energyTowerGroup = helper.addGroup(tileCalCellMonAlg, 'CellsXTower', topPath)
144  energyTowerGroup.defineHistogram('tower,energy;CellsXTower', path = '', type='TProfile',
145  title = 'Tile Cell Energy vs tower;Tower;Mean Cell Energy [GeV]',
146  xbins = 18, xmin = 0, xmax = 18)
147 
148  # 12) Configure histogram with occupancy map over threshold vs eta and phi
149  occupEtaPhiGroup = helper.addGroup(tileCalCellMonAlg, 'CellsXEtaVSPhi', topPath)
150  occupEtaPhiTitle = ('Number of Tile Cell above threshold %s MeV;#eta;#phi' % kwargs['EnergyThreshold'])
151  occupEtaPhiGroup.defineHistogram('eta,phi;CellsXEtaVSPhi', path = '', type='TH2F', title = occupEtaPhiTitle,
152  xbins = 17, xmin = -1.7, xmax = 1.7, ybins = 64, ymin = -3.14, ymax = 3.14)
153 
154  # 13) Configure histograms with mean Tile cell energy vs module per sample
155  samples = ['A', 'BC', 'D', 'E']
156  energyModuleArray = helper.addArray([len(samples)], tileCalCellMonAlg, 'CellsXModule', topPath = topPath)
157  for postfix, tool in energyModuleArray.Tools.items():
158  sampleIdx = int( postfix.split('_')[1] )
159  sample = samples[sampleIdx]
160  title = ('Tile Sampling %s' % sample) + ';Module;Mean Cell Energy [GeV]'
161  name = 'module,energy;CellsXModuleS' + str(sampleIdx + 1)
162  tool.defineHistogram(name, title = title, type = 'TProfile',
163  xbins = 64, xmin = 1, xmax = 65)
164 
165 
166  accumalator = helper.result()
167  cfg.merge(accumalator)
168  return cfg
169 
170 
SystemOfUnits
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
CaloMonAlgBase.CaloBaseHistConfig
def CaloBaseHistConfig(group, histpath, binlabels)
Definition: CaloMonAlgBase.py:5
python.CaloNoiseCondAlgConfig.CaloNoiseCondAlgCfg
def CaloNoiseCondAlgCfg(flags, noisetype="totalNoise")
Definition: CaloNoiseCondAlgConfig.py:11
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
python.AtlasReadyFilterConfig.AtlasReadyFilterCfg
def AtlasReadyFilterCfg(flags)
Definition: AtlasReadyFilterConfig.py:10
LArCollisionTimeConfig.LArCollisionTimeCfg
def LArCollisionTimeCfg(configFlags, cutIteration=False)
Definition: LArCollisionTimeConfig.py:8
str
Definition: BTagTrackIpAccessor.cxx:11
TileCalCellMonAlg.TileCalCellMonAlgConfig
def TileCalCellMonAlgConfig(flags, **kwargs)
Definition: TileCalCellMonAlg.py:12
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7