diff --git a/.gitignore b/.gitignore index efa044d..f039f32 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ working/Settings EventBuilder *.root -data_raw \ No newline at end of file +data_raw +root_data \ No newline at end of file diff --git a/SOLARIS.sh b/SOLARIS.sh new file mode 100644 index 0000000..9d66d49 --- /dev/null +++ b/SOLARIS.sh @@ -0,0 +1,23 @@ +#=================== Main +unset SOLARISSYS + +SOURCE=${BASH_ARGV[0]} +PCName=$(uname -n) +if [ $(uname -n) == "solaris-daq" ]; then + SOLARISSYS=~/Analysis +else + if [ $(pwd) == $HOME ]; then + SOLARISSYS=$(dirname ${SOURCE}) + + if [[ ${SOLARISSYS} == *"$HOME"* ]]; then + dummpy=0 + else + SOLARISSYS=${HOME}/$SOLARISSYS + fi + + else + SOLARISSYS=$(pwd) + fi +fi + +export SOLARISSYS \ No newline at end of file diff --git a/SetupNewExp b/SetupNewExp new file mode 100755 index 0000000..7eb67eb --- /dev/null +++ b/SetupNewExp @@ -0,0 +1,28 @@ +#!/bin/bash + + +################################################### +## +## This is a script for Setup/switch Experiment +## +## +## +#################################################### + + +# this will define global enviroment varibales, like the analysis path, export armory +source SOLARIS.sh + +# Check git + + + +#need to distingish mac and daq + + +#create working/expName.sh + +# create folders +# data_raw = /mnt/data0/${expName} +# root_data = /mnt/data1/${expName} + diff --git a/armory/EventBuilder.cpp b/armory/EventBuilder.cpp index 5ac3fd5..9f0e4c2 100644 --- a/armory/EventBuilder.cpp +++ b/armory/EventBuilder.cpp @@ -134,10 +134,15 @@ int main(int argc, char ** argv){ } //^=========================================== + + printf("================================= \n"); + int fileID = 0; findEarliestTime(nFile, fileID); fillData(fileID, saveTrace); + int last_precentage = 0; + unsigned count = 1; while(count < totNumEvent){ @@ -158,11 +163,20 @@ int main(int argc, char ** argv){ } count ++; + int percentage = count * 100/totNumEvent; + + if( percentage > last_precentage ) { + printf("Processed : %u, %.0f%% \n\033[A\r", count, count*100./totNumEvent); + last_precentage = percentage; + } + } outRootFile->cd(); tree->Write(); + printf("===================================== done. "); + printf("Number of Event Built is %lld .\n", evID); //^############## delete new for( int i = 0; i < nFile; i++) delete reader[i]; diff --git a/armory/Process_PathSetting b/armory/Process_PathSetting new file mode 100644 index 0000000..cc1f786 --- /dev/null +++ b/armory/Process_PathSetting @@ -0,0 +1 @@ +#!/bin/bash \ No newline at end of file diff --git a/armory/Process_Run b/armory/Process_Run new file mode 100755 index 0000000..4ae5d37 --- /dev/null +++ b/armory/Process_Run @@ -0,0 +1,37 @@ +#!/bin/bash + +if [ $# -eq 0 ] || [ $1 == "-help" ]; then + echo "$ Proess_Run [RunNum] [EventBuild] [Monitor]" + echo " RunNum = run number / \"lastRun\" " + echo " EventBld = 2/1/0/-1/-2 || 2 = with Trace" + echo " Monitors = 2/1/0 || 1 = single run, 2 = using the list in ChainMonitors.C" + echo " 10 = single run and post to websrv, 20 = list runs and post to websrv" + echo "" + echo " **** When feeding trace data to Monitors, the EventBld flag must be 2 or -2." + echo "" + exit 1 +fi; + + +RUN=$1 +EventBld=$2 + +#padding +if [ "${RUN:0:1}" == "0" ]; then + RUN=${RUN:1:2} +else + RUN=$(printf '%d' $RUN) +fi +RUN=$(printf '%03d' ${RUN}) + +source ~/Analysis/working/expName.sh + +ls -1 ${rawDataPath}/${expName}_${RUN}_* + +if [ ${EventBld} -neq 0 ]; then + + if [ ${EventBld} -eq 1 ]; then + ./EventBuilder ${rawDataPath}/${expName}_${RUN}.root 100 0 `ls -1 ${rawDataPath}/${expName}_${RUN}_*` + fi + +fi diff --git a/working/expName.sh b/working/expName.sh index 3168bb7..c21a45f 100644 --- a/working/expName.sh +++ b/working/expName.sh @@ -1,5 +1,6 @@ expName=Master rawDataPath=/mnt/data0/Master +rootDataPath=/mnt/data1/Master runID=1 elogID=14 //------------end of file. \ No newline at end of file