Changeset 9909


Ignore:
Timestamp:
08/30/10 12:36:57 (14 years ago)
Author:
Daniela Dorner
Message:
bugfix for insert of runs with new ceres keys
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/datacenter/scripts/insertmc

    r9898 r9909  
    3737# to really insert information set insert="yes"
    3838insert="yes"
    39 #insert=
     39insert=
    4040
    4141
     
    4444#  make sure that the information on the setup (i.e. table CeresSetup)
    4545#  has been inserted before
    46 #cereskeys=( 2 3 )
    47 cereskeys=( 1 )
     46cereskeys=( 2 3 4 5 6 )
     47#cereskeys=( 1 )
    4848
    4949
     
    5555#  protons: files 2000-2399 i.e. runs 633-750
    5656#  protons: files 3000-3099 i.e. runs 933-960
    57 #runmin=423
    58 #runmax=960
    59 runmin=
    60 runmax=
     57runmin=423
     58runmax=960
     59#runmin=
     60#runmax=
    6161
    6262
     
    190190   echo "Do you really want to insert the following cereskey(s)?"
    191191   echo "  run number range:  "$runmin" - "$runmax
    192    query="SELECT fRunNumber FROM CorsikaInfo WHERE fRunNumber BETWEEN "$runmin" AND "$runmax
     192   query="SELECT fRunNumber FROM CorsikaInfo WHERE fRunNumber BETWEEN "$runmin" AND "$runmax" GROUP BY fRunNumber"
    193193   runs=( `sendquery` )
    194194   echo "    i.e. the following runs: "${runs[@]}
     
    270270   for cereskey in ${cereskeys[@]}
    271271   do
    272       for (( i=1 ; i<=$numfile ; i++ ))
     272      query="SELECT fFileNumber FROM CorsikaInfo WHERE fRunNumber="$drun
     273      files=`sendquery`
     274      for file in ${files[@]}
    273275      do
    274          query="INSERT CeresInfo SET fSequenceNumber="$drun", fRunNumber="$drun", fFileNumber="$i", fCeresSetupKEY="$cereskey", fRunTypeKEY=2"
     276         query="INSERT CeresInfo SET fSequenceNumber="$drun", fRunNumber="$drun", fFileNumber="$file", fCeresSetupKEY="$cereskey", fRunTypeKEY=2"
    275277         sendquery2
    276278      done
Note: See TracChangeset for help on using the changeset viewer.