12 |
|
print "--TriggerList=<path>" |
13 |
|
print "--NColBunches=<# colliding bunches>" |
14 |
|
print "--NoVersion Exclude version number" |
15 |
+ |
print "--Lumi luminosity of estimations" |
16 |
|
|
17 |
|
def main(): |
18 |
|
print "making TMD pkl fit files" |
27 |
|
|
28 |
|
####################################### |
29 |
|
try: |
30 |
< |
opt, args = getopt.getopt(sys.argv[1:],"",["NColBunches=","NoVersion","TriggerList="]) |
30 |
> |
opt, args = getopt.getopt(sys.argv[1:],"",["NColBunches=","NoVersion","Lumi=","TriggerList="]) |
31 |
|
|
32 |
|
except getopt.GetoptError, err: |
33 |
|
print str(err) |
37 |
|
trig_list=[] |
38 |
|
fit_list={} |
39 |
|
NoVersion=False |
40 |
+ |
lumi=5000 |
41 |
|
|
42 |
|
for o,a in opt: |
43 |
|
if o == "--NColBunches": |
46 |
|
bunfrac=float(ncolbunch)/float(ntotbunch) |
47 |
|
elif o == "--NoVersion": |
48 |
|
NoVersion=True |
49 |
+ |
elif o == "--Lumi": |
50 |
+ |
lumi=float(a) |
51 |
+ |
|
52 |
|
for o,a in opt: |
53 |
|
if o == "--TriggerList": |
54 |
|
try: |
68 |
|
##trig_list.append([split[0],split[1],split[2],split[3]]) |
69 |
|
if not NoVersion: |
70 |
|
trig_list.append(split[0]) |
71 |
< |
fit_list[split[0]]=[0.,float(split[1])/5000.,float(split[2])] |
71 |
> |
fit_list[split[0]]=[0.,float(split[1])/lumi,float(split[2])] |
72 |
|
|
73 |
|
else: |
74 |
|
trig_list.append(StripVersion(split[0])) |
75 |
< |
fit_list[StripVersion(split[0])]=[0.,float(split[1])/5000.,float(split[2])] |
75 |
> |
fit_list[StripVersion(split[0])]=[0.,float(split[1])/lumi,float(split[2])] |
76 |
|
|
77 |
|
|
78 |
|
|
91 |
|
bunfrac=float(ncolbunch)/float(ntotbunch) |
92 |
|
elif o == "--NoVersion": |
93 |
|
NoVersion=True |
94 |
+ |
elif o == "--Lumi": |
95 |
+ |
lumi=float(a) |
96 |
|
else: |
97 |
|
print "\nInvalid Option %s\n" % (str(o),) |
98 |
|
usage() |
120 |
|
############# fIT FILE NAME ########### |
121 |
|
|
122 |
|
if not NoVersion: |
123 |
< |
fit_file="fits_TMD_ncolbunch%s.pkl" |
123 |
> |
fit_file="fits_TMD_ncolbunch%s_lumi%s.pkl" |
124 |
|
else: |
125 |
< |
fit_file="fits_TMD_ncolbunch%s_noV.pkl" |
126 |
< |
fit_file = fit_file % (ncolbunch) |
125 |
> |
fit_file="fits_TMD_ncolbunch%s_noV_lumi%s.pkl" |
126 |
> |
fit_file = fit_file % (ncolbunch,lumi) |
127 |
|
|
128 |
|
if os.path.exists(fit_file): |
129 |
|
os.remove(fit_file) |