clusterking / clusterking_physics

Generate additional kinematic distributions to be used by ClusterKinG
MIT License
0 stars 0 forks source link

Consolidate functions #3

Open klieret opened 6 years ago

klieret commented 6 years ago

This is not too important, but currently we are defining a lot of single functions with cryptic names that cover some cases, e.g.

def Gammap0(w: Wilson, q2, El):
    return 2 * Gammat0p(w, q2, El)

def Gammam0(w: Wilson, q2, El):
    return 2 * Gamma0m(w, q2, El)

def Gammam2(w: Wilson, q2, El):
    return -2 * Gamma0m(w, q2, El)

def Gammap2(w: Wilson, q2, El):
    return 2 * Gamma00p(w, q2, El)

def Gammam1(w: Wilson, q2, El):
    return 0.

def Gammap1(w: Wilson, q2, El):
    return 2 * GammaI0p(w, q2, El)

for me it would perhaps be clearer if we implement that in one function:

def Gamma(sign, number, w, q2, El):
    if sign == "+" and  number == 1:
         return blah
   else if:
         return bluh
    ....
    else:
           raise ValueError
celis commented 6 years ago

yes thats a good idea