ATLAS Offline Software
TrigEgammaMonitorHelper.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 '''@file TrigEgammaMonitoringConfigRun3.py
6 @author D. Maximov
7 @date 2019-07-08
8 @brief Run 3 configuration builder. Histograms definitions taken from TrigEgammaPlotTool
9 '''
10 
11 
12 
14  def __init__(self, name):
15  self.name = name
16  self.kwargs = {}
17 
18  def __setitem__(self, key, value):
19  self.kwargs[key] = value
20 
21 
22 
23 
24 def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs):
25 
26  res = THWrapper(name)
27  res['type'] = 'TH1F'
28  res['title'] = title
29 
30  if isinstance(bins_par2, (list, tuple) ): # signature 2
31  res['xbins'] = bins_par2
32  else: # signature 1
33  res['xbins'] = nxbins
34  res['xmin'] = bins_par2
35  res['xmax'] = bins_par3
36 
37  res['path'] = path
38  res.kwargs.update(kwargs)
39  return res
40 
41 
42 
43 
44 
45 def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs):
46 
47  res = THWrapper(name)
48  res['type'] = 'TH2F'
49  res['title'] = title
50 
51  if isinstance(bins_par2, (list, tuple) ): # signature 2 or 4
52  res['xbins'] = bins_par2
53  if isinstance(bins_par4, (list, tuple) ): # signature 4
54  res['ybins'] = bins_par4
55  else: # signature 2
56  res['ybins'] = bins_par3
57  res['ymin'] = bins_par4
58  res['ymax'] = bins_par5
59 
60  else: # signature 1 or 3
61  res['xbins'] = nxbins
62  res['xmin'] = bins_par2
63  res['xmax'] = bins_par3
64  if isinstance(bins_par5, (list, tuple) ): # signature 3
65  res['ybins'] = bins_par5
66  else: # signature 1
67  res['ybins'] = bins_par4
68  res['ymin'] = bins_par5
69  res['ymax'] = bins_par6
70 
71  res['path'] = path
72  res.kwargs.update(kwargs)
73  return res
74 
75 
76 
77 
78 
79 
80 
81 def TProfile(*args, **kwargs):
82  res = TH1F(*args, **kwargs)
83  res.name = res.name
84  res['type'] = 'TProfile'
85  return res
86 
87 
88 
89 
90 
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
python.TrigEgammaMonitorHelper.THWrapper
Definition: TrigEgammaMonitorHelper.py:13
python.TrigEgammaMonitorHelper.THWrapper.name
name
Definition: TrigEgammaMonitorHelper.py:15
python.TrigEgammaMonitorHelper.THWrapper.__init__
def __init__(self, name)
Definition: TrigEgammaMonitorHelper.py:14
python.TrigEgammaMonitorHelper.THWrapper.__setitem__
def __setitem__(self, key, value)
Definition: TrigEgammaMonitorHelper.py:18
pickleTool.object
object
Definition: pickleTool.py:30
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
python.TrigEgammaMonitorHelper.THWrapper.kwargs
kwargs
Definition: TrigEgammaMonitorHelper.py:16