Changeset 7629 for trunk/MagicSoft/Mars/datacenter/macros
- Timestamp:
- 04/07/06 14:10:53 (19 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/macros
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C
r7528 r7629 463 463 " fL1TriggerTableKEY, fL2TriggerTableKEY," 464 464 " fHvSettingsKEY, fDiscriminatorThresholdTableKEY," 465 " fTriggerDelayTableKEY, fLightConditionsKEY, fTestFlagKEY" 465 " fTriggerDelayTableKEY, fLightConditionsKEY, " 466 " fTestFlagKEY, fObservationModeKEY " 466 467 " FROM RunData" 467 468 " WHERE fRunTypeKEY=2 AND fExcludedFDAKEY=1 AND (fRunNumber BETWEEN %d AND %d)" … … 496 497 query1+=Form(" fTriggerDelayTableKEY=%s,", (*row)[6]); 497 498 query1+=Form(" fLightConditionsKEY=%s,", (*row)[7]); 498 query1+=Form(" fTestFlagKEY=%s, fManuallyChangedKEY=1", (*row)[8]); 499 query1+=Form(" fTestFlagKEY=%s, ", (*row)[8]); 500 query1+=Form(" fObservationModeKEY=%s, fManuallyChangedKEY=1", (*row)[9]); 499 501 500 502 … … 810 812 811 813 //get all values from the database, that are relevant for building sequences 812 TString query(Form("SELECT fRunNumber, fSourceKEY, fProjectKEY, fHvSettingsKEY, fLightConditionsKEY, fDiscriminatorThresholdTableKEY, fTriggerDelayTableKEY FROM RunData WHERE %s AND fExcludedFDAKEY=1 order by fRunNumber", cond.Data()));814 TString query(Form("SELECT fRunNumber, fSourceKEY, fProjectKEY, fHvSettingsKEY, fLightConditionsKEY, fDiscriminatorThresholdTableKEY, fTriggerDelayTableKEY, fObservationModeKEY FROM RunData WHERE %s AND fExcludedFDAKEY=1 order by fRunNumber", cond.Data())); 813 815 814 816 TSQLResult *res = serv.Query(query); … … 819 821 //for each block the first and the last run are stored in a TExMap 820 822 //the values are checked with the help of an array of TStrings 821 TString keys[ 6]= { "NULL", "NULL", "NULL", "NULL", "NULL", "NULL" };823 TString keys[7]= { "NULL", "NULL", "NULL", "NULL", "NULL", "NULL" , "NULL" }; 822 824 TString stop = "NULL"; 823 825 TString runstart = "NULL"; … … 833 835 if (count==0) 834 836 { 835 for (Int_t i=1 ; i< 7; i++)837 for (Int_t i=1 ; i<8 ; i++) 836 838 keys[i-1]=(*row)[i]; 837 839 runstart=(*row)[0]; 838 840 } 839 841 840 for (Int_t i=1 ; i< 7; i++)842 for (Int_t i=1 ; i<8 ; i++) 841 843 { 842 844 runbegin=atoi(runstart.Data()); … … 854 856 blocks.Add((ULong_t)blocks.GetSize(), (Long_t)runbegin, (Long_t)runend); 855 857 runstart=(*row)[0]; 856 for (Int_t i=1 ; i< 7; i++)858 for (Int_t i=1 ; i<8 ; i++) 857 859 keys[i-1]=(*row)[i]; 858 860 break; -
trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C
r7460 r7629 38 38 // 041113-0, 041209-0, 041221-0 39 39 // 050224-0, 050317-0, 050322-0, 050401-0, 050413-0, 050415-0, 050714-0, 40 // 050719-0, 050829-0, 051025-0 40 // 050719-0, 050829-0, 051025-0, 41 // 060330-0 41 42 // 42 43 // Usage: … … 187 188 version!=200504010 && version!=200504130 && version!=200504150 && 188 189 version!=200507140 && version!=200507190 && version!=200508290 && 189 version!=200510250) 190 version!=200510250 && 191 version!=200603300) 190 192 { 191 193 cout << filename << ": File Version unknown - please update the macro!" << endl; … … 406 408 default: 407 409 { 408 cout << "WARNING: neit er L1 nor L2 Trigger table - please check what is happening." << strng << endl;410 cout << "WARNING: neither L1 nor L2 Trigger table - please check what is happening." << strng << endl; 409 411 break; 410 412 } … … 456 458 || version==200504010 || version==200504130 || version==200504150 457 459 || version==200507140 || version==200507190 || version==200508290 458 || version==200510250 )460 || version==200510250 || version==200603300) 459 461 { 460 462 // ========== Col 19-35: DC and HV-values, mjd ========= … … 512 514 } 513 515 514 // ========== Col 40,41: RA and Dec sent to drive =========516 // ========== Col 40,41: Telescope RA and Dec sent to drive ========= 515 517 strng.ReadToDelim(fin, ' '); 516 518 strng.ReadToDelim(fin, ' '); 517 519 518 520 // ========== Col 42: Calibration Script ========= 519 strng.ReadToDelim(fin, '\n'); 521 if (version==200411130 || version==200412090 || version==200412210 522 || version==200502240 || version==200503170 || version==200503220 523 || version==200504010 || version==200504130 || version==200504150 524 || version==200507140 || version==200507190 || version==200508290 525 || version==200510250) 526 strng.ReadToDelim(fin, '\n'); 527 else 528 strng.ReadToDelim(fin, ' '); 520 529 if (strng.Contains("???")) 521 530 strng="n/a"; … … 528 537 } 529 538 539 } 540 541 Int_t observationmodekey=1; 542 if (version==200603300) 543 { 544 // ========== Col 43: Observation Mode ========= 545 strng.ReadToDelim(fin, ' '); 546 if (strng.Contains("???")) 547 strng="n/a"; 548 549 observationmodekey = QueryNameKEY(serv, dummy, "ObservationMode", strng.Data()); 550 if (observationmodekey<0) 551 { 552 strng.ReadLine(fin); 553 continue; 554 } 555 556 // ========== Col 44-51: Source RA and Dec, DT's and IPR ========= 557 for (int i=0 ; i<7 ; i++) 558 { 559 strng.ReadToDelim(fin, ' '); 560 } 561 strng.ReadToDelim(fin, '\n'); 530 562 } 531 563 … … 554 586 query += Form("fLightConditionsKEY=%d, ", lightcondkey); 555 587 query += Form("fHvSettingsKEY=%d, ", hvkey); 588 query += Form("fObservationModeKEY=%d, ", observationmodekey); 556 589 if (!TMath::IsNaN(zd) && TMath::Finite(zd)) 557 590 query += Form("fZenithDistance=%d, ", TMath::Nint(zd)); -
trunk/MagicSoft/Mars/datacenter/macros/setupdb.C
r7482 r7629 254 254 "INSERT MyMagic.DiscriminatorThresholdTable (fDiscriminatorThresholdTableKEY, fDiscriminatorThresholdTableName, fDiscriminatorThresholdTable) VALUES " 255 255 " (1, 'n/a', 'Discriminator threshold table is not available')")); 256 257 // Observation Mode 258 list.Add(new TObjString( 259 "INSERT MyMagic.ObservationMode (fObservationModeKEY, fObservationModeName, fObservationMode) VALUES " 260 " (1, 'n/a', 'Not available')")); 256 261 257 262 … … 330 335 " fDiscriminatorThresholdTableKEY SMALLINT UNSIGNED NOT NULL," 331 336 " fTriggerDelayTableKEY SMALLINT UNSIGNED NOT NULL," 337 " fObservationModeKEY SMALLINT UNSIGNED NOT NULL," 332 338 ")"; 333 339 … … 419 425 list.Add(CreateKeyTable("DiscriminatorThresholdTable")); 420 426 list.Add(CreateKeyTable("TriggerDelayTable")); 427 list.Add(CreateKeyTable("ObservationMode")); 421 428 422 429 list.Add(new TObjString( … … 530 537 " fDiscriminatorThresholdTableKEY SMALLINT UNSIGNED NOT NULL," 531 538 " fTriggerDelayTableKEY SMALLINT UNSIGNED NOT NULL," 539 " fObservationModeKEY SMALLINT UNSIGNED NOT NULL," 532 540 ")"; 533 541
Note:
See TracChangeset
for help on using the changeset viewer.