Commit 1a6a9d2b authored by Simon Spannagel's avatar Simon Spannagel
Browse files

create_hempc3: actually randomize four-vectors and energy

parent 283c9428
Loading
Loading
Loading
Loading
+22 −28
Original line number Diff line number Diff line
@@ -31,60 +31,54 @@ def generate_HEPEVT(event_id):

    v1 = hm.GenVertex()
    evt.add_vertex(v1)
    p1 = hm.GenParticle(hm.FourVector(0, 0, 7000, 7000), 2212, 3)
    pv1 = hm.FourVector(0 * random.random(), 0 * random.random(), 7000 * random.random(), 7000 * random.random())
    p1 = hm.GenParticle(pv1, 2212, 3)
    evt.add_particle(p1)
    p1.add_attribute("flow1", hm.IntAttribute(231))
    p1.add_attribute("flow1", hm.IntAttribute(231))
    p1.add_attribute("theta", hm.DoubleAttribute(random.random() * math.pi))
    p1.add_attribute("phi", hm.DoubleAttribute(random.random() * math.pi * 2))
    v1.add_particle_in(p1)

    v2 = hm.GenVertex()
    evt.add_vertex(v2)
    p2 = hm.GenParticle(hm.FourVector(0, 0, -7000, 7000), 2212, 3)
    pv2 = hm.FourVector(0 * random.random(), 0 * random.random(), -7000 * random.random(), 7000 * random.random())
    p2 = hm.GenParticle(pv2, 2212, 3)
    evt.add_particle(p2)
    p2.add_attribute("flow1", hm.IntAttribute(243))
    p2.add_attribute("theta", hm.DoubleAttribute(random.random() * math.pi))
    p2.add_attribute("phi", hm.DoubleAttribute(random.random() * math.pi * 2))
    v2.add_particle_in(p2)

    p3 = hm.GenParticle(hm.FourVector(0.751, -1.569, 32.191, 32.238), 1, 3)
    pv3 = hm.FourVector(0.751 * random.random(), -1.569 * random.random(), 32.191 * random.random(), 32.238 * random.random())
    p3 = hm.GenParticle(pv3, 1, 3)
    evt.add_particle(p3)
    p3.add_attribute("flow1", hm.IntAttribute(231))
    p3.add_attribute("theta", hm.DoubleAttribute(random.random() * math.pi))
    p3.add_attribute("phi", hm.DoubleAttribute(random.random() * math.pi * 2))
    v1.add_particle_out(p3)
    p4 = hm.GenParticle(hm.FourVector(-3.047, -19.0, -54.629, 57.920), -2, 3)

    pv4 = hm.FourVector(-3.047 * random.random(), -19.0 * random.random(), -54.629 * random.random(), 57.920 * random.random())
    p4 = hm.GenParticle(pv4, -2, 3)
    evt.add_particle(p4)
    p4.add_attribute("flow1", hm.IntAttribute(243))
    p4.add_attribute("theta", hm.DoubleAttribute(random.random() * math.pi))
    p4.add_attribute("phi", hm.DoubleAttribute(random.random() * math.pi * 2))
    v2.add_particle_out(p4)

    v3 = hm.GenVertex()
    evt.add_vertex(v3)
    v3.add_particle_in(p3)
    v3.add_particle_in(p4)
    p6 = hm.GenParticle(hm.FourVector(-3.813, 0.113, -1.833, 4.233), 22, 1)

    pv6 = hm.FourVector(-3.813* random.random(), 0.113* random.random(), -1.833* random.random(), 4.233* random.random())
    p6 = hm.GenParticle(pv6, 22, 1)
    evt.add_particle(p6)
    p6.add_attribute("flow1", hm.IntAttribute(231))
    p6.add_attribute("theta", hm.DoubleAttribute(random.random() * math.pi))
    p6.add_attribute("phi", hm.DoubleAttribute(random.random() * math.pi * 2))
    v3.add_particle_out(p6)
    p5 = hm.GenParticle(hm.FourVector(1.517, -20.68, -20.605, 85.925), -24, 3)

    pv5 = hm.FourVector(1.517* random.random(), -20.68* random.random(), -20.605* random.random(), 85.925* random.random())
    p5 = hm.GenParticle(pv5, -24, 3)
    evt.add_particle(p5)
    p5.add_attribute("flow1", hm.IntAttribute(243))
    p5.add_attribute("theta", hm.DoubleAttribute(random.random() * math.pi))
    p5.add_attribute("phi", hm.DoubleAttribute(random.random() * math.pi * 2))
    v3.add_particle_out(p5)
    # create v4
    v4 = hm.GenVertex(hm.FourVector(0.12, -0.3, 0.05, 0.004))
    v4 = hm.GenVertex(hm.FourVector(0.12* random.random(), -0.3* random.random(), 0.05* random.random(), 0.004* random.random()))
    evt.add_vertex(v4)
    v4.add_particle_in(p5)
    p7 = hm.GenParticle(hm.FourVector(-2.445, 28.816, 6.082, 29.552), 2212, 1)

    pv7 = hm.FourVector(-2.445 * random.random(), 28.816 * random.random(), 6.082 * random.random(), 29.552 * random.random())
    p7 = hm.GenParticle(pv7, 2212, 1)
    evt.add_particle(p7)
    v4.add_particle_out(p7)
    p8 = hm.GenParticle(hm.FourVector(3.962, -49.498, -26.687, 560.373), 11, 1)

    pv8 = hm.FourVector(3.962 * random.random(), -49.498 * random.random(), -26.687 * random.random(), 560.373 * random.random())
    p8 = hm.GenParticle(pv8, 11, 1)
    evt.add_particle(p8)
    v4.add_particle_out(p8)