33 |
|
#CountWithPU.Scale(factor) |
34 |
|
#CountWithPU2011B.Scale(factor) |
35 |
|
input.Close() |
36 |
< |
output.Close() |
37 |
< |
''' |
38 |
< |
def copytree(pathIN,pathOUT,prefix,file,Aprefix,Acut): |
39 |
< |
input = TFile.Open("%s/%s%s.root" %(pathIN,prefix,file),'read') |
40 |
< |
Count = input.Get("Count") |
41 |
< |
CountWithPU = input.Get("CountWithPU") |
42 |
< |
CountWithPU2011B = input.Get("CountWithPU2011B") |
43 |
< |
inputTree = input.Get("tree") |
44 |
< |
nEntries = inputTree.GetEntries() |
45 |
< |
output = TFile.Open("%s/%s%s%s.root" %(pathOUT,prefix,Aprefix,file),'recreate') |
46 |
< |
print '\n\t copy file: %s with cut: %s' %(file,Acut) |
47 |
< |
outputTree = inputTree.CopyTree(Acut) |
48 |
< |
kEntries = outputTree.GetEntries() |
49 |
< |
printc('blue','',"\t before cuts\t %s" %nEntries) |
50 |
< |
printc('green','',"\t survived\t %s" %kEntries) |
51 |
< |
#print "\t Factor for Scaling is %s" %factor |
52 |
< |
outputTree.AutoSave() |
53 |
< |
#Count.Scale(factor) |
54 |
< |
Count.Write() |
55 |
< |
CountWithPU.Write() |
56 |
< |
#CountWithPU.Scale(factor) |
57 |
< |
CountWithPU2011B.Write() |
58 |
< |
#CountWithPU2011B.Scale(factor) |
59 |
< |
input.Close() |
60 |
< |
output.Close() |
61 |
< |
|
62 |
< |
''' |
63 |
< |
|
64 |
< |
|
65 |
< |
|
36 |
> |
output.Close() |