ATLAS Offline Software
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 
7 import argparse
8 import os
9 from AthenaCommon.Logging import logging
10 mainLogger = logging.getLogger( 'RunTrigEgammaMonitoringOnGrid' )
11 
12 
13 
14 parser = argparse.ArgumentParser(description = '', add_help = False)
15 parser = argparse.ArgumentParser()
16 
17 
18 #
19 # prun configuration
20 #
21 
22 parser.add_argument('--inDS', action='store', dest='inDS', required = True, type=str, help = "Input dataset.")
23 parser.add_argument('--outDS', action='store', dest='outDS', required = True, type=str, help = "Output dataset.")
24 
25 parser.add_argument('--dry_run', action='store_true', dest='dry_run', required = False, default = False,
26  help = "Do not launch if this is True.")
27 
28 parser.add_argument('--nFilesPerJob', action='store', dest='nFilesPerJob', required = False, type=int, default=1,
29  help = "Number of files per job in grid mode.")
30 
31 parser.add_argument('--job', action='store', dest='job', required = False, type=str, default='RunTrigEgammaMonitoring.py',
32  help = "Job name")
33 
34 parser.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 
41 parser.add_argument('--preExec', help='Code to execute before locking configs', default=None)
42 parser.add_argument('--postExec', help='Code to execute after setup', default=None)
43 parser.add_argument('--emulate', help='emulate the HLT e/g sequence', action='store_true')
44 
45 parser.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.")
48 parser.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.")
51 parser.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 
56 import sys,os
57 if len(sys.argv)==1:
58  parser.print_help()
59  sys.exit(1)
60 
61 
62 args = parser.parse_args()
63 
64 execute = "{JOB} -i '%IN'".format(JOB=args.job)
65 if 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 
71 if args.preExec:
72  execute+= ' --preExec '+args.preExec
73 if args.postExec:
74  execute+= ' --postExec '+ args.postExec
75 
76 
77 
78 command = """ 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 
90 command = command.format(
91  INDS = args.inDS,
92  OUTDS = args.outDS,
93  COMMAND = execute,
94  N_FILES_PER_JOB = args.nFilesPerJob,
95  )
96 
97 
98 if args.dry_run:
99  print(command)
100 else:
101  print(command)
102  os.system(command)
103 
104 
105 
106 
107 
108 
109 
110 
111 
vtune_athena.format
format
Definition: vtune_athena.py:14
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25