2 # Minimal script to copy a file from grid cloud, process it... On the grid
5 echo " RunCyl, v1_1, My date, there " `date`
9 echo " condor scrach is " ${_CONDOR_SCRATCH_DIR}
10 cd ${_CONDOR_SCRATCH_DIR}
11 echo "Check, I am now on " `pwd`
17 SCRATCH_DIR="/pnfs/fermilab/volatile"
18 echo -e "\nSetting up NEXT UPS DB : "
19 #source /grid/fermiapp/products/next/setups.sh
20 source /grid/fermiapp/products/next/setups.sh
22 echo " Product ifdh ok ? " $IFDHC_DIR
24 #echo " Trying to process " ${NUMCONC} " root files"
26 voms-proxy-init -rfc -noregen -voms fermilab:/fermilab/Role=Analysis
28 export CPN_LOCK_GROUP=gpcf
29 echo " After voms-proxy.. Processing " ${NUMCONC} " root files"
30 echo " Other arguments are : "
31 echo " CLUSTER " ${CLUSTER}
32 echo " PROCESS " ${PROCESS}
33 ls -l /lbne/app/users/lebrun/fluka/install/flukahp
35 # One must have this is ifdhc product is used!
37 export CPN_LOCK_GROUP=gpcf
38 echo "Check, I am now on " `pwd`
39 source /grid/fermiapp/products/common/etc/setups.sh
40 source /grid/fermiapp/products/lbne/setup
43 export FLUFOR="gfortran"
44 cp /lbne/app/users/lebrun/fluka/SimpleCylTarget/CylTargetProd.inp ./CylTargetProd_${CLUSTER}_${PROCESS}.inp
45 let "myran=${CLUSTER}/10 +${PROCESS}"
46 sed -i s/RanCra/${myran}.0/ ./CylTargetProd_${CLUSTER}_${PROCESS}.inp
47 echo " Random number will be " ${myran}
48 cp /lbne/app/users/lebrun/fluka/install/runJan13/fort.1 .
49 cp /lbne/app/users/lebrun/fluka/install/fort.2 .
50 cp /lbne/app/users/lebrun/fluka/install/fluodt.dat .
51 cp /lbne/app/users/lebrun/fluka/install/random.dat .
52 cp /lbne/app/users/lebrun/fluka/install/sidae.dat .
53 cp /lbne/app/users/lebrun/fluka/install/sidan.dat .
54 cp /lbne/app/users/lebrun/fluka/install/sidap.dat .
55 cp /lbne/app/users/lebrun/fluka/install/sidapi.dat .
56 cp /lbne/app/users/lebrun/fluka/install/xnloan.dat .
57 cp /lbne/app/users/lebrun/fluka/install/brems_fin.bin .
58 cp /lbne/app/users/lebrun/fluka/install/cohff.bin .
59 cp /lbne/app/users/lebrun/fluka/install/elasct.bin .
60 cp /lbne/app/users/lebrun/fluka/install/gxsect.bin .
61 cp /lbne/app/users/lebrun/fluka/install/neuxsc.bin .
62 cp /lbne/app/users/lebrun/fluka/install/neuxsc-ind_260.bin .
63 cp /lbne/app/users/lebrun/fluka/install/nuclear.bin .
64 cp /lbne/app/users/lebrun/fluka/install/sigmapi.bin .
65 cp /lbne/app/users/lebrun/fluka/install/flukahp .
67 time ./flukahp < ./CylTargetProd_${CLUSTER}_${PROCESS}.inp
68 #cp ./outProd_${CLUSTER}_${PROCESS}.dat /lbne/data/users/lebrun/fluka
69 cp ./fort.11 /lbne/data/users/lebrun/fluka/outFluka_${CLUSTER}_${PROCESS}.log
70 echo " Run g4lbne now at " `date`
71 cp /lbne/app/users/lebrun/work2/dev2/repo/macros/CylTargetFlukaProd.mac ./runProd.mac
72 sed -i s/RanCra/${myran}/ ./runProd.mac
73 sed -i s/genProd/${CLUSTER}_${PROCESS}/ ./runProd.mac
74 sed -i s/theFlukaName/outProd_${CLUSTER}_${PROCESS}.dat/ ./runProd.mac
75 source /lbne/app/users/lebrun/work2/dev2/repo/setups/setup_g4lbne_fnal.sh
76 time /lbne/app/users/lebrun/work2/dev2/repo/g4lbneProd1 ./runProd.mac >& g4lbne_${CLUSTER}_${PROCESS}.lis
78 cp ./g4lbne_${CLUSTER}_${PROCESS}.lis /lbne/data/users/lebrun/fluka/
79 cp ./OutD_*.dk2nu.root /lbne/data/users/lebrun/fluka/