#!/bin/bash echo "test36: the if and the define commands (1 sec)" cat >test36.in <<-\! param histoFile="" physics QGSP doStochastics=0 beam ascii filename=test36.beam nEvents=9 if 1==1 'param RADIUS=200' if 1==1.0001 'param RADIUS=invalid' define Macro 'virtualdetector format=BLTrackFile AF radius=$RADIUS length=$$length color=1,1,1 file=test36.txt' if 1!=3 'param length=1' if 1==3 'define Macro INVALID' if 1+1==2 Macro if 1+1==2 'place AF z=100' ! cat >test36.beam <<-! #BLTrackFile test36 beam #x y z Px Py Pz t PDGid EventID TrackID ParentID Weight #cm cm cm MeV/c MeV/c MeV/c ns - - - - - 0.000 0.000 0.000 0.000 0.000 200.000 0.375 -13 0 1 0 1.0000 0.000 0.000 0.000 10.000 0.000 200.000 0.375 -13 1 1 0 2.0000 0.000 0.000 0.000 0.000 10.000 200.000 0.375 -13 2 1 0 2.0000 0.000 0.000 0.000 10.000 10.000 200.000 0.375 -13 3 1 0 3.0000 0.000 0.000 0.000 -10.000 0.000 200.000 0.375 -13 4 1 0 2.0000 0.000 0.000 0.000 0.000 -10.000 200.000 0.375 -13 5 1 0 2.0000 0.000 0.000 0.000 -10.000 -10.000 200.000 0.375 -13 6 1 0 3.0000 0.000 0.000 0.000 -10.000 10.000 200.000 0.375 -13 7 1 0 3.0000 0.000 0.000 0.000 10.000 -10.000 200.000 0.375 -13 8 1 0 3.0000 ! cat >test36.good <<-! #BLTrackFile VirtualDetector/AF #x y z Px Py Pz t PDGid EventID TrackID ParentID Weight #mm mm mm MeV/c MeV/c MeV/c ns - - - - - 0 0 99.5 0 0 200 0.750365 -13 0 1 0 1 4.975 0 99.5 10 0 200 0.750731 -13 1 1 0 2 0 4.975 99.5 0 10 200 0.750731 -13 2 1 0 2 4.975 4.975 99.5 10 10 200 0.751098 -13 3 1 0 3 -4.975 0 99.5 -10 0 200 0.750731 -13 4 1 0 2 0 -4.975 99.5 0 -10 200 0.750731 -13 5 1 0 2 -4.975 -4.975 99.5 -10 -10 200 0.751098 -13 6 1 0 3 -4.975 4.975 99.5 -10 10 200 0.751098 -13 7 1 0 3 4.975 -4.975 99.5 10 -10 200 0.751098 -13 8 1 0 3 ! if ! g4bl test36.in >test36.out then echo "****** test36: g4bl FAILED! -- test36.* files left intact" exit 1 fi if ! ./compare test36.txt test36.good then echo "****** test36: Output Files DIFFER -- test36.* files left intact" exit 1 fi # clean up and exit rm test36.* exit 0