mlogger - ROOT - misleading error messages

Create issue
Issue #220 resolved
Andreas Suter created an issue

The attached file diff is a proposed fix for the following two issues

  1. there is currently a double counting for ‘log_chn->statistics.events_written’ when writing ROOT files.
  2. there are misleading error messages when writing ROOT files due to unfiltered midas system events (BOR, EOR, ….)

Comments (11)

  1. Stefan Ritt
    1. Cannot reproduce the problem. Maybe you have to loggers running in parallel? Just did a quick check on a fresh experiment and got correct numbers (4493 events logged, 4441+50+2 events generated: Screenshot 2020-03-27 at 15.38.18 .png

    2. I just outcommented the error message. Now the ROOT writer silently ignores the BOR/EOR events.

  2. Andreas Suter reporter

    In root_write()

    at the end there you find

    /* update statistics */
    log_chn->statistics.bytes_written += size;
    log_chn->statistics.bytes_written_total += size;

    root_write() is called in int wr_write(LOG_CHN* log_chn, const void* data, const int size).
    There are many wr_write() over which I have no overview.

    log_chn->statistics.events_written++ is called also in log_write():

    INT log_write(LOG_CHN * log_chn, EVENT_HEADER * pevent)
       INT status = 0, size;
       DWORD actual_time, start_time, duration;
       BOOL next_subrun;
       //printf("log_write %d\n", pevent->data_size + sizeof(EVENT_HEADER));
       start_time = ss_millitime();
       if (log_chn->writer) {
          int evt_size = pevent->data_size + sizeof(EVENT_HEADER);
          WriterInterface* wr = log_chn->writer;
          status = wr->wr_write(log_chn, pevent, evt_size); <-- here root_write() is called internally (at least I think)
                                                                which increments events_written (see above)  
          if (status == SUCCESS) {
             /* update statistics */
             log_chn->statistics.events_written++;          <-- here it is incremented again, hence double counting!!
             log_chn->statistics.bytes_written_uncompressed += evt_size;

  3. Stefan Ritt

    The wr->wr_write() function was written by KO in 2015:

    So I assign this bug to him. Actually with the Looger.odb from above I was able to reproduce the error, so I can confirm that it’s still there:


  4. Log in to comment