13 from ROOT
import Belle2
16 from subprocess
import call
25 hostname = socket.gethostname()
26 if 'cc.kek.jp' in hostname:
27 lib_source =
'/home/belle2/tasheng/tsim/'
28 rdi_path =
'/home/belle2/tasheng/Vivado_2017.2/lib/lnx64.o'
29 elif 'btrgpc09' == hostname:
30 lib_source =
'/home/trgadmin/tsim/'
31 rdi_path =
'/home/trgadmin/Xilinx/Vivado/2017.2/lib/lnx64.o'
32 elif 'belle2' '= hostname':
33 lib_source =
'/home/ta/tsim/'
34 rdi_path =
'/home/ta/Vivado_2017.2/lib/lnx64.o'
41 if rdi_path
not in os.environ[
'LD_LIBRARY_PATH']:
42 print(
'please set environment variable first! do either')
43 print(
'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:' + rdi_path)
45 print(
'setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:' + rdi_path)
49 for link
in [
'xsim.dir',
'innerLRLUT.mif',
'outerLRLUT.mif']:
50 if link
not in os.listdir(os.getcwd()):
51 call([
'ln',
'-s', lib_source + link])
54 generate tracks with particle gun, simulate CDC and CDC trigger, save the output.
64 particlegun_params = {
65 'pdgCodes': [-13, 13],
67 'momentumGeneration':
'inversePt',
68 'momentumParams': [2., 10.],
69 'thetaGeneration':
'uniform',
70 'thetaParams': [35, 145],
71 'phiGeneration':
'uniform',
72 'phiParams': [46, 135],
73 'vertexGeneration':
'uniform',
74 'xVertexParams': [0, 0.0],
75 'yVertexParams': [0, 0.0],
76 'zVertexParams': [-10., 10.]}
82 if not environment.getNumberEventsOverride():
83 environment.setNumberEventsOverride(evtnum)
86 b2.set_random_seed(seed)
90 main = b2.create_path()
92 empty_path = b2.create_path()
96 main.add_module(
'RootInput', inputFileName=
'/home/belle2/tasheng/gcr/cdc/cosmic.0001.03898.HLT1.f00007.root')
98 main.add_module(
'Progress')
101 main.add_module(
'EventInfoSetter', evtNumList=evtnum)
102 main.add_module(
'Gearbox')
103 main.add_module(
'Geometry', components=[
'BeamPipe',
105 'MagneticFieldConstant4LimitedRCDC'])
106 particlegun = b2.register_module(
'ParticleGun')
107 particlegun.param(particlegun_params)
108 main.add_module(particlegun)
110 main.add_module(
'FullSim')
111 main.add_module(
'CDCDigitizer')
118 main.add_module(
'Gearbox')
119 main.add_module(
'Geometry', components=[
'BeamPipe',
121 'MagneticFieldConstant4LimitedRCDC'])
122 main.add_module(
'CDCTriggerTSF',
126 firmtsf = b2.register_module(
'CDCTriggerTSFFirmware')
127 firmtsf.param(
'mergerOnly', merger_only)
128 firmtsf.logging.log_level = b2.LogLevel.DEBUG
129 firmtsf.logging.debug_level = 10
130 firmtsf.logging.set_info(b2.LogLevel.DEBUG, b2.LogInfo.LEVEL | b2.LogInfo.MESSAGE)
131 main.add_module(firmtsf)
142 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...