ATLAS Offline Software
Loading...
Searching...
No Matches
RunTrigEgammaMonitoringOnGrid.py
Go to the documentation of this file.
1#!/usr/bin/env python
2#
3# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4#
5
6
7import argparse
8import os
9from AthenaCommon.Logging import logging
10mainLogger = logging.getLogger( 'RunTrigEgammaMonitoringOnGrid' )
11
12
13
14parser = argparse.ArgumentParser(description = '', add_help = False)
15parser = argparse.ArgumentParser()
16
17
18#
19# prun configuration
20#
21
22parser.add_argument('--inDS', action='store', dest='inDS', required = True, type=str, help = "Input dataset.")
23parser.add_argument('--outDS', action='store', dest='outDS', required = True, type=str, help = "Output dataset.")
24
25parser.add_argument('--dry_run', action='store_true', dest='dry_run', required = False, default = False,
26 help = "Do not launch if this is True.")
27
28parser.add_argument('--nFilesPerJob', action='store', dest='nFilesPerJob', required = False, type=int, default=1,
29 help = "Number of files per job in grid mode.")
30
31parser.add_argument('--job', action='store', dest='job', required = False, type=str, default='RunTrigEgammaMonitoring.py',
32 help = "Job name")
33
34parser.add_argument('-a', '--asetup', action='store', dest='asetup', required = False, type=str, default='asetup Athena,master,latest,here',
35 help = "asetup release")
36
37#
38# Job Command
39#
40
41parser.add_argument('--preExec', help='Code to execute before locking configs', default=None)
42parser.add_argument('--postExec', help='Code to execute after setup', default=None)
43parser.add_argument('--emulate', help='emulate the HLT e/g sequence', action='store_true')
44
45parser.add_argument('--pidConfigPath', action='store', required = False,
46 type=str, default='ElectronPhotonSelectorTools/trigger/rel22_20210611',
47 help = "Electron Likelihood and Photon CB config path to use in emulated precision step.")
48parser.add_argument('--dnnConfigPath', action='store', required = False,
49 type=str, default='ElectronPhotonSelectorTools/offline/mc16_20210430',
50 help = "Electron DNN config path to use in emulated precision step.")
51parser.add_argument('--ringerConfigPath', action='store', required = False,
52 type=str, default='RingerSelectorTools/TrigL2_20210702_r4',
53 help = "Electron ringer config path to use in emulated fast calo step.")
54
55
56import sys,os
57if len(sys.argv)==1:
58 parser.print_help()
59 sys.exit(1)
60
61
62args = parser.parse_args()
63
64execute = "{JOB} -i '%IN'".format(JOB=args.job)
65if args.emulate:
66 execute+= ' --emulate'
67 execute+= " --pidConfigPath '{PATH}'".format(PATH=args.pidConfigPath)
68 execute+= " --dnnConfigPath '{PATH}'".format(PATH=args.dnnConfigPath)
69 execute+= " --ringerConfigPath '{PATH}'".format(PATH=args.ringerConfigPath)
70
71if args.preExec:
72 execute+= ' --preExec '+args.preExec
73if args.postExec:
74 execute+= ' --postExec '+ args.postExec
75
76
77
78command = """ prun --exec \
79 "{COMMAND};" \
80 --noBuild \
81 --inDS={INDS} \
82 --outDS={OUTDS} \
83 --disableAutoRetry \
84 --outputs="*.root" \
85 --nFilesPerJob={N_FILES_PER_JOB} \
86 --mergeOutput \
87 --useAthenaPackage \
88 """
89
90command = command.format(
91 INDS = args.inDS,
92 OUTDS = args.outDS,
93 COMMAND = execute,
94 N_FILES_PER_JOB = args.nFilesPerJob,
95 )
96
97
98if args.dry_run:
99 print(command)
100else:
101 print(command)
102 os.system(command)
103
104
105
106
107
108
109
110
111
void print(char *figname, TCanvas *c1)