- Timestamp:
- 07/20/08 15:21:42 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9016 r9017 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2008/07/20 Thomas Bretz 22 23 * callisto.cc, star.cc, mjobs/MDataSet.cc, mjobs/MJCalibrateSignal.cc, 24 mjobs/MJCalibration.cc, mjobs/MJPedestal.cc, mjoptim/MJOptimize.cc, 25 mmain/MEventDisplay.cc: 26 - replaced Setup*Runs by GetRuns 27 28 * datacenter/macros/buildsequenceentries.C: 29 - output if something is deleted 30 31 * datacenter/macros/plotdb.C: 32 - added kGroupByDay option 33 - some small changes 34 - made group by work with "as" 35 - made use of TEnv obsolete 36 37 * datacenter/macros/plotrundb.C: 38 - added telescope number as otpion 39 40 * datacenter/scripts/checkfilesforsequenceavail: 41 - added telescope number 1 to call of checkfileavail.C 42 43 * mbase/MTime.cc: 44 - made SetSqlDateTime more flexible 45 46 20 47 21 48 2008/07/19 Thomas Bretz -
trunk/MagicSoft/Mars/callisto.cc
r8999 r9017 122 122 } 123 123 124 static void PrintFiles(const MSequence &seq, const TString &kInpathD, Bool_t raw, Bool_tshowall)124 static void PrintFiles(const MSequence &seq, const TString &kInpathD, Bool_t showall) 125 125 { 126 126 const char *prep = showall ? "Found" : "Scheduled"; 127 127 128 128 MDirIter Next1, Next2, Next3; 129 seq. SetupPedRuns(Next1, kInpathD, raw);130 seq. SetupCalRuns(Next2, kInpathD, raw);131 seq. SetupDatRuns(Next3, kInpathD, raw);129 seq.GetRuns(Next1, MSequence::kRawPed, kInpathD); 130 seq.GetRuns(Next2, MSequence::kRawCal, kInpathD); 131 seq.GetRuns(Next3, MSequence::kRawDat, kInpathD); 132 132 133 133 gLog << all; … … 310 310 // 311 311 if (kPrintFiles) 312 PrintFiles(seq, kInpathD, !seq.IsMonteCarlo(),kFALSE);312 PrintFiles(seq, kInpathD, kFALSE); 313 313 if (kPrintFound) 314 PrintFiles(seq, kInpathD, !seq.IsMonteCarlo(),kTRUE);314 PrintFiles(seq, kInpathD, kTRUE); 315 315 316 316 // if (seq.HasMoon()) -
trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C
r9014 r9017 446 446 if (IsDummy()) 447 447 { 448 cout << " + unlink " << fname << endl;449 cout << " + " << cmd1 << endl;450 cout << " + " << cmd2 << endl;448 cout << " + would unlink " << fname << endl; 449 cout << " + would remove " << cmd1 << endl; 450 cout << " + would remove " << cmd2 << endl; 451 451 return kTRUE; 452 452 } 453 454 cout << " + will unlink " << fname << endl; 455 cout << " + will remove " << cmd1 << endl; 456 cout << " + will remove " << cmd2 << endl; 453 457 454 458 gSystem->Unlink(fname); -
trunk/MagicSoft/Mars/datacenter/macros/plotdb.C
r8988 r9017 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.4 8 2008-06-30 09:36:34tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: plotdb.C,v 1.49 2008-07-20 14:21:40 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 63 63 64 64 #include <TH1.h> 65 #include <TEnv.h>66 65 #include <TPad.h> 67 66 #include <TLine.h> … … 90 89 kGroupByPrimary, 91 90 kGroupByHour, 91 kGroupByDay, 92 92 kGroupByNight, 93 93 kGroupByWeek, … … 159 159 while ((row=res.Next())) 160 160 { 161 Int_t pos=0; 161 162 // Get all fields of this row 162 const char *date = (*row)[0]; 163 const char *zd = (*row)[1]; 164 const char *val = (*row)[2]; 165 const char *snum = res.GetFieldCount()>3 ? (*row)[3] : 0; 166 const char *verr = res.GetFieldCount()>4 ? (*row)[5] : 0; 163 const char *date = (*row)[pos++]; 164 const char *zd = (*row)[pos++]; 165 const char *val = (*row)[pos++]; 166 const char *zderr = fGroupBy!=kNone ? (*row)[pos++] : 0; 167 const char *verr = fGroupBy!=kNone ? (*row)[pos++] : 0; 168 const char *snum = fDataSet ? (*row)[pos++] : 0; 167 169 168 170 delete row; … … 383 385 fDataSet = NULL; 384 386 } 385 if (!filename.IsNull()) 386 fDataSet = new MDataSet(filename); 387 388 fPrimaryNumber=""; 389 390 if (filename.IsNull()) 391 return; 392 393 fDataSet = new MDataSet(filename); 394 fPrimaryNumber="Sequences.fSequenceFirst"; 387 395 } 388 396 void SetPlotRange(Float_t min, Float_t max/*, Int_t n=5*/) { fPlotMin = min; fPlotMax = max; } … … 395 403 void SetGroupBy(GroupBy_t b=kGroupByWeek) { fGroupBy=b; } 396 404 void SetPrimaryDate(const char *ts) { fPrimaryDate=ts; } 397 void SetPrimaryNumber(const char *ts) { fPrimaryNumber=ts;}405 void SetPrimaryNumber(const char *ts) { } 398 406 void SetSecondary(const char *ts) { fSecondary=ts; } 399 407 400 408 MStatusDisplay *GetDisplay() { return fDisplay; } 409 MSQLMagic &GetServer() { return fServer; } 401 410 402 411 Bool_t Plot(const char *value, Float_t min=0, Float_t max=-1, Float_t resolution=0) … … 424 433 case kGroupByNight: 425 434 query += Form("DATE_FORMAT(ADDDATE(%s,Interval 12 hour), '%%Y-%%m-%%d 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 435 break; 436 case kGroupByDay: 437 query += Form("DATE_FORMAT(%s, '%%Y-%%m-%%d 00:00:00') AS %s ", fPrimaryDate.Data(), valued.Data()+1); 426 438 break; 427 439 case kGroupByWeek: … … 445 457 query += ", "; 446 458 query += value; 459 } 460 else 461 { 462 TString v(value); 463 464 TString as = v(TPRegexp(" +[aA][sS] +[a-zA-Z0-9]+ *$")); 465 Ssiz_t p = v.Index(as); 466 467 v.Prepend("("); 468 v.Insert(p<=0?v.Length():p+1, ")"); 469 470 query += ", AVG"; 471 query += v; 472 query += ", AVG("; 473 query += fSecondary; 474 query += "), STD"; 475 query += v; 476 query += ", STD("; 477 query += fSecondary; 478 query += ")"; 479 } 480 481 if (fDataSet) 482 { 447 483 query += ", "; 448 484 query += fPrimaryNumber; 449 query += " "; 450 } 451 else 452 { 453 query += ", AVG("; 454 query += fSecondary; 455 query += "), AVG("; 456 query += value; 457 query += "), "; 458 query += fPrimaryNumber; 459 query += ", STD("; 460 query += fSecondary; 461 query += "), STD("; 462 query += value; 463 query += ") "; 464 } 465 466 query += Form("FROM %s ", tabled.Data()); 485 } 486 487 query += Form(" FROM %s ", tabled.Data()); 467 488 468 489 const Bool_t interval = !fRequestFrom.IsNull() && !fRequestTo.IsNull(); 469 490 470 491 TString where(fCondition); 471 /*472 if (!fDataSet && !interval && tablev=="Star")473 {474 if (!where.IsNull())475 where += " AND ";476 where += "Star.fMuonNumber>300 ";477 }478 */479 492 if (interval) 480 493 { … … 521 534 return kTRUE; 522 535 } 536 // ClassDef(MPlot, 0) 523 537 }; 538 539 //ClassImp(MPlot); 524 540 525 541 void plotalldb(MPlot &plot) 526 542 { 527 543 //plot.SetGroupBy(MPlot::kGroupByNight); 544 //plot.SetDataSet("dataset.txt"); 528 545 529 546 plot.SetPrimaryDate("Sequences.fRunStart"); 530 plot.SetPrimaryNumber("Sequences.fSequenceFirst");531 547 plot.SetSecondary("(Sequences.fZenithDistanceMin+Sequences.fZenithDistanceMax)/2 as '<Zd>'"); 532 548 … … 668 684 int plotdb(TString from, TString to, const char *dataset=0) 669 685 { 670 TEnv env("sql.rc"); 671 672 MSQLMagic serv(env); 686 MSQLMagic serv("sql.rc"); 673 687 if (!serv.IsConnected()) 674 688 { … … 700 714 int plotdb(const char *ds) 701 715 { 702 TEnv env("sql.rc"); 703 704 MSQLMagic serv(env); 716 MSQLMagic serv("sql.rc"); 705 717 if (!serv.IsConnected()) 706 718 { … … 732 744 int plotdb(Int_t period, const char *dataset="") 733 745 { 734 TEnv env("sql.rc"); 735 736 MSQLMagic serv(env); 746 MSQLMagic serv("sql.rc"); 737 747 if (!serv.IsConnected()) 738 748 { -
trunk/MagicSoft/Mars/datacenter/macros/plotrundb.C
r8996 r9017 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: plotrundb.C,v 1. 6 2008-07-05 19:01:42tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: plotrundb.C,v 1.7 2008-07-20 14:21:40 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 61 61 #include "plotdb.C" 62 62 63 void plotall(MPlot &plot )63 void plotall(MPlot &plot, Int_t tel=0) 64 64 { 65 65 plot.SetGroupBy(MPlot::kGroupByNight); … … 73 73 cond += t.GetSqlDateTime(); 74 74 cond += "'"; 75 if (tel>0) 76 { 77 query[0] += " AND fTelescopeNumber="; 78 query[0] += tel; 79 } 75 80 plot.SetCondition(cond); 76 81 -
trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
r8513 r9017 73 73 makedir $checkfileavailpath >> $scriptlog 2>&1 74 74 checkfileavaillog=$checkfileavailpath/$program-$sequence.log 75 75 76 76 sequencefile=$sequpath/$no/sequence$no2.txt 77 77 … … 79 79 setstatus "start" >> $scriptlog 2>&1 80 80 81 check1=`root -q -b $macrospath/checkfileavail.C+\(\""$sequencefile\" "\) | tee $checkfileavaillog | intgrep`81 check1=`root -q -b $macrospath/checkfileavail.C+\(\""$sequencefile\",1"\) | tee $checkfileavaillog | intgrep` 82 82 83 83 case $check1 in -
trunk/MagicSoft/Mars/mbase/MTime.cc
r9012 r9017 403 403 return kFALSE; 404 404 405 UInt_t y, mon, d, h, m, s; 405 UInt_t y, mon, d, h, m, s, ms; 406 407 if (7==sscanf(str, "%04u-%02u-%02u %02u:%02u:%02u.%u", &y, &mon, &d, &h, &m, &s, &ms)) 408 return Set(y, mon, d, h, m, s, ms); 409 406 410 if (6==sscanf(str, "%04u-%02u-%02u %02u:%02u:%02u", &y, &mon, &d, &h, &m, &s)) 407 411 return Set(y, mon, d, h, m, s); 412 413 if (5==sscanf(str, "%04u-%02u-%02u %02u:%02u", &y, &mon, &d, &h, &m)) 414 return Set(y, mon, d, h, m); 415 416 if (4==sscanf(str, "%04u-%02u-%02u %02u", &y, &mon, &d, &h)) 417 return Set(y, mon, d, h); 408 418 409 419 if (3==sscanf(str, "%04u-%02u-%02u", &y, &mon, &d)) -
trunk/MagicSoft/Mars/mjobs/MDataSet.cc
r8989 r9017 633 633 } 634 634 635 if (seq-> SetupDatRuns(files, MSequence::kImages)<=0)635 if (seq->GetRuns(files, MSequence::kImages)<=0) 636 636 return kFALSE; 637 637 } -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r8999 r9017 260 260 if (fSequence.IsValid()) 261 261 { 262 if (fSequence. SetupDatRuns(iter, 0, !fSequence.IsMonteCarlo())<=0)262 if (fSequence.GetRuns(iter, MSequence::kRawDat)<=0) 263 263 return kFALSE; 264 264 } -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r9005 r9017 1483 1483 1484 1484 MDirIter iter; 1485 if (fSequence. SetupCalRuns(iter, 0, !fSequence.IsMonteCarlo())<=0)1485 if (fSequence.GetRuns(iter, MSequence::kRawCal)<=0) 1486 1486 return kFALSE; 1487 1487 -
trunk/MagicSoft/Mars/mjobs/MJPedestal.cc
r9005 r9017 949 949 { 950 950 const Int_t n0 = IsUseData() 951 ? fSequence. SetupDatRuns(iter, 0, !fSequence.IsMonteCarlo())952 : fSequence. SetupPedRuns(iter, 0, !fSequence.IsMonteCarlo());951 ? fSequence.GetRuns(iter, MSequence::kRawDat) 952 : fSequence.GetRuns(iter, MSequence::kRawPed); 953 953 954 954 if (n0<=0) -
trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc
r8957 r9017 250 250 if (!seq->IsValid()) 251 251 return kFALSE; 252 if (seq-> SetupDatRuns(files)<=0)252 if (seq->GetRuns(files, MSequence::kRootDat)<=0) 253 253 return kFALSE; 254 254 } -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r8999 r9017 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.6 4 2008-07-14 19:59:11tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.65 2008-07-20 14:21:39 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 227 227 { 228 228 MDirIter iter; 229 if (seq-> SetupDatRuns(iter, MSequence::kCalibrated)<=0)229 if (seq->GetRuns(iter, MSequence::kCalibrated)<=0) 230 230 return; 231 231 read->AddFiles(iter); -
trunk/MagicSoft/Mars/star.cc
r8999 r9017 84 84 85 85 MDirIter Next; 86 seq. SetupDatRuns(Next, MSequence::kCalibrated, kInpathD);86 seq.GetRuns(Next, MSequence::kCalibrated, kInpathD); 87 87 88 88 gLog << all;
Note:
See TracChangeset
for help on using the changeset viewer.