RMF
rmf_decorator.py
1## \example rmf_decorator.py
2# The example shows how to use the decorators by printing the
3# coordates and radius of every node that has them.
4import RMF
5
6
7def traverse(nh, pf):
8 # check if the current node has coordinates and radius
9 if pf.get_is(nh):
10 # create a decorator for the current node
11 d = pf.get(nh)
12 print(nh.get_name(), d.get_coordinates())
13 # recurse on the children
14 children = nh.get_children()
15 for c in children:
16 traverse(c, pf)
17
18fch = RMF.open_rmf_file_read_only(RMF.get_example_path("simple.rmf3"))
19pf = RMF.ParticleFactory(fch)
20fch.set_current_frame(RMF.FrameID(0))
21traverse(fch.get_root_node(), pf)
FileConstHandle open_rmf_file_read_only(std::string path)