ATLAS Offline Software
gridIDPVM.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 
4 import argparse
5 import subprocess
6 
7 def getArgs():
8  args= argparse.ArgumentParser()
9  args.add_argument('--inDS', required=True)
10  args.add_argument('--outDS', required=True)
11  args.add_argument('--nFiles', type=int)
12 
13  # We want to set these ones to %IN & %OUT...
14  args.add_argument('--filesInput')
15  args.add_argument('--outputFile')
16 
17  myArgs, otherArgs = args.parse_known_args()
18 
19  if myArgs.filesInput:
20  print("ERROR: only specify --inDS, not --filesInput!")
21  exit(1)
22 
23  if myArgs.outputFile:
24  print("ERROR: only specify --outDS, not --outputFile!")
25  exit(1)
26 
27  return myArgs, otherArgs
28 
29 
30 def main():
31 
32  args, otherArgs = getArgs()
33 
34  trf = [
35  'runIDPVM.py',
36  '--filesInput', '%IN',
37  '--outputFile', '%OUT.IDPVM.root',
38  ] + otherArgs
39  trf = ' '.join(trf)
40 
41  merge = 'mergeIDPVM.py --filesInput %IN --outputFile %OUT'
42 
43  cmd = [
44  'pathena',
45  '--inDS', args.inDS,
46  '--outDS', args.outDS,
47  '--trf', trf,
48  '--mergeOutput',
49  '--mergeScript', merge
50  ]
51 
52  if args.nFiles:
53  cmd += ['--nFiles', str(args.nFiles)]
54 
55  subprocess.run(cmd, check=True)
56 
57 
58 if __name__ == '__main__':
59  main()
gridIDPVM.main
def main()
Definition: gridIDPVM.py:30
calibdata.exit
exit
Definition: calibdata.py:236
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
gridIDPVM.getArgs
def getArgs()
Definition: gridIDPVM.py:7
str
Definition: BTagTrackIpAccessor.cxx:11