Belle II Software  release-08-01-10
IPDQM.py
1 # !/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 """
13 This module defines functions to add the interaction point montitor to DQM modules.
14 """
15 
16 import basf2
17 import modularAnalysis as ma
18 import vertex as vx
19 
20 
21 def add_IP_dqm(path, dqm_environment='expressreco'):
22  '''
23  This function adds the IPDQM module to the path.
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  '''
28 
29  mySelection = '[p > 1.0] and [abs(dz) < 2.0] and [dr < 0.5]'
30  if dqm_environment == 'expressreco':
31  ma.fillParticleList('mu+:DQM', mySelection, path=path)
32  ma.reconstructDecay('Upsilon(4S):IPDQM -> mu+:DQM mu-:DQM', '9.5<M<11.5', path=path)
33  vx.kFit('Upsilon(4S):IPDQM', conf_level=0, path=path)
34 
35  dqm = basf2.register_module('IPDQM')
36  dqm.set_log_level(basf2.LogLevel.INFO)
37  dqm.param('Y4SPListName', 'Upsilon(4S):IPDQM')
38  dqm.param('onlineMode', dqm_environment)
39  path.add_module(dqm)
40 
41  elif dqm_environment == 'hlt':
42  # In order to save computing time, we fill the ParticleList only if the event passes the dimuon skim.
43  mySelection += ' and [SoftwareTriggerResult(software_trigger_cut&skim&accept_mumu_tight_or_highm) > 0]'
44  ma.fillParticleList('mu+:DQM_HLT', mySelection, path=path)
45  ma.reconstructDecay('Upsilon(4S):IPDQM_HLT -> mu+:DQM_HLT mu-:DQM_HLT', '9.5<M<11.5', path=path)
46  vx.kFit('Upsilon(4S):IPDQM_HLT', conf_level=0, path=path)
47 
48  dqm = basf2.register_module('IPDQM')
49  dqm.set_log_level(basf2.LogLevel.INFO)
50  dqm.param('Y4SPListName', 'Upsilon(4S):IPDQM_HLT')
51  dqm.param('onlineMode', dqm_environment)
52  path.add_module(dqm)