ATLAS Offline Software
Functions | Variables
python.runDiffRootOnChanged Namespace Reference

Functions

def read_diff_pool_log (filename)
 
def diff_root (pool_list, test, ftype)
 
def guessSecond (ESD_list)
 
def get_test_pool_files (logfile, tests)
 
def test_pool_files (logfile, tests)
 

Variables

 logfile
 
 tests
 

Function Documentation

◆ diff_root()

def python.runDiffRootOnChanged.diff_root (   pool_list,
  test,
  ftype 
)

Definition at line 43 of file runDiffRootOnChanged.py.

43 def diff_root(pool_list,test,ftype):
44  outfile = "%s_%s.log" %(test, ftype)
45  command = "acmd.py diff-root %s %s --error-mode resilient --ignore-leaves RecoTimingObj_p1_HITStoRDO_timings RecoTimingObj_p1_RAWtoESD_mems RecoTimingObj_p1_RAWtoESD_timings RAWtoESD_mems RAWtoESD_timings ESDtoAOD_mems ESDtoAOD_timings HITStoRDO_timings --entries 10 >> %s" %(pool_list[0], pool_list[1], outfile)
46  if options.dryrun:
47  print (command)
48  else:
49  os.system(command)
50 
51 
52 
53 """
54  since some pool files are located on eos others are on afs
55  this little hack is needed to get all files for the comparison
56 """

◆ get_test_pool_files()

def python.runDiffRootOnChanged.get_test_pool_files (   logfile,
  tests 
)

Definition at line 71 of file runDiffRootOnChanged.py.

71 def get_test_pool_files(logfile, tests):
72  for test in tests:
73  AOD_list = []
74  ESD_list = []
75  print()
76  print()
77  print (test)
78  f = open(logfile, 'r')
79  for line in f:
80  if ".pool.root" in line and "open" in line and test in line:
81  if "AOD" in line:
82  AOD_list.append( line.split('[')[1].split(']')[0])
83  elif "ESD" in line:
84  ESD_list.append( line.split('[')[1].split(']')[0])
85  f.close()
86  AOD_list = list(set(AOD_list))
87  ESD_list = list(set(ESD_list))
88  if len(ESD_list) == 1:
89  ESD_list = guessSecond(ESD_list)
90  if len(AOD_list) == 1:
91  AOD_list = guessSecond(AOD_list)
92 
93  if len(ESD_list) < 2:
94  print ("ERROR missing ESD file for diff-root comparison" )
95  else:
96  print ("INFO evaluate ESD diff-root")
97  diff_root(ESD_list, test, "ESD")
98 
99  if len(AOD_list) < 2:
100  print ("ERROR missing AOD file for diff-root comparison")
101  else:
102  print ("INFO evaluate AOD diff-root")
103  diff_root(AOD_list, test, "AOD")
104 
105 
106 

◆ guessSecond()

def python.runDiffRootOnChanged.guessSecond (   ESD_list)

Definition at line 57 of file runDiffRootOnChanged.py.

57 def guessSecond(ESD_list):
58  ref = ESD_list[0]
59  repl = "rel%s" %(ref.split("rel")[1].split("/")[0])
60  newversion = "rel_%i" %(int(repl.split("_")[1])+1)
61  filename = ref.replace(repl,newversion)
62  if os.path.isfile(filename):
63  ESD_list.append(filename)
64  return ESD_list
65 
66 """
67  extract path to pool files from diff-pool log
68  skip tests with failing tests
69  then execute diff_root for every pair
70 """

◆ read_diff_pool_log()

def python.runDiffRootOnChanged.read_diff_pool_log (   filename)

Definition at line 30 of file runDiffRootOnChanged.py.

30 def read_diff_pool_log(filename):
31  changed_tests = []
32  f = open(filename, 'r')
33  lines = f.readlines(); f.close()
34  for line in lines[-40:]:
35  if "CHANGED" in line:
36  changed_tests.append(line.split()[0])
37  return changed_tests
38 
39 
40 """
41  exectute diff-root command
42 """

◆ test_pool_files()

def python.runDiffRootOnChanged.test_pool_files (   logfile,
  tests 
)

Definition at line 107 of file runDiffRootOnChanged.py.

107 def test_pool_files(logfile, tests):
108  rels = ["rel_2","rel_3"]
109  for test in tests:
110  path = "/afs/cern.ch/atlas/project/RTT/prod/Results/tct/REL/20.1.X.Y-VAL/build/x86_64-slc6-gcc48-opt/offline/Tier0ChainTests/%s/" %(test)
111  AOD_list = []
112  ESD_list = []
113  print()
114  print()
115  print (test)
116  for rel in rels:
117  aod = path.replace("REL",rel)+"myAOD.pool.root"
118  esd = path.replace("REL",rel)+"myESD.pool.root"
119  if os.path.isfile(aod):
120  AOD_list.append(aod)
121  if os.path.isfile(esd):
122  ESD_list.append(esd)
123  AOD_list = list(set(AOD_list))
124  ESD_list = list(set(ESD_list))
125  if len(ESD_list) < 2:
126  print ("ERROR missing ESD file for diff-root comparison" )
127  else:
128  print ("INFO evaluate ESD diff-root")
129  diff_root(ESD_list, test, "ESD")
130 
131  if len(AOD_list) < 2:
132  print ("ERROR missing AOD file for diff-root comparison")
133  else:
134  print ("INFO evaluate AOD diff-root")
135  diff_root(AOD_list, test, "AOD")
136 
137 parser=OptionParser(usage="\n ./runDiffRootOnChanged.py --file <file name with full diff-pool log > \n")
138 parser.add_option("-f","--file" ,type="string" ,dest="filename" ,default="none" ,help="diff pool log file")
139 parser.add_option("-d","--dryRun", action="store_true" ,dest="dryrun" ,default=False ,help="only dumps commands on screen")
140 
141 
142 (options,args)=parser.parse_args()

Variable Documentation

◆ logfile

python.runDiffRootOnChanged.logfile

Definition at line 143 of file runDiffRootOnChanged.py.

◆ tests

python.runDiffRootOnChanged.tests

Definition at line 144 of file runDiffRootOnChanged.py.

python.runDiffRootOnChanged.test_pool_files
def test_pool_files(logfile, tests)
Definition: runDiffRootOnChanged.py:107
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.runDiffRootOnChanged.guessSecond
def guessSecond(ESD_list)
Definition: runDiffRootOnChanged.py:57
python.runDiffRootOnChanged.get_test_pool_files
def get_test_pool_files(logfile, tests)
Definition: runDiffRootOnChanged.py:71
python.runDiffRootOnChanged.diff_root
def diff_root(pool_list, test, ftype)
Definition: runDiffRootOnChanged.py:43
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
Trk::open
@ open
Definition: BinningType.h:40
python.runDiffRootOnChanged.read_diff_pool_log
def read_diff_pool_log(filename)
Definition: runDiffRootOnChanged.py:30
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
Trk::split
@ split
Definition: LayerMaterialProperties.h:38