ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetValidation
InDetTrackPerfMon
scripts
IDTPMcnv.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
4
6
7
import
argparse, ROOT, os
8
9
# Parsing arguments
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"
)
13
parser.add_argument(
"-o"
,
"--output"
, help=
"suffix for output file (IDTPMcnv for IDPVM vs IDTPM, ref for EF vs Offline)"
)
14
15
MyArgs = parser.parse_args()
16
17
inFileName = MyArgs.inputFile
18
outputSuffix = MyArgs.output
19
inFile = ROOT.TFile.Open( inFileName ,
"READ"
)
20
21
outFile = ROOT.TFile.Open( inFileName.replace(
"root"
, outputSuffix+
".root"
) ,
"RECREATE"
)
22
23
configFileName = MyArgs.config
24
configFile = open( configFileName,
'r'
)
25
lines = configFile.readlines()
26
27
for
line
in
lines:
28
parsed = line.strip().
split
()
29
htype = parsed[0]
30
href = parsed[1]
31
htest = parsed[2]
32
33
34
inFile.cd()
35
obj = inFile.Get( href )
36
if
not
obj:
continue
37
obj.SetDirectory(0)
38
39
40
outFile.cd()
41
htest_dir = os.path.dirname( htest )
42
htest_name = os.path.basename( htest )
43
if
(
not
outFile.GetDirectory( htest_dir ) ):
44
outFile.mkdir( htest_dir, htest_dir )
45
outFile.cd( htest_dir )
46
obj.SetName( htest_name )
47
obj.Write()
48
49
inFile.Close()
50
outFile.Close()
if
if(pathvar)
Definition
SealSharedLib.cxx:168
split
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition
hcg.cxx:179
Generated on
for ATLAS Offline Software by
1.17.0