Changeset 7232 for trunk/MagicSoft/Mars
- Timestamp:
- 07/29/05 23:13:12 (19 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7231 r7232 21 21 -*-*- END OF LINE -*-*- 22 22 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 23 45 2005/07/27 Markus Meyer, Daniela Dorner 24 46 25 * datacenter/ fillstar.C:47 * datacenter/macros/fillstar.C: 26 48 - implemented new algorithm and new values for the calculation 27 49 of the muon parameter in the database -
trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C
r7215 r7232 31 31 // to group the runs of one night into sequences, this marco: 32 32 // - reads the runinformation of one night from the database 33 // - sorts the runs by source34 // - groups the runs to sequences such that each run belongs33 // - 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 35 35 // 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 40 38 // 41 39 ///////////////////////////////////////////////////////////////////////////// … … 62 60 int debug = 0; 63 61 64 Bool_t DeleteSequence(MSQLServer &serv, Int_t sequ, Bool_t dummy)62 Bool_t DeleteSequence(MSQLServer &serv, TString datapath, TString sequpath, Int_t sequ, Bool_t dummy) 65 63 { 66 64 TString query1(Form("DELETE FROM Calibration WHERE fSequenceFirst=%d", sequ)); … … 70 68 TString query5(Form("DELETE FROM Sequences WHERE fSequenceFirst=%d AND fManuallyChangedKEY=1", sequ)); 71 69 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)); 75 73 76 74 if (dummy) … … 177 175 } 178 176 179 Bool_t CheckSequence(MSQLServer &serv, Int_t from, Int_t to, Bool_t dummy)177 Bool_t CheckSequence(MSQLServer &serv, TString datapath, TString sequpath, Int_t from, Int_t to, Bool_t dummy) 180 178 { 181 179 Bool_t rc=kFALSE; … … 213 211 { 214 212 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)) 216 214 rc=kFALSE; 217 215 } … … 267 265 { 268 266 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); 270 268 } 271 269 … … 275 273 continue; 276 274 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); 278 276 } 279 277 … … 405 403 } 406 404 407 Bool_t NewSequence(MSQLServer &serv, Int_t from, Int_t to, Bool_t dummy)405 Bool_t NewSequence(MSQLServer &serv, TString datapath, TString sequpath, Int_t from, Int_t to, Bool_t dummy) 408 406 { 409 407 cout << "Found Sequence (" << from << ", " << to << ") ... checking runs..." << flush; … … 429 427 cout << "checking Sequence..." << endl; 430 428 431 if (!CheckSequence(serv, from, to, dummy))429 if (!CheckSequence(serv, datapath, sequpath, from, to, dummy)) 432 430 { 433 431 cout << " inserting sequence not necessary" << endl; … … 446 444 } 447 445 448 Bool_t Process(MSQLServer &serv, Int_t from, Int_t to, Bool_t dummy)446 Bool_t Process(MSQLServer &serv, TString datapath, TString sequpath, Int_t from, Int_t to, Bool_t dummy) 449 447 { 450 448 … … 589 587 if (n!=-1) 590 588 { 591 if (!NewSequence(serv, start, last, dummy))589 if (!NewSequence(serv, datapath, sequpath, start, last, dummy)) 592 590 { 593 591 rc = kFALSE; … … 605 603 if (n!=-1 && start!=last) 606 604 { 607 if (!NewSequence(serv, start, last, dummy))605 if (!NewSequence(serv, datapath, sequpath, start, last, dummy)) 608 606 rc = kFALSE; 609 607 } … … 617 615 618 616 619 int buildsequenceentries(TString day, Bool_t dummy=kTRUE)617 int buildsequenceentries(TString day, TString datapath, TString sequpath, Bool_t dummy=kTRUE) 620 618 { 621 619 TEnv env("sql.rc"); … … 704 702 cout << endl << "datablock from " << runstart2 << " to " << runstop2 << endl; 705 703 706 if (!Process(serv, runstart2, runstop2, dummy))704 if (!Process(serv, datapath, sequpath, runstart2, runstop2, dummy)) 707 705 rc = kFALSE; 708 706 … … 712 710 713 711 714 int buildsequenceentries( )712 int buildsequenceentries(TString datapath, TString sequpath, Bool_t dummy=kTRUE) 715 713 { 716 714 TEnv env("sql.rc"); … … 733 731 { 734 732 cout << "date: " << (*row)[0] << endl; 735 buildsequenceentries((*row)[0] );733 buildsequenceentries((*row)[0], dummy); 736 734 } 737 735 -
trunk/MagicSoft/Mars/datacenter/macros/createdataset.C
r7167 r7232 27 27 // createdataset.C 28 28 // =============== 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! 29 35 // 30 36 ///////////////////////////////////////////////////////////////////////////// -
trunk/MagicSoft/Mars/datacenter/macros/findcacofiles.C
r7182 r7232 44 44 45 45 46 int findcacofiles(TString date )46 int findcacofiles(TString date, TString logpath) 47 47 { 48 48 TEnv env("sql.rc"); … … 72 72 } 73 73 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); 79 76 if (!fout) 80 77 { 81 cout << "ERROR - Cannot open file ."<< endl;82 return kFALSE;78 cout << "ERROR - Cannot open file " << filename << endl; 79 return 0; 83 80 } 84 TString runnumber=0; 81 85 82 TSQLRow *row=0; 86 83 while ((row = res->Next())) -
trunk/MagicSoft/Mars/datacenter/macros/getdolist.C
r7182 r7232 45 45 46 46 47 int getdolist(TString table, TString column, TString date )47 int getdolist(TString table, TString column, TString date, TString listpath) 48 48 { 49 49 TEnv env("sql.rc"); … … 118 118 return 0; 119 119 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 } 122 127 123 128 TSQLRow *row=0; -
trunk/MagicSoft/Mars/datacenter/macros/resetcolumn.C
r7112 r7232 33 33 // for this step in the DB has to be reset. This can be done with this macro. 34 34 // 35 // As arguments you have to give the column, the table and thefrom which35 // As arguments you have to give the column, the table and from which 36 36 // to which Date/Sequence/Run you want to reset the value. 37 37 // -
trunk/MagicSoft/Mars/datacenter/macros/writesequencefile.C
r7168 r7232 233 233 } 234 234 235 Bool_t GetSequence(MSQLServer &serv, TSQLRow &data )235 Bool_t GetSequence(MSQLServer &serv, TSQLRow &data, TString sequpath) 236 236 { 237 237 UShort_t y; … … 257 257 return kFALSE; 258 258 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]))); 260 260 cout << "Creating " << fname << "..." << flush; 261 261 … … 308 308 309 309 // This tool will work from Period017 (2004_05_17) on... 310 int writesequencefile(Int_t sequno )310 int writesequencefile(Int_t sequno, TString sequpath) 311 311 { 312 312 TEnv env("sql.rc"); … … 333 333 TSQLRow *row = 0; 334 334 while ((row = res->Next())) 335 if (!GetSequence(serv, *row ))335 if (!GetSequence(serv, *row, sequpath)) 336 336 return 0; 337 337 -
trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries
r7213 r7232 83 83 84 84 echo "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)//'`85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatus.log | grep int | sed -e 's/(int)//'` 86 86 87 87 case $check0 in … … 117 117 fi 118 118 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)//'` 120 120 121 121 case $check1 in -
trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
r7213 r7232 74 74 75 75 echo "getting list..." >> $scriptlog 2>&1 76 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\ ) | tee $getstatuslog | grep int | sed -e 's/(int)//'`76 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` 77 77 78 78 case $check0 in -
trunk/MagicSoft/Mars/datacenter/scripts/checkstardone
r7213 r7232 75 75 76 76 echo "getting list..." >> $scriptlog 2>&1 77 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\ ) | tee $getstatuslog | grep int | sed -e 's/(int)//'`77 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` 78 78 79 79 case $check0 in … … 99 99 no=`printf %08d $dataset | cut -c 0-5` 100 100 echo "checking files for dataset $dataset..." >> $scriptlog 2>&1 101 datasetfile= /magic/datasets/$no/dataset`printf %08d $dataset`.txt101 datasetfile=$datasetpath/$no/dataset`printf %08d $dataset`.txt 102 102 sequences=(`cat $datasetfile | grep Sequences | sed -e 's/SequencesOn://g' | sed -e 's/SequencesOff://g'`) 103 103 -
trunk/MagicSoft/Mars/datacenter/scripts/correcttime
r7213 r7232 59 59 60 60 echo "getting list..." 61 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\ ) | tee $getstatuslog | grep int | sed -e 's/(int)//'`61 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` 62 62 63 63 case $check0 in -
trunk/MagicSoft/Mars/datacenter/scripts/doexclusions
r7213 r7232 83 83 84 84 echo "getting list..." >> $scriptlog 2>&1 85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\ ) | tee $getstatuslog | grep int | sed -e 's/(int)//'`85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` 86 86 87 87 case $check0 in -
trunk/MagicSoft/Mars/datacenter/scripts/filesondisk
r7213 r7232 85 85 86 86 echo "checking missing cacofiles..." 87 check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\ ) | tee $filesondisklogpath/findcacofiles-$date.log | grep int | sed -e 's/(int)//'`87 check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\,"\"$filesondisklogpath\""\) | tee $filesondisklogpath/findcacofiles-$date.log | grep int | sed -e 's/(int)//'` 88 88 89 89 case $check1 in -
trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto
r7213 r7232 83 83 84 84 echo "getting list..." >> $scriptlog 2>&1 85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\ ) | tee $getstatuslog | grep int | sed -e 's/(int)//'`85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` 86 86 87 87 case $check0 in -
trunk/MagicSoft/Mars/datacenter/scripts/fillstar
r7213 r7232 83 83 84 84 echo "getting list..." >> $scriptlog 2>&1 85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\ ) | tee $getstatuslog | grep int | sed -e 's/(int)//'`85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` 86 86 87 87 case $check0 in -
trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets
r7213 r7232 64 64 65 65 66 datasetfiles=(`ls /magic/datasets/*/*`)66 datasetfiles=(`ls $datasetpath/*/*`) 67 67 echo "datasetfiles: "${datasetfiles[@]} >> $scriptlog 2>&1 68 68 echo "" >> $scriptlog 2>&1 -
trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
r7213 r7232 32 32 set -C 33 33 34 callistorcnew= /magic/datacenter/setup/callisto/callisto.rc34 callistorcnew=$setuppath/callisto/callisto.rc 35 35 36 36 table=SequenceProcessStatus … … 95 95 96 96 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)//'` 98 98 99 99 case $check0 in … … 187 187 fi 188 188 fi 189 sequfile=" /magic/sequences/$no/sequence$no2.txt"189 sequfile="$sequpath/$no/sequence$no2.txt" 190 190 echo "sequfile: "$sequfile >> $scriptlog 2>&1 191 191 -
trunk/MagicSoft/Mars/datacenter/scripts/runganymed
r7213 r7232 90 90 else 91 91 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)//'` 93 93 94 94 case $check0 in … … 181 181 fi 182 182 fi 183 datasetfile=" /magic/datasets/$no/dataset$no2.txt"183 datasetfile="$datasetpath/$no/dataset$no2.txt" 184 184 echo "datasetfile: "$datasetfile >> $scriptlog 2>&1 185 185 wobble=`grep 'WobbleMode:' $datasetfile` >> $scriptlog 2>&1 … … 191 191 mode="onoff" >> $scriptlog 2>&1 192 192 fi 193 ganymedrc= /magic/datacenter/setup/ganymed/ganymed_$mode.rc193 ganymedrc=$setuppath/ganymed/ganymed_$mode.rc 194 194 195 195 echo "run ganymed..." >> $scriptlog 2>&1 -
trunk/MagicSoft/Mars/datacenter/scripts/runstar
r7213 r7232 90 90 else 91 91 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)//'` 93 93 94 94 case $check0 in … … 184 184 fi 185 185 fi 186 sequfile=" /magic/sequences/$no/sequence$no2.txt"186 sequfile="$sequpath/$no/sequence$no2.txt" 187 187 echo "sequfile: "$sequfile >> $scriptlog 2>&1 188 188 -
trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
r7106 r7232 35 35 scriptspath=$mars/datacenter/scripts 36 36 37 logpath=/magic/datacenter/autologs 37 38 lockpath=/magic/datacenter/locks 38 39 listpath=/magic/datacenter/lists 39 logpath=/magic/datacenter/autologs 40 setuppath=/magic/datacenter/setup 41 40 42 datapath=/magic/data 43 subsystempath=/magic/subsystemdata 44 sequpath=/magic/sequences 45 datasetpath=/magic/datasets 41 46 -
trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles
r7213 r7232 83 83 84 84 echo "getting list..." >> $scriptlog 2>&1 85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\ ) | tee $getstatuslog | grep int | sed -e 's/(int)//'`85 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` 86 86 87 87 case $check0 in … … 107 107 no=`printf %08d $sequence | cut -c 0-4` 108 108 no2=`printf %08d $sequence` 109 sequencepath= /magic/sequences/$no109 sequencepath=$sequpath/$no 110 110 if [ ! -d $sequencepath ] 111 111 then … … 131 131 132 132 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)//'` 134 134 case $check2 in 135 135 1) echo "check2=$check2 -> everthing ok " >> $scriptlog 2>&1
Note:
See TracChangeset
for help on using the changeset viewer.