Belle II Software development
collector.py
1#!/usr/bin/env python3
2# -*- coding: utf-8 -*-
3
4
11
12import sys
13
14import basf2 as b2
15# from simulation import register_simulation
16# from reconstruction import register_reconstruction
17
18b2.set_log_level(b2.LogLevel.ERROR)
19
20argvs = sys.argv
21argc = len(argvs)
22
23print(argvs[1])
24print(argc)
25
26# detecor components to be reconstructed
27components = [
28 'MagneticField',
29 'BeamPipe',
30 'PXD',
31 'SVD',
32 'CDC',
33 'TOP',
34 'ARICH',
35 'BKLM',
36 'ECL',
37]
38
39# Register modules to declare objects
40# register_simulation(components)
41# register_reconstruction(components)
42
43# Register RoI related modules for object decoding
44roiGen = b2.register_module('ROIGenerator')
45roiPayloadAssembler = b2.register_module('ROIPayloadAssembler')
46
47# create a main path
48main = b2.create_path()
49
50# Load Geometry module
51gearbox = b2.register_module('Gearbox')
52geometry = b2.register_module('Geometry')
53
54# Add input module
55# input = register_module("SeqRootInput")
56# input.param ( "inputFileName", "/fcdisk1-1/data/sim/sim-evtgen.sroot")
57# main.add_module(input)
58
59# Add output module
60# output= register_module("SeqRootOutput")
61# output.param ( "outputFileName", "/dev/null" )
62# main.add_module(output)
63
64# Add Rbuf2Ds
65rbuf2ds = b2.register_module("Rbuf2Ds")
66# rbuf2ds = register_module("FastRbuf2Ds")
67rbuf2ds.param("RingBufferName", argvs[1])
68# rbuf2ds.param("NumThreads", 4 )
69main.add_module(rbuf2ds)
70
71# Add Progress
72progress = b2.register_module("Progress")
73progress.param('maxN', 4)
74main.add_module(progress)
75
76# Add Elapsed Time
77elapsed = b2.register_module("ElapsedTime")
78elapsed.param("EventInterval", 20000)
79main.add_module(elapsed)
80
81# Add Ds2Rbuf
82# ds2rbuf = register_module("Ds2Rbuf")
83# ds2rbuf.param("RingBufferName", argvs[2])
84# main.add_module(ds2rbuf)
85
86# Add Ds2Raw
87ds2rbuf = b2.register_module("Ds2Raw")
88ds2rbuf.param("RingBufferName", argvs[2])
89main.add_module(ds2rbuf)
90
91# Test seqrootoutput
92# output = register_module("SeqRootOutput" )
93# output.param ( "outputFileName", "/dev/null" )
94# main.add_module(output)
95
96# Run
97b2.process(main)