ATLAS Offline Software
Loading...
Searching...
No Matches
gridSubmitIDTPM.py
Go to the documentation of this file.
1#!/usr/bin/env python
2# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
5 from argparse import ArgumentParser
6 myparser = ArgumentParser( description='Parser for IDTPM merger' )
7 myparser.add_argument( "-i", "--inDS", help="Input dataset", required=True )
8 myparser.add_argument( "-o", "--outDS", help="Output dataset", required=True )
9 myparser.add_argument( "-e", "--extraIDTPMOptions", help="other flags for runIDTPM.py, besides --inputFileNames and --outputFilePrefix", default='' )
10 myparser.add_argument( "-m", "--merge", help="Merge output HIST files", action="store_true", default=False )
11 myparser.add_argument( "-me", "--mergeExtraOptions", help="other flags for mergeIDTPM.py, besides -i and -o", default='' )
12 return myparser.parse_known_args()
13
14
15MyArgs, otherPathenaArgs = GetCustomAthArgs()
16
17import subprocess
18
19trf = [ 'runIDTPM.py',
20 '--inputFileNames', '%IN',
21 '--outputFilePrefix', '%OUT.IDTPM.HIST.root' ]
22trf.append( MyArgs.extraIDTPMOptions )
23
24
25cmd = [ 'pathena',
26 '--inDS', MyArgs.inDS,
27 '--outDS', MyArgs.outDS,
28 '--trf', ' '.join(trf)
29 ] + otherPathenaArgs
30
31if MyArgs.merge :
32
33 mergeCmd = [ 'mergeIDTPM.py',
34 '-i', '%IN',
35 '-o', '%OUT'
36 ]
37 mergeCmd.append( MyArgs.mergeExtraOptions )
38
39 cmd += [ '--mergeOutput',
40 '--mergeScript', ' '.join( mergeCmd )
41 ]
42
43
44print( "Running: "+(' '.join( cmd )) )
45subprocess.run( cmd, check=True )
void print(char *figname, TCanvas *c1)