ATLAS Offline Software
Functions
EfexMonitorAlgorithm Namespace Reference

Functions

def EfexMonitoringConfig (inputFlags)
 
def EfexMonitoringHistConfig (flags, eFexAlg)
 

Function Documentation

◆ EfexMonitoringConfig()

def EfexMonitorAlgorithm.EfexMonitoringConfig (   inputFlags)
Function to configure LVL1 Efex algorithm in the monitoring system.

Definition at line 4 of file EfexMonitorAlgorithm.py.

4 def EfexMonitoringConfig(inputFlags):
5  '''Function to configure LVL1 Efex algorithm in the monitoring system.'''
6 
7  # get the component factory - used for merging the algorithm results
8  from AthenaConfiguration.ComponentFactory import CompFactory
9  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
10  result = ComponentAccumulator()
11 
12  # uncomment if you want to see all the flags
13  #inputFlags.dump() # print all the configs
14 
15  # make the athena monitoring helper
16  from AthenaMonitoring import AthMonitorCfgHelper
17  helper = AthMonitorCfgHelper(inputFlags,'EfexMonitoringCfg')
18 
19  # add algorithm to the helper
20  EfexMonAlg = helper.addAlgorithm(CompFactory.EfexMonitorAlgorithm,'EfexMonAlg')
21 
22  # add any steering
23  baseGroupName = 'EfexMonitor' # the monitoring group name is also used for the package name
24  EfexMonAlg.PackageName = baseGroupName
25  EfexMonAlg.LowPtCut = 0.0
26  EfexMonAlg.HiPtCut = 15000.0
27  EfexMonAlg.eFexEMTobKeyList = ['L1_eEMRoI', 'L1_eEMxRoI']
28  EfexMonAlg.eFexTauTobKeyList = ['L1_eTauRoI', 'L1_eTauxRoI']
29 
30  acc = helper.result()
31  result.merge(acc)
32  return result
33 
34 

◆ EfexMonitoringHistConfig()

def EfexMonitorAlgorithm.EfexMonitoringHistConfig (   flags,
  eFexAlg 
)
The histogram binning depends on the algorithm settings, configure separately

Definition at line 35 of file EfexMonitorAlgorithm.py.

35 def EfexMonitoringHistConfig(flags, eFexAlg):
36  """
37  The histogram binning depends on the algorithm settings, configure separately
38  """
39  import math
40  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
41  result = ComponentAccumulator()
42 
43 
44  # make the athena monitoring helper again so we can add groups
45  from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig import L1CaloMonitorCfgHelper
46  helper = L1CaloMonitorCfgHelper(flags,None,'EfexMonitoringCfg')
47  helper.alg = eFexAlg
48 
49  # we don't add the algorithm again, use the supplied one
50  EfexMonAlg = eFexAlg
51  baseGroupName = EfexMonAlg.PackageName
52 
53  # Some helpful variables for declaring the histograms
54  # mainDir = 'L1Calo'
55  trigPath = 'Developer/Efex/' # Directory trigger path for output histos
56  # Map from the key name to the output directory substructure.
57  keyDirPathMap = {'L1_eEMRoI' : 'eEM',
58  'L1_eEMxRoI' : 'eEMx', 'L1_eEMRoISim' : 'TOBSim/eEM', 'L1_eEMxRoISim' : 'xTOBSim/eEM',
59  'L1_eTauRoI' : 'eTAU',
60  'L1_eTauxRoI' : 'eTAUx', 'L1_eTauRoISim' : 'TOBSim/eTau',
61  'L1_eTauxRoISim' : 'xTOBSim/eTau'}
62  cut_names = ["LowPtCut", "HiPtCut"] # List of cut names, for looping over to separate out histograms into directories
63  cut_vals = [EfexMonAlg.LowPtCut, EfexMonAlg.HiPtCut] # List of values, for looping over to add to histogram titles
64 
65  # First, define the histograms with no Pt cut
66  # add monitoring algorithm to group, with group name and main directory
67 
68  locIdxs = []
69  for phiOct in range(0,8):
70  for etaIdx in range(-25,25):
71  locIdxs += [str(phiOct) + ":" + str(etaIdx)]
72 
73  for containerKey in (list(EfexMonAlg.eFexEMTobKeyList) + list(EfexMonAlg.eFexTauTobKeyList)):
74  helper.defineHistogram(containerKey + '_nTOBs_nocut;h_n'+containerKey+'_nocut', title='Number of '+containerKey+';Number of '+containerKey+';Events',
75  fillGroup = baseGroupName,
76  type='TH1I', xbins=100,xmin=-0.5,xmax=99.5)
77  if "Sim" not in containerKey:
78  # don't make these expensive plots for simulation
79  helper.defineHistogram("LBN,locIdx,tobEt;h_"+containerKey+"_et_posLbnMap", title = "Average " + containerKey + " ET;LB;Position (Octant:Eta)",
80  fillGroup = baseGroupName + "_" + containerKey,
81  path = ("Expert/Outputs/" if "x" not in containerKey else trigPath)+keyDirPathMap[containerKey],
82  hanConfig={"description":"Check for horizontal anomalies (hotspot/coldspot) or vertical anomalies (whole-system hot/cold)"},
83  type="TProfile2D",
84  xbins=1,xmin=0,xmax=1, ylabels=locIdxs, opt=['kAddBinsDynamically'])
85  helper.defineHistogram(f"LBN,{containerKey}_nTOBs_nocut;h_"+containerKey+"_nTOBs", title = "Average # of " + containerKey + " TOBs;LBN",
86  fillGroup = baseGroupName,
87  type="TH2I",
88  xbins=1,xmin=0,xmax=1,ybins=20,ymin=-0.5,ymax=19.5, opt=['kAddBinsDynamically'])
89 
90 
91  # Now define the histograms with low/hi Pt cut
92  for cut_name, cut_val in zip(cut_names, cut_vals):
93  cut_title_addition = '' if (cut_val == 0.0) else ' [Et>=' + '%.1f'%(cut_val/1000) + 'GeV]'
94  # Em first
95  for containerKey in EfexMonAlg.eFexEMTobKeyList:
96  fillGroup = baseGroupName+'_'+containerKey+'_'+cut_name
97  tobTypeStr = "xTOB" if ('xRoI' in containerKey) else "TOB"
98  simStr = "Sim" if ('Sim' in containerKey) else ""
99  tobStr = tobTypeStr + simStr
100  # histograms of eEM variables
101  helper.defineHistogram('nEMTOBs;h_nEmTOBs', title='Number of eFex EM '+tobStr+'s'+cut_title_addition+';EM '+tobStr+'s;Number of EM '+tobStr+'s',
102  fillGroup=fillGroup,
103  type='TH1I', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=10,xmin=0,xmax=10)
104 
105  helper.defineHistogram('TOBTransverseEnergy;h_TOBTransverseEnergy', title='eFex '+tobStr+' EM Transverse Energy [MeV]'+cut_title_addition,
106  fillGroup=fillGroup,
107  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=100,xmin=0,xmax=50000)
108 
109  helper.defineHistogram('TOBEta;h_TOBEta', title='eFex '+tobStr+' EM Eta'+cut_title_addition,
110  fillGroup=fillGroup,
111  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=50,xmin=-2.5,xmax=2.5)
112 
113  helper.defineHistogram('TOBPhi;h_TOBPhi', title='eFex '+tobStr+' EM Phi'+cut_title_addition,
114  fillGroup=fillGroup,
115  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=64,xmin=-math.pi,xmax=math.pi)
116 
117  helper.defineHistogram(f"tauTOBEta,tauTOBPhi;h_{containerKey}_{cut_name}_EtaPhiMap", title='eEM '+tobStr+' Count'+cut_title_addition+';#eta;#phi',
118  fillGroup=fillGroup,
119  hanConfig={"description":"Inspect for hot/cold spots - check help for list of known hot/coldspots"},
120  type='TH2F',
121  path=(("Expert/Outputs/"+keyDirPathMap[containerKey]) if "Sim" not in containerKey and "x" not in containerKey else trigPath+keyDirPathMap[containerKey]+cut_name),
122  xbins=50,xmin=-2.5,xmax=2.5,ybins=64,ymin=-math.pi,ymax=math.pi)
123 
124  helper.defineHistogram('TOBshelfNumber;h_TOBshelfNumber', title='eFex '+tobStr+' EM Shelf Number'+cut_title_addition,
125  fillGroup=fillGroup,
126  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=2,xmin=0,xmax=2)
127 
128  helper.defineHistogram('TOBeFEXNumberSh0;h_TOBeFEXNumberShelf0', title='eFex '+tobStr+' EM Module Number Shelf 0'+cut_title_addition,
129  fillGroup=fillGroup,
130  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=12,xmin=0,xmax=12)
131 
132  helper.defineHistogram('TOBeFEXNumberSh1;h_TOBeFEXNumberShelf1', title='eFex '+tobStr+' EM Module Number Shelf 1'+cut_title_addition,
133  fillGroup=fillGroup,
134  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=12,xmin=0,xmax=12)
135 
136  helper.defineHistogram('TOBfpga;h_TOBfpga', title='eFex '+tobStr+' EM FPGA'+cut_title_addition,
137  fillGroup=fillGroup,
138  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4)
139 
140  helper.defineHistogram('TOBReta;h_TOBReta', title='eFex '+tobStr+' EM Reta'+cut_title_addition,
141  fillGroup=fillGroup,
142  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name,xbins=250,xmin=0,xmax=1)
143 
144  helper.defineHistogram('TOBRhad;h_TOBRhad', title='eFex '+tobStr+' EM Rhad'+cut_title_addition,
145  fillGroup=fillGroup,
146  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=250,xmin=0,xmax=1)
147 
148  helper.defineHistogram('TOBWstot;h_TOBWstot', title='eFex '+tobStr+' EM Wstot'+cut_title_addition,
149  fillGroup=fillGroup,
150  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=250,xmin=0,xmax=1)
151 
152  threshold_labels = ['fail','loose','medium','tight']
153  helper.defineHistogram('TOBReta_threshold;h_TOBReta_threshold', title='eFex '+tobStr+' EM Reta threshold'+cut_title_addition,
154  fillGroup=fillGroup,
155  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name,xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
156 
157  helper.defineHistogram('TOBRhad_threshold;h_TOBRhad_threshold', title='eFex '+tobStr+' EM Rhad threshold'+cut_title_addition,
158  fillGroup=fillGroup,
159  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
160 
161  helper.defineHistogram('TOBWstot_threshold;h_TOBWstot_threshold', title='eFex '+tobStr+' EM Wstot threshold'+cut_title_addition,
162  fillGroup=fillGroup,
163  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4.0,xlabels=threshold_labels)
164 
165  # Now Tau
166  for containerKey in EfexMonAlg.eFexTauTobKeyList:
167  fillGroup = baseGroupName+'_'+containerKey+'_'+cut_name
168  tobTypeStr = "xTOB" if ('xRoI' in containerKey) else "TOB"
169  simStr = "Sim" if ('Sim' in containerKey) else ""
170  tobStr = tobTypeStr + simStr
171  # plotting of eTau variables
172  helper.defineHistogram('nTauTOBs;h_nTauTOBs', title='Number of eFex Tau '+tobStr+'s'+cut_title_addition+';Tau '+tobStr+'s;Number of Tau '+tobStr+'s',
173  fillGroup = fillGroup,
174  type='TH1I', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=10,xmin=0,xmax=10)
175 
176  helper.defineHistogram('tauTOBTransverseEnergy;h_tauTOBTransverseEnergy', title='eFex '+tobStr+' Tau Transverse Energy [MeV]'+cut_title_addition,
177  fillGroup = fillGroup,
178  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=100,xmin=0,xmax=50000)
179 
180  helper.defineHistogram('tauTOBEta;h_tauTOBEta', title='eFex '+tobStr+' Tau Eta'+cut_title_addition,
181  fillGroup = fillGroup,
182  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=60,xmin=-2.5,xmax=2.5)
183 
184  helper.defineHistogram('tauTOBPhi;h_tauTOBPhi', title='eFex '+tobStr+' Tau Phi'+cut_title_addition,
185  fillGroup = fillGroup,
186  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=100,xmin=-math.pi,xmax=math.pi)
187 
188  helper.defineHistogram(f"tauTOBEta,tauTOBPhi;h_{containerKey}_{cut_name}_EtaPhiMap", title='eTAU '+tobStr+' Count'+cut_title_addition+';#eta;#phi',
189  fillGroup = fillGroup,
190  hanConfig={"description":"Inspect for hot/cold spots - check help for list of known hot/cold spots</a>"},
191  type='TH2F',
192  path=(("Expert/Outputs/"+keyDirPathMap[containerKey]) if "Sim" not in containerKey and "x" not in containerKey else (trigPath+keyDirPathMap[containerKey]+cut_name)),
193  xbins=50,xmin=-2.5,xmax=2.5,ybins=64,ymin=-math.pi,ymax=math.pi)
194 
195  helper.defineHistogram('tauTOBshelfNumber;h_tauTOBshelfNumber', title='eFex '+tobStr+' Tau Shelf Number'+cut_title_addition,
196  fillGroup = fillGroup,
197  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=2,xmin=0,xmax=2)
198 
199  helper.defineHistogram('tauTOBeFEXNumberSh0;h_tauTOBeFEXNumberShelf0', title='eFex '+tobStr+' Tau Module Number Shelf 0'+cut_title_addition,
200  fillGroup = fillGroup,
201  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=12,xmin=0,xmax=12)
202 
203  helper.defineHistogram('tauTOBeFEXNumberSh1;h_tauTOBeFEXNumberShelf1', title='eFex '+tobStr+' Tau Module Number Shelf 1'+cut_title_addition,
204  fillGroup = fillGroup,
205  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=12,xmin=0,xmax=12)
206 
207 
208  helper.defineHistogram('tauTOBfpga;h_tauTOBfpga', title='eFex '+tobStr+' Tau FPGA'+cut_title_addition,
209  fillGroup = fillGroup,
210  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4)
211 
212  helper.defineHistogram('tauTOBRcore;h_tauTOBRcore', title='eFex '+tobStr+' Tau rCore'+cut_title_addition,
213  fillGroup = fillGroup,
214  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=250,xmin=0,xmax=1)
215 
216  helper.defineHistogram('tauTOBRhad;h_tauTOBRhad', title='eFex '+tobStr+' Tau rHad'+cut_title_addition,
217  fillGroup = fillGroup,
218  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=250,xmin=0,xmax=1)
219 
220  helper.defineHistogram('tauTOBRcore_threshold;h_tauTOBRcore_threshold', title='eFex '+tobStr+' Tau rCore threshold'+cut_title_addition,
221  fillGroup = fillGroup,
222  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
223 
224  helper.defineHistogram('tauTOBRhad_threshold;h_tauTOBRhad_threshold', title='eFex '+tobStr+' Tau rHad threshold'+cut_title_addition,
225  fillGroup = fillGroup,
226  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
227 
228  helper.defineHistogram('tauTOBthree_threshold;h_tauTOBthree_threshold', title='eFex '+tobStr+' Tau 3 taus threshold'+cut_title_addition,
229  fillGroup = fillGroup,
230  type='TH1F', path=trigPath+keyDirPathMap[containerKey]+cut_name, xbins=4,xmin=0,xmax=4.0, xlabels=threshold_labels)
231 
232  acc = helper.result()
233  result.merge(acc)
234  return result
235 
236 
EfexMonitorAlgorithm.EfexMonitoringHistConfig
def EfexMonitoringHistConfig(flags, eFexAlg)
Definition: EfexMonitorAlgorithm.py:35
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
str
Definition: BTagTrackIpAccessor.cxx:11
EfexMonitorAlgorithm.EfexMonitoringConfig
def EfexMonitoringConfig(inputFlags)
Definition: EfexMonitorAlgorithm.py:4