diff --git a/eos-toys/scan-dBRds.py b/eos-toys/scan-dBRds.py new file mode 100644 index 0000000..775f1ac --- /dev/null +++ b/eos-toys/scan-dBRds.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# @Author: Elena Graverini +# @Date: 2017-03-22 11:15:24 +# @Last Modified by: Elena Graverini +# @Last Modified time: 2017-03-22 12:01:00 +import os +tempfile = 'out.temp' +step = 0.5 +bounds = { + 'mu': (0.0, 8.5), + 'tau': (3.0, 8.5), +} +scan = { + 'mu': {'s': [], 'br': []}, + 'tau': {'s': [], 'br': []} +} +# Scanning differential branching ratio for muons and taus +for l in bounds.keys(): + os.system("for i in $(LANG=en_US seq {min} {step} {max});" + "do out=$(eos-evaluate --kinematics s $i" + " --observable 'Lambda_b->Lambda_c(2625)lnu::dBR/ds;l={l}');" + " echo $out; done > {tempf}".format(min=bounds[l][0], + max=bounds[l][1], l=l, tempf=tempfile, step=step)) + with open(tempfile, 'rb') as f: + for line in f: + # take the part we are interested into + line = line.split('delta_max') + line = line[-1] + # split by blank spaces + line = line.split() + scan[l]['s'].append(float(line[0])) + scan[l]['br'].append(float(line[1])) + os.remove(tempfile) + print("l={l}: \t{q2:>8} = {s}\n" + "\t{dbr:>8} = {br}\n".format(l=l, + q2='q^2', dbr='dBR/dq^2', + s=scan[l]['s'], br=scan[l]['br']))