Exemplo n.º 1
0
def MeanNormZeroPadParticles(Filename_in, MeanNormTuple, inbranches, nMax,
                             nevents):

    from DeepJetCore.compiled import c_meanNormZeroPad

    array = numpy.zeros((nevents, nMax, len(inbranches)), dtype='float32')

    means = []
    norms = []
    for b in inbranches:
        if MeanNormTuple is None:
            means.append(0)
            norms.append(1)
        elif numpy.isnan(MeanNormTuple[b][0]) or numpy.isnan(
                MeanNormTuple[b][1]):
            means.append(0)
            norms.append(1)
        else:
            means.append(MeanNormTuple[b][0])
            norms.append(MeanNormTuple[b][1])

    c_meanNormZeroPad.particlecluster(array, [norms], [means], [inbranches],
                                      [nMax], Filename_in)

    return array
Exemplo n.º 2
0
def ZeroPadParticles(Filename_in, MeanNormTuple, inbranches, nMax, nevents):
    from DeepJetCore.compiled import c_meanNormZeroPad

    array = numpy.zeros((nevents, nMax, len(inbranches)), dtype='float32')

    means = []
    norms = []
    for b in inbranches:
        means.append(0.)
        norms.append(1.)

    c_meanNormZeroPad.particlecluster(array, [norms], [means], [inbranches],
                                      [nMax], Filename_in)

    return array