Changeset 7232 for trunk/MagicSoft


Ignore:
Timestamp:
07/29/05 23:13:12 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7231 r7232  
    2121                                                 -*-*- END OF LINE -*-*-
    2222
     23 2005/07/29 Daniela Dorner
     24
     25   * datacenter/scripts/sourcefile:
     26     - added four more general paths to the sourcefile to make it
     27       easier to use the software for different users, paths and setups
     28
     29   * datacenter/scripts/buildsequenceentries, checkstardone,
     30     checkfilesforsequenceavail, correcttime, doexclusions, filesondisk,
     31     fillcallisto, fillstar, insertdatasets, runcallisto, runganymed,
     32     runstar, writesequencefiles:
     33     - adapted this scripts to the usage of the paths
     34
     35   * datacenter/macros/buildsequenceentries.C, findcacofiles.C,
     36     getdolist.C, writesequencefile.C:
     37     - adapted this macros to the usage of the paths
     38
     39   * datacenter/macros/buildsequenceentries.C, createdataset.C,
     40     resetcolumn.C:
     41     - fixed documentation of this macros
     42
     43
     44
    2345 2005/07/27 Markus Meyer, Daniela Dorner
    2446
    25    * datacenter/fillstar.C:
     47   * datacenter/macros/fillstar.C:
    2648     - implemented new algorithm and new values for the calculation
    2749       of the muon parameter in the database
  • trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C

    r7215 r7232  
    3131// to group the runs of one night into sequences, this marco:
    3232// - reads the runinformation of one night from the database
    33 // - sorts the runs by source
    34 // - groups the runs to sequences such that each run belongs
     33// - group the runs into sets of following runs with the same conditions
     34// - groups the runs in this sets to sequences such that each run belongs
    3535//   to the nearest (in time) calibration run
    36 //
    37 // apart from that the runs in one sequence must have the same
    38 // hv-settings, trigger tables, light conditions, DT tables,
    39 // trigger delay tables and testflag
     36// - check if the runs with the same runtype have the same calibration script
     37//   and the same trigger tables
    4038//
    4139/////////////////////////////////////////////////////////////////////////////
     
    6260int debug = 0;
    6361
    64 Bool_t DeleteSequence(MSQLServer &serv, Int_t sequ, Bool_t dummy)
     62Bool_t DeleteSequence(MSQLServer &serv, TString datapath, TString sequpath, Int_t sequ, Bool_t dummy)
    6563{
    6664    TString query1(Form("DELETE FROM Calibration WHERE fSequenceFirst=%d", sequ));
     
    7068    TString query5(Form("DELETE FROM Sequences WHERE fSequenceFirst=%d AND fManuallyChangedKEY=1", sequ));
    7169
    72     TString fname(Form("/mnt/stk01/sequences/%04d/sequence%08d.txt", sequ/10000, sequ));
    73     TString command(Form("rm -r /magic/data/callisto/%04d/%08d/", sequ/10000, sequ));
    74     TString command2(Form("rm -r /magic/data/star/%04d/%08d/", sequ/10000, sequ));
     70    TString fname(Form("%s/%04d/sequence%08d.txt", sequpath.Data(),sequ/10000, sequ));
     71    TString command(Form("rm -r %s/callisto/%04d/%08d/", datapath.Data(), sequ/10000, sequ));
     72    TString command2(Form("rm -r %s/star/%04d/%08d/", datapath.Data(), sequ/10000, sequ));
    7573
    7674    if (dummy)
     
    177175}
    178176
    179 Bool_t CheckSequence(MSQLServer &serv, Int_t from, Int_t to, Bool_t dummy)
     177Bool_t CheckSequence(MSQLServer &serv, TString datapath, TString sequpath, Int_t from, Int_t to, Bool_t dummy)
    180178{
    181179    Bool_t rc=kFALSE;
     
    213211            {
    214212                cout << "deleting sequence " << sequences.At(i) << "... <" << i << ">" << endl;
    215                 if(!DeleteSequence(serv, sequences.At(i), dummy))
     213                if(!DeleteSequence(serv, datapath, sequpath, sequences.At(i), dummy))
    216214                   rc=kFALSE;
    217215            }
     
    267265        {
    268266            cout << "different sequsizes -> deleting sequence " << sequences.At(0) << endl;
    269             return DeleteSequence(serv, sequences.At(0), dummy);
     267            return DeleteSequence(serv, datapath, sequpath, sequences.At(0), dummy);
    270268        }
    271269
     
    275273                continue;
    276274            cout << "different runs -> deleting sequence " << sequences.At(0) << endl;
    277             return DeleteSequence(serv, sequences.At(0), dummy);
     275            return DeleteSequence(serv, datapath, sequpath, sequences.At(0), dummy);
    278276        }
    279277
     
    405403}
    406404
    407 Bool_t NewSequence(MSQLServer &serv, Int_t from, Int_t to, Bool_t dummy)
     405Bool_t NewSequence(MSQLServer &serv, TString datapath, TString sequpath, Int_t from, Int_t to, Bool_t dummy)
    408406{
    409407    cout << "Found Sequence (" << from << ", " << to << ") ... checking runs..." << flush;
     
    429427    cout << "checking Sequence..." << endl;
    430428
    431     if (!CheckSequence(serv, from, to, dummy))
     429    if (!CheckSequence(serv, datapath, sequpath, from, to, dummy))
    432430    {
    433431        cout << " inserting sequence not necessary" << endl;
     
    446444}
    447445
    448 Bool_t Process(MSQLServer &serv, Int_t from, Int_t to, Bool_t dummy)
     446Bool_t Process(MSQLServer &serv, TString datapath, TString sequpath, Int_t from, Int_t to, Bool_t dummy)
    449447{
    450448
     
    589587            if (n!=-1)
    590588            {
    591                 if (!NewSequence(serv, start, last, dummy))
     589                if (!NewSequence(serv, datapath, sequpath, start, last, dummy))
    592590                {
    593591                    rc = kFALSE;
     
    605603    if (n!=-1 && start!=last)
    606604    {
    607         if (!NewSequence(serv, start, last, dummy))
     605        if (!NewSequence(serv, datapath, sequpath, start, last, dummy))
    608606            rc = kFALSE;
    609607    }
     
    617615
    618616
    619 int buildsequenceentries(TString day, Bool_t dummy=kTRUE)
     617int buildsequenceentries(TString day, TString datapath, TString sequpath, Bool_t dummy=kTRUE)
    620618{
    621619    TEnv env("sql.rc");
     
    704702        cout << endl << "datablock from " << runstart2 << " to " << runstop2 << endl;
    705703
    706         if (!Process(serv, runstart2, runstop2, dummy))
     704        if (!Process(serv, datapath, sequpath, runstart2, runstop2, dummy))
    707705            rc = kFALSE;
    708706
     
    712710
    713711
    714 int buildsequenceentries()
     712int buildsequenceentries(TString datapath, TString sequpath, Bool_t dummy=kTRUE)
    715713{
    716714    TEnv env("sql.rc");
     
    733731    {
    734732        cout << "date: " << (*row)[0] << endl;
    735         buildsequenceentries((*row)[0]);
     733        buildsequenceentries((*row)[0], dummy);
    736734    }
    737735
  • trunk/MagicSoft/Mars/datacenter/macros/createdataset.C

    r7167 r7232  
    2727// createdataset.C
    2828// ===============
     29//
     30// this script is not run automatically
     31// the purpose of this script is to make it easier for people to write
     32// datasetfiles
     33//
     34// be careful with the path in this macro, if you use it for test-reasons!
    2935//
    3036/////////////////////////////////////////////////////////////////////////////
  • trunk/MagicSoft/Mars/datacenter/macros/findcacofiles.C

    r7182 r7232  
    4444
    4545
    46 int findcacofiles(TString date)
     46int findcacofiles(TString date, TString logpath)
    4747{
    4848    TEnv env("sql.rc");
     
    7272    }
    7373
    74     Int_t idx = date.First('-');
    75     TString year = date(0, idx);
    76     cout << "year: " << year << endl;
    77 
    78     ofstream fout("/magic/datacenter/autologs/filesondisk/"+year+"/findcacofiles-"+date+".txt");
     74    TString filename(Form("%s/findcacofiles-%s.txt", logpath.Data(), date.Data()));
     75    ofstream fout(filename, ios::app);
    7976    if (!fout)
    8077    {
    81         cout << "ERROR - Cannot open file." << endl;
    82         return kFALSE;
     78        cout << "ERROR - Cannot open file " << filename << endl;
     79        return 0;
    8380    }
    84     TString runnumber=0;
     81
    8582    TSQLRow *row=0;
    8683    while ((row = res->Next()))
  • trunk/MagicSoft/Mars/datacenter/macros/getdolist.C

    r7182 r7232  
    4545
    4646
    47 int getdolist(TString table, TString column, TString date)
     47int getdolist(TString table, TString column, TString date, TString listpath)
    4848{
    4949    TEnv env("sql.rc");
     
    118118        return 0;
    119119
    120     ofstream fout("/magic/datacenter/lists/ToDo-"+table+"-"+column+".txt", ios::app);
    121 //    ofstream fout("/data/MAGIC/datacenter/"+table+"-"+column+".txt", ios::app);
     120    TString filename(Form("%s/ToDo%s-%s.txt", listpath.Data(), table.Data(), column.Data()));
     121    ofstream fout(filename, ios::app);
     122    if (!fout)
     123    {
     124        cout << "ERROR - Cannot open file " << filename << endl;
     125        return 0;
     126    }
    122127
    123128    TSQLRow *row=0;
  • trunk/MagicSoft/Mars/datacenter/macros/resetcolumn.C

    r7112 r7232  
    3333// for this step in the DB has to be reset. This can be done with this macro.
    3434//
    35 // As arguments you have to give the column, the table and the from which
     35// As arguments you have to give the column, the table and from which
    3636// to which Date/Sequence/Run you want to reset the value.
    3737//
  • trunk/MagicSoft/Mars/datacenter/macros/writesequencefile.C

    r7168 r7232  
    233233}
    234234
    235 Bool_t GetSequence(MSQLServer &serv, TSQLRow &data)
     235Bool_t GetSequence(MSQLServer &serv, TSQLRow &data, TString sequpath)
    236236{
    237237    UShort_t y;
     
    257257        return kFALSE;
    258258
    259     TString fname(Form("/mnt/stk01/sequences/%04d/sequence%08d.txt", atoi(data[0])/10000, atoi(data[0])));
     259    TString fname(Form("%s/sequences/%04d/sequence%08d.txt", sequpath.Data(), atoi(data[0])/10000, atoi(data[0])));
    260260    cout << "Creating " << fname << "..." << flush;
    261261
     
    308308
    309309// This tool will work from Period017 (2004_05_17) on...
    310 int writesequencefile(Int_t sequno)
     310int writesequencefile(Int_t sequno, TString sequpath)
    311311{
    312312    TEnv env("sql.rc");
     
    333333    TSQLRow *row = 0;
    334334    while ((row = res->Next()))
    335         if (!GetSequence(serv, *row))
     335        if (!GetSequence(serv, *row, sequpath))
    336336            return 0;
    337337
  • trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries

    r7213 r7232  
    8383
    8484echo "getting list..." >> $scriptlog 2>&1
    85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\) | tee $getstatus.log | grep int | sed -e 's/(int)//'`
     85check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatus.log | grep int | sed -e 's/(int)//'`
    8686
    8787case $check0 in
     
    117117      fi
    118118   fi
    119    check1=`root -q -b $macrospath/buildsequenceentries.C+\("\"$date\""\,kFALSE\) | tee $buildsequentriespath/buildsequenceentries-$date.log | grep int | sed -e 's/(int)//'`
     119   check1=`root -q -b $macrospath/buildsequenceentries.C+\("\"$date\""\,"\"$datapath\""\,"\"$sequpath\""\,kFALSE\) | tee $buildsequentriespath/buildsequenceentries-$date.log | grep int | sed -e 's/(int)//'`
    120120
    121121   case $check1 in
  • trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail

    r7213 r7232  
    7474
    7575echo "getting list..." >> $scriptlog 2>&1
    76 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     76check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    7777
    7878case $check0 in
  • trunk/MagicSoft/Mars/datacenter/scripts/checkstardone

    r7213 r7232  
    7575
    7676echo "getting list..." >> $scriptlog 2>&1
    77 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     77check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    7878
    7979case $check0 in
     
    9999   no=`printf %08d $dataset | cut -c 0-5`
    100100   echo "checking files for dataset $dataset..." >> $scriptlog 2>&1
    101    datasetfile=/magic/datasets/$no/dataset`printf %08d $dataset`.txt
     101   datasetfile=$datasetpath/$no/dataset`printf %08d $dataset`.txt
    102102   sequences=(`cat $datasetfile | grep Sequences | sed -e 's/SequencesOn://g' | sed -e 's/SequencesOff://g'`)
    103103   
  • trunk/MagicSoft/Mars/datacenter/scripts/correcttime

    r7213 r7232  
    5959
    6060echo "getting list..."
    61 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     61check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    6262
    6363case $check0 in
  • trunk/MagicSoft/Mars/datacenter/scripts/doexclusions

    r7213 r7232  
    8383
    8484echo "getting list..." >> $scriptlog 2>&1
    85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     85check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    8686
    8787case $check0 in
  • trunk/MagicSoft/Mars/datacenter/scripts/filesondisk

    r7213 r7232  
    8585
    8686echo "checking missing cacofiles..."
    87 check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\) | tee $filesondisklogpath/findcacofiles-$date.log | grep int | sed -e 's/(int)//'`
     87check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\,"\"$filesondisklogpath\""\) | tee $filesondisklogpath/findcacofiles-$date.log | grep int | sed -e 's/(int)//'`
    8888
    8989case $check1 in
  • trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto

    r7213 r7232  
    8383
    8484echo "getting list..." >> $scriptlog 2>&1
    85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     85check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    8686
    8787case $check0 in
  • trunk/MagicSoft/Mars/datacenter/scripts/fillstar

    r7213 r7232  
    8383
    8484echo "getting list..." >> $scriptlog 2>&1
    85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     85check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    8686
    8787case $check0 in
  • trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets

    r7213 r7232  
    6464
    6565
    66 datasetfiles=(`ls /magic/datasets/*/*`)
     66datasetfiles=(`ls $datasetpath/*/*`)
    6767echo "datasetfiles: "${datasetfiles[@]}  >> $scriptlog 2>&1
    6868echo "" >> $scriptlog 2>&1
  • trunk/MagicSoft/Mars/datacenter/scripts/runcallisto

    r7213 r7232  
    3232set -C
    3333
    34 callistorcnew=/magic/datacenter/setup/callisto/callisto.rc
     34callistorcnew=$setuppath/callisto/callisto.rc
    3535
    3636table=SequenceProcessStatus
     
    9595   
    9696   echo "getting list..." >> $scriptlog 2>&1
    97    check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     97   check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    9898   
    9999   case $check0 in
     
    187187    fi
    188188  fi
    189   sequfile="/magic/sequences/$no/sequence$no2.txt"
     189  sequfile="$sequpath/$no/sequence$no2.txt"
    190190  echo "sequfile: "$sequfile >> $scriptlog 2>&1
    191191 
  • trunk/MagicSoft/Mars/datacenter/scripts/runganymed

    r7213 r7232  
    9090else
    9191   echo "getting list..." >> $scriptlog 2>&1
    92    check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     92   check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    9393   
    9494   case $check0 in
     
    181181    fi
    182182  fi
    183   datasetfile="/magic/datasets/$no/dataset$no2.txt"
     183  datasetfile="$datasetpath/$no/dataset$no2.txt"
    184184  echo "datasetfile: "$datasetfile >> $scriptlog 2>&1
    185185  wobble=`grep 'WobbleMode:' $datasetfile` >> $scriptlog 2>&1
     
    191191     mode="onoff" >> $scriptlog 2>&1
    192192  fi
    193   ganymedrc=/magic/datacenter/setup/ganymed/ganymed_$mode.rc
     193  ganymedrc=$setuppath/ganymed/ganymed_$mode.rc
    194194 
    195195  echo "run ganymed..." >> $scriptlog 2>&1
  • trunk/MagicSoft/Mars/datacenter/scripts/runstar

    r7213 r7232  
    9090else
    9191   echo "getting list..." >> $scriptlog 2>&1
    92    check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     92   check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    9393   
    9494   case $check0 in
     
    184184    fi
    185185  fi
    186   sequfile="/magic/sequences/$no/sequence$no2.txt"
     186  sequfile="$sequpath/$no/sequence$no2.txt"
    187187  echo "sequfile: "$sequfile >> $scriptlog 2>&1
    188188 
  • trunk/MagicSoft/Mars/datacenter/scripts/sourcefile

    r7106 r7232  
    3535scriptspath=$mars/datacenter/scripts
    3636
     37logpath=/magic/datacenter/autologs
    3738lockpath=/magic/datacenter/locks
    3839listpath=/magic/datacenter/lists
    39 logpath=/magic/datacenter/autologs
     40setuppath=/magic/datacenter/setup
     41
    4042datapath=/magic/data
     43subsystempath=/magic/subsystemdata
     44sequpath=/magic/sequences
     45datasetpath=/magic/datasets
    4146
  • trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles

    r7213 r7232  
    8383
    8484echo "getting list..." >> $scriptlog 2>&1
    85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     85check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
    8686
    8787case $check0 in
     
    107107   no=`printf %08d $sequence | cut -c 0-4`
    108108   no2=`printf %08d $sequence`
    109    sequencepath=/magic/sequences/$no
     109   sequencepath=$sequpath/$no
    110110   if [ ! -d $sequencepath ]
    111111   then
     
    131131
    132132   echo "write sequencefile for sequence $sequence" >> $scriptlog 2>&1
    133    check2=`root -q -b $macrospath/writesequencefile.C+\($sequence\) | tee $writesequencefilelogpath/writesequencefile-$no2.log | grep int | sed -e 's/(int)//'`
     133   check2=`root -q -b $macrospath/writesequencefile.C+\($sequence\,"\"$sequpath\""\) | tee $writesequencefilelogpath/writesequencefile-$no2.log | grep int | sed -e 's/(int)//'`
    134134   case $check2 in
    135135      1)   echo "check2=$check2 -> everthing ok " >> $scriptlog 2>&1
Note: See TracChangeset for help on using the changeset viewer.