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