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