ATLAS Offline Software
ClusterMonitorAlgorithm.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 '''@file ClusterMonitorAlgorithm.py
6 @author L. Sawyer
7 @date 2019-08-15
8 @python configuration for the Run III Calo Cluster Monitoring package
9 '''
10 
11 def ClusterMonitoringConfig(inputFlags):
12  '''Function to configures some algorithms in the monitoring system.'''
13 
14 
20 
21  # The following class will make a sequence, configure algorithms, and link
22  # them to GenericMonitoringTools
23  from AthenaMonitoring import AthMonitorCfgHelper
24  helper = AthMonitorCfgHelper(inputFlags,'ClusterAthMonitorCfg')
25 
26 
27 
34 
35  from AthenaMonitoring.AtlasReadyFilterConfig import AtlasReadyFilterCfg
36  from AthenaMonitoring.BadLBFilterToolConfig import LArBadLBFilterToolCfg
37  from AthenaMonitoring.EventFlagFilterToolConfig import EventFlagFilterToolCfg
38 
39  from AthenaConfiguration.ComponentFactory import CompFactory
40  clusterMonAlg = helper.addAlgorithm(CompFactory.ClusterMonitorAlgorithm,'ClusterMonAlg',
41  addFilterTools = [AtlasReadyFilterCfg(inputFlags),
42  LArBadLBFilterToolCfg(inputFlags),
43  EventFlagFilterToolCfg(inputFlags,doLAr=True, doTile=False, doSCT=False, doCore=False)
44  ])
45 
46 
47 
48 
55 
56  clusterMonAlg.CaloTopoClusterContainer = "CaloCalTopoClusters"
57  clusterMonAlg.EMTopoClusterContainer = "egammaClusters"
58  # cluster energy threshold in GeV -
59  clusterMonAlg.lowEthresh = 10.0
60  clusterMonAlg.medEthresh = 15.0
61  clusterMonAlg.medhiEthresh = 25.0
62  clusterMonAlg.hiEthresh = 50.0
63 
64  clusterMonAlg.EMlowEthresh = 4.0
65  clusterMonAlg.EMmedEthresh = 10.0
66  clusterMonAlg.EMmedhiEthresh = 15.0
67  clusterMonAlg.EMhiEthresh = 25.0
68 
69 
72 
73  # # Then, add a tool that doesn't have its own configuration function. In
74  # # this example, no accumulator is returned, so no merge is necessary.
75  # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
76  # clusterMonAlg.MyDomainTool = MyDomainTool()
77 
78 
79  # Add monitor groups.
80  clustersAllGroup = helper.addGroup(
81  alg=clusterMonAlg,
82  name='ClusterMonitorAllClusters',
83  topPath='CaloTopoClusters/AllClusters/'
84  )
85  clustersAllGroupEM = helper.addGroup(
86  alg=clusterMonAlg,
87  name='ClusterMonitorAllEMClusters',
88  topPath='CaloTopoClusters/AllEMClusters/'
89  )
90 
91  clustersExpertGroup = helper.addGroup(
92  alg=clusterMonAlg,
93  name='ClusterMonitorExpertPlots',
94  topPath='CaloTopoClusters/AllClusters/Expert/'
95  )
96  clustersExpertGroupEM = helper.addGroup(
97  alg=clusterMonAlg,
98  name='ClusterMonitorExpertPlotsEM',
99  topPath='CaloTopoClusters/AllEMClusters/Expert/'
100  )
101 
102  clustersCalECAGroup = helper.addGroup(
103  alg=clusterMonAlg,
104  name='ClusterMonitorCalECA',
105  topPath='CaloTopoClusters/CalECA/'
106  )
107  clustersEMECAGroup = helper.addGroup(
108  alg=clusterMonAlg,
109  name='ClusterMonitorEMECA',
110  topPath='CaloTopoClusters/CalEMECA/'
111  )
112 
113  clustersCalBARGroup = helper.addGroup(
114  alg=clusterMonAlg,
115  name='ClusterMonitorCalBAR',
116  topPath='CaloTopoClusters/CalBAR/'
117  )
118  clustersEMBARGroup = helper.addGroup(
119  alg=clusterMonAlg,
120  name='ClusterMonitorEMBAR',
121  topPath='CaloTopoClusters/CalEMBAR/'
122  )
123 
124  clustersCalECCGroup = helper.addGroup(
125  alg=clusterMonAlg,
126  name='ClusterMonitorCalECC',
127  topPath='CaloTopoClusters/CalECC/'
128  )
129  clustersEMECCGroup = helper.addGroup(
130  alg=clusterMonAlg,
131  name='ClusterMonitorEMECC',
132  topPath='CaloTopoClusters/CalEMECC/'
133  )
134 
135 
136  # Configure histograms - All Clusters
137  clustersAllGroup.defineHistogram('nClusters',title='No. of Clusters;N_{clusters};Events',xbins=200,xmin=0.0,xmax=1000.0)
138  clustersAllGroup.defineHistogram('clusterEta',title='Cluster eta;eta;Events',xbins=98,xmin=-4.9,xmax=4.9)
139  clustersAllGroup.defineHistogram('clusterPhi', title='Cluster phi;phi;Events',xbins=64,xmin=-3.15,xmax=3.15)
140  clustersAllGroup.defineHistogram('clusterE', title='Cluster energy;E;Events',xbins=100,xmin=0.0,xmax=100)
141  clustersAllGroup.defineHistogram('clusterET', title='Cluster transverse energy;ET;Events',xbins=100,xmin=0.0,xmax=100)
142 
143  clustersAllGroup.defineHistogram('clusterEta,clusterE', type='TH2F',title='Cluster energy vs eta;eta;E',
144  xbins=98,xmin=-4.9,xmax=4.9,ybins=100,ymin=0.0,ymax=100.0 )
145  clustersAllGroup.defineHistogram('clusterEta,clusterET', type='TH2F', title='Cluster transverse energy vs eta;eta;E_{T}',
146  xbins=98,xmin=-4.9,xmax=4.9,ybins=100,ymin=0.0,ymax=100.0 )
147  clustersAllGroup.defineHistogram('clusterPhi,clusterE', type='TH2F',title='Cluster energy vs phi;phi;E',
148  xbins=64,xmin=-3.15,xmax=3.15,ybins=100,ymin=0.0,ymax=100.0 )
149  clustersAllGroup.defineHistogram('clusterPhi,clusterET', type='TH2F', title='Cluster transverse energy vs phi;phi;E_{T}',
150  xbins=64,xmin=-3.15,xmax=3.15,ybins=100,ymin=0.0,ymax=100.0 )
151  clustersAllGroup.defineHistogram('clusterEta,clusterPhi,clusterE', type='TProfile2D', title='Average Cluster Energy;eta;phi',
152  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
153  clustersAllGroup.defineHistogram('clusterEta,clusterPhi,clusterET', type='TProfile2D', title='Average Cluster Transverse Energy;eta;phi',
154  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
155 
156  # Configure histograms - All Clusters:Expert Plots
157  clustersExpertGroup.defineHistogram('nCells',title='No. of Cells in a Clusters;N_{cells};Events',xbins=200,xmin=0.0,xmax=200.0)
158  clustersExpertGroup.defineHistogram('nBadCells',title='No. of Bad Cells in a Clusters;N_{bad cells};Events',xbins=11,xmin=-1.0,xmax=10.0)
159  clustersExpertGroup.defineHistogram('EBadCells',title='E of Bad Cells in a Clusters;E_{bad cells};Events',xbins=210,xmin=-10.0,xmax=100.0)
160  clustersExpertGroup.defineHistogram('clusterEta,clusterPhi,nCells', type='TProfile2D', title='No. of Cells in a Clusters;eta;phi',
161  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
162  clustersExpertGroup.defineHistogram('clusterEta,clusterPhi,nBadCells', type='TProfile2D', title='No. of Bad Cells in a Clusters;eta;phi',
163  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
164  clustersExpertGroup.defineHistogram('clusterTime',title='Cluster Time;time;Events',xbins=200,xmin=-100.0,xmax=100.0)
165  clustersExpertGroup.defineHistogram('clusterTime,clusterE',type='TH2F',title='Cluster Time vs E;time;E',
166  xbins=200,xmin=-100.0,xmax=100.0,ybins=100,ymin=0.0,ymax=100.0)
167  clustersExpertGroup.defineHistogram('HotRat',title='Energy Fraction of Highest Cell;E_{frac};Events',xbins=200,xmin=-0.2,xmax=1.8)
168  clustersExpertGroup.defineHistogram('clusterIsol',title='Cluster Isolation;Isolation;Events',xbins=60,xmin=-1.0,xmax=2.0)
169  clustersExpertGroup.defineHistogram('BadLARQFrac',title='Bad LAR Q Frac.;Frac;Events',xbins=25,xmin=-1.0,xmax=1.5)
170  clustersExpertGroup.defineHistogram('EngPos',title='E from Positive Cells;E;Events',xbins=100,xmin=0.0,xmax=100.0)
171  clustersExpertGroup.defineHistogram('AveLARQ',title='Average LAR Q;LAR Q;Events',xbins=31,xmin=-1000.0,xmax=30000.0)
172  clustersExpertGroup.defineHistogram('AveTileQ',title='Average Tile Q;Tile Q;Events',xbins=21,xmin=-10.0,xmax=200.0)
173 
174  clustersExpertGroup.defineHistogram('clusterEta,clusterPhi,HotRat',type='TProfile2D', title='Energy Fraction of Highest Cell;eta;phi',
175  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
176  clustersExpertGroup.defineHistogram('clusterEta,clusterPhi,HotRat;vHotRatE',type='TProfile2D', title='Energy Fraction of Highest Cell for E_{frac}>0.9;eta;phi',
177  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='HighHotRat')
178  clustersExpertGroup.defineHistogram('clusterEta,clusterPhi;vHotRatOcc',type='TH2F', title='Occupancy of Clusters with Highest Cell E_{frac}>0.9;eta;phi',
179  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='HighHotRat')
180 
181 
182  # Configure histograms - Occupancies and energies by region
183  #ECA:
184  clustersCalECAGroup.defineHistogram('clusterEta,clusterPhi;Thresh0ECAOcc', type='TH2F',title='Cluster Occupancy - No Threshold;eta;phi',
185  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
186  clustersCalECAGroup.defineHistogram('clusterEta,clusterPhi;Thresh1ECAOcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.lowEthresh)+' GeV;eta;phi',
187  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold1' )
188  clustersCalECAGroup.defineHistogram('clusterEta,clusterPhi;Thresh2ECAOcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.medEthresh)+' GeV;eta;phi',
189  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold2' )
190  clustersCalECAGroup.defineHistogram('clusterEta,clusterPhi;Thresh3ECAOcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.medhiEthresh)+' GeV;eta;phi',
191  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold3' )
192  clustersCalECAGroup.defineHistogram('clusterEta,clusterPhi;Thresh4ECAOcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.hiEthresh)+' GeV;eta;phi',
193  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold4' )
194 
195  clustersCalECAGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh0ECAAveE', type='TProfile2D',title='Average Cluster Energy - No Threshold;eta;phi',
196  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
197  clustersCalECAGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh1ECAAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.lowEthresh)+' GeV;eta;phi',
198  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold1' )
199  clustersCalECAGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh2ECAAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.medEthresh)+' GeV;eta;phi',
200  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold2' )
201  clustersCalECAGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh3ECAAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.medhiEthresh)+' GeV;eta;phi',
202  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold3' )
203  clustersCalECAGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh4ECAAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.hiEthresh)+' GeV;eta;phi',
204  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold4' )
205  #BAR:
206  clustersCalBARGroup.defineHistogram('clusterEta,clusterPhi;Thresh0BAROcc', type='TH2F',title='Cluster Occupancy - No Threshold;eta;phi',
207  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
208  clustersCalBARGroup.defineHistogram('clusterEta,clusterPhi;Thresh1BAROcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.lowEthresh)+' GeV;eta;phi',
209  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold1' )
210  clustersCalBARGroup.defineHistogram('clusterEta,clusterPhi;Thresh2BAROcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.medEthresh)+' GeV;eta;phi',
211  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold2' )
212  clustersCalBARGroup.defineHistogram('clusterEta,clusterPhi;Thresh3BAROcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.medhiEthresh)+' GeV;eta;phi',
213  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold3' )
214  clustersCalBARGroup.defineHistogram('clusterEta,clusterPhi;Thresh4BAROcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.hiEthresh)+' GeV;eta;phi',
215  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold4' )
216 
217  clustersCalBARGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh0BARAveE', type='TProfile2D',title='Average Cluster Energy - No Threshold;eta;phi',
218  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
219  clustersCalBARGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh1BARAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.lowEthresh)+' GeV;eta;phi',
220  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold1' )
221  clustersCalBARGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh2BARAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.medEthresh)+' GeV;eta;phi',
222  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold2' )
223  clustersCalBARGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh3BARAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.medhiEthresh)+' GeV;eta;phi',
224  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold3' )
225  clustersCalBARGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh4BARAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.hiEthresh)+' GeV;eta;phi',
226  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold4' )
227  #ECC:
228  clustersCalECCGroup.defineHistogram('clusterEta,clusterPhi;Thresh0ECCOcc', type='TH2F',title='Cluster Occupancy - No Threshold;eta;phi',
229  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
230  clustersCalECCGroup.defineHistogram('clusterEta,clusterPhi;Thresh1ECCOcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.lowEthresh)+' GeV;eta;phi',
231  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold1' )
232  clustersCalECCGroup.defineHistogram('clusterEta,clusterPhi;Thresh2ECCOcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.medEthresh)+' GeV;eta;phi',
233  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold2' )
234  clustersCalECCGroup.defineHistogram('clusterEta,clusterPhi;Thresh3ECCOcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.medhiEthresh)+' GeV;eta;phi',
235  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold3' )
236  clustersCalECCGroup.defineHistogram('clusterEta,clusterPhi;Thresh4ECCOcc', type='TH2F',title='Cluster Occupancy - Threshold='+str(clusterMonAlg.hiEthresh)+' GeV;eta;phi',
237  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold4' )
238 
239  clustersCalECCGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh0ECCAveE', type='TProfile2D',title='Average Cluster Energy - No Threshold;eta;phi',
240  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
241  clustersCalECCGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh1ECCAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.lowEthresh)+' GeV;eta;phi',
242  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold1' )
243  clustersCalECCGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh2ECCAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.medEthresh)+' GeV;eta;phi',
244  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold2' )
245  clustersCalECCGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh3ECCAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.medhiEthresh)+' GeV;eta;phi',
246  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold3' )
247  clustersCalECCGroup.defineHistogram('clusterEta,clusterPhi,clusterE;Thresh4ECCAveE', type='TProfile2D',title='Average Cluster Energy - Threshold='+str(clusterMonAlg.hiEthresh)+' GeV;eta;phi',
248  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='Threshold4' )
249 
250  # Configure histograms - egamma Clusters
251  clustersAllGroupEM.defineHistogram('nEMClusters',title='No. of EM Clusters;N_{clusters};Events',xbins=200,xmin=0.0,xmax=200.0)
252  clustersAllGroupEM.defineHistogram('emclusterEta',title='EM Cluster eta;eta;Events',xbins=98,xmin=-4.9,xmax=4.9)
253  clustersAllGroupEM.defineHistogram('emclusterPhi', title='EM Cluster phi;phi;Events',xbins=64,xmin=-3.15,xmax=3.15)
254  clustersAllGroupEM.defineHistogram('emclusterE', title='EM Cluster energy;E;Events',xbins=100,xmin=0.0,xmax=100)
255  clustersAllGroupEM.defineHistogram('emclusterET', title='EM Cluster transverse energy;ET;Events',xbins=100,xmin=0.0,xmax=100)
256 
257  # Configure histograms - egamma Clusters:Expert Plots
258  clustersExpertGroupEM.defineHistogram('nEMCells',title='No. of Cells in EM Clusters;N_{cells};Events',xbins=200,xmin=0.0,xmax=200.0)
259  clustersExpertGroupEM.defineHistogram('nEMBadCells',title='No. of Bad Cells in EM Clusters;N_{bad cells};Events',xbins=11,xmin=-1.0,xmax=10.0)
260  clustersExpertGroupEM.defineHistogram('emEBadCells',title='E of Bad Cells in EM Clusters;E_{bad cells};Events',xbins=210,xmin=-10.0,xmax=100.0)
261  clustersExpertGroupEM.defineHistogram('emclusterEta,emclusterPhi,nEMCells', type='TProfile2D', title='No. of Cells in EM Clusters;eta;phi',
262  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
263  clustersExpertGroupEM.defineHistogram('emclusterEta,emclusterPhi,nEMBadCells', type='TProfile2D', title='No. of Bad Cells in a Clusters;eta;phi',
264  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
265  clustersExpertGroupEM.defineHistogram('emclusterTime',title='EM Cluster Time;time;Events',xbins=200,xmin=-100.0,xmax=100.0)
266  clustersExpertGroupEM.defineHistogram('emclusterTime,emclusterE',type='TH2F',title='EM Cluster Time vs E;time;E',
267  xbins=200,xmin=-100.0,xmax=100.0,ybins=300,ymin=0.0,ymax=1500.0)
268  clustersExpertGroupEM.defineHistogram('emHotRat',title='Energy Fraction of Highest Cell (EM Clusters);E_{frac};Events',
269  xbins=200,xmin=-0.2,xmax=1.8)
270  clustersExpertGroupEM.defineHistogram('emclusterIsol',title='EM Cluster Isolation;Isolation;Events',xbins=60,xmin=-1.0,xmax=2.0)
271  clustersExpertGroupEM.defineHistogram('emBadLARQFrac',title='Bad LAR Q Frac. (EMClusters);Frac;Events',xbins=25,xmin=-1.0,xmax=1.5)
272  clustersExpertGroupEM.defineHistogram('emEngPos',title='E from Positive Cells (EM CLusters);E;Events',xbins=100,xmin=0.0,xmax=100.0)
273  clustersExpertGroupEM.defineHistogram('emAveLARQ',title='Average LAR Q (EM Clusters);LAR Q;Events',xbins=31,xmin=-1000.0,xmax=30000.0)
274 
275  clustersExpertGroupEM.defineHistogram('emclusterEta,emclusterPhi,emHotRat',type='TProfile2D', title='Energy Fraction of Highest Cell (EM Clusters);eta;phi',
276  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
277  clustersExpertGroupEM.defineHistogram('emclusterEta,emclusterPhi,emHotRat;vemHotRatE',type='TProfile2D', title='Energy Fraction of Highest Cell for E_{frac}>0.9 (EM Clusters);eta;phi',
278  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='HighHotRat')
279  clustersExpertGroupEM.defineHistogram('emclusterEta,emclusterPhi;vemHotRatOcc',type='TH2F', title='Occupancy of EM Clusters with Highest Cell E_{frac}>0.9;eta;phi',
280  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='HighHotRat')
281 
282  # Configure histograms - egamma Occupancies and energies by region
283  #ECA:
284  clustersEMECAGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh0ECAOcc', type='TH2F',title='EM Cluster Occupancy - No Threshold;eta;phi',
285  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
286  clustersEMECAGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh1ECAOcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMlowEthresh)+' GeV;eta;phi',
287  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold1' )
288  clustersEMECAGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh2ECAOcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMmedEthresh)+' GeV;eta;phi',
289  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold2' )
290  clustersEMECAGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh3ECAOcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMmedhiEthresh)+' GeV;eta;phi',
291  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold3' )
292  clustersEMECAGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh4ECAOcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMhiEthresh)+' GeV;eta;phi',
293  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold4' )
294 
295  clustersEMECAGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh0ECAAveE', type='TProfile2D',title='Average EM Cluster Energy - No Threshold;eta;phi',
296  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
297  clustersEMECAGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh1ECAAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMlowEthresh)+' GeV;eta;phi',
298  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold1' )
299  clustersEMECAGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh2ECAAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMmedEthresh)+' GeV;eta;phi',
300  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold2' )
301  clustersEMECAGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh3ECAAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMmedhiEthresh)+' GeV;eta;phi',
302  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold3' )
303  clustersEMECAGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh4ECAAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMhiEthresh)+' GeV;eta;phi',
304  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold4' )
305  #BAR:
306  clustersEMBARGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh0BAROcc', type='TH2F',title='EM Cluster Occupancy - No Threshold;eta;phi',
307  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
308  clustersEMBARGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh1BAROcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMlowEthresh)+' GeV;eta;phi',
309  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold1' )
310  clustersEMBARGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh2BAROcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMmedEthresh)+' GeV;eta;phi',
311  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold2' )
312  clustersEMBARGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh3BAROcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMmedhiEthresh)+' GeV;eta;phi',
313  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold3' )
314  clustersEMBARGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh4BAROcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMhiEthresh)+' GeV;eta;phi',
315  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold4' )
316 
317  clustersEMBARGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh0BARAveE', type='TProfile2D',title='Average EM Cluster Energy - No Threshold;eta;phi',
318  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
319  clustersEMBARGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh1BARAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMlowEthresh)+' GeV;eta;phi',
320  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold1' )
321  clustersEMBARGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh2BARAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMmedEthresh)+' GeV;eta;phi',
322  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold2' )
323  clustersEMBARGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh3BARAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMmedhiEthresh)+' GeV;eta;phi',
324  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold3' )
325  clustersEMBARGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh4BARAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMhiEthresh)+' GeV;eta;phi',
326  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold4' )
327  #ECC:
328  clustersEMECCGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh0ECCOcc', type='TH2F',title='EM Cluster Occupancy - No Threshold;eta;phi',
329  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
330  clustersEMECCGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh1ECCOcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMlowEthresh)+' GeV;eta;phi',
331  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold1' )
332  clustersEMECCGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh2ECCOcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMmedEthresh)+' GeV;eta;phi',
333  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold2' )
334  clustersEMECCGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh3ECCOcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMmedhiEthresh)+' GeV;eta;phi',
335  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold3' )
336  clustersEMECCGroup.defineHistogram('emclusterEta,emclusterPhi;EMThresh4ECCOcc', type='TH2F',title='EM Cluster Occupancy - Threshold='+str(clusterMonAlg.EMhiEthresh)+' GeV;eta;phi',
337  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold4' )
338 
339  clustersEMECCGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh0ECCAveE', type='TProfile2D',title='Average EM Cluster Energy - No Threshold;eta;phi',
340  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15 )
341  clustersEMECCGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh1ECCAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMlowEthresh)+' GeV;eta;phi',
342  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold1' )
343  clustersEMECCGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh2ECCAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMmedEthresh)+' GeV;eta;phi',
344  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold2' )
345  clustersEMECCGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh3ECCAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMmedhiEthresh)+' GeV;eta;phi',
346  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold3' )
347  clustersEMECCGroup.defineHistogram('emclusterEta,emclusterPhi,emclusterE;EMThresh4ECCAveE', type='TProfile2D',title='Average EM Cluster Energy - Threshold='+str(clusterMonAlg.EMhiEthresh)+' GeV;eta;phi',
348  xbins=98,xmin=-4.9,xmax=4.9,ybins=64,ymin=-3.15,ymax=3.15, cutmask='EMThreshold4' )
349 
350 
355  return helper.result()
356 
357  # # Otherwise, merge with result object and return
358  # acc = helper.result()
359  # result.merge(acc)
360  # return result
361 
362 if __name__=='__main__':
363  # Setup logs
364  from AthenaCommon.Logging import log
365  from AthenaCommon.Constants import INFO
366  log.setLevel(INFO)
367 
368  # Set the Athena configuration flags
369  from AthenaConfiguration.AllConfigFlags import initConfigFlags
370  import sys
371  nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
372  file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
373  flags = initConfigFlags()
374  flags.Input.Files = [nightly+file]
375  flags.Input.isMC = False
376  flags.Output.HISTFileName = 'ClusterMonitorOutput.root'
377  flags.fillFromArgs(sys.argv[1:])
378 
379  flags.lock()
380 
381  # Initialize configuration object, add accumulator, merge, and run.
382  from AthenaConfiguration.MainServicesConfig import MainServicesThreadedCfg
383  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
384  cfg = MainServicesThreadedCfg(flags)
385  cfg.merge(PoolReadCfg(flags))
386 
387  clusterMonitorAcc = ClusterMonitoringConfig(flags)
388  cfg.merge(clusterMonitorAcc)
389 
390  # If you want to turn on more detailed messages ...
391  # clusterMonitorAcc.getEventAlgo('ClusterMonAlg').OutputLevel = 2 # DEBUG
392  cfg.printConfig(withDetails=False) # set True for exhaustive info
393 
394  cfg.run() #use cfg.run(20) to only run on first 20 events
ClusterMonitorAlgorithm.ClusterMonitoringConfig
def ClusterMonitoringConfig(inputFlags)
Definition: ClusterMonitorAlgorithm.py:11
python.BadLBFilterToolConfig.LArBadLBFilterToolCfg
def LArBadLBFilterToolCfg(inputFlags, origDbTag=None)
Definition: BadLBFilterToolConfig.py:100
Constants
some useful constants -------------------------------------------------—
python.AtlasReadyFilterConfig.AtlasReadyFilterCfg
def AtlasReadyFilterCfg(flags)
Definition: AtlasReadyFilterConfig.py:10
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.EventFlagFilterToolConfig.EventFlagFilterToolCfg
def EventFlagFilterToolCfg(flags, name="EventFlagFilter", doLAr=True, doTile=True, doSCT=True, doCore=True, alwaysReturnTrue=False)
Definition: EventFlagFilterToolConfig.py:5
str
Definition: BTagTrackIpAccessor.cxx:11
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69