Belle II Software  release-05-01-25
cdctrigger.py
1 # !/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 from basf2 import *
5 from ROOT import Belle2
6 
7 
8 def add_cdc_trigger(path, SimulationMode=1, shortTracks=False, lowPt=False,
9  thetaDef='avg', zDef='min'):
10  """
11  This function adds the CDC trigger modules to a path.
12  @path modules are added to this path
13  @SimulationMode the simulation mode in TSIM, 1: fast simulation,
14  trigger algoritm simulation only, no firmware simulation
15  2: full simulation, both trigger algorithm and firmware
16  are simulated
17  @shortTracks the standard track finding requires hits in 4 axial super layers.
18  with the shortTracks option, tracks with hits in the innermost
19  3 super layers are also found.
20  @lowPt default threshold for track finding is 0.3Gev.
21  with the lowPt option, the threshold is 0.255GeV.
22  use together with the shortTracks option.
23  @thetaDef theta definition for the CDCTriggerTrackCombiner
24  @zDef z definition for the CDCTriggerTrackCombiner
25  (for details see module description)
26  """
27 
28  if SimulationMode == 1:
29  # TSF
30  path.add_module('CDCTriggerTSF',
31  InnerTSLUTFile=Belle2.FileSystem.findFile("data/trg/cdc/innerLUT_Bkg_p0.70_b0.80.coe"),
32  OuterTSLUTFile=Belle2.FileSystem.findFile("data/trg/cdc/outerLUT_Bkg_p0.70_b0.80.coe"))
33  # 2D finder
34  if shortTracks:
35  minHitsShort = 3
36  else:
37  minHitsShort = 4
38  if lowPt:
39  minPt = 0.255
40  else:
41  minPt = 0.3
42  path.add_module('CDCTrigger2DFinder',
43  minHits=4, minHitsShort=minHitsShort, minPt=minPt)
44 
45  # Old ETF
46  # path.add_module('CDCTriggerETF', trueEventTime=trueEventTime)
47  # ETF priority fastest timings among 2D Tracks
48  path.add_module('CDCTriggerHoughETF')
49 
50  # fitters
51  path.add_module('CDCTrigger2DFitter')
52  path.add_module('CDCTrigger3DFitter')
53  # neurotrigger
54  if shortTracks:
55  B2ERROR("shortTracks=True is deprecated and no longer supported! "
56  "Network weights will now be loaded from the database. "
57  "If you really want to use shorttracks, load the specific network "
58  "weights in the Neurotrigger module!")
59  exit()
60  path.add_module('CDCTriggerNeuro')
61 
62  path.add_module('CDCTriggerTrackCombiner',
63  thetaDefinition=thetaDef, zDefinition=zDef)
64  elif SimulationMode == 2:
65  B2WARNING("full simulation mode does not include all CDC trigger modules yet")
66  # standard CDC trigger
67  trgcdc = register_module('TRGCDC')
68  trgcdc_params = {
69  'ConfigFile': Belle2.FileSystem.findFile("data/trg/cdc/TRGCDCConfig_0_20101111.dat"),
70  'InnerTSLUTFile': Belle2.FileSystem.findFile("data/trg/cdc/innerLUT_v3.0.coe"),
71  'OuterTSLUTFile': Belle2.FileSystem.findFile("data/trg/cdc/outerLUT_v3.0.coe"),
72  'HoughFinderMappingFileMinus': Belle2.FileSystem.findFile("data/trg/cdc/HoughMappingMinus20160223.dat"),
73  'HoughFinderMappingFilePlus': Belle2.FileSystem.findFile("data/trg/cdc/HoughMappingPlus20160223.dat"),
74  'SimulationMode': SimulationMode,
75  '2DfinderCollection': 'TRGCDC2DFinderTracks',
76  '2DfitterCollection': 'TRGCDC2DFitterTracks',
77  '3DfitterCollection': 'TRGCDC3DFitterTracks'}
78  trgcdc.param(trgcdc_params)
79  path.add_module(trgcdc)
Belle2::FileSystem::findFile
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
Definition: FileSystem.cc:147