Changeset 15344 for trunk/FACT++/src
- Timestamp:
- 04/15/13 13:15:48 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/EventBuilder.c
r15343 r15344 2327 2327 } 2328 2328 2329 void checkAndCloseRun(int j, int irun, int cond, char *where)2329 void checkAndCloseRun(int j, int irun, int cond, int where) 2330 2330 { 2331 2331 if (!cond && … … 2360 2360 if (rc<0) 2361 2361 { 2362 factPrintf(kError, 503, "writeEvt-% s: Error closing run %d (runClose[1],rc=%d)",2362 factPrintf(kError, 503, "writeEvt-%d: Error closing run %d (runClose,rc=%d)", 2363 2363 where, runCtrl[j].runId, rc); 2364 runCtrl[j].fileId = 92 ;2364 runCtrl[j].fileId = 92+where*2; 2365 2365 } 2366 2366 else 2367 2367 { 2368 factPrintf(kInfo, 503, "writeEvt-% s: Closed run %d (ii=%d)",2368 factPrintf(kInfo, 503, "writeEvt-%d: Closed run %d (reason=%d)", 2369 2369 where, irun, ii); 2370 runCtrl[j].fileId = 93 ;2370 runCtrl[j].fileId = 93+where*2; 2371 2371 } 2372 2372 } … … 2500 2500 } 2501 2501 2502 checkAndCloseRun(j, irun, rc<0, "1");2502 checkAndCloseRun(j, irun, rc<0, 1); 2503 2503 } 2504 2504 } … … 2553 2553 //ETIENNE added the condition at this line. dunno what to do with run 0: skipping it 2554 2554 const int cond = runCtrl[j].lastTime < lastStartedTime && runCtrl[j].runId != 0; 2555 checkAndCloseRun(j, runCtrl[j].runId, cond, "2");2555 checkAndCloseRun(j, runCtrl[j].runId, cond, 2); 2556 2556 } 2557 2557 } … … 2581 2581 factPrintf(kInfo, -1, "Close all open files ..."); 2582 2582 for (j = 0; j < MAX_RUN; j++) 2583 if (runCtrl[j].fileId == 0) { 2584 if (runCtrl[j].runId == gi_myRun) 2585 gi_myRun = g_actTime; 2586 2587 if (runCtrl[j].procId == 0) { 2588 runFinish1 (runCtrl[j].runId); 2589 runCtrl[j].procId = 92; 2590 } 2591 2592 runCtrl[j].closeTime = g_actTime - 1; 2593 int i = runClose (runCtrl[j].fileHd, &runTail[j], sizeof (runTail[j])); 2594 int ii = 0; 2595 if (runCtrl[j].closeTime < g_actTime) 2596 ii |= 2; // = 2 2597 /*else*/ if (runCtrl[j].lastTime < g_actTime - 300) 2598 ii |= 4; // = 3 2599 /*else*/ if (runCtrl[j].maxEvt <= runCtrl[j].actEvt) 2600 ii |= 8; // = 4 2601 if (i < 0) { 2602 factPrintf(kError, 506, "writeEvt: Error closing run %d (runClose[3],i=%d)", runCtrl[j].runId, i); 2603 runCtrl[j].fileId = 96; 2604 } else { 2605 factPrintf(kInfo, 507, "writeEvt: Closed run %d (ii[3]=%d)", runCtrl[j].runId, ii); 2606 runCtrl[j].fileId = 97; 2607 } 2608 } 2583 { 2584 if (runCtrl[j].fileId == 0) 2585 checkAndCloseRun(j, runCtrl[j].runId, 1, 3); 2586 } 2609 2587 2610 2588 gw_runStat = -99;
Note:
See TracChangeset
for help on using the changeset viewer.