7 import argparse, ROOT, os
10 parser = argparse.ArgumentParser( description =
"MakePlots.py options:" )
11 parser.add_argument(
"-i",
"--inputFile", help=
"IDPVM input file" )
12 parser.add_argument(
"-c",
"--config", help=
"config file" )
14 MyArgs = parser.parse_args()
16 inFileName = MyArgs.inputFile
17 inFile = ROOT.TFile.Open( inFileName ,
"READ" )
19 outFile = ROOT.TFile.Open( inFileName.replace(
"root",
"IDTPMcnv.root" ) ,
"RECREATE" )
21 configFileName = MyArgs.config
22 configFile =
open( configFileName,
'r' )
23 lines = configFile.readlines()
33 obj = inFile.Get( hidpvm )
38 hidtpm_dir = os.path.dirname( hidtpm )
39 hidtpm_name = os.path.basename( hidtpm )
40 if(
not outFile.GetDirectory( hidtpm_dir ) ):
41 outFile.mkdir( hidtpm_dir, hidtpm_dir )
42 outFile.cd( hidtpm_dir )
43 obj.SetName( hidtpm_name )