9 return [key.GetName()
for key
in gDirectory.GetListOfKeys()]
10 TFile.GetKeyNames = GetKeyNames
14 print "Too few arguments. Expected the following:"
15 print " 1. Input file"
16 print " 2. Output file"
17 print " 3. Name of component to strip"
20 inputFile = TFile.Open(sys.argv[1],
"READ")
21 outputFile = TFile.Open(sys.argv[2],
"RECREATE")
22 compName = sys.argv[3]
24 foundComponent =
False
25 for histName
in inputFile.GetKeyNames():
26 hist = inputFile.Get(histName)
27 if TString(histName).Contains(compName):
28 print "Removing component:",histName