Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  22 Sep 2024, Tam Kai Chung, Bug Report, Can we convert the .mid file into .root file 
    Reply  24 Sep 2024, Konstantin Olchanski, Bug Report, Can we convert the .mid file into .root file 
Message ID: 2858     Entry time: 24 Sep 2024     In reply to: 2856
Author: Konstantin Olchanski 
Topic: Bug Report 
Subject: Can we convert the .mid file into .root file 
"Can we convert the .mid file into .root file".

yes, you can, but the operation is under-defined. it's like asking "can I convert these stones into houses". the answer is "yes", but it involves 
more than running a universal conversion program.

For this reason, I recommend against converting midas files "to root". for some types of midas data such a conversion makes no sense (i.e. alpha-g 
streamed udp packets with chopped compressed waveforms).

I recommend that you analyze you data in the midas analyzer. You can start with manalyzer_example_root.cxx,
it shows how to create a ROOT histogram, how to access midas event bank data and call the TH1 "Fill" method.

Instead of filling histograms in the analyzer, you can create a ROOT TTree and fill it with data from midas data banks,
effectively you will create your own custom converter from midas to root.

The key thing is that it has to be a custom converter, because only you know the meaning of midas bank data
and how it should be best stored in a root tree.

K.O.
ELOG V3.1.4-2e1708b5