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

Comparing UserCode/mjarvis/makePSet.py (file contents):
Revision 1.2 by mjarvis, Thu Jul 22 09:38:07 2010 UTC vs.
Revision 1.3 by mjarvis, Thu Jul 22 11:17:09 2010 UTC

# Line 2 | Line 2
2  
3   #Generates psets
4   #Uses 'lcg-ls' which requires grid to be sourced and a valid grid proxy (voms-proxy-init)
5 <
5 > #Does not add the correct crosssections, this will need to be done by hand.
6  
7   import commands
8  
# Line 31 | Line 31 | for row in rows:
31                                  path = (row['rpath'])+string.replace(dset[1:], '/', '.')
32                                  paths.append(path)
33                                  shortName = (string.split(dset, '/'))[1] + "_" + (string.split(dset, '/'))[2]
34 +                                shortName = string.replace(shortName,'-','_')
35                                  shortNames.append(shortName)
36                                  xsecs.append(0.0)
37                                  #Would be nice if this information was in the database.
# Line 39 | Line 40 | for row in rows:
40                          path = (row['rpath'])
41                          paths.append(path)
42                          shortName = (string.split(dset, '/'))[1] + "_" + (string.split(dset, '/'))[2]
43 +                        shortName = string.replace(shortName,'-','_')
44                          shortNames.append(shortName)
45                          xsecs.append(0.0)
46                  break
47   db.disconnect()
48  
49   for path, shortName, xsec in zip(paths, shortNames, xsecs) :
50 <        print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
51 <        print "Generating " + shortName + '_pset.py'
52 <        print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
53 <        print "Path is " + path
50 >        # print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
51 >        print "Generating " + shortName + '.py'
52 >        # print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
53 >        # print "\tPath: " + path
54          
55          prefix = '\n' + '\t' +  "\"dcap://gfe02.grid.hep.ph.ic.ac.uk:22128/" + path[22:]
56          suffix = '.root\" ,'
# Line 67 | Line 69 | for path, shortName, xsec in zip(paths,
69          for i,line1 in enumerate(infile[:-1]) :
70                  for line2 in infile[i+1:] :
71                          if line1[:-1] == line2[:-1] :
72 <                                print "\tDuplicates exist: " + line1 + " and " + line2
73 <                                print "\t\tIgnoring " + line1
72 >                                # print "\tDuplicates: " + line1 + " and " + line2
73 >                                # print "\t\tIgnoring: " + line1
74                                  toRemove.append(i)
75                                  break
76          toRemove.sort()
# Line 76 | Line 78 | for path, shortName, xsec in zip(paths,
78          for i in toRemove :
79                  del infile[i]
80                                  
81 <        outfile = open(shortName+'_pset.py','w')
81 >        outfile = open(shortName+'.py','w')
82  
83          filenames = []
84          for line in infile :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines