Ignore:
Timestamp:
10/15/07 15:50:00 (17 years ago)
Author:
hoehne
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/scripts
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/mcsequences

    r8482 r8758  
    4040set -C
    4141
    42 scriptlog=$runlogpath/$program`date +%F`.log
     42scriptlog=$runlogpath/$program-$datetime.log
    4343date >> $scriptlog 2>&1
    4444
     
    4848
    4949# find montecarlo directories, build one sequence per directory and write sequence file
    50 printprocesslog "INFO building one sequence per mcdirectory"
     50printprocesslog "INFO building one sequence per mcdirectory and epoch"
    5151dirs=`find $mcrawpath -type d`
    5252for dir in ${dirs[@]}
    5353do
    54    cont=`echo $dir | cut -d/ -f6`
     54#   cont=`echo $dir | cut -d/ -f6`
     55   cont=`echo $dir | cut -d/ -f10`
    5556   if [ "$cont" == "" ]
    5657   then
     
    5859   fi
    5960   echo $dir >> $scriptlog 2>&1
    60    files=`ls $dir`
    61    calfile=`find $dir -name *_C_*`
    62    pedfile=`find $dir -name *_P_*`
    63    calrun=`echo $calfile | cut -d_ -f2`
    64    pedrun=`echo $pedfile | cut -d_ -f2`
    65    datruns=`find $dir -name *_D_* | cut -d_ -f2 | tr "\n" " "`
    66 # workaround due to 5digit runnumber for data with runnumber < 35487
    67 #   firstrun=`echo $datruns | cut -c 0-8`
    68    firstrun=`echo $datruns | cut -c 0-5 | sed -e 's/^0//g' -e 's/^0//g' -e 's/^0//g' -e 's/^0//g'`
    69    date=`echo $dir | cut -c 22-31 | sed -e 's/\//-/g'`
    7061   
    71 # workaround due to 5digit runnumber for data with runnumber < 35487
    72 #   no=`echo $firstrun | cut -c 0-4`
    73    no=`printf %08d $firstrun | cut -c 0-4`
    74    no2=`printf %08d $firstrun`
    75    sequpath=$mcsequpath/$no
    76    makedir $sequpath >> $scriptlog 2>&1
    77 #   sequfile=$sequpath/sequence$firstrun.txt
    78    sequfile=$sequpath/sequence$no2.txt
    79    echo "writing sequfile "$sequfile >> $scriptlog 2>&1
    80    printprocesslog "INFO writing sequencefile $sequfile"
    81    
    82    echo "Sequence:        $firstrun" >| $sequfile
    83    echo "Night:           $date" >> $sequfile
    84    echo "" >> $sequfile
    85    echo "CalRuns:         $calrun" >> $sequfile
    86    echo "PedRuns:         $pedrun" >> $sequfile
    87    echo "DatRuns:         $datruns" >> $sequfile
    88    echo "" >> $sequfile
    89    echo "MonteCarlo: Yes" >> $sequfile
    90    echo "" >> $sequfile
     62   epochs=`ls -l $mcpath/camera | cut -c 52-70`
     63   for epoch in ${epochs[@]}
     64   do
     65      echo $epoch >> $scriptlog 2>&1
     66      calfile=`find $dir -lname *$epoch*.root | grep "_C_"`
     67      pedfile=`find $dir -lname *$epoch*.root | grep "_P_"`
     68#      datfiles=`find $dir -lname '*$epoch*.root' | grep "_D_"`
     69     
     70      calrun=`echo $calfile | cut -d_ -f2`
     71      pedrun=`echo $pedfile | cut -d_ -f2`
     72      datruns=`find $dir -lname *$epoch*.root | grep "_D_" | cut -d_ -f2 | tr "\n" " "`
     73      # workaround due to 5digit runnumber for data with runnumber < 35487
     74      firstrun=`echo $datruns | cut -c 0-8`
     75      #   firstrun=`echo $datruns | cut -c 0-5 | sed -e 's/^0//g' -e 's/^0//g' -e 's/^0//g' -e 's/^0//g'`
     76#      date=`echo $dir | cut -c 28-37 | sed -e 's/\//-/g'`
     77      # for tests
     78      date=`echo $dir | cut -c 57-66 | sed -e 's/\//-/g'`
     79     
     80      # workaround due to 5digit runnumber for data with runnumber < 35487
     81      no=`echo $firstrun | cut -c 0-4`
     82      #   no=`printf %08d $firstrun | cut -c 0-4`
     83      #   no2=`printf %08d $firstrun`
     84      sequpath=$mcsequpath/$no
     85      makedir $sequpath >> $scriptlog 2>&1
     86      sequfile=$sequpath/sequence$firstrun.txt
     87      #   sequfile=$sequpath/sequence$no2.txt
     88      echo "writing sequfile "$sequfile >> $scriptlog 2>&1
     89      printprocesslog "INFO writing sequencefile $sequfile"
     90     
     91      echo "Sequence:        $firstrun" >| $sequfile
     92      echo "Night:           $date" >> $sequfile
     93      echo "Epoch:           $epoch" >> $sequfile
     94      echo "" >> $sequfile
     95      echo "CalRuns:         $calrun" >> $sequfile
     96      echo "PedRuns:         $pedrun" >> $sequfile
     97      echo "DatRuns:         $datruns" >> $sequfile
     98      echo "" >> $sequfile
     99      echo "MonteCarlo: Yes" >> $sequfile
     100      echo "" >> $sequfile
     101   done
    91102done
    92103
  • trunk/MagicSoft/Mars/datacenter/scripts/processmcsequences

    r8482 r8758  
    5959   no=`echo $sequno | cut -c 0-4`
    6060   date=`grep Night $sequfile | cut -c 18-29 | sed -e 's/-/\//g'`
     61   muxcheck=`grep Epoch $sequfile | cut -c 18-32`
     62   case $muxcheck in
     63      "MC_up_to_April06")
     64      callistorc=$setuppath/callisto/callisto.rc
     65      ;;
     66      "MC_old")
     67      callistorc=$setuppath/callisto/callisto.rc
     68      ;;
     69      "MC_April_May06")
     70      callistorc=$setuppath/callisto/callisto.rc
     71      ;;
     72      "MC_post_June06")
     73      callistorc=$setuppath/callisto/callisto.rc
     74      ;;
     75      "MC_MuxFADCs")
     76      callistorc=$setuppath/callisto/callisto_mux.rc
     77      ;;
     78      "MC_MuxFADCs_NEW")
     79      callistorc=$setuppath/callisto/callisto_mux.rc
     80      ;;
     81      *)
     82      echo "No epoch found"
     83      printprocesslog "ERROR no epoch found in $sequfile for setting the right callisto.rc, using standard callisto.rc, epoch: $epoch"
     84      finish >> $scriptlog 2>&1
     85      ;;
     86   esac
     87     
    6188   caloutpath=$mccalpath/$no/$sequno
    6289   makedir $caloutpath >> $scriptlog 2>&1
Note: See TracChangeset for help on using the changeset viewer.