-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_python.py
More file actions
62 lines (45 loc) · 1.47 KB
/
run_python.py
File metadata and controls
62 lines (45 loc) · 1.47 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import sys
import os
file_list = sys.argv[1]
run = file_list.split('_')[0]
print("run", run)
#outdir = "/pnfs/sbnd/scratch/users/aantonak/PMTAna/"
#outdir = "/pnfs/sbnd/scratch/users/aantonak/PMTAnaTrig/"
outdir = "/pnfs/sbnd/scratch/users/aantonak/PMTAnaOffBeam/"
count = 0
with open(file_list, 'r') as file:
# loop through each file in the file list
for line in file:
new_line = line.strip()
#print(new_line)
output = outdir + "pmt_file"+str(count)+"_"+run+".root"
count += 1
#print(output)
os.system("lar -c run_WaveformScraper.fcl -s "+new_line + " -T "+output)
"""
with open(daq_dir+test_file, 'r') as file:
# Loop through each line in the file
for line in file:
# Strip the newline character and split the line by whitespace
temp_line = line.strip().split()
if len(temp_line) > 0:
if temp_line[0] == "[":
#print(temp_line)
i = temp_line.index('170,')
new_line = temp_line
new_line[i] = "180,"
#new_lines.append(new_line)
final_line = ""
for w in new_line:
final_line += w
final_line += " "
final_line += "\n"
new_lines.append(final_line)
else:
new_lines.append(line)
else:
new_lines.append(line)
#words = line.strip().split()
# Print the list of words
print(line)
"""