Esempio n. 1
0
def WeightedSumSq(weights, inputs=None, *args, **kwargs):
    weights = stdvector(weights)
    if inputs is None:
        inputs = weights
    elif isinstance(inputs[0], str):
        inputs = stdvector(inputs)
    else:
        inputs = OutputDescriptors(inputs)

    return R.GNA.GNAObjectTemplates.WeightedSumSqT(
        context.current_precision())(weights, inputs, *args, **kwargs)
Esempio n. 2
0
def Dummy(shape, name, varnames=None, *args, **kwargs):
    if varnames:
        return R.GNA.GNAObjectTemplates.DummyT(context.current_precision())(
            shape, name, stdvector(varnames), *args, **kwargs)

    return R.GNA.GNAObjectTemplates.DummyT(context.current_precision())(
        shape, name, *args, **kwargs)
Esempio n. 3
0
def OscProb3(*args, **kwargs):
    """OscProb3 wrapper

    Aguments:
       Neutrino from,
       Neutrino to,
       std::string l_name="L",
       bool modecos=true,
       std::vector<std::string> dmnames={}
    """
    if len(args) >= 5:
        args = list(args)
        args[4] = stdvector(args[4])

    return R.GNA.GNAObjectTemplates.OscProb3T(context.current_precision())(
        *args, **kwargs)
Esempio n. 4
0
def OutputDescriptors(outputs):
    descriptors = []
    odescr = R.OutputDescriptorT(context.current_precision(),
                                 context.current_precision())
    ohandle = R.TransformationTypes.OutputHandleT(context.current_precision())
    singleoutput = R.SingleOutputT(context.current_precision())
    for output in outputs:
        if isinstance(output, odescr):
            append = output
        elif isinstance(output, ohandle):
            append = odescr(output)
        elif isinstance(output, singleoutput):
            append = odescr(output.single())
        else:
            raise Exception('Expect OutputHandle or SingleOutput object')
        descriptors.append(append)

    return stdvector(
        descriptors, 'OutputDescriptorT<%s,%s>' %
        (context.current_precision(), context.current_precision()))
Esempio n. 5
0
def VarProduct(varnames, *args, **kwargs):
    return R.GNA.GNAObjectTemplates.VarProductT(context.current_precision())(
        stdvector(varnames), *args, **kwargs)
Esempio n. 6
0
def VarArrayPreallocated(vars, *args, **kwargs):
    cls = R.GNA.GNAObjectTemplates.VarArrayPreallocatedT(
        context.current_precision())
    ret = cls(stdvector(vars), *args, **kwargs)
    return ret
Esempio n. 7
0
def VarArray(vars, *args, **kwargs):
    cls = R.GNA.GNAObjectTemplates.VarArrayT(context.current_precision())
    ret = cls(stdvector(vars), *args, **kwargs)
    ret.transformations.front().updateTypes()
    return ret
Esempio n. 8
0
def EnergyResolution(weights, *args, **kwargs):
    return R.EnergyResolution(stdvector(weights), *args, **kwargs)
Esempio n. 9
0
def PolyRatio(nominator=[], denominator=[], *args, **kwargs):
    nominator = stdvector(nominator, 'string')
    denominator = stdvector(denominator, 'string')
    return R.GNA.GNAObjectTemplates.PolyRatioT(context.current_precision())(
        nominator, denominator, *args, **kwargs)