Small module to demonstrate how the registration of StoreArrays works from Python
Definition at line 23 of file register_pystorearray.py.
◆ event()
Access and fill the registered StoreArray
Definition at line 31 of file register_pystorearray.py.
32 """ Access and fill the registered StoreArray """
35 mcParticle = mcParticles.appendNew()
38 vertex = ROOT.TVector3(0, 0, 0)
42 phi = ROOT.gRandom.Uniform(0.0, 2.0 * math.pi)
43 costheta = ROOT.gRandom.Uniform(-1.0, 1.0)
44 theta = math.acos(costheta)
45 momentum = ROOT.Math.XYZVector(math.sin(theta) * math.cos(phi), math.sin(theta) * math.sin(phi), costheta)
48 mcParticle.setMassFromPDG()
49 mcParticle.addStatus(Belle2.MCParticle.c_PrimaryParticle)
50 mcParticle.addStatus(Belle2.MCParticle.c_StableInGenerator)
51 mcParticle.setProductionVertex(vertex)
52 mcParticle.setMomentum(momentum)
53 m = mcParticle.getMass()
54 mcParticle.setEnergy(math.sqrt(momentum * momentum + m * m))
55 mcParticle.setDecayTime(float(
"inf"))
A (simplified) python wrapper for StoreArray.
◆ initialize()
The documentation for this class was generated from the following file: