15def browseDir( dir ):
16
17 path = dir.GetPath().
split(
':/', 1)[-1]
18 pathdir = dir
19
20 keylist = dir.GetListOfKeys()
21
22 for key in keylist:
23 obj = key.ReadObj()
24
25
26 if obj.IsA().InheritsFrom(ROOT.TH2.Class()) or obj.IsA().InheritsFrom(ROOT.TProfile.Class()) or "fficiency" in obj.GetName() or 'RecoFraction' in obj.GetName() or 'purity' in obj.GetName() or "PtResol" in obj.GetName() or "PtScale" in obj.GetName() or "Prof" in obj.GetName() or "Fit" in obj.GetName():
27 continue
28
29 if obj.IsA().InheritsFrom(ROOT.TH1.Class()) :
30
31
32 ii = 1.*obj.Integral()
33 hname = obj.GetName()
34 if ii>0:
35 obj.Scale(1./ii)
36
37 pathdir.WriteTObject( obj , hname , "WriteDelete" )
38 continue
39
40 if obj.IsA().InheritsFrom(ROOT.TDirectory.Class()):
41
42 browseDir(obj)
43
44
45
46
std::vector< std::string > split(const std::string &s, const std::string &t=":")