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 
31  args = parser.parse_args()
32  print(args)
33 
34  runPostProcessing = args.run_post_processing
35 
36  isIncremental = args.is_incremental_merge
37 
38  compressionLevel = args.output_file_compression_level
39 
40  debugLevel = args.debugLevel
41 
42  if args.excludeDir:
43  directoryRegularExpression = f'^((?!{args.excludeDir}).)*$'
44  else:
45  directoryRegularExpression = '.*'
46 
47  if args.excludeHist:
48  histogramRegularExpression = f'^((?!{args.excludeHist}).)*$'
49  else:
50  histogramRegularExpression = '.*'
51 
52  mod.DQHistogramMerge(args.input_list_file_name, args.merged_file_name,
53  runPostProcessing, isIncremental=isIncremental,
54  compressionLevel=compressionLevel, debugLevel=debugLevel,
55  directoryRegularExpression=directoryRegularExpression,
56  histogramRegularExpression=histogramRegularExpression)
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
DQHistogramMerge.fakebool
fakebool
Definition: DQHistogramMerge.py:23
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60