ATLAS Offline Software
DQHistogramMerge.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4 
5 from __future__ import print_function
6 
7 import DataQualityUtils.DQHistogramMergeMod as mod
8 import os
9 import argparse
10 
11 
12 os.environ['TDAQ_ERS_NO_SIGNAL_HANDLERS'] = '1'
13 
14 def fakebool(x):
15  return bool(eval(x))
16 
17 
18 
19 if __name__ == "__main__":
20  parser = argparse.ArgumentParser()
21  parser.add_argument('input_list_file_name', help='Text file containing input file list (one file per line)')
22  parser.add_argument('merged_file_name', help='Name of output merged ROOT file')
23  parser.add_argument('run_post_processing', nargs='?', type=fakebool, default=False, help='False/True/0/1 default=0')
24  parser.add_argument('is_incremental_merge', nargs='?', type=fakebool, default=False, help='False/True/0/1 default=0')
25  parser.add_argument('output_file_compression_level', nargs='?', type=int, default=1, help='see ROOT TFile doc. default=1')
26  parser.add_argument('debugLevel', nargs='?', type=int, default=0, help='integer default=0')
27  parser.add_argument('--excludeDir', help='Regex pattern for directories to exclude from merge')
28  parser.add_argument('--excludeHist', help='Regex pattern for histogram names to exclude from merge\n'
29  'Note that this is just the name - paths cannot be specified')
30  parser.add_argument('--doTiming',action = 'store_true', help="Print CPU timing per histogram")
31 
32  args = parser.parse_args()
33  print(args)
34 
35  runPostProcessing = args.run_post_processing
36 
37  isIncremental = args.is_incremental_merge
38 
39  compressionLevel = args.output_file_compression_level
40 
41  debugLevel = args.debugLevel
42 
43  if args.excludeDir:
44  directoryRegularExpression = f'^((?!{args.excludeDir}).)*$'
45  else:
46  directoryRegularExpression = '.*'
47 
48  if args.excludeHist:
49  histogramRegularExpression = f'^((?!{args.excludeHist}).)*$'
50  else:
51  histogramRegularExpression = '.*'
52 
53  doTiming=False
54  if args.doTiming:
55  doTiming=True
56 
57  mod.DQHistogramMerge(args.input_list_file_name, args.merged_file_name,
58  runPostProcessing, isIncremental=isIncremental,
59  compressionLevel=compressionLevel, debugLevel=debugLevel,
60  doTiming=doTiming,
61  directoryRegularExpression=directoryRegularExpression,
62  histogramRegularExpression=histogramRegularExpression)
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
DQHistogramMerge.fakebool
fakebool
Definition: DQHistogramMerge.py:23
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60