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 algorithm 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 useDB=True,
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 path.add_module('CDCTrigger2DFinder',
43 useDB=True)
44
45 # ETF
46 path.add_module('CDCTriggerHoughETF')
47
48 # fitters
49 path.add_module('CDCTrigger2DFitter')
50 path.add_module('CDCTrigger3DFitter')
51 # neurotrigger
52 if shortTracks:
53 b2.B2ERROR("shortTracks=True is deprecated and no longer supported! "
54 "Network weights will now be loaded from the database. "
55 "If you really want to use shorttracks, load the specific network "
56 "weights in the Neurotrigger module!")
57 exit()
58 path.add_module('CDCTriggerNeuro')
59
60 path.add_module('CDCTriggerTrackCombiner',
61 thetaDefinition=thetaDef, zDefinition=zDef)
62 elif SimulationMode == 2:
63 b2.B2WARNING("full simulation mode does not include all CDC trigger modules yet")
64 # standard CDC trigger
65 trgcdc = b2.register_module('TRGCDC')
66 trgcdc_params = {
67 'ConfigFile': Belle2.FileSystem.findFile("data/trg/cdc/TRGCDCConfig_0_20101111.dat"),
68 'InnerTSLUTFile': Belle2.FileSystem.findFile("data/trg/cdc/innerLUT_v3.0.coe"),
69 'OuterTSLUTFile': Belle2.FileSystem.findFile("data/trg/cdc/outerLUT_v3.0.coe"),
70 'HoughFinderMappingFileMinus': Belle2.FileSystem.findFile("data/trg/cdc/HoughMappingMinus20160223.dat"),
71 'HoughFinderMappingFilePlus': Belle2.FileSystem.findFile("data/trg/cdc/HoughMappingPlus20160223.dat"),
72 'SimulationMode': SimulationMode,
73 '2DfinderCollection': 'TRGCDC2DFinderTracks',
74 '2DfitterCollection': 'TRGCDC2DFitterTracks',
75 '3DfitterCollection': 'TRGCDC3DFitterTracks'}
76 trgcdc.param(trgcdc_params)
77 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...