Changeset 19027 for trunk/FACT++


Ignore:
Timestamp:
06/25/18 10:11:56 (6 years ago)
Author:
tbretz
Message:
Be a bit more specific when closing a file to avoid confusion. Same for opening a file. In additon there is no need when the run number changes to overwrite maxEvt. This was an early hack to close the file (which is done now automatically whenever a new file is opened) and produces wrong output ('file closed after 1005 events').
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/EventBuilder.cc

    r18987 r19027  
    654654    if (newrun)
    655655    {
    656         // Since we have started a new run, we know already when to close the
    657         // previous run in terms of number of events
    658         actrun->maxEvt = actrun->lastEvt;
    659 
    660656        factPrintf(MessageImp::kInfo, "New run %d (evt=%d) registered with roi=%d(%d), prev=%d",
    661657                   rd.H.runnumber, rd.H.fad_evt_counter, nRoi[0], nRoi[8], actrun->runId);
     
    842838            }
    843839
    844             factPrintf(MessageImp::kInfo, "Opened new file for run %d (evt=%d)", evt->runNum, evt->evNum);
     840            factPrintf(MessageImp::kInfo, "Opened new file for data from run %d (evt=%d)", evt->runNum, evt->evNum);
    845841            run.fileStat = kFileOpen;
    846842        }
     
    880876    vector<string> reason;
    881877    if (evt->closeRequest&kRequestManual)
    882         reason.emplace_back("close requested");
     878        reason.emplace_back("close was requested");
    883879    if (evt->closeRequest&kRequestTimeout)
    884         reason.emplace_back("receive timeout");
     880        reason.emplace_back("receive timed out");
    885881    if (evt->closeRequest&kRequestConnectionChange)
    886882        reason.emplace_back("connection changed");
     
    888884        reason.emplace_back("event check failed");
    889885    if (evt->closeRequest&kRequestMaxTimeReached)
    890         reason.push_back(to_string(run.closeTime-run.openTime)+"s reached");
     886        reason.push_back(to_string(run.closeTime-run.openTime)+"s had been reached");
    891887    if (evt->closeRequest&kRequestMaxEvtsReached)
    892         reason.push_back(to_string(run.maxEvt)+" evts reached");
     888        reason.push_back(to_string(run.maxEvt)+" evts had been reached");
    893889    if (!rc1)
    894890        reason.emplace_back("runWrite failed");
    895891
    896892    const string str = boost::algorithm::join(reason, ", ");
    897     factPrintf(MessageImp::kInfo, "File closed because %s",  str.c_str());
     893    factPrintf(MessageImp::kInfo, "File %d was closed because %s", run.runId,  str.c_str());
    898894
    899895    return true;
Note: See TracChangeset for help on using the changeset viewer.