def make_channel(name, samples, data=None, verbose=False):
    """
    Create a Channel from a list of Samples
    """
    if verbose:
        llog = log['make_channel']
        llog.info("creating channel {0}".format(name))
    # avoid segfault if name begins with a digit by using "channel_" prefix
    chan = Channel('channel_{0}'.format(name))
    chan.SetStatErrorConfig(0.05, "Poisson")

    if data is not None:
        if verbose:
            llog.info("setting data")
        chan.SetData(data)

    for sample in samples:
        if verbose:
            llog.info("adding sample {0}".format(sample.GetName()))
        chan.AddSample(sample)

    return chan
Create a Channel from a list of Samples