ATLAS Offline Software
Loading...
Searching...
No Matches
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
6import DataQualityUtils.DQHistogramMergeMod as mod
7import os
8import argparse
9
10
11os.environ['TDAQ_ERS_NO_SIGNAL_HANDLERS'] = '1'
12
13def fakebool(x):
14 return bool(eval(x))
15
16
17
18if __name__ == "__main__":
19 parser = argparse.ArgumentParser()
20 parser.add_argument('input_list_file_name', help='Text file containing input file list (one file per line)')
21 parser.add_argument('merged_file_name', help='Name of output merged ROOT file')
22 parser.add_argument('run_post_processing', nargs='?', type=fakebool, default=False, help='False/True/0/1 default=0')
23 parser.add_argument('is_incremental_merge', nargs='?', type=fakebool, default=False, help='False/True/0/1 default=0')
24 parser.add_argument('output_file_compression_level', nargs='?', type=int, default=1, help='see ROOT TFile doc. default=1')
25 parser.add_argument('debugLevel', nargs='?', type=int, default=0, help='integer default=0')
26 parser.add_argument('--excludeDir', help='Regex pattern for directories to exclude from merge')
27 parser.add_argument('--excludeHist', help='Regex pattern for histogram names to exclude from merge\n'
28 'Note that this is just the name - paths cannot be specified')
29 parser.add_argument('--doTiming',action = 'store_true', help="Print CPU timing per histogram")
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 doTiming=False
53 if args.doTiming:
54 doTiming=True
55
56 mod.DQHistogramMerge(args.input_list_file_name, args.merged_file_name,
57 runPostProcessing, isIncremental=isIncremental,
58 compressionLevel=compressionLevel, debugLevel=debugLevel,
59 doTiming=doTiming,
60 directoryRegularExpression=directoryRegularExpression,
61 histogramRegularExpression=histogramRegularExpression)
void print(char *figname, TCanvas *c1)