Belle II Software  release-05-01-25
collisiondqm.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
5 from daqdqm.commondqm import add_common_dqm
6 from IPDQM import add_IP_dqm
7 from V0DQM import add_V0_dqm
8 
9 
10 def add_collision_dqm(path, components=None, dqm_environment="expressreco", dqm_mode="dont_care", create_hlt_unit_histograms=False):
11  """
12  This function adds DQMs for collisions
13 
14  @param components: A list of the detector components which are available in this
15  run of basf2
16  @param dqm_environment: The environment the DQM modules are running in
17  "expressreco" (default) if running on the ExpressReco system
18  "hlt" if running on the HLT online reconstructon nodes
19  If running on the hlt, you may want to output less or other DQM plots
20  due to the limited bandwith of the HLT nodes.
21  @param dqm_mode: How to split up the path for online/HLT.
22  For dqm_mode == "dont_care" all the DQM modules should be added.
23  For dqm_mode == "all_events" only the DQM modules which should run on all events
24  (filtered and dismissed) should be added
25  For dqm_mode == "before_filter" only the DQM modules which should run before
26  the hlt filter
27  For dqm_mode == "filtered" only the DQM modules which should run on filtered
28  events should be added
29  @param create_hlt_unit_histograms: Parameter for SoftwareTiggerHLTDQMModule.
30  Should be True only when running on the HLT servers
31  """
32 
33  assert dqm_mode in ["dont_care", "all_events", "filtered", "before_filter"]
34 
35  add_common_dqm(path, components=components, dqm_environment=dqm_environment,
36  dqm_mode=dqm_mode, create_hlt_unit_histograms=create_hlt_unit_histograms)
37 
38  if dqm_environment == "expressreco" and (dqm_mode in ["dont_care"]):
39  # PXD (not useful on HLT)
40  if components is None or 'PXD' in components:
41  # need to be behind add_common_dqm as intercepts are calculated there
42  path.add_module('PXDDQMEfficiency', histogramDirectoryName='PXDEFF')
43 
44  # the following makes only sense in collisions
45  if dqm_environment == "expressreco":
46  if components is None or ('CDC' in components and 'SVD' in components):
47  add_IP_dqm(path)
48 
49  if components is None or 'CDC' in components:
50  add_V0_dqm(path)