Skip to content

Commit c342ddd

Browse files
authored
Merge pull request #4 from LSexton2396/cobraa2
Cobraa2
2 parents a1b41bc + 7a5e819 commit c342ddd

6 files changed

Lines changed: 307 additions & 197 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
env_wm.*
1+
env_cobraa.*
22
*.txt
33
*.pyc
44
*.root
@@ -9,3 +9,4 @@ fred_root_files*
99
log_*
1010
*.C
1111
*.png
12+
testjob.mac

cobraa.py

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111

1212
if __name__ == '__main__':
1313

14-
print(docstring)
14+
#fix path for directory generation
15+
path=os.environ['COBRAAENV']
16+
os.chdir(path)
17+
18+
#print(docstring)
1519
if arguments['-v']:
1620
print(arguments)
1721
# print defaultValues
@@ -38,16 +42,21 @@
3842
if arguments['--backgrounds']:
3943
backgrounds()
4044

41-
print('''All done.
45+
if arguments['--reset']:
46+
reset()
47+
48+
print("\n All done")
49+
50+
#print('''All done.
4251

43-
You can submit multiple jobs with a single command line 'for i in `ls job/job*.sh`; do bsub $i; done')
52+
#You can submit multiple jobs with a single command line 'for i in `ls job/job*.sh`; do bsub $i; done')
4453

45-
You can use the stand-along version of bonsai (bonsai2) by copying a like.bin to the base folder and doing the following steps:
46-
>bsub
47-
>source /p/gpfs1/adg/wmutils/env.sh
48-
>for i in `ls root_files_*/*/*`; do bonsai2 $i bonsai_$i 3000 800 -500 1000 1;done
49-
>Ctrl-D
50-
which will work on lassen. (Option should be 'do bonsai2 $i bonsai_$i 3000 800 -500 1000 0' for wbls.)
51-
''')
54+
#You can use the stand-along version of bonsai (bonsai2) by copying a like.bin to the base folder and doing the following steps:
55+
#>bsub
56+
#>source /p/gpfs1/adg/wmutils/env.sh
57+
#>for i in `ls root_files_*/*/*`; do bonsai2 $i bonsai_$i 3000 800 -500 1000 1;done
58+
#>Ctrl-D
59+
#which will work on lassen. (Option should be 'do bonsai2 $i bonsai_$i 3000 800 -500 1000 0' for wbls.)
60+
#''')
5261

5362
######################## End of main function ###########################

cobraa/globals.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ def drange(start, stop, step):
2929
nruns = int(arguments['-N'])
3030
nsetSingles = 200
3131
detectorStr = f"{arguments['--geofile']}"
32+
experimentStr = f"{arguments['--expname']}"
33+
if (arguments['--bonsai']):
34+
filetype="reconstructed"
35+
else:
36+
filetype="raw"
3237

3338
# Reactor on/off ratio based on typical AGR-1 schedule
3439
RonOff = (4*2)/52.
@@ -81,20 +86,24 @@ def testEnabledCondition(arguments):
8186
additionalMacOpt = ""
8287

8388
# file naming
84-
additionalString += "_%s"%(arguments['--geofile'])
89+
additionalString += "_%s"%(arguments['--expname'])
8590

8691
if (arguments['--lightSimWater']):
8792
additionalString += "_lightSimWater"
8893

8994
if (arguments['--lightSimWbLS']):
9095
additionalString += "_lightSimWbLS"
96+
arguments['--detectMedia']="WBLS"
97+
98+
if arguments['--singles']:
99+
additionalString += "_singles"
91100

92101
# additional macro commands
93-
if (arguments['--detectMedia']):
102+
if (arguments['--detectMedia']): #This does not work for lightSimWbLS unless detectMedia is changed
94103
additionalMacOpt +="/rat/db/set GEO[detector_veto1] material \"%s\"\n"%(arguments['--detectMedia'])
95104
additionalMacOpt += "/rat/db/set GEO[detector_target_gb] material \"%s\"\n"%(arguments['--detectMedia'])
96105
additionalMacOpt += "/rat/db/set GEO[detector_target_fv] material \"%s\"\n"%(arguments['--detectMedia'])
97-
additionalString += "_detectorMedia_%s" %(arguments['--detectMedia'])
106+
additionalString += "_%s" %(arguments['--detectMedia'])
98107

99108
if (arguments['--collectionEff']):
100109
additionalMacOpt += "/rat/db/set GEO[inner_pmts] efficiency_correction %f\n" %(float(arguments['--collectionEff']))

0 commit comments

Comments
 (0)