9 return [key.GetName()
for key
in gDirectory.GetListOfKeys()]
10TFile.GetKeyNames = GetKeyNames
14 print "Too few arguments. Expected the following:"
15 print " 1. Input file"
16 print " 2. Output file"
17 print " 3. Original name of component"
18 print " 4. New name of component"
21inputFile = TFile.Open(sys.argv[1],
"READ")
22outputFile = TFile.Open(sys.argv[2],
"RECREATE")
26for histName
in inputFile.GetKeyNames():
27 hist = inputFile.Get(histName)
28 if TString(histName).Contains(compName):
29 newHistName = re.sub(compName,newName,histName)
30 print "Renaming component: %s --> %s"%(histName,newHistName)
32 hist.Write(newHistName)