ATLAS Offline Software
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 
15 MyArgs, otherPathenaArgs = GetCustomAthArgs()
16 
17 import subprocess
18 
19 trf = [ 'runIDTPM.py',
20  '--inputFileNames', '%IN',
21  '--outputFilePrefix', '%OUT.IDTPM.HIST.root' ]
22 trf.append( MyArgs.extraIDTPMOptions )
23 
24 
25 cmd = [ 'pathena',
26  '--inDS', MyArgs.inDS,
27  '--outDS', MyArgs.outDS,
28  '--trf', ' '.join(trf)
29  ] + otherPathenaArgs
30 
31 if 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 
44 print( "Running: "+(' '.join( cmd )) )
45 subprocess.run( cmd, check=True )
gridSubmitIDTPM.GetCustomAthArgs
def GetCustomAthArgs()
Definition: gridSubmitIDTPM.py:4
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:26
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10