6 print "Error. Expected at least 3 arguments\n\nUsage: python GetRecoTauVFromDQM_MC_cff.py InputFile OutputFile EventType"
14 InputFileName =
"%s" % Input
15 OutputFileName =
"%s" % Output
20 outFile = ROOT.TFile(OutputFileName,
"recreate")
23 fullFile = ROOT.TFile(InputFileName)
26 source = ROOT.gDirectory.ls()
29 source = ROOT.gDirectory.ls()
30 next=ROOT.TIter(fullFile.GetListOfKeys())
37 cl = ROOT.gROOT.GetClass(key.GetClassName())
38 if(cl.InheritsFrom(
"TDirectory")):
40 dirFound0=dir.GetName()
41 next2=ROOT.TIter(dir.GetListOfKeys())
43 cl2 = ROOT.gROOT.GetClass(key.GetClassName())
44 if(cl2.InheritsFrom(
"TDirectory")):
46 dirFound1 = dir2.GetName()
47 next3=ROOT.TIter(dir2.GetListOfKeys())
49 cl3 = ROOT.gROOT.GetClass(key.GetClassName())
50 if(cl3.InheritsFrom(
"TDirectory")):
52 if 'RecoTauV' in dir3.GetName():
53 dirFound2 = dir3.GetName()
54 next4=ROOT.TIter(dir3.GetListOfKeys())
56 cl4 = ROOT.gROOT.GetClass(key.GetClassName())
57 if(cl4.InheritsFrom(
"TDirectory")):
59 dirFound3 = dir4.GetName()
61 InputDir = dirFound0+
"/"+dirFound1+
"/"+dirFound2+
"/"+dirFound3
62 ROOT.gDirectory.cd(InputDir)
66 next5=ROOT.TIter(ROOT.gDirectory.GetListOfKeys())
68 cl5 = ROOT.gROOT.GetClass(key.GetClassName())
69 if(cl5.InheritsFrom(
"TDirectory")):
70 dirFound4=key.ReadObj()
71 dirFound4_name=dirFound4.GetName()
72 if EventType
in dirFound4_name:
73 SubDirs.append(dirFound4_name)
78 ROOT.gDirectory.mkdir(sub)
80 ROOT.gDirectory.cd(InputDir+
"/"+sub)
81 HList = ROOT.TIter(ROOT.gDirectory.GetListOfKeys())
83 kk = ROOT.gROOT.GetClass(k.GetClassName())
84 if(kk.InheritsFrom(
"TH1F")):
86 ROOT.gDirectory.cd(sub)