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.TVector3(0, 0, 0)
46 momentum.SetMagThetaPhi(1, theta, phi)
49 mcParticle.setMassFromPDG()
50 mcParticle.addStatus(Belle2.MCParticle.c_PrimaryParticle)
51 mcParticle.addStatus(Belle2.MCParticle.c_StableInGenerator)
52 mcParticle.setProductionVertex(vertex)
53 mcParticle.setMomentum(momentum)
54 m = mcParticle.getMass()
55 mcParticle.setEnergy(math.sqrt(momentum * momentum + m * m))
56 mcParticle.setDecayTime(float(
"inf"))
a (simplified) python wrapper for StoreArray.
◆ initialize()
The documentation for this class was generated from the following file: