12 from ROOT
import TFile
14 from b2test_utils
import skip_test_if_light, clean_working_directory
17 from simulation
import add_simulation
18 from reconstruction
import add_reconstruction
21 main.add_module(
'EventInfoSetter', evtNumList=[5])
22 main.add_module(
'ParticleGun', pdgCodes=[211, -211, 321, -321], nTracks=2)
25 components = [
'MagneticField',
'BeamPipe',
'CDC']
26 simulation_components = [
'CDC']
27 add_simulation(main, simulation_components)
28 add_reconstruction(main, simulation_components)
29 basf2.set_module_parameters(main, type=
"Geometry", useDB=
False, components=components)
32 main.add_module(
'RootOutput', outputFileName=
'streamer_test.root')
34 with clean_working_directory():
38 tfile = TFile(
'streamer_test.root')
39 tree = tfile.Get(
'tree')
42 tree.Project(
"",
"MCParticles.m_pdg")
46 tree.Project(
"",
"abs(MCParticles.m_pdg)")
50 tree.Project(
"",
"ZZZ.Doesnt.Exist")
53 tree.Project(
"",
"GF2Tracks.getNumPoints()")