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
41 let "myran=${CLUSTER}/10 +${PROCESS}"
42 sed -i s/RanCra/${myran}.0/ ./CylTargetProd_${CLUSTER}_${PROCESS}.inp
43 echo " Random number will be " ${myran}
44 echo " Run g4lbne now at " `date`
45 cp /lbne/app/users/lebrun/work2/dev2/repo/macros/CylTargetNoFlukaProd.mac ./runProd.mac
46 sed -i s/RanCra/${myran}/ ./runProd.mac
47 sed -i s/genProd/${CLUSTER}_${PROCESS}/ ./runProd.mac
48 sed -i s/theFlukaName/outProd_${CLUSTER}_${PROCESS}.dat/ ./runProd.mac
49 source /lbne/app/users/lebrun/work2/dev2/repo/setups/setup_g4lbne_fnal.sh
50 time /lbne/app/users/lebrun/work2/dev2/repo/g4lbneProd2 ./runProd.mac >& g4lbne_${CLUSTER}_${PROCESS}.lis
52 cp ./g4lbne_${CLUSTER}_${PROCESS}.lis /lbne/data/users/lebrun/fluka/
53 cp ./OutNFD_*.dk2nu.root /lbne/data/users/lebrun/fluka/