ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/RateMonShiftTool_dev/mkTMDfits.py
(Generate patch)

Comparing UserCode/RateMonShiftTool_dev/mkTMDfits.py (file contents):
Revision 1.4 by grchrist, Fri Apr 13 09:47:36 2012 UTC vs.
Revision 1.5 by grchrist, Tue May 22 11:06:15 2012 UTC

# Line 12 | Line 12 | def usage():
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"
# Line 26 | Line 27 | def main():
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)
# Line 36 | Line 37 | def main():
37      trig_list=[]
38      fit_list={}
39      NoVersion=False
40 +    lumi=5000
41      
42      for o,a in opt:
43          if o == "--NColBunches":
# Line 44 | Line 46 | def main():
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:
# Line 63 | Line 68 | def main():
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  
# Line 86 | Line 91 | def main():
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()
# Line 113 | Line 120 | def main():
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)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines