import tensorflow as tf



def gaussian_pdf(x, mean, std):
    val = tf.div(tf.exp(-tf.pow((x - mean) / std, 2) / two), (sqrt2pi * std),
                 name="gaussian_pdf")
    return val


# // --- Build Argus background PDF ---
# RooRealVar argpar("argpar","argus shape parameter",-20.0,-100.,-1.) ;
# RooConstVar m0("m0", "resonant mass", 5.291);

argpar = tf.Variable(argpar_num, name="argpar", dtype=tf.float64)
m0 = tf.constant(m0_num, name="m0", dtype=tf.float64)
vdict['argpar'] = argpar

# RooArgusBG argus("argus","Argus PDF",mes,m0,argpar) ;


def argus_pdf(m, m0, c, p=0.5):
    t = m / m0
    u = 1 - t * t
    argus_t_ge_1 = m * tf.pow(u, p) * tf.exp(c * u)
    return tf.maximum(tf.zeros_like(m), argus_t_ge_1, name="argus_pdf")


