Changeset 4694 for trunk/MagicSoft/Mars/macros/sql
- Timestamp:
- 08/20/04 11:25:36 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/macros/sql
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/sql/filldotrbk.C
r4680 r4694 193 193 TSQLResult *res = serv.Query(query); 194 194 if (!res) 195 {196 cout << "ERROR: " << query << endl << endl;197 195 return 0; 198 }199 196 200 197 delete res; -
trunk/MagicSoft/Mars/macros/sql/filldotrun.C
r4680 r4694 107 107 TSQLResult *res = serv.Query(query); 108 108 if (!res) 109 { 110 cout << "ERROR - Query: " << query << endl; 111 return -1; 112 } 109 return -1; 113 110 114 111 TSQLRow *row=res->Next(); … … 134 131 res=serv.Query(query); 135 132 if (!res) 136 { 137 cout << "ERROR - Query: " << query << endl; 138 return -1; 139 } 133 return -1; 134 140 135 delete res; 141 136 … … 157 152 if (!fin) 158 153 { 159 cout << "Could not open file " << f name << endl;154 cout << "Could not open file " << filename << endl; 160 155 return -1; 161 156 } … … 379 374 if (!TMath::IsNaN(l2uprate) && TMath::Finite(l2uprate)) 380 375 query += Form("fL2RateUnpresc=%d, ", TMath::Nint(l2uprate)); 381 query += "fMagicNumberKEY=1 ";376 query += "fMagicNumberKEY=1, fExcludedFDAKEY=1"; 382 377 383 378 //cout << query << endl; … … 393 388 TSQLResult *res = serv.Query(query); 394 389 if (!res) 395 {396 cout << query << " - FAILED!" << endl;397 390 return -1; 398 }399 391 400 392 delete res; … … 406 398 407 399 // This tool will work from Period017 (2004_05_17) on... 408 void filldotrun(const char *path="/data/MAGIC/Period018/ccdata", Bool_t dummy=kTRUE)400 int filldotrun(const TString path="/data/MAGIC/Period018/ccdata", Bool_t dummy=kTRUE) 409 401 { 410 402 MSQLServer serv("mysql://hercules:d99swMT!@localhost"); … … 423 415 if (path.EndsWith(".run")) 424 416 { 417 cout << path(TRegexp("CC_.*.run", kFALSE)) << flush; 418 Int_t n = insert(serv, dummy, path); 419 cout << " <" << n << "> " << (dummy?"DUMMY":"") << endl; 420 421 return n<0 ? 0 : 1; 422 } 423 424 MDirIter Next(path, "CC_*.run", -1); 425 while (1) 426 { 427 TString name = Next(); 428 if (name.IsNull()) 429 break; 430 425 431 cout << name(TRegexp("CC_.*.run", kFALSE)) << flush; 426 432 Int_t n = insert(serv, dummy, name); 427 433 cout << " <" << n << "> " << (dummy?"DUMMY":"") << endl; 428 434 429 return n<0 ? 0 : 1;430 }431 432 MDirIter Next(path, "CC_*.run", -1);433 while (1)434 {435 TString name = Next();436 if (name.IsNull())437 break;438 439 cout << name(TRegexp("CC_.*.run", kFALSE)) << flush;440 Int_t n = insert(serv, dummy, name);441 cout << " <" << n << "> " << (dummy?"DUMMY":"") << endl;442 443 435 if (n<0) 444 436 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.