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

Comparing UserCode/VHbb/python/evaluateMVA.py (file contents):
Revision 1.28 by bortigno, Tue Feb 26 13:10:41 2013 UTC vs.
Revision 1.29 by nmohr, Thu Apr 4 09:01:30 2013 UTC

# Line 1 | Line 1
1   #!/usr/bin/env python
2   from __future__ import print_function
3   import sys
4 < import os
4 > import os,subprocess
5   import ROOT
6   from array import array
7   from math import sqrt
# Line 89 | Line 89 | for mva in MVAinfos:
89  
90   samples = info.get_samples(namelist)
91   print(samples)
92 + tmpDir = os.environ["TMPDIR"]
93   for job in samples:
94      #get trees:
95      print(INpath+'/'+job.prefix+job.identifier+'.root')
96      input = ROOT.TFile.Open(INpath+'/'+job.prefix+job.identifier+'.root','read')
97      print(OUTpath+'/'+job.prefix+job.identifier+'.root')
98 <    outfile = ROOT.TFile.Open(OUTpath+'/'+job.prefix+job.identifier+'.root','recreate')
98 >    outfile = ROOT.TFile.Open(tmpDir+'/'+job.prefix+job.identifier+'.root','recreate')
99      input.cd()
100      obj = ROOT.TObject
101      for key in ROOT.gDirectory.GetListOfKeys():
# Line 136 | Line 137 | for job in samples:
137          newtree.Fill()
138      newtree.AutoSave()
139      outfile.Close()
140 +    targetStorage = OUTpath.replace('gsidcap://t3se01.psi.ch:22128/','srm://t3se01.psi.ch:8443/srm/managerv2?SFN=')+'/'+job.prefix+job.identifier+'.root'
141 +    command = 'lcg-del -b -D srmv2 -l %s' %(targetStorage)
142 +    print(command)
143 +    subprocess.call([command], shell=True)
144 +    command = 'lcg-cp -b -D srmv2 file:///%s %s' %(tmpDir+'/'+job.prefix+job.identifier+'.root',targetStorage)
145 +    print(command)
146 +    subprocess.call([command], shell=True)
147                  
148   print('\n')

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines