-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathSymLinkSetup_iFarm.sh
executable file
·400 lines (388 loc) · 17.2 KB
/
SymLinkSetup_iFarm.sh
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
#!/bin/bash
# 24/02/21 - Stephen JD Kay - University of Regina
# This script sets up the relevant sim links for running your replay scripts
# It makes the relevant directories in /volatile if they do not exist
echo "Beginning setup of folders and symlinks"
# Set path depending upon hostname. Change or add more as needed
if [[ "${HOSTNAME}" = *"farm"* ]]; then
GROUPPATH="/group/c-pionlt"
USERPATH="${GROUPPATH}/USERS/${USER}"
VOLATILEPATH="/volatile/hallc/c-pionlt"
cd "${USERPATH}/hallc_replay_lt"
else echo "Host not recognised, please add relevant pathing for hostname to the script and re-run"
fi
# Set up the hcana sym link and execute setup for this
if [ ! -L "${USERPATH}/hallc_replay_lt/hcana" ]; then
ln -s "${GROUPPATH}/hcana/hcana" "${USERPATH}/hallc_replay_lt/hcana"
elif [ -L "${USERPATH}/hallc_replay_lt/hcana" ]; then
if [ ! -e "${USERPATH}/hallc_replay_lt/hcana" ]; then
echo "hcana sym link exists but is broken, replacing"
rm "${USERPATH}/hallc_replay_lt/hcana"
ln -s "${GROUPPATH}/hcana/hcana" "${USERPATH}/hallc_replay_lt/hcana"
else read -p "hcana sym link exists and isn't broken, update it anyway? <Y/N> " prompt
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]; then
rm "${USERPATH}/hallc_replay_lt/hcana"
ln -s "${GROUPPATH}/hcana/hcana" "${USERPATH}/hallc_replay_lt/hcana"
fi
fi
fi
# Next, need to make a load of directories, check they exist, if not, make em!
if [ ! -d "${VOLATILEPATH}/${USER}" ]; then
mkdir "${VOLATILEPATH}/${USER}"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAM" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS"
fi
# Now, check if subdirectories exist for ROOTfiles, if not, make them
# Analysis subdirectories
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/HeeP" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/HeeP"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/Lumi" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/Lumi"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/PionLT" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/PionLT"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/PID" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/PID"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/Optics" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/Optics"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/General" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Analysis/General"
fi
# Calib sub directories
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Calib" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Calib"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/Hodo" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/Hodo"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/DC" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/DC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/Cal" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/Cal"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/HGC" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/HGC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/Aero" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/Aero"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/NGC" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/NGC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/General" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/General"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/Timing" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Calib/Timing"
fi
# Scalers ROOTfiles directory
if [ ! -d "${VOLATILEPATH}/${USER}/ROOTfiles/Scalers" ]; then
mkdir "${VOLATILEPATH}/${USER}/ROOTfiles/Scalers"
fi
# Now, check if subdirectories exist for OUTPUT, if not, make them
# Analysis subdirectories
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Analysis" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Analysis"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/HeeP" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/HeeP"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/Lumi" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/Lumi"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/PionLT" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/PionLT"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/PID" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/PID"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/Optics" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/Optics"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/General" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Analysis/General"
fi
# Calib sub directories
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Calib" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Calib"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Calib/Hodo" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Calib/Hodo"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Calib/DC" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Calib/DC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Calib/Cal" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Calib/Cal"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Calib/HGC" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Calib/HGC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Calib/Aero" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Calib/Aero"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Calib/NGC" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Calib/NGC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Calib/General" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Calib/General"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Calib/Timing" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Calib/Timing"
fi
# Scalers OUTPUT directory
if [ ! -d "${VOLATILEPATH}/${USER}/OUTPUT/Scalers" ]; then
mkdir "${VOLATILEPATH}/${USER}/OUTPUT/Scalers"
fi
# Now, check if subdirectories exist for REPORT_OUTPUT, if not, make them
# Analysis subdirectories
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/HeeP" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/HeeP"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/Lumi" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/Lumi"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/PionLT" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/PionLT"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/PID" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/PID"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/Optics" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/Optics"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/General" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Analysis/General"
fi
# Calib sub directories
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/Hodo" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/Hodo"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/DC" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/DC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/Cal" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/Cal"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/HGC" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/HGC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/Aero" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/Aero"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/NGC" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/NGC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/General" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/General"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/Timing" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Calib/Timing"
fi
# Scalers REPORT_OUTPUT directory
if [ ! -d "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Scalers" ]; then
mkdir "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/Scalers"
fi
# Now, check if subdirectories exist for HISTOGRAMS, if not, make them
# Analysis subdirectories
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/HeeP" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/HeeP"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/Lumi" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/Lumi"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/PionLT" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/PionLT"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/PID" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/PID"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/Optics" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/Optics"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/General" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Analysis/General"
fi
# Calib sub directories
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/Hodo" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/Hodo"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/DC" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/DC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/Cal" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/Cal"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/HGC" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/HGC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/Aero" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/Aero"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/NGC" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/NGC"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/General" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/General"
fi
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/Timing" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Calib/Timing"
fi
# Scalers HISTOGRAMS directory
if [ ! -d "${VOLATILEPATH}/${USER}/HISTOGRAMS/Scalers" ]; then
mkdir "${VOLATILEPATH}/${USER}/HISTOGRAMS/Scalers"
fi
# Make a raw data directory on volatile
if [ ! -d "${VOLATILEPATH}/${USER}/raw" ]; then
mkdir "${VOLATILEPATH}/${USER}/raw"
fi
# Directories now created, make the sym links
echo "Directories have been created in volatile if they did not already exists, sym links will now be made for - "
echo ""
echo "${VOLATILEPATH}/${USER}/ROOTfiles/ - ROOTfiles"
echo "${VOLATILEPATH}/${USER}/OUTPUT/ - OUTPUT"
echo "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/ - REPORT_OUTPUT"
echo "${VOLATILEPATH}/${USER}/HISTOGRAMS/ - HISTOGRAMS"
echo "/cache/hallc/spring17/raw - raw"
echo "/cache/hallc/spring17/raw - cache"
echo "/cache/hallc/spring17/raw - raw_KaonLT"
echo "/cache/hallc/c-pionlt/raw - raw_PionLT"
echo "${VOLATILEPATH}/${USER}/raw - raw_volatile"
echo""
read -p "Proceed with sym link setup setup? <Y/N> " prompt2
if [[ $prompt2 == "y" || $prompt2 == "Y" || $prompt2 == "yes" || $prompt2 == "Yes" ]]; then
echo "Creating sym links"
else
echo "Please update script with desired changes to sym links and re-run if desired"
exit 1
fi
# Each loop checks if the link exists, if it doesn't, make it
# If it DOES, check it's not broken, if broken, replace, if not, just print that it exists
if [ ! -L "${USERPATH}/hallc_replay_lt/ROOTfiles" ]; then
ln -s "${VOLATILEPATH}/${USER}/ROOTfiles/" "${USERPATH}/hallc_replay_lt/ROOTfiles"
elif [ -L "${USERPATH}/hallc_replay_lt/ROOTfiles" ]; then
if [ ! -e "${USERPATH}/hallc_replay_lt/ROOTfiles" ]; then
echo "ROOTfiles sym link exits but is broken, replacing"
rm "${USERPATH}/hallc_replay_lt/ROOTfiles"
ln -s "${VOLATILEPATH}/${USER}/ROOTfiles/" "${USERPATH}/hallc_replay_lt/ROOTfiles"
else echo "${USERPATH}/hallc_replay_lt/ROOTfiles sym link already exists and not broken"
fi
fi
if [ ! -L "${USERPATH}/hallc_replay_lt/OUTPUT" ]; then
ln -s "${VOLATILEPATH}/${USER}/OUTPUT/" "${USERPATH}/hallc_replay_lt/OUTPUT"
elif [ -L "${USERPATH}/hallc_replay_lt/OUTPUT" ]; then
if [ ! -e "${USERPATH}/hallc_replay_lt/OUTPUT" ]; then
echo "OUTPUT sym link exits but is broken, replacing"
rm "${USERPATH}/hallc_replay_lt/OUTPUT"
ln -s "${VOLATILEPATH}/${USER}/OUTPUT/" "${USERPATH}/hallc_replay_lt/OUTPUT"
else echo "${USERPATH}/hallc_replay_lt/OUTPUT sym link already exists and not broken"
fi
fi
if [ ! -L "${USERPATH}/hallc_replay_lt/REPORT_OUTPUT" ]; then
ln -s "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/" "${USERPATH}/hallc_replay_lt/REPORT_OUTPUT"
elif [ -L "${USERPATH}/hallc_replay_lt/REPORT_OUTPUT" ]; then
if [ ! -e "${USERPATH}/hallc_replay_lt/REPORT_OUTPUT" ]; then
echo "REPORT_OUTPUT sym link exits but is broken, replacing"
rm "${USERPATH}/hallc_replay_lt/REPORT_OUTPUT"
ln -s "${VOLATILEPATH}/${USER}/REPORT_OUTPUT/" "${USERPATH}/hallc_replay_lt/REPORT_OUTPUT"
else echo "${USERPATH}/hallc_replay_lt/REPORT_OUTPUT sym link already exists and not broken"
fi
fi
if [ ! -L "${USERPATH}/hallc_replay_lt/HISTOGRAMS" ]; then
ln -s "${VOLATILEPATH}/${USER}/HISTOGRAMS/" "${USERPATH}/hallc_replay_lt/HISTOGRAMS"
elif [ -L "${USERPATH}/hallc_replay_lt/HISTOGRAMS" ]; then
if [ ! -e "${USERPATH}/hallc_replay_lt/HISTOGRAMS" ]; then
echo "HISTOGRAMS sym link exits but is broken, replacing"
rm "${USERPATH}/hallc_replay_lt/HISTOGRAMS"
ln -s "${VOLATILEPATH}/${USER}/HISTOGRAMS/" "${USERPATH}/hallc_replay_lt/HISTOGRAMS"
else echo "${USERPATH}/hallc_replay_lt/HISTOGRAMS sym link already exists and not broken"
fi
fi
if [ ! -L "${USERPATH}/hallc_replay_lt/raw_volatile" ]; then
ln -s "${VOLATILEPATH}/${USER}/raw" "${USERPATH}/hallc_replay_lt/raw_volatile"
elif [ -L "${USERPATH}/hallc_replay_lt/raw_volatile" ]; then
if [ ! -e "${USERPATH}/hallc_replay_lt/raw_volatile" ]; then
echo "raw_volatile sym link exits but is broken, replacing"
rm "${USERPATH}/hallc_replay_lt/raw_volatile"
ln -s "${VOLATILEPATH}/${USER}/raw" "${USERPATH}/hallc_replay_lt/raw_volatile"
else echo "${USERPATH}/hallc_replay_lt/raw_volatile sym link already exists and not broken"
fi
fi
if [ ! -L "${USERPATH}/hallc_replay_lt/raw" ]; then
ln -s "/cache/hallc/spring17/raw" "${USERPATH}/hallc_replay_lt/raw"
elif [ -L "${USERPATH}/hallc_replay_lt/raw" ]; then
if [ ! -e "${USERPATH}/hallc_replay_lt/raw" ]; then
echo "raw sym link exits but is broken, replacing"
rm "${USERPATH}/hallc_replay_lt/raw"
ln -s "/cache/hallc/spring17/raw" "${USERPATH}/hallc_replay_lt/raw"
else echo "${USERPATH}/hallc_replay_lt/raw sym link already exists and not broken"
fi
fi
# SJDK 28/02/22 - Make a sym link specifically for the PionLT raw data
if [ ! -L "${USERPATH}/hallc_replay_lt/raw_PionLT" ]; then
ln -s "/cache/hallc/c-pionlt/raw" "${USERPATH}/hallc_replay_lt/raw_PionLT"
elif [ -L "${USERPATH}/hallc_replay_lt/raw_PionLT" ]; then
if [ ! -e "${USERPATH}/hallc_replay_lt/raw_PionLT" ]; then
echo "raw_PionLT sym link exits but is broken, replacing"
rm "${USERPATH}/hallc_replay_lt/raw_PionLT"
ln -s "/cache/hallc/c-pionlt/raw" "${USERPATH}/hallc_replay_lt/raw_PionLT"
else echo "${USERPATH}/hallc_replay_lt/raw_PionLT sym link already exists and not broken"
fi
fi
# SJDK 28/02/22 - Make a sym link specifically for the KaonLT raw data
if [ ! -L "${USERPATH}/hallc_replay_lt/raw_KaonLT" ]; then
ln -s "/cache/hallc/spring17/raw" "${USERPATH}/hallc_replay_lt/raw_KaonLT"
elif [ -L "${USERPATH}/hallc_replay_lt/raw_KaonLT" ]; then
if [ ! -e "${USERPATH}/hallc_replay_lt/raw_KaonLT" ]; then
echo "raw_KaonLT sym link exits but is broken, replacing"
rm "${USERPATH}/hallc_replay_lt/raw_KaonLT"
ln -s "/cache/hallc/spring17/raw" "${USERPATH}/hallc_replay_lt/raw_KaonLT"
else echo "${USERPATH}/hallc_replay_lt/raw_KaonLT sym link already exists and not broken"
fi
fi
if [ ! -L "${USERPATH}/hallc_replay_lt/cache" ]; then
ln -s "/cache/hallc/spring17/raw" "${USERPATH}/hallc_replay_lt/cache"
elif [ -L "${USERPATH}/hallc_replay_lt/cache" ]; then
if [ ! -e "${USERPATH}/hallc_replay_lt/cache" ]; then
echo "cache sym link exits but is broken, replacing"
rm "${USERPATH}/hallc_replay_lt/cache"
ln -s "/cache/hallc/spring17/raw" "${USERPATH}/hallc_replay_lt/cache"
else echo "${USERPATH}/hallc_replay_lt/cache sym link already exists and not broken"
fi
fi
echo ""
echo "Directories and sym links for hallc_replay_lt now setup"
echo "Setting up hcana path too"
# Set hcana with setup script
exec "${GROUPPATH}/hcana/setup.csh"
exit 0