Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  12 Feb 2025, Mark Grimes, Forum, TMFeRpcHandlerInterface::HandleEndRun when running offline on a Midas file 
    Reply  26 Feb 2025, Thomas Lindner, Forum, TMFeRpcHandlerInterface::HandleEndRun when running offline on a Midas file 
    Reply  20 Mar 2025, Konstantin Olchanski, Forum, TMFeRpcHandlerInterface::HandleEndRun when running offline on a Midas file 
       Reply  25 Mar 2025, Mark Grimes, Forum, TMFeRpcHandlerInterface::HandleEndRun when running offline on a Midas file 
          Reply  25 Mar 2025, Konstantin Olchanski, Forum, TMFeRpcHandlerInterface::HandleEndRun when running offline on a Midas file 
             Reply  26 Mar 2025, Mark Grimes, Forum, TMFeRpcHandlerInterface::HandleEndRun when running offline on a Midas file 
                Reply  28 Mar 2025, Konstantin Olchanski, Forum, TMFeRpcHandlerInterface::HandleEndRun when running offline on a Midas file 
Message ID: 2971     Entry time: 20 Mar 2025     In reply to: 2942     Reply to this: 2997
Author: Konstantin Olchanski 
Topic: Forum 
Subject: TMFeRpcHandlerInterface::HandleEndRun when running offline on a Midas file 
> I have a manalyzer that uses a derived class of TMFeRpcHandlerInterface to communicate information to 
> Midas during online running.  At the end of each run it saves out custom data in the 
> TMFeRpcHandlerInterface::HandleEndRun override. This works really well.
> However, when I run offline on a Midas output file the HandleEndRun method is never called and my data is 
> never saved.  Is this intentional?  I understand that there is no point for the HandleBinaryRpc method offline, 
> but the other methods (HandleEndRun, HandleBeginRun etc) could serve a purpose.  Or is it a conscious 
> choice to ignore all of TMFeRpcHandlerInterface when offline?

apologies for delayed response.

I saw the question, completely did not understand it, only now got around to figure out what is going on.

according to manalyzer/README.md, section "manalyzer module and object life time", BeginRun() and EndRun() is called 
always. Offline and online. What you see would be a bug that we do not see in our environment. I confirm this by 
running manalyzer in a demo mode: ./bin/manalyzer_test.exe  --demo -e10 -t

no, wait, you say you use HandleBeginRun() and HandleEndRun(). this is not right, they are not part of the manalyzer 
API and they indeed are only used when running online.

correct solution would be to use BeginRun() and EndRun() instead of HandleBeginRun() and HandleEndRun().

you could also save your data in the module destructor (although good programming recommendation is to use 
destructor only for unavoidable things, like freeing memory, etc).

K.O.
ELOG V3.1.4-2e1708b5