12from ROOT
import Belle2
15from subprocess
import call
24hostname = socket.gethostname()
25if 'cc.kek.jp' in hostname:
26 lib_source =
'/home/belle2/tasheng/tsim/'
27 rdi_path =
'/home/belle2/tasheng/Vivado_2017.2/lib/lnx64.o'
28elif 'btrgpc09' == hostname:
29 lib_source =
'/home/trgadmin/tsim/'
30 rdi_path =
'/home/trgadmin/Xilinx/Vivado/2017.2/lib/lnx64.o'
31elif 'belle2' '= hostname':
32 lib_source =
'/home/ta/tsim/'
33 rdi_path =
'/home/ta/Vivado_2017.2/lib/lnx64.o'
40 if rdi_path
not in os.environ[
'LD_LIBRARY_PATH']:
41 print(
'please set environment variable first! do either')
42 print(
'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:' + rdi_path)
44 print(
'setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:' + rdi_path)
48 for link
in [
'xsim.dir',
'innerLRLUT.mif',
'outerLRLUT.mif']:
49 if link
not in os.listdir(os.getcwd()):
50 call([
'ln',
'-s', lib_source + link])
53generate tracks with particle gun, simulate CDC and CDC trigger, save the output.
64 'pdgCodes': [-13, 13],
66 'momentumGeneration':
'inversePt',
67 'momentumParams': [2., 10.],
68 'thetaGeneration':
'uniform',
69 'thetaParams': [35, 145],
70 'phiGeneration':
'uniform',
71 'phiParams': [46, 135],
72 'vertexGeneration':
'uniform',
73 'xVertexParams': [0, 0.0],
74 'yVertexParams': [0, 0.0],
75 'zVertexParams': [-10., 10.]}
81if not environment.getNumberEventsOverride():
82 environment.setNumberEventsOverride(evtnum)
85b2.set_random_seed(seed)
89main = b2.create_path()
91empty_path = b2.create_path()
95 main.add_module(
'RootInput', inputFileName=
'/home/belle2/tasheng/gcr/cdc/cosmic.0001.03898.HLT1.f00007.root')
97main.add_module(
'Progress')
100 main.add_module(
'EventInfoSetter', evtNumList=evtnum)
101 main.add_module(
'Gearbox')
102 main.add_module(
'Geometry', components=[
'BeamPipe',
104 'MagneticFieldConstant4LimitedRCDC'])
105 particlegun = b2.register_module(
'ParticleGun')
106 particlegun.param(particlegun_params)
107 main.add_module(particlegun)
109 main.add_module(
'FullSim')
110 main.add_module(
'CDCDigitizer')
117 main.add_module(
'Gearbox')
118 main.add_module(
'Geometry', components=[
'BeamPipe',
120 'MagneticFieldConstant4LimitedRCDC'])
121 main.add_module(
'CDCTriggerTSF',
125firmtsf = b2.register_module(
'CDCTriggerTSFFirmware')
126firmtsf.param(
'mergerOnly', merger_only)
127firmtsf.logging.log_level = b2.LogLevel.DEBUG
128firmtsf.logging.debug_level = 10
129firmtsf.logging.set_info(b2.LogLevel.DEBUG, b2.LogInfo.LEVEL | b2.LogInfo.MESSAGE)
130main.add_module(firmtsf)
141 main.add_module(
'RootOutput', outputFileName=
'tsfout.root')
static Environment & Instance()
Static method to get a reference to the Environment instance.
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...