- Timestamp:
- 01/07/09 16:31:28 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9212 r9213 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2009/01/07 Daniel Hoehne-Moench 22 23 * datacenter/macros/filldotrun.C: 24 - updated column counting numbers 25 - included a check for the number of columns in the runfiles 26 27 * datacenter/macros/buildsequenceentries.C: 28 - implemented SumTriggerFlagKEY for sequence building 29 30 20 31 21 32 2009/01/06 Thomas Bretz -
trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C
r9191 r9213 345 345 query += ", fL1TriggerTableKEY, fL2TriggerTableKEY," 346 346 " fHvSettingsKEY, fDiscriminatorThresholdTableKEY," 347 " fTriggerDelayTableKEY, fObservationModeKEY "347 " fTriggerDelayTableKEY, fObservationModeKEY, fSumTriggerFlagKEY " 348 348 " FROM RunData WHERE fRunTypeKEY=2 AND "; 349 349 query += where; … … 355 355 356 356 row = res->Next(); 357 if (!row || res->GetFieldCount()!= 8)357 if (!row || res->GetFieldCount()!=9) 358 358 { 359 359 cout << "ERROR - No result from query: " << query << endl; … … 383 383 query1 += Form(" fLightConditionsKEY=%s,", light.Data()); 384 384 query1 += Form(" fObservationModeKEY=%s, ", (*row)[7]); 385 query1 += Form(" fSumTriggerFlagKEY=%s, ", (*row)[8]); 385 386 query1 += "fManuallyChangedKEY=1"; 386 387 -
trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C
r9197 r9213 87 87 using namespace std; 88 88 89 90 89 Int_t insert(MSQLMagic &serv, Bool_t dummy, TString filename) 91 90 { … … 96 95 return -1; 97 96 } 97 //read the file a second time for the check for number of columns 98 ifstream fin2(filename); 98 99 99 100 TString strng; 101 TString strng2; 102 TObjArray *array = new TObjArray(); 103 Int_t check=0; 104 100 105 strng.ReadLine(fin); 106 strng2.ReadLine(fin2); 101 107 if (strng!=TString("[CC Plain Run Summary File]")) 102 108 { … … 108 114 109 115 strng.ReadLine(fin); 116 strng2.ReadLine(fin2); 110 117 TRegexp reg("[0-9][0-9][0-9][0-9][0-9][0-9]-[0-9]"); 111 118 TString arehucas = strng(reg); … … 135 142 { 136 143 strng.ReadLine(fin); 144 strng2.ReadLine(fin2); 137 145 if (!strng.BeginsWith("Telescope M")) 138 146 { … … 145 153 { 146 154 strng.ReadLine(fin); 155 strng2.ReadLine(fin2); 147 156 if (strng[0]!='#') 148 157 { … … 157 166 while (1) 158 167 { 168 // ===== Check for number of columns in file ===== 169 // different arehucas versions provide a different number of columns: 170 // 200405050 - 200405140: 18 columns 171 // 200405180 - 200407270: 35 columns 172 // 200411130 - 200510250: 43 columns 173 // 200603300 - 200802200: 52 columns 174 // 200805190 - 200809120: 54 columns 175 // > 200812040: 55 columns 176 // 177 178 strng2.ReadLine(fin2); 179 //fill an array with the values separated by ' ' 180 array=strng2.Tokenize(" "); 181 check=array->GetEntries(); 182 cout << check << endl; 183 //check the number of columns for the different versions, if there is an empty line (check=0), do nothing 184 if (check != 0) 185 { 186 if ((version <= 200405140 && check != 18) || 187 (version > 200405140 && version <= 200407270 && check != 35) || 188 (version > 200407270 && version <= 200510250 && check != 43) || 189 (version > 200510250 && version <= 200802200 && check != 52) || 190 (version > 200802200 && version <= 200809120 && check != 54) || 191 (version > 200809120 && check != 55)) 192 { 193 strng.ReadLine(fin); 194 cout << "ERROR - Number of columns doesn't match number of required columns." << endl; 195 array->Delete(); 196 continue; 197 } 198 } 199 array->Delete(); 200 201 202 // ========== Col 1: Telescope Number ========= 159 203 Int_t telnumber = 1; // FIXME: "NULL"? 160 204 if (version >=200805190) … … 181 225 } 182 226 183 // ========== Col 1: Run Number =========227 // ========== Col 2: Run Number ========= 184 228 //Reading the line 185 229 //and converting some strings to ints/floats … … 200 244 } 201 245 246 // ========== Col 3: Subrun Number ========= starting with version 200805190 202 247 Int_t filenumber = 0; // FIXME: "NULL"? 203 248 if (version >=200805190) … … 217 262 } 218 263 219 // ========== Col 2: Run Type =========264 // ========== Col 4: Run Type ========= 220 265 strng.ReadToDelim(fin, ' '); 221 266 if (strng.Contains("???")) … … 232 277 //cout << runtype << " "; 233 278 234 // ========== Col 3,4: Start Time =========279 // ========== Col 5,6: Start Time ========= 235 280 TString startdate, starttime; 236 281 startdate.ReadToDelim(fin, ' '); … … 238 283 //cout << startdate << " " << starttime << " "; 239 284 240 // ========== Col 5,6: Stop Time =========285 // ========== Col 7,8: Stop Time ========= 241 286 TString stopdate, stoptime; 242 287 stopdate.ReadToDelim(fin, ' '); … … 253 298 stoptime="00:00:00"; 254 299 255 // ========== Col 7: Source Name =========300 // ========== Col 9: Source Name ========= 256 301 strng.ReadToDelim(fin, ' '); 257 302 if (strng.Contains("???")) … … 266 311 //cout << sourcekey << " "; 267 312 268 // ========== Col 8,9: Local source position =========313 // ========== Col 10,11: Local source position ========= 269 314 strng.ReadToDelim(fin, ' '); 270 315 Float_t zd = atof(strng.Data()); … … 275 320 //cout << zd << " " << az << " "; 276 321 277 // ========== Col 1 0: Number of Events =========322 // ========== Col 12: Number of Events ========= 278 323 strng.ReadToDelim(fin, ' '); 279 324 Int_t evtno = atoi(strng.Data()); … … 281 326 //cout << evtno << " "; 282 327 283 // ========== Col 1 1: Project Name =========328 // ========== Col 13: Project Name ========= 284 329 strng.ReadToDelim(fin, ' '); 285 330 if (strng.Contains("???")) … … 294 339 //cout << projkey << " "; 295 340 296 // ========== Col 1 2: Trigger Table Name =========297 // starting from version 200411130: Col 1 2,13: Trigger Table Name =========341 // ========== Col 14: Trigger Table Name ========= 342 // starting from version 200411130: Col 14,15: Trigger Table Name ========= 298 343 strng.ReadToDelim(fin, ' '); 299 344 if (strng.Contains("???")) … … 401 446 } 402 447 403 // ========== Col 1 3-15: TrigRate, L2 UnPresc Rate, L2 Presc Rate ==========448 // ========== Col 16-18: TrigRate, L2 UnPresc Rate, L2 Presc Rate ========== 404 449 strng.ReadToDelim(fin, ' '); 405 450 Float_t trigrate = atof(strng.Data()); … … 411 456 Float_t l2prrate = atof(strng.Data()); 412 457 413 // ========== Col 1 6,17: DaqRate, Storage Rate ==========458 // ========== Col 19,20: DaqRate, Storage Rate ========== 414 459 strng.ReadToDelim(fin, ' '); 415 460 Float_t daqrate = atof(strng.Data()); … … 418 463 Float_t storerate = atof(strng.Data()); 419 464 420 // ========== Col 18: HV table =========465 // ========== Col 21: HV table ========= 421 466 if (version==200405050 || version==200405140) 422 467 strng.ReadToDelim(fin, '\n'); … … 443 488 if (version>=200411130) 444 489 { 445 // ========== Col 19-35: DC and HV-values, mjd =========490 // ========== Col 22-38: DC and HV-values, mjd ========= 446 491 for (int i=0 ; i<17 ; i++) 447 492 { … … 449 494 } 450 495 451 // ========== Col 3 6: test-flag =========496 // ========== Col 39: test-flag ========= 452 497 strng.ReadToDelim(fin, ' '); 453 498 if (strng.Contains("???")) … … 461 506 } 462 507 463 // ========== Col 37: light conditions =========508 // ========== Col 40: light conditions ========= 464 509 strng.ReadToDelim(fin, ' '); 465 510 if (strng.Contains("???")) … … 473 518 } 474 519 475 // ========== Col 38: discriminator threshold table =========520 // ========== Col 41: discriminator threshold table ========= 476 521 strng.ReadToDelim(fin, ' '); 477 522 if (strng.Contains("???")) … … 485 530 } 486 531 487 // ========== Col 39: trigger delay table =========532 // ========== Col 42: trigger delay table ========= 488 533 strng.ReadToDelim(fin, ' '); 489 534 if (strng.Contains("???")) … … 497 542 } 498 543 499 // ========== Col 4 0,41: Telescope RA and Dec sent to drive =========500 strng.ReadToDelim(fin, ' '); 501 strng.ReadToDelim(fin, ' '); 502 503 // ========== Col 4 2: Calibration Script =========544 // ========== Col 43,44: Telescope RA and Dec sent to drive ========= 545 strng.ReadToDelim(fin, ' '); 546 strng.ReadToDelim(fin, ' '); 547 548 // ========== Col 45: Calibration Script ========= 504 549 if (version>=200411130 && version<=200510250) 505 550 strng.ReadToDelim(fin, '\n'); … … 521 566 if (version>=200603300) 522 567 { 523 // ========== Col 4 3: Observation Mode =========568 // ========== Col 46: Observation Mode ========= 524 569 strng.ReadToDelim(fin, ' '); 525 570 if (strng.Contains("???")) … … 533 578 } 534 579 535 // ========== Col 4 4-51: Source RA and Dec, DT's and IPR =========580 // ========== Col 47-54: Source RA and Dec, DT's and IPR ========= 536 581 for (int i=0 ; i<7 ; i++) 537 582 { … … 547 592 if (version>=200812040) 548 593 { 549 // ========= Col 5 2: SumTrigger flag =========594 // ========= Col 55: SumTrigger flag ========= 550 595 strng.ReadToDelim(fin, '\n'); 551 596 if (strng.Contains("???"))
Note:
See TracChangeset
for help on using the changeset viewer.