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

Comparing UserCode/VHbb/python/copytree.py (file contents):
Revision 1.4 by nmohr, Tue Jun 19 22:18:02 2012 UTC vs.
Revision 1.5 by bortigno, Wed Dec 5 13:07:24 2012 UTC

# Line 4 | Line 4 | from printcolor import printc
4  
5          
6   def copytree(pathIN,pathOUT,prefix,newprefix,file,Aprefix,Acut):
7 +
8 +    print "##### COPY TREE - BEGIN ######"
9 +    print "Input File : %s/%s%s.root " %(pathIN,prefix,file)
10 +    print "Output File : %s/%s%s%s.root" %(pathOUT,newprefix,Aprefix,file)
11 +        
12      input = TFile.Open("%s/%s%s.root" %(pathIN,prefix,file),'read')
13      output = TFile.Open("%s/%s%s%s.root" %(pathOUT,newprefix,Aprefix,file),'recreate')
14  
# Line 29 | Line 34 | def copytree(pathIN,pathOUT,prefix,newpr
34      printc('green','',"\t survived\t %s" %kEntries)
35      #print "\t Factor for Scaling is %s" %factor
36      outputTree.AutoSave()
37 +    output.ls()
38      #Count.Scale(factor)
39      #CountWithPU.Scale(factor)
40      #CountWithPU2011B.Scale(factor)
41 <    input.Close()
41 >    print "Writing output file"
42 >    output.Write()
43 >    print "Closing output file"
44      output.Close()
45 +    print "Closing input file"
46 +    input.Close()
47 +
48 +    print "##### COPY TREE - END ######"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines