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