Belle II Software development
collisiondqm.py
1#!/usr/bin/env python3
2
3
10
11
12from geometry import is_detector_present, are_detectors_present
13from daqdqm.commondqm import add_common_dqm
14from IPDQM import add_IP_dqm
15from V0DQM import add_V0_dqm
16
17
18def 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 bandwidth 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 is_detector_present("PXD", 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 are_detectors_present(["CDC", "SVD"], components):
57 add_IP_dqm(path, dqm_environment=dqm_environment)
58
59 # KLM2 (requires mu+ particle list from add_analysis_dqm)
60 if is_detector_present("KLM", components):
61 path.add_module("KLMDQM2", MuonListName='mu+:KLMDQM2',
62 MinimalMatchingDigits=14,
63 MinimalMatchingDigitsOuterLayers=4,
64 MinimalMomentumNoOuterLayers=4.0)
65
66 # the following makes only sense in collisions
67 if dqm_environment == "expressreco" and (dqm_mode in ["dont_care"]):
68
69 # V0 DQM
70 if is_detector_present("CDC", components):
71 add_V0_dqm(path)