6 from ROOT
import TFile, TTree
8 from b2test_utils
import skip_test_if_light
11 from simulation
import add_simulation
12 from reconstruction
import add_reconstruction
15 main.add_module(
'EventInfoSetter', evtNumList=[5])
16 main.add_module(
'ParticleGun', pdgCodes=[211, -211, 321, -321], nTracks=2)
19 components = [
'MagneticField',
'BeamPipe',
'CDC']
20 simulation_components = [
'CDC']
21 add_simulation(main, simulation_components)
22 add_reconstruction(main, simulation_components)
23 basf2.set_module_parameters(main, type=
"Geometry", useDB=
False, components=components)
26 main.add_module(
'RootOutput', outputFileName=
'streamer_test.root')
31 tfile = TFile(
'streamer_test.root')
32 tree = tfile.Get(
'tree')
35 tree.Project(
"",
"MCParticles.m_pdg")
39 tree.Project(
"",
"abs(MCParticles.m_pdg)")
43 tree.Project(
"",
"ZZZ.Doesnt.Exist")
46 tree.Project(
"",
"GF2Tracks.getNumPoints()")
48 os.remove(
'streamer_test.root')