ATLAS Offline Software
Functions
ZdcMonitorAlgorithm Namespace Reference

Functions

def create_log_bins (min_value, max_value, num_bins)
 
def ZdcMonitoringConfig (inputFlags, run_type)
 

Function Documentation

◆ create_log_bins()

def ZdcMonitorAlgorithm.create_log_bins (   min_value,
  max_value,
  num_bins 
)

Definition at line 18 of file ZdcMonitorAlgorithm.py.

18 def create_log_bins(min_value, max_value, num_bins):
19  # Calculate the logarithmic bin edges
20  log_min = np.log10(min_value)
21  log_max = np.log10(max_value)
22  log_bin_edges = np.linspace(log_min, log_max, num_bins + 1)
23  bin_edges = [10 ** edge for edge in log_bin_edges]
24 
25  return bin_edges
26 
27 

◆ ZdcMonitoringConfig()

def ZdcMonitorAlgorithm.ZdcMonitoringConfig (   inputFlags,
  run_type 
)

Definition at line 28 of file ZdcMonitorAlgorithm.py.

28 def ZdcMonitoringConfig(inputFlags, run_type):
29 
30  from AthenaMonitoring import AthMonitorCfgHelper
31  helper = AthMonitorCfgHelper(inputFlags,'ZdcAthMonitorCfg')
32 
33  from AthenaConfiguration.ComponentFactory import CompFactory
34  zdcMonAlg = helper.addAlgorithm(CompFactory.ZdcMonitorAlgorithm,'ZdcMonAlg')
35 
36  # Edit properties of a algorithm
37  zdcMonAlg.EnableTrigger = inputFlags.DQ.useTrigger
38  zdcMonAlg.CalInfoOn = inputFlags.Input.TriggerStream == 'physics_MinBias' or inputFlags.Input.TriggerStream == 'express_express' # turn calorimeter info on if input triggerstream (autoconfigured from input file) is physics_MinBias or express_express
39 
40  genZdcMonTool = helper.addGroup(
41  zdcMonAlg,
42  'genZdcMonTool'
43  )
44 
45 # --------------------------------------------------------------------------------------------------
46  # Configure histograms
47 
48  # (potentially run-type dependent) range settings
49  lumi_block_max = 2000
50  bcid_max = 3564
51  n_energy_bins_default = 200
52  n_time_centroid_bins_default = 100
53  n_module_amp_zoomin_bins = 100
54  n_mod_fraction_bins_default = 100
55  module_chisq_min = 0.1
56  module_chisq_max = 800000
57  module_chisq_over_amp_min = 0.01
58  module_chisq_over_amp_max = 100000
59 
60  if run_type == "LHCf2022":
61  print ("looking at 2022 lhcf data")
62  energy_sum_xmax = 3000
63  energy_sum_zoomin_xmax = 3000
64  uncalib_amp_sum_zoomin_xmax = 3000
65  x_centroid_min = -500 #small amplitude sum --> large range for x, y position
66  x_centroid_max = 500
67  y_centroid_min = -50
68  y_centroid_max = 750
69  zdc_amp_sum_xmax = 3000
70  rpd_channel_amp_min = - 200.
71  rpd_amp_sum_xmax = 3000
72  rpd_max_adc_sum_xmax = 3000
73  module_amp_xmax = 2000
74  module_calib_amp_xmax = 5000
75  module_amp_1Nmonitor_xmax = 2000 #about 5N / 4 * 2.7TeV
76  module_calib_amp_1Nmonitor_xmax = 5000 #about 5N / 4 * 2.7TeV
77 
78  elif run_type == "pp2023":
79  print ("looking at pp reference run")
80  energy_sum_xmax = 3000
81  energy_sum_zoomin_xmax = 3000
82  uncalib_amp_sum_zoomin_xmax = 3000
83  x_centroid_min = -500 #small amplitude sum --> large range for x, y position
84  x_centroid_max = 500
85  y_centroid_min = -50
86  y_centroid_max = 750
87  zdc_amp_sum_xmax = 3000
88  rpd_channel_amp_min = - 200.
89  rpd_amp_sum_xmax = 3000
90  rpd_max_adc_sum_xmax = 3000
91  module_amp_xmax = 2000
92  module_calib_amp_xmax = 5000
93  module_amp_1Nmonitor_xmax = 2000 #about 5N / 4 * 2.7TeV
94  module_calib_amp_1Nmonitor_xmax = 5000 #about 5N / 4 * 2.7TeV
95 
96 
97  elif run_type == "PbPb2023":
98  print ("looking at pbpb run")
99  energy_sum_xmax = 200000.0
100  energy_sum_zoomin_xmax = 20000.0
101  uncalib_amp_sum_zoomin_xmax = 6000.0
102  x_centroid_min = -20 #small amplitude sum --> large range for x, y position
103  x_centroid_max = 20
104  y_centroid_min = -20
105  y_centroid_max = 20
106  zdc_amp_sum_xmax = 163840.0
107  rpd_channel_amp_min = - 2048.
108  rpd_amp_sum_xmax = 245760.0 #not the full range but a reasonable value
109  rpd_max_adc_sum_xmax = 40960.0
110  module_amp_xmax = 40960.0
111  module_calib_amp_xmax = 100000.0 #about the full dynamic range: 160 N / 4 * 2.5TeV
112  module_amp_1Nmonitor_xmax = 1250.0 #about 5N / 4 * 2.7TeV
113  module_calib_amp_1Nmonitor_xmax = 3400.0 #about 5N / 4 * 2.7TeV
114 
115  # #bins for RPD channel amplitude, including negative values - determined by the ratio between the negative amplitude range & positive amplitude range
116  n_rpd_amp_bins_full_range = int((abs(rpd_channel_amp_min) + module_amp_xmax) / module_amp_xmax * n_energy_bins_default)
117  n_rpd_amp_bins_half_range = int((abs(rpd_channel_amp_min) + module_amp_xmax/2.) / (module_amp_xmax/2.) * n_energy_bins_default)
118  rpd_sub_amp_min = - module_amp_xmax / 4.
119  rpd_sub_amp_max = module_amp_xmax / 2.
120  n_rpd_sub_amp_bins = int((abs(rpd_sub_amp_min) + rpd_sub_amp_max) / rpd_sub_amp_max * n_energy_bins_default)
121 
122  genZdcMonTool.defineHistogram('zdcEnergySumA',title='ZDC Side A Energy Sum;E_{ZDC,A}[GeV];Events',
123  path='ZDC/ZDC/PerArm/Energy/SideA',
124  xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_xmax) # 2.5TeV * 80 neutrons
125  genZdcMonTool.defineHistogram('zdcEnergySumC',title='ZDC Side C Energy Sum;E_{ZDC,C}[GeV];Events',
126  path='ZDC/ZDC/PerArm/Energy/SideC',
127  xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_xmax)
128  genZdcMonTool.defineHistogram('zdcEnergySumA;zdcEnergySumA_zoomin_wTrigSelec',title='ZDC Side A Energy Sum (few neutrons, triggered on side C);E_{ZDC,A}[GeV];Events',
129  path='ZDC/ZDC/PerArm/Energy/SideA',
130  cutmask = 'passTrigSideC',
131  xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_zoomin_xmax) # 2.5TeV * 8 neutrons
132  genZdcMonTool.defineHistogram('zdcEnergySumC;zdcEnergySumC_zoomin_wTrigSelec',title='ZDC Side C Energy Sum (few neutrons, triggered on side A);E_{ZDC,C}[GeV];Events',
133  path='ZDC/ZDC/PerArm/Energy/SideC',
134  cutmask = 'passTrigSideA',
135  xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_zoomin_xmax)
136  genZdcMonTool.defineHistogram('zdcEnergySumA;zdcEnergySumA_zoomin_noTrigSelec',title='ZDC Side A Energy Sum (few neutrons, no trigger selection);E_{ZDC,A}[GeV];Events',
137  path='ZDC/ZDC/PerArm/Energy/SideA',
138  xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_zoomin_xmax) # 2.5TeV * 8 neutrons
139  genZdcMonTool.defineHistogram('zdcEnergySumC;zdcEnergySumC_zoomin_noTrigSelec',title='ZDC Side C Energy Sum (few neutrons, no trigger selection);E_{ZDC,C}[GeV];Events',
140  path='ZDC/ZDC/PerArm/Energy/SideC',
141  xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_zoomin_xmax)
142 
143  genZdcMonTool.defineHistogram('zdcUncalibSumA',title='ZDC Side A Uncalibrated Sum;[ADC Counts];Events',
144  path='ZDC/ZDC/PerArm/UncalibAmp/SideA',
145  xbins=n_energy_bins_default,xmin=0.0,xmax=zdc_amp_sum_xmax)
146  genZdcMonTool.defineHistogram('zdcUncalibSumC',title='ZDC Side C Uncalibrated Sum;[ADC Counts];Events',
147  path='ZDC/ZDC/PerArm/UncalibAmp/SideC',
148  xbins=n_energy_bins_default,xmin=0.0,xmax=zdc_amp_sum_xmax)
149 
150  # 2D vars: x vs y
151 
152  genZdcMonTool.defineHistogram('lumiBlock, zdcEnergySumA;zdcEnergySumA_vs_lb_noTrig', type='TH2F', title=';lumi block;E_{ZDC,A} [GeV]',
153  path='ZDC/ZDC/PerArm/Energy/SideA',
154  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
155  ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
156  genZdcMonTool.defineHistogram('lumiBlock, zdcEnergySumC;zdcEnergySumC_vs_lb_noTrig', type='TH2F', title=';lumi block;E_{ZDC,C} [GeV]',
157  path='ZDC/ZDC/PerArm/Energy/SideC',
158  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
159  ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
160  genZdcMonTool.defineHistogram('lumiBlock, zdcEnergySumA;zdcEnergySumA_vs_lb_wTrig', type='TH2F', title=';lumi block;E_{ZDC,A} [GeV]',
161  path='ZDC/ZDC/PerArm/Energy/SideA',
162  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max, cutmask = 'passTrigSideC',
163  ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
164  genZdcMonTool.defineHistogram('lumiBlock, zdcEnergySumC;zdcEnergySumC_vs_lb_wTrig', type='TH2F', title=';lumi block;E_{ZDC,C} [GeV]',
165  path='ZDC/ZDC/PerArm/Energy/SideC',
166  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max, cutmask = 'passTrigSideA',
167  ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
168 
169  genZdcMonTool.defineHistogram('lumiBlock, zdcUncalibSumA;zdcUncalibSumA_vs_lb_noTrig', type='TH2F', title=';lumi block;ZDC amp A[ADC counts]',
170  path='ZDC/ZDC/PerArm/UncalibAmp/SideA',
171  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
172  ybins=n_energy_bins_default,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
173  genZdcMonTool.defineHistogram('lumiBlock, zdcUncalibSumC;zdcUncalibSumC_vs_lb_noTrig', type='TH2F', title=';lumi block;ZDC amp C[ADC counts]',
174  path='ZDC/ZDC/PerArm/UncalibAmp/SideC',
175  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
176  ybins=n_energy_bins_default,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
177  genZdcMonTool.defineHistogram('lumiBlock, zdcUncalibSumA;zdcUncalibSumA_vs_lb_wTrig', type='TH2F', title=';lumi block;ZDC amp A[ADC counts]',
178  path='ZDC/ZDC/PerArm/UncalibAmp/SideA',
179  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max, cutmask = 'passTrigSideC',
180  ybins=n_energy_bins_default,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
181  genZdcMonTool.defineHistogram('lumiBlock, zdcUncalibSumC;zdcUncalibSumC_vs_lb_wTrig', type='TH2F', title=';lumi block;ZDC amp C[ADC counts]',
182  path='ZDC/ZDC/PerArm/UncalibAmp/SideC',
183  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max, cutmask = 'passTrigSideA',
184  ybins=n_energy_bins_default,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
185 
186  genZdcMonTool.defineHistogram('bcid, zdcEnergySumA;zdcEnergySumA_vs_bcid_noTrig', type='TH2F', title=';BCID;E_{ZDC,A} [GeV]',
187  path='ZDC/ZDC/PerArm/Energy/SideA',
188  xbins=bcid_max,xmin=0.0,xmax=bcid_max,
189  ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
190  genZdcMonTool.defineHistogram('bcid, zdcEnergySumC;zdcEnergySumC_vs_bcid_noTrig', type='TH2F', title=';BCID;E_{ZDC,C} [GeV]',
191  path='ZDC/ZDC/PerArm/Energy/SideC',
192  xbins=bcid_max,xmin=0.0,xmax=bcid_max,
193  ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
194  genZdcMonTool.defineHistogram('bcid, zdcEnergySumA;zdcEnergySumA_vs_bcid_wTrig', type='TH2F', title=';BCID;E_{ZDC,A} [GeV]',
195  path='ZDC/ZDC/PerArm/Energy/SideA',
196  xbins=bcid_max,xmin=0.0,xmax=bcid_max, cutmask = 'passTrigSideC',
197  ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
198  genZdcMonTool.defineHistogram('bcid, zdcEnergySumC;zdcEnergySumC_vs_bcid_wTrig', type='TH2F', title=';BCID;E_{ZDC,C} [GeV]',
199  path='ZDC/ZDC/PerArm/Energy/SideC',
200  xbins=bcid_max,xmin=0.0,xmax=bcid_max, cutmask = 'passTrigSideA',
201  ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
202 
203  genZdcMonTool.defineHistogram('bcid, zdcUncalibSumA;zdcUncalibSumA_vs_bcid_noTrig', type='TH2F', title=';BCID;ZDC amp A[ADC counts]',
204  path='ZDC/ZDC/PerArm/UncalibAmp/SideA',
205  xbins=bcid_max,xmin=0.0,xmax=bcid_max,
206  ybins=n_energy_bins_default,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
207  genZdcMonTool.defineHistogram('bcid, zdcUncalibSumC;zdcUncalibSumC_vs_bcid_noTrig', type='TH2F', title=';BCID;ZDC amp C[ADC counts]',
208  path='ZDC/ZDC/PerArm/UncalibAmp/SideC',
209  xbins=bcid_max,xmin=0.0,xmax=bcid_max,
210  ybins=n_energy_bins_default,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
211  genZdcMonTool.defineHistogram('bcid, zdcUncalibSumA;zdcUncalibSumA_vs_bcid_wTrig', type='TH2F', title=';BCID;ZDC amp A[ADC counts]',
212  path='ZDC/ZDC/PerArm/UncalibAmp/SideA',
213  xbins=bcid_max,xmin=0.0,xmax=bcid_max, cutmask = 'passTrigSideC',
214  ybins=n_energy_bins_default,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
215  genZdcMonTool.defineHistogram('bcid, zdcUncalibSumC;zdcUncalibSumC_vs_bcid_wTrig', type='TH2F', title=';BCID;ZDC amp C[ADC counts]',
216  path='ZDC/ZDC/PerArm/UncalibAmp/SideC',
217  xbins=bcid_max,xmin=0.0,xmax=bcid_max, cutmask = 'passTrigSideA',
218  ybins=n_energy_bins_default,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
219 
220  genZdcMonTool.defineHistogram('lumiBlock, zdcUncalibSumA;zdcUncalibSumA_vs_lb_160bins_noTrig', type='TH2F', title=';lumi block;E_{ZDC,A} [GeV]',
221  path='ZDC/ZDC/PerArm/UncalibAmp/SideA',
222  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
223  ybins=160,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
224  genZdcMonTool.defineHistogram('lumiBlock, zdcUncalibSumC;zdcUncalibSumC_vs_lb_160bins_noTrig', type='TH2F', title=';lumi block;E_{ZDC,C} [GeV]',
225  path='ZDC/ZDC/PerArm/UncalibAmp/SideC',
226  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
227  ybins=160,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
228  genZdcMonTool.defineHistogram('lumiBlock, zdcUncalibSumA;zdcUncalibSumA_vs_lb_160bins_wTrig', type='TH2F', title=';lumi block;E_{ZDC,A} [GeV]',
229  path='ZDC/ZDC/PerArm/UncalibAmp/SideA',
230  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max, cutmask = 'passTrigSideC',
231  ybins=160,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
232  genZdcMonTool.defineHistogram('lumiBlock, zdcUncalibSumC;zdcUncalibSumC_vs_lb_160bins_wTrig', type='TH2F', title=';lumi block;E_{ZDC,C} [GeV]',
233  path='ZDC/ZDC/PerArm/UncalibAmp/SideC',
234  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max, cutmask = 'passTrigSideA',
235  ybins=160,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax) # for lumi dependence, only focus on the few-neutron peaks
236 
237  genZdcMonTool.defineHistogram('zdcEnergySumA, zdcEnergySumC', type='TH2F', title=';E_{ZDC,A} [GeV];E_{ZDC,C} [GeV]',
238  path='ZDC/Global/SideACCorr',
239  xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_xmax,
240  ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_xmax)
241 
242  genZdcMonTool.defineHistogram('rpdCosDeltaReactionPlaneAngle', title=';Cos (#Delta #phi_{AorC});Events',
243  path='ZDC/Global/ReactionPlane',
244  cutmask='bothHasCentroid', # only require both sides to have centroid
245  xbins=n_time_centroid_bins_default,xmin=-1,xmax=1)
246  genZdcMonTool.defineHistogram('rpdCosDeltaReactionPlaneAngle;rpdCosDeltaReactionPlaneAngle_requireValid', title=';Cos (#Delta #phi_{AorC});Events',
247  path='ZDC/Global/ReactionPlane',
248  cutmask='bothReactionPlaneAngleValid', # require centroid calculation on both sides to be valid
249  xbins=n_time_centroid_bins_default,xmin=-1,xmax=1)
250 
251  # FCal E_T vs ZDC E_T
252  # to be run on min bias stream
253  if (zdcMonAlg.CalInfoOn):
254  genZdcMonTool.defineHistogram('fcalEtA, zdcEnergySumA', type='TH2F', title=';E_{FCal, A} [GeV];E_{ZDC,A} [GeV]',
255  path='ZDC/Global/ZDCFcalCorr',
256  xbins=n_energy_bins_default,xmin=0.0,xmax=5000,
257  ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_xmax)
258  genZdcMonTool.defineHistogram('fcalEtC, zdcEnergySumC', type='TH2F', title=';E_{FCal, C} [GeV];E_{ZDC,C} [GeV]',
259  path='ZDC/Global/ZDCFcalCorr',
260  xbins=n_energy_bins_default,xmin=0.0,xmax=5000,
261  ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_xmax)
262  genZdcMonTool.defineHistogram('fcalEtA, fcalEtC', type='TH2F', title=';E_{FCal, A} [GeV];E_{FCal, C} [GeV]',
263  path='ZDC/Global/SideACCorr',
264  xbins=n_energy_bins_default,xmin=0.0,xmax=5000,
265  ybins=n_energy_bins_default,ymin=0.0,ymax=5000)
266 
267 # --------------------------------------------------------------------------------------------------
268  nSides = 2
269  nModules = 4
270  nChannels = 16
271 
272  nZdcStatusBits = 18
273  nRpdStatusBits = 15
274  nRpdCentroidStatusBits = 21
275 
276 # --------------------------------------------------------------------------------------------------
277 
278  zdcSideMonToolArr = helper.addArray([nSides],zdcMonAlg,'ZdcSideMonitor')
279 
280 
281  zdcSideMonToolArr.defineHistogram('zdcAvgTime',title='ZDC Side Average Time;t[ns];Events', cutmask = 'zdcModuleMask',
282  path='ZDC/ZDC/PerArm/AvgTime',
283  xbins=n_time_centroid_bins_default,xmin=-10.0,xmax=10.0)
284 
285  zdcSideMonToolArr.defineHistogram('lumiBlock, zdcAvgTime;zdcAvgTime_vs_lb', type='TH2F', title='ZDC Side Average Time versus Lumi block;lumi block;t[ns]',
286  path='ZDC/ZDC/PerArm/AvgTime',
287  cutmask = 'zdcModuleMask',
288  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
289  ybins=n_time_centroid_bins_default,ymin=-10.0,ymax=10.0)
290 
291  zdcSideMonToolArr.defineHistogram('centroidStatusBits',title=';;Events',
292  path='ZDC/Global/Centroid',
293  xbins=nRpdCentroidStatusBits,xmin=0.0,xmax=nRpdCentroidStatusBits,opt='kVec',
294  xlabels=['ValidBit', 'HasCentroidBit', 'ZDCInvalidBit', 'InsufficientZDCEnergyBit', 'ExcessiveZDCEnergyBit', 'EMInvalidBit', 'InsufficientEMEnergyBit', 'ExcessiveEMEnergyBit', 'RPDInvalidBit', 'PileupBit', 'ExcessivePileupBit', 'ZeroSumBit', 'ExcessiveSubtrUnderflowBit', 'Row0ValidBit', 'Row1ValidBit', 'Row2ValidBit', 'Row3ValidBit', 'Col0ValidBit', 'Col1ValidBit', 'Col2ValidBit', 'Col3ValidBit'])
295 
296  zdcSideMonToolArr.defineHistogram('xCentroid, yCentroid',type='TH2F',title=';Centroid x position [mm];Centroid y position [mm]',
297  path='ZDC/Global/Centroid',
298  xbins=n_time_centroid_bins_default,xmin=x_centroid_min,xmax=x_centroid_max,
299  ybins=n_time_centroid_bins_default,ymin=y_centroid_min,ymax=y_centroid_max)
300  zdcSideMonToolArr.defineHistogram('ReactionPlaneAngle',title=';Reaction Plane Angle;Events',
301  path='ZDC/Global/ReactionPlane',
302  xbins=64,xmin=-3.141593,xmax=3.141593)
303 
304  zdcSideMonToolArr.defineHistogram('xCentroid, yCentroid;yCentroid_vs_xCentroid_requireValid',type='TH2F',title=';Centroid x position [mm];Centroid y position [mm]',
305  path='ZDC/Global/Centroid',
306  cutmask='centroidValid',
307  xbins=n_time_centroid_bins_default,xmin=x_centroid_min,xmax=x_centroid_max,
308  ybins=n_time_centroid_bins_default,ymin=y_centroid_min,ymax=y_centroid_max)
309  zdcSideMonToolArr.defineHistogram('ReactionPlaneAngle;ReactionPlaneAngle_requireValid',title=';Reaction Plane Angle;Events',
310  path='ZDC/Global/ReactionPlane',
311  cutmask='centroidValid',
312  xbins=64,xmin=-3.141593,xmax=3.141593)
313 
314 
315  zdcSideMonToolArr.defineHistogram('lumiBlock, xCentroid;xCentroid_vs_lb', type='TH2F', title=';lumi block;Centroid x position [mm]',
316  path='ZDC/Global/CentroidLBdep',
317  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
318  ybins=n_time_centroid_bins_default,ymin=x_centroid_min,ymax=x_centroid_max)
319  zdcSideMonToolArr.defineHistogram('lumiBlock, yCentroid;yCentroid_vs_lb', type='TH2F', title=';lumi block;Centroid y position [mm]',
320  path='ZDC/Global/CentroidLBdep',
321  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
322  ybins=n_time_centroid_bins_default,ymin=y_centroid_min,ymax=y_centroid_max)
323 
324  zdcSideMonToolArr.defineHistogram('lumiBlock, xCentroid;xCentroid_vs_lb_requireValid', type='TH2F', title=';lumi block;Centroid x position [mm]',
325  path='ZDC/Global/CentroidLBdep',
326  cutmask='centroidValid',
327  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
328  ybins=n_time_centroid_bins_default,ymin=x_centroid_min,ymax=x_centroid_max)
329  zdcSideMonToolArr.defineHistogram('lumiBlock, yCentroid;yCentroid_vs_lb_requireValid', type='TH2F', title=';lumi block;Centroid y position [mm]',
330  path='ZDC/Global/CentroidLBdep',
331  cutmask='centroidValid',
332  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
333  ybins=n_time_centroid_bins_default,ymin=y_centroid_min,ymax=y_centroid_max)
334 
335  zdcSideMonToolArr.defineHistogram('rpdSubAmpSum', title=';RPD Subtracted Amp Sum (AorC) [ADC counts]',
336  path='ZDC/RPD/PerArm',
337  cutmask='centroidValid',
338  xbins=n_energy_bins_default,xmin = - rpd_amp_sum_xmax / 16., xmax=rpd_amp_sum_xmax / 4.) # try a value for now
339 
340  zdcSideMonToolArr.defineHistogram('zdcEnergySum, rpdMaxADCSum', type='TH2F', title=';E ZDC side [TeV];RPD Max ADC Sum (AorC) [ADC counts]',
341  path='ZDC/ZdcRpdPerSideCorr',
342  cutmask='RPDSideValid',
343  xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_xmax,
344  ybins=n_energy_bins_default,ymin=0.0,ymax=rpd_max_adc_sum_xmax) # try a value for now
345  zdcSideMonToolArr.defineHistogram('zdcEnergySum, rpdAmplitudeCalibSum', type='TH2F', title=';E ZDC side [GeV];RPD Calib Amp Sum (AorC) [ADC counts]',
346  path='ZDC/ZdcRpdPerSideCorr',
347  cutmask='RPDSideValid',
348  xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_xmax,
349  ybins=n_energy_bins_default,ymin=0.0,ymax=rpd_amp_sum_xmax) # try a value for now
350  zdcSideMonToolArr.defineHistogram('zdcEMModuleEnergy, rpdAmplitudeCalibSum', type='TH2F', title=';E EM module AorC [GeV];RPD Calib Amp Sum (AorC) [ADC counts]',
351  path='ZDC/ZdcRpdPerSideCorr',
352  cutmask='RPDSideValid',
353  xbins=n_energy_bins_default,xmin=0.0,xmax=module_calib_amp_xmax / 2., # divide by 2 to make a more zoomed-in plot (not full range)
354  ybins=n_energy_bins_default,ymin=0.0,ymax=rpd_amp_sum_xmax) # try a value for now
355 
356 # --------------------------------------------------------------------------------------------------
357 
358  zdcModuleMonToolArr = helper.addArray([nSides,nModules],zdcMonAlg,'ZdcModuleMonitor', topPath='ZDC/ZDC/ZdcModule/')
359 
360  zdcModuleMonToolArr.defineHistogram('zdcStatusBits',title=';;Events',
361  path='ModuleStatusBits',
362  xbins=nZdcStatusBits,xmin=0.0,xmax=nZdcStatusBits,opt='kVec',
363  xlabels=['PulseBit', 'LowGainBit', 'FailBit', 'HGOverflowBit', 'HGUnderflowBit', 'PSHGOverUnderflowBit', 'LGOverflowBit', 'LGUnderflowBit', 'PrePulseBit', 'PostPulseBit', 'FitFailedBit', 'BadChisqBit', 'BadT0Bit', 'ExcludeEarlyLGBit', 'ExcludeLateLGBit', 'preExpTailBit', 'FitMinAmpBit', 'RepassPulseBit'])
364 
365 
366  zdcModuleMonToolArr.defineHistogram('zdcModuleAmp',title=';Module Amplitude [ADC Counts];Events',
367  path='ModuleAmp',
368  xbins=n_energy_bins_default,xmin=0.0,xmax=module_amp_xmax)
369  zdcModuleMonToolArr.defineHistogram('zdcModuleAmp;zdcModuleAmp_halfrange',title=';Module Amplitude [ADC Counts];Events',
370  path='ModuleAmp',
371  xbins=n_energy_bins_default,xmin=0.0,xmax=module_amp_xmax / 2.)
372  zdcModuleMonToolArr.defineHistogram('zdcModuleFract',title=';Module Amplitude Fraction;Events',
373  path='ModuleFraction',
374  xbins=n_mod_fraction_bins_default,xmin=0.0,xmax=1.)
375  zdcModuleMonToolArr.defineHistogram('zdcModuleFract;zdcModuleFract_above20N',title=';Module Amplitude Fraction;Events',
376  path='ModuleFraction',
377  cutmask='zdcAbove20NCurrentSide',
378  xbins=n_mod_fraction_bins_default,xmin=0.0,xmax=1.)
379  zdcModuleMonToolArr.defineHistogram('lumiBlock, zdcModuleFract;zdcModuleFract_above20N_vs_lb', type='TH2F',title=';lumi block;Module Amplitude Fraction',
380  path='ModuleFractionLBdep',
381  cutmask='zdcAbove20NCurrentSide',
382  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
383  ybins=n_mod_fraction_bins_default,ymin=0.0,ymax=1.)
384  zdcModuleMonToolArr.defineHistogram('zdcUncalibSumCurrentSide, zdcModuleFract', type='TH2F', title=';Amplitude Sum Current Side [ADC Counts];Module Amplitude Fraction',
385  path='ModuleFraction',
386  xbins=n_energy_bins_default,xmin=0.0,xmax=zdc_amp_sum_xmax / 2.,
387  ybins=n_mod_fraction_bins_default,ymin=0.0,ymax=1.)
388  zdcModuleMonToolArr.defineHistogram('zdcUncalibSumCurrentSide, zdcModuleFract;zdcModuleFract_vs_zdcUncalibSumCurrentSide_zoomedin', type='TH2F', title=';Amplitude Sum Current Side [ADC Counts];Module Amplitude Fraction',
389  path='ModuleFraction',
390  xbins=n_energy_bins_default,xmin=0.0,xmax=5000,
391  ybins=n_mod_fraction_bins_default,ymin=0.0,ymax=1.)
392 
393  zdcModuleMonToolArr.defineHistogram('zdcModuleCalibAmp',title=';Module Calibrated Amplitude [GeV];Events',
394  path='ModuleCalibAmp',
395  xbins=2*n_energy_bins_default,xmin=0.0,xmax=module_calib_amp_xmax) # 2.5TeV * 40
396  zdcModuleMonToolArr.defineHistogram('zdcModuleCalibAmp;zdcModuleCalibAmp_halfrange',title=';Module Calibrated Amplitude [GeV];Events',
397  path='ModuleCalibAmp',
398  xbins=2*n_energy_bins_default,xmin=0.0,xmax=module_calib_amp_xmax / 2.) # 2.5TeV * 40
399  zdcModuleMonToolArr.defineHistogram('zdcModuleTime',title=';Module Time [ns];Events',
400  path='ModuleTime',
401  xbins=n_time_centroid_bins_default,xmin=-10.0,xmax=10.0)
402  zdcModuleMonToolArr.defineHistogram('zdcModuleTime;zdcModuleTime_LG',title=';Module Time [ns];Events',
403  path='ModuleTime',
404  cutmask='zdcModuleLG',
405  xbins=n_time_centroid_bins_default,xmin=-10.0,xmax=10.0)
406  zdcModuleMonToolArr.defineHistogram('zdcModuleTime;zdcModuleTime_HG',title=';Module Time [ns];Events',
407  path='ModuleTime',
408  cutmask='zdcModuleHG',
409  xbins=n_time_centroid_bins_default,xmin=-10.0,xmax=10.0)
410  zdcModuleMonToolArr.defineHistogram('zdcModuleCalibTime',title=';Module Calibrated Time [ns];Events',
411  path='ModuleCalibTime',
412  xbins=n_time_centroid_bins_default,xmin=-10.0,xmax=10.0)
413  zdcModuleMonToolArr.defineHistogram('zdcModuleChisq',title=';Module Chi-square;Events',
414  path='ModuleChisq',
415  xbins=create_log_bins(module_chisq_min, module_chisq_max, 80))
416  zdcModuleMonToolArr.defineHistogram('zdcModuleChisqOverAmp',title=';Module Chi-square / Amplitude;Events',
417  path='ModuleChisq',
418  xbins=create_log_bins(module_chisq_over_amp_min, module_chisq_over_amp_max, 80))
419 
420  zdcModuleMonToolArr.defineHistogram('lumiBlock, zdcModuleAmp;zdcModuleAmp_vs_lb', type='TH2F', title=';lumi block;Module Amplitude [ADC counts]',
421  path='ModuleAmpLBdep',
422  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
423  ybins=n_module_amp_zoomin_bins, ymin=0.0, ymax=module_amp_1Nmonitor_xmax)
424  zdcModuleMonToolArr.defineHistogram('lumiBlock, zdcModuleCalibAmp;zdcModuleCalibAmp_vs_lb', type='TH2F', title=';lumi block;Module Calib Amplitude',
425  path='ModuleCalibAmpLBdep',
426  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
427  ybins=n_module_amp_zoomin_bins, ymin=0.0, ymax=module_calib_amp_1Nmonitor_xmax)
428 
429  zdcModuleMonToolArr.defineHistogram('bcid, zdcModuleCalibAmp', type='TH2F', title=';BCID;Module Calib Amplitude',
430  path='ModuleCalibAmpBCIDdep',
431  xbins=bcid_max,xmin=0.0,xmax=bcid_max,
432  ybins=n_module_amp_zoomin_bins, ymin=0.0, ymax=module_calib_amp_1Nmonitor_xmax)
433 
434  zdcModuleMonToolArr.defineHistogram('lumiBlock, zdcModuleTime;zdcModuleTime_vs_lb', type='TH2F', title=';lumi block;Module Time [ns]',
435  path='ModuleTimeLBdep',
436  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
437  ybins=n_time_centroid_bins_default, ymin=-10.0, ymax=10.0)
438  zdcModuleMonToolArr.defineHistogram('lumiBlock, zdcModuleTime;zdcModuleTime_LG_vs_lb', type='TH2F', title=';lumi block;Module Time [ns]',
439  path='ModuleTimeLBdep',
440  cutmask='zdcModuleLG',
441  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
442  ybins=n_time_centroid_bins_default, ymin=-10.0, ymax=10.0)
443  zdcModuleMonToolArr.defineHistogram('lumiBlock, zdcModuleTime;zdcModuleTime_HG_vs_lb', type='TH2F', title=';lumi block;Module Time [ns]',
444  path='ModuleTimeLBdep',
445  cutmask='zdcModuleHG',
446  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
447  ybins=n_time_centroid_bins_default, ymin=-10.0, ymax=10.0)
448 
449 # --------------------------------------------------------------------------------------------------
450 
451  rpdChannelMonToolArr = helper.addArray([nSides,nChannels],zdcMonAlg,'RpdChannelMonitor', topPath='ZDC/RPD/RPDChannel/')
452 
453  rpdChannelMonToolArr.defineHistogram('RPDStatusBits',title=';;Events',
454  path='StatusBits',
455  xbins=nRpdStatusBits,xmin=0,xmax=nRpdStatusBits,opt='kVec',
456  xlabels=['ValidBit', 'OutOfTimePileupBit', 'OverflowBit', 'PrePulseBit', 'PostPulseBit', 'NoPulseBit', 'BadAvgBaselineSubtrBit', 'InsufficientPileupFitPointsBit', 'PileupStretchedExpFitFailBit', 'PileupStretchedExpGrowthBit', 'PileupBadStretchedExpSubtrBit', 'PileupExpFitFailBit', 'PileupExpGrowthBit', 'PileupBadExpSubtrBit', 'PileupStretchedExpPulseLike'])
457 
458  rpdChannelMonToolArr.defineHistogram('RPDChannelAmplitudeCalib', title=';RPD Channel Calibrated Amplitude;Events',
459  path='CalibAmp',
460  cutmask='RPDChannelValid',
461  xbins=n_rpd_amp_bins_full_range,xmin=rpd_channel_amp_min,xmax=module_amp_xmax) # NOT energy calibration - calibration factor is 1 for now
462  rpdChannelMonToolArr.defineHistogram('RPDChannelAmplitudeCalib;RPDChannelAmplitudeCalib_halfrange', title=';RPD Channel Calibrated Amplitude;Events',
463  path='CalibAmp',
464  cutmask='RPDChannelValid',
465  xbins=n_rpd_amp_bins_half_range,xmin=rpd_channel_amp_min,xmax=module_amp_xmax / 2.) # NOT energy calibration - calibration factor is 1 for now
466  rpdChannelMonToolArr.defineHistogram('RPDChannelSubAmp', title=';RPD Channel Subtracted Amplitude;Events',
467  path='SubAmp',
468  cutmask='RPDChannelCentroidValid',
469  xbins=n_rpd_sub_amp_bins,xmin=rpd_sub_amp_min,xmax=rpd_sub_amp_max) # NOT energy calibration - calibration factor is 1 for now
470  rpdChannelMonToolArr.defineHistogram('RPDChannelMaxADC', title=';Max ADC [ADC Counts];Events',
471  path='MaxADC',
472  cutmask='RPDChannelValid',
473  xbins=n_energy_bins_default,xmin=0.0,xmax=4096.0)
474  rpdChannelMonToolArr.defineHistogram('lumiBlock, RPDChannelAmplitudeCalib;RPDChannelAmplitudeCalib_vs_lb', type='TH2F', title=';lumi block;RPD Channel Calibrated Amplitude',
475  path='CalibAmpLBdep',
476  cutmask='RPDChannelValid',
477  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
478  ybins=n_rpd_amp_bins_full_range,ymin=rpd_channel_amp_min,ymax=module_amp_xmax) # NOT energy calibration - calibration factor is 1 for now
479  rpdChannelMonToolArr.defineHistogram('lumiBlock, RPDChannelAmplitudeCalib;RPDChannelAmplitudeCalib_halfrange_vs_lb', type='TH2F', title=';lumi block;RPD Channel Calibrated Amplitude',
480  path='CalibAmpLBdep',
481  cutmask='RPDChannelValid',
482  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
483  ybins=n_rpd_amp_bins_half_range,ymin=rpd_channel_amp_min,ymax=module_amp_xmax / 2.) # NOT energy calibration - calibration factor is 1 for now
484  rpdChannelMonToolArr.defineHistogram('lumiBlock, RPDChannelMaxADC;RPDChannelMaxADC_vs_lb', type='TH2F', title=';lumi block;Max ADC [ADC Counts]',
485  path='MaxADCLBdep',
486  cutmask='RPDChannelValid',
487  xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
488  ybins=n_energy_bins_default,ymin=0.0,ymax=4096.0)
489 
490 
491  # study on EM module energy, max ADC and pile-up fit slope for RPD channels with negative amplitude
492  rpdChannelMonToolArr.defineHistogram('RPDChannelPileupFrac;RPDChannelPileupFrac_negative_amp', title=';;Events',
493  path='NegativeAmpDistrs',
494  cutmask='RPDChannelNegativeAmp',
495  xlabels=['pileup','no pileup'],
496  xbins=2,xmin=-1.5,xmax=0.5)
497 
498  rpdChannelMonToolArr.defineHistogram('zdcEMModuleSameSideHasPulse;zdcEMModuleSameSideHasPulse_negative_amp', title=';;Events',
499  path='NegativeAmpDistrs',
500  cutmask='RPDChannelNegativeAmp',
501  xlabels=['EM pulse bit false','EM pulse bit true'],
502  xbins=2,xmin=-0.5,xmax=1.5)
503 
504  rpdChannelMonToolArr.defineHistogram('RPDChannelMaxADC;RPDChannelMaxADC_negative_amp', title=';Max ADC [ADC Counts];Events',
505  path='NegativeAmpDistrs',
506  cutmask='RPDChannelNegativeAmp',
507  xbins=n_energy_bins_default,xmin=0.0,xmax=4096.0)
508 
509  rpdChannelMonToolArr.defineHistogram('zdcEMModuleEnergySameSide;zdcEMModuleEnergySameSide_negative_amp', title=';E EM module AorC [GeV];Events',
510  path='NegativeAmpDistrs',
511  cutmask='RPDChannelNegativeAmp',
512  xbins=n_energy_bins_default,xmin=0.0,xmax=module_calib_amp_xmax / 2.)
513 
514  rpdChannelMonToolArr.defineHistogram('zdcEMModuleEnergySameSide, RPDChannelPileupFitSlope;RPDChannelPileupFitSlope_vs_zdcEMModuleEnergySameSide_negative_amp', type='TH2F', title=';E EM module AorC [GeV];RPD Pileup Fitted Slope',
515  path='NegativeAmpDistrs',
516  cutmask='RPDChannelNegativePileup',
517  xbins=n_energy_bins_default,xmin=0.0,xmax=module_calib_amp_xmax / 2., # divide by 2 to make a more zoomed-in plot (not full range)
518  ybins=n_energy_bins_default,ymin=-100.,ymax=10.) # try a value for now
519 
520  # Study of effect of minimum EM module energy cut on RPD channel amplitude
521  rpdChannelMonToolArr.defineHistogram('RPDChannelAmplitudeCalib;RPDChannelAmplitudeCalib_EMbelow0', title=';RPD Channel Calibrated Amplitude;Events',
522  path='CalibAmp/RpdChanAmpDistrAtLowEMModuleEnergy',
523  cutmask='rpdValidZdcEMModuleEnergySameSideBelow0',
524  xbins=n_rpd_amp_bins_half_range,xmin=rpd_channel_amp_min,xmax=module_amp_xmax / 2.) # NOT energy calibration - calibration factor is 1 for now
525  rpdChannelMonToolArr.defineHistogram('RPDChannelAmplitudeCalib;RPDChannelAmplitudeCalib_EMbelow70', title=';RPD Channel Calibrated Amplitude;Events',
526  path='CalibAmp/RpdChanAmpDistrAtLowEMModuleEnergy',
527  cutmask='rpdValidZdcEMModuleEnergySameSideBelow70',
528  xbins=n_rpd_amp_bins_half_range,xmin=rpd_channel_amp_min,xmax=module_amp_xmax / 2.) # NOT energy calibration - calibration factor is 1 for now
529 
530 
531 
536  return helper.result()
537 
538  # # Otherwise, merge with result object and return
539  # acc = helper.result()
540  # result.merge(acc)
541  # return result
542 
ZdcMonitorAlgorithm.create_log_bins
def create_log_bins(min_value, max_value, num_bins)
Definition: ZdcMonitorAlgorithm.py:18
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
ZdcMonitorAlgorithm.ZdcMonitoringConfig
def ZdcMonitoringConfig(inputFlags, run_type)
Definition: ZdcMonitorAlgorithm.py:28