-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdriver.py
More file actions
33 lines (25 loc) · 1.02 KB
/
Copy pathdriver.py
File metadata and controls
33 lines (25 loc) · 1.02 KB
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
import os, sys
from datetime import date
today=str(date.today())
version ='1'
#This python script is used to run the main C script from outside the root environment.
#This makes plots for all histograms.
histdict={
'3L_onZ_HTlep':{'channel':'3L_onZ', 'plot':'HTlep', 'name':'HTlep (3L, onZ)'},
}
for hist, value in histdict.items():
channelname = value['channel']
plotname = value['plot']
plottitle = value['name']
#Managing the output:
ofname = channelname+'_'+plotname+'_'+today+'_version'+version+'.png'
outdir = 'outputs/'+today+'_version'+version+'/'
make_outdir = 'mkdir -p '+outdir
os.system(make_outdir)
ofname = outdir+ofname #This is the full path to the output png file
#Calling ROOT and executing the C script:
arguments=f'"{channelname}", "{plotname}", "{plottitle}","{ofname}"'
processline = f"root -l -b -q 'make_overlay.C({arguments})'"
#print(processline)
os.system(processline)
print(f'\nAll plots are dumped in the following folder : {outdir}')