Exemplo n.º 1
0
 def simparticle(ptc, index):
     '''Create a sim particle to be used in papas from an input particle.
     '''
     tp4 = ptc.p4()
     vertex = ptc.start_vertex().position()
     charge = ptc.q()
     pid = ptc.pdgid()
     simptc = Particle(tp4, vertex, charge, index, pid)
     pdebugger.info(" ".join(("Made", simptc.__str__())))
     simptc.gen_ptc = ptc
     return simptc
Exemplo n.º 2
0
def pfsimparticle(ptc):
    '''Create a PFSimParticle from a particle.
    The PFSimParticle will have the same p4, vertex, charge, pdg ID.
    '''
    tp4 = ptc.p4()
    vertex = ptc.start_vertex().position()
    charge = ptc.q()
    pid = ptc.pdgid()
    simptc = PFSimParticle(tp4, vertex, charge, pid)
    pdebugger.info(" ".join(("Made", simptc.__str__())))
    simptc.gen_ptc = ptc
    return simptc
Exemplo n.º 3
0
def pfsimparticle(ptc):
    """Create a PFSimParticle from a particle.
    The PFSimParticle will have the same p4, vertex, charge, pdg ID.
    """
    tp4 = ptc.p4()
    vertex = ptc.start_vertex().position()
    charge = ptc.q()
    pid = ptc.pdgid()
    simptc = PFSimParticle(tp4, vertex, charge, pid)
    pdebugger.info(" ".join(("Made", simptc.__str__())))
    simptc.gen_ptc = ptc
    return simptc
Exemplo n.º 4
0
 def simparticle(ptc, index):
     '''Create a sim particle to be used in papas from an input particle.
     '''
     tp4 = ptc.p4()
     vertex = ptc.start_vertex().position()
     charge = ptc.q()
     pid = ptc.pdgid()
     simptc = Particle(tp4, vertex, charge, pid)
     simptc.set_dagid(IdCoder.make_id(IdCoder.PFOBJECTTYPE.PARTICLE, index, 's', simptc.idvalue))
     pdebugger.info(" ".join(("Made", simptc.__str__())))
     #simptc.gen_ptc = ptc
     #record that sim particle derives from gen particle
     child = papasevent.history.setdefault(simptc.dagid(), Node(simptc.dagid())) #creates a new node if it is not there already
     parent = papasevent.history.setdefault(ptc.dagid(), Node(ptc.dagid()))
     parent.add_child(child)
     return simptc
Exemplo n.º 5
0
 def simparticle(ptc, index):
     '''Create a sim particle to be used in papas from an input particle.
     '''
     tp4 = ptc.p4()
     vertex = ptc.start_vertex().position()
     charge = ptc.q()
     pid = ptc.pdgid()
     simptc = Particle(tp4, vertex, charge, pid)
     simptc.set_dagid(
         IdCoder.make_id(IdCoder.PFOBJECTTYPE.PARTICLE, index, 's',
                         simptc.idvalue))
     pdebugger.info(" ".join(("Made", simptc.__str__())))
     #simptc.gen_ptc = ptc
     #record that sim particle derives from gen particle
     child = papasevent.history.setdefault(
         simptc.dagid(), Node(simptc.dagid(
         )))  #creates a new node if it is not there already
     parent = papasevent.history.setdefault(ptc.dagid(),
                                            Node(ptc.dagid()))
     parent.add_child(child)
     return simptc