-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathRunPSO.py
More file actions
35 lines (30 loc) · 820 Bytes
/
RunPSO.py
File metadata and controls
35 lines (30 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
from PSO.PSOManager import PSOManager
import sys
from subprocess import call
if len(sys.argv)<2:
print "usage:"
print "python PSO.py [OPTION] FILE_WITH_PSO_CONFIG"
print "[-t] skip tree creating step, for example if you already did it for a previous run"
print "[-v] print additional debug information"
exit(0)
currentPath = sys.path[0]+"/"
MakeNewTrees=True
Verbose=False
PSOConfig=""
for arg in sys.argv[1:]:
if "-t" in arg:
MakeNewTrees=False
if "-v" in arg:
Verbose=True
else:
PSOConfig=arg
if MakeNewTrees==True:
command="PSO/PrepareTrees.C+(\""+PSOConfig+"\")"
call(["root","-b","-q",command])
PSO=PSOManager(currentPath,Verbose, PSOConfig)
PSO.CompileAndSetupClientExecutable()
PSO.SetupParticles()
PSO.InitParticles()
PSO.RunPSO()
PSO.PrintResult()