-
Notifications
You must be signed in to change notification settings - Fork 53
/
GetToolDAQ.sh
689 lines (599 loc) · 13.2 KB
/
GetToolDAQ.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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
#!/bin/bash
# rpms prerequisits needs root
#yum install make gcc-c++ gcc binutils libX11-devel libXpm-devel libXft-devel libXext-devel git bzip2-devel python-devel
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
init=1
tooldaq=1
rootflag=0
root6flag=1
boostflag=1
zmq=1
final=1
MrdTrackLib=1
WCSimlib=1
Python=0
Python3=1
Pythia=1
Clhep=1
Lhapdf=1
Genie=1
RATEventlib=1
PlotWaveforms=0
fnalflag=0
while [ ! $# -eq 0 ]
do
case "$1" in
--help | -h)
helpmenu
exit
;;
--no_root | -r)
echo "Installing ToolDAQ without root"
rootflag=0
;;
--no_boost | -b)
echo "Installing ToolDAQ without boost"
boostflag=0
;;
--FNAL | -f)
echo "Installing ToolDAQ for FNAL"
boostflag=0
rootflag=0
fnalflag=1
Python=0
cp Makefile.FNAL Makefile
;;
--no_init )
echo "Installing ToolDAQ without creating ToolDAQ Folder"
init=0;
;;
--no_zmq )
echo "Installing ToolDAQ without zmq"
zmq=0
;;
--no_tooldaq )
echo "Installing dependancies without ToolDAQ"
tooldaq=0
;;
--no_final )
echo "Installing ToolDAQ without compiling ToolAnalysis"
final=0
;;
--ToolDAQ_ZMQ )
echo "Installing ToolDAQ & ZMQ"
rootflag=0
boostflag=0
final=0
MrdTrackLib=0
WCSimlib=0
root6flag=0
Python=0
Python3=0
Pythia=0
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=0
;;
--Boost )
echo "Installing Boost"
init=0
tooldaq=0
rootflag=0
zmq=0
final=0
MrdTrackLib=0
WCSimlib=0
root6flag=0
Python=0
Python3=0
Pythia=0
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=0
;;
--Root )
echo "Installing ToolDAQ"
init=0
tooldaq=0
boostflag=0
zmq=0
final=0
root6flag=0
MrdTrackLib=0
WCSimlib=0
Python=0
Python3=0
Pythia=0
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=0
;;
--Root6 )
echo "Installing ToolDAQ"
init=0
tooldaq=0
boostflag=0
zmq=0
final=0
MrdTrackLib=0
WCSimlib=0
rootflag=0
root6flag=1
Python=0
Python3=0
Pythia=0
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=0
;;
--WCSim )
echo "Installing WCSim libs"
init=0
tooldaq=0
rootflag=0
root6flag=0
boostflag=0
zmq=0
final=0
MrdTrackLib=0
WCSimlib=1
Python=0
Python3=0
Pythia=0
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=0
;;
--MrdTrackLib )
echo "Installing MRDTrackLib"
init=0
tooldaq=0
rootflag=0
root6flag=0
boostflag=0
zmq=0
final=0
MrdTrackLib=1
WCSimlib=0
Python=0
Python3=0
Pythia=0
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=0
;;
--Python )
echo "Compiling ToolDAQ"
init=0
tooldaq=0
rootflag=0
root6flag=0
boostflag=0
zmq=0
MrdTrackLib=0
WCSimlib=0
final=0
Python=1
Python3=0
Pythia=0
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=0
;;
--Python3 )
echo "Compiling ToolDAQ"
init=0
tooldaq=0
rootflag=0
root6flag=0
boostflag=0
zmq=0
MrdTrackLib=0
WCSimlib=0
final=0
Python=0
Python3=1
Pythia=0
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=0
;;
--Pythia )
echo "Compiling ToolDAQ"
init=0
tooldaq=0
rootflag=0
root6flag=0
boostflag=0
zmq=0
MrdTrackLib=0
WCSimlib=0
final=0
Python=0
Python3=0
Pythia=1
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=0
;;
--Clhep )
echo "Compiling ToolDAQ"
init=0
tooldaq=0
rootflag=0
root6flag=0
boostflag=0
zmq=0
MrdTrackLib=0
WCSimlib=0
final=0
Python=0
Python3=0
Pythia=0
Clhep=1
Lhapdf=0
Genie=0
RATEventlib=0
;;
--Lhapdf )
echo "Compiling ToolDAQ"
init=0
tooldaq=0
rootflag=0
root6flag=0
boostflag=0
zmq=0
MrdTrackLib=0
WCSimlib=0
final=0
Python=0
Python3=0
Pythia=0
Clhep=0
Lhapdf=1
Genie=0
RATEventlib=0
;;
--Genie )
echo "Compiling ToolDAQ"
init=0
tooldaq=0
rootflag=0
root6flag=0
boostflag=0
zmq=0
MrdTrackLib=0
WCSimlib=0
final=0
Python=0
Python3=0
Pythia=0
Clhep=0
Lhapdf=0
Genie=1
RATEventlib=0
;;
--RATEventlib )
echo "Compiling ToolDAQ"
init=0
tooldaq=0
rootflag=0
root6flag=0
boostflag=0
zmq=0
MrdTrackLib=0
WCSimlib=0
final=0
Python=0
Python3=0
Pythia=0
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=1
;;
--PlotWaveforms )
echo "Building PlotWaveformslib"
init=0
tooldaq=0
rootflag=0
root6flag=0
boostflag=0
zmq=0
final=0
MrdTrackLib=0
WCSimlib=0
Python=0
Python3=0
Pythia=0
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=0
PlotWaveforms=1
;;
--Final )
echo "Compiling ToolDAQ"
init=0
tooldaq=0
rootflag=0
root6flag=0
boostflag=0
zmq=0
MrdTrackLib=0
WCSimlib=0
Python=0
Python=0
Python3=0
Pythia=0
Clhep=0
Lhapdf=0
Genie=0
RATEventlib=0
;;
esac
shift
done
if [ $init -eq 1 ]
then
cd ${BASEDIR}
mkdir ToolDAQ
fi
if [ $tooldaq -eq 1 ]
then
cd ${BASEDIR}/ToolDAQ
#git clone https://github.com/ToolDAQ/ToolDAQFramework.git
git clone https://github.com/ANNIEsoft/ToolDAQFramework.git
fi
if [ $zmq -eq 1 ]
then
cd ${BASEDIR}/ToolDAQ
git clone https://github.com/ToolDAQ/zeromq-4.0.7.git
cd zeromq-4.0.7
./configure --prefix=`pwd`
make -j8
make install
export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH
fi
if [ $boostflag -eq 1 ]
then
cd ${BASEDIR}/ToolDAQ
wget http://downloads.sourceforge.net/project/boost/boost/1.66.0/boost_1_66_0.tar.gz
tar zxf boost_1_66_0.tar.gz
rm -rf boost_1_66_0.tar.gz
cd boost_1_66_0
mkdir install
./bootstrap.sh --prefix=`pwd`/install/ > /dev/null 2>/dev/null
./b2 install iostreams
export LD_LIBRARY_PATH=`pwd`/install/lib:$LD_LIBRARY_PATH
fi
if [ $root6flag -eq 1 ]
then
cd ${BASEDIR}
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
cd ${BASEDIR}/ToolDAQ
wget https://root.cern/download/root_v6.24.06.source.tar.gz
tar -xzf root_v6.24.06.source.tar.gz
rm root_v6.24.06.source.tar.gz
cd root-6.24.06
mkdir install
cd install
cmake ../ -DCMAKE_CXX_STANDARD=14 -Dgdml=ON -Dxml=ON -Dmt=ON -Dmathmore=ON -Dx11=ON -Dimt=ON -Dtmva=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dpythia6=ON -Dfftw3=ON
make -j8
make install
cd ../
/bin/bash -O extglob -c 'rm -rf !(install)'
source bin/thisroot.sh
fi
if [ $WCSimlib -eq 1 ]
then
cd ${BASEDIR}
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
cd ${BASEDIR}/ToolDAQ
git clone https://github.com/ANNIEsoft/WCSimLib.git
cd WCSimLib
make -f Makefile_ROOT6
fi
if [ $MrdTrackLib -eq 1 ]
then
cd ${BASEDIR}
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
cd ${BASEDIR}/ToolDAQ
git clone https://github.com/ANNIEsoft/MrdTrackLib.git
cd MrdTrackLib
cp Makefile.FNAL Makefile
make
fi
if [ $Python3 -eq 1 ]
then
cd ${BASEDIR}
source Setup.sh
pip3 install numpy==1.23.4
pip3 install pandas==1.5.0
pip3 install matplotlib==3.6.1
pip3 install scipy==1.9.2
pip3 install scikit-learn==1.1.2
pip3 install seaborn==0.12.0
pip3 install uproot==4.3.7
pip3 install xgboost==1.6.2
pip3 install tensorflow==2.10.0
pip3 install torch==1.12.1
pip3 install PyQt5
# set tensorflow verbosity to suppress info messages about not having a GPU or maximal acceleration
# https://stackoverflow.com/questions/35911252/disable-tensorflow-debugging-information/42121886#42121886
#echo "export TF_CPP_MIN_LOG_LEVEL=2" >> ${BASEDIR}/Setup.sh # already done
cd ${BASEDIR}/UserTools
mkdir -p InactiveTools
mkdir -p ImportedTools
cd ImportedTools
git clone https://github.com/ToolFramework/ToolPack.git
cd ToolPack
./Import.sh PythonScript
fi
if [ $Pythia -eq 1 ]
then
cd ${BASEDIR}
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
cd ${BASEDIR}/ToolDAQ
mkdir fsplit && cd fsplit
wget https://gist.githubusercontent.com/marc1uk/c0e32d955dd1c06ef69d80ce643018ad/raw/10e592d42737ecc7dca677e774ae66dcb5a3859d/fsplit.c
gcc fsplit.c -o fsplit
export PATH=$PWD:$PATH
#echo "export PATH=$PWD:\$PATH" >> ${BASEDIR}/Setup.sh # already done
cd ${BASEDIR}/ToolDAQ
cvs -d :pserver:[email protected]:/cvsroot/log4cpp -z3 co log4cpp
cd log4cpp/
./autogen.sh
./configure --prefix=`pwd`
make
make install
cd ../
git clone https://github.com/GENIE-MC-Community/Pythia6Support.git
cd Pythia6Support
./build_pythia6.sh --dummies=remove
export PYTHIA6_DIR=/ToolAnalysis/ToolDAQ/Pythia6Support/v6_424/
fi
if [ $Clhep -eq 1 ]
then
cd ${BASEDIR}
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
cd ${BASEDIR}/ToolDAQ
wget https://proj-clhep.web.cern.ch/proj-clhep/dist1/clhep-2.4.0.2.tgz
tar zxf clhep-2.4.0.2.tgz
rm -rf clhep-2.4.0.2.tgz
cd 2.4.0.2
mkdir CLHEP_build CLHEP_install
cd CLHEP_build
cmake -DCMAKE_INSTALL_PREFIX=/ToolAnalysis/ToolDAQ/2.4.0.2/CLHEP_install /ToolAnalysis/ToolDAQ/2.4.0.2/CLHEP
cmake --build . --config RelWithDebInfo
cmake --build . --target install
cd ..
rm -rf CLHEP CLHEP_build
fi
if [ $Lhapdf -eq 1 ]
then
cd ${BASEDIR}
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
cd ${BASEDIR}/ToolDAQ
wget http://lhapdf.hepforge.org/downloads/LHAPDF-6.3.0.tar.gz
tar zxf LHAPDF-6.3.0.tar.gz
rm -rf LHAPDF-6.3.0.tar.gz
cd LHAPDF-6.3.0
mkdir install
./configure --prefix=/ToolAnalysis/ToolDAQ/LHAPDF-6.3.0/install
make
make install
cd install/share/LHAPDF
wget http://lhapdf.hepforge.org/downloads/pdfsets/5.9.1/CT10.LHgrid
wget http://lhapdf.hepforge.org/downloads/pdfsets/5.9.1/cteq61.LHpdf
wget http://lhapdf.hepforge.org/downloads/pdfsets/5.9.1/cteq61.LHgrid
wget http://lhapdf.hepforge.org/downloads/pdfsets/5.9.1/GRV98lo.LHgrid
wget http://lhapdf.hepforge.org/downloads/pdfsets/5.9.1/GRV98lo_patched.LHgrid
wget http://lhapdf.hepforge.org/downloads/pdfsets/5.9.1/GRV98nlo.LHgrid
wget http://lhapdf.hepforge.org/downloads/pdfsets/5.9.1/GRVG0.LHgrid
wget http://lhapdf.hepforge.org/downloads/pdfsets/5.9.1/GRVG1.LHgrid
wget http://lhapdf.hepforge.org/downloads/pdfsets/5.9.1/GRVPI0.LHgrid
wget http://lhapdf.hepforge.org/downloads/pdfsets/5.9.1/GRVPI1.LHgrid
cd ${BASEDIR}/ToolDAQ/LHAPDF-6.3.0
/bin/bash -O extglob -c 'rm -rf !(install)'
fi
if [ $Genie -eq 1 ]
then
cd ${BASEDIR}
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
cd ${BASEDIR}/ToolDAQ
wget https://github.com/ANNIEsoft/GENIE-v3/archive/refs/heads/master.zip
ls
unzip master.zip
rm -rf master.zip
cd GENIE-v3-master/
mkdir install
export GENIE=`pwd`
./configure --prefix=/ToolAnalysis/ToolDAQ/GENIE-v3-master/install/ --enable-lhapdf6 --enable-rwght --enable-fnal --with-pythia6-inc=/ToolAnalysis/ToolDAQ/Pythia6Support/v6_424/inc/ --with-pythia6-lib=/ToolAnalysis/ToolDAQ/Pythia6Support/v6_424/lib/ --with-log4cpp-inc=/ToolAnalysis/ToolDAQ/log4cpp/include/ --with-log4cpp-lib=/ToolAnalysis/ToolDAQ/log4cpp/lib/
make -j8
make install
cd config
cp G18_10a/ModelConfiguration.xml .
cp G18_10a/TuneGeneratorList.xml .
cd ${BASEDIR}/ToolDAQ
wget https://github.com/uboone/Reweight/archive/refs/tags/v3_00_04_ub3.zip
unzip v3_00_04_ub3.zip
rm -rf v3_00_04_ub3.zip
cd Reweight-3_00_04_ub3/
export GENIE_REWEIGHT=`pwd`
make
make install
fi
if [ $RATEventlib -eq 1 ]
then
cd ${BASEDIR}
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
cd ${BASEDIR}/ToolDAQ
git clone https://github.com/ANNIEsoft/RATEventLib.git
cd RATEventLib/
make
fi
if [ $PlotWaveforms -eq 1 ]
then
cd ${BASEDIR}
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
cd ${BASEDIR}/UserTools/PlotWaveforms
make
fi
if [ $final -eq 1 ]
then
cd ${BASEDIR}
if [ $fnalflag -eq 1 ]; then
source SetupFNAL.sh
else
source Setup.sh
fi
make clean
make
export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH
fi