Back Midas Rome Roody Rootana
  Rome Analyzer Framework, Page 8 of 11  Not logged in ELOG logo
ID Date Author Topicdown Subject
  169   29 Oct 2015 Ryu SawadaForumRunning ROME in online mode
Dear Joe

In the online mode, the analyzer does not read midas files.
Instead, it connects to a midas experiment over the network or to the local shared memory.

Same as other midas online applications, you may need to specify the hostname of the midas system and the 
experiment name.
You can set the parameters in the <Online> section of your configuration XML file.

Of course, the midas system has to be ready to accept the connection.
You can check it, for example, using 'odbedit' command.

Best regards,

Ryu

> Hi folks,
> 
> I've been a happy and successful user of rome in the offline mode for some time,
> and now when I try and connect it to a current run the analyzer does not find
> the current file.  I attach a screenshot - you can see when I run the analyzer
> instead of reporting a successful connection to a midas file it says it starts Run
> #-1.  I use a file path specified in romeConfig.xml which is successful when I run
> in offline mode but not in online mode, even when I specify the file path with the
> run-time argument -pi.  Any ideas what may be the trouble? 
> 
> I did verify that my romeConfig.xml file specifies the online mode run configuration. 
> 
> Thanks very much,
> Joe
  170   29 Oct 2015 Ryu SawadaForumROME / Argus crashing between runs with MIDAS
Hello,

You can try to set <MidasOnlineCommunicationThread>to be true in your config XML file.
By doing it, the communication with the midas system will be done in a dedicated thread so it runs independently 
of analysis tasks.

Ryu

> I'm running ROME+Argus as an online analyzer and display for a MIDAS DAQ system.
>  In our set up there is generally a few seconds between MIDAS runs.  ROME
> handles the first run just fine, but always crashes when runs are taken in quick
> succession like this.  When running in a slower mode, letting ROME finish
> whatever run of end task exist, the online analyzer does not have this problem.
>  I've suppressed writing all output files while in the online mode and I don't
> have any end of run operations in any of the tasks.  What is happening at the
> end of running that is causing ROME to crash?
> 
> Thanks for any help.
  171   05 Nov 2015 Joe GrangeForumRunning ROME in online mode
Dear Ryu,

Thanks for your response.  Unfortunately setting these parameters in the XML file does not change the apparent
behavior and I still cannot connect to the experiment in online mode.  I also notice that other colleagues
working with independent experiments successfully run ROME in the online mode without setting the parameters
in the <online> section of the XML file.    

Can you tell me how I can verify the system is ready to accept the connection with the odbedit command?  I can
verify all basic information such as experiment name, run number, are as expected but I wonder if you mean
something more specific.

Thank you,
Joe
  172   08 Nov 2015 Ryu SawadaForumRunning ROME in online mode
Dear Joe,

Did you run ROMEBuilder for your application with -midas option ?
With this option, MIDAS library is linked to the application for communicating with MIDAS experiments.

Actual connection is done with using a function implemented in the MIDAS library.
This is the code where a ROME application connects to MIDAS.
(You can see this in $ROMESYS/src/ROMEMidasDAQ.cpp)
cm_connect_experiment is implemented in $MIDASSYS/src/midas.c
//______________________________________________________________________________
Bool_t ROMEMidasDAQ::ConnectExperiment(ROMEMidasDAQ *localThis)
{
   // Connect to the experiment
#if defined( HAVE_MIDAS )
   if (cm_connect_experiment(const_cast<char*>(gROME->GetOnlineHost()),
                             const_cast<char*>(gROME->GetOnlineExperiment()),
                             const_cast<char*>(gROME->GetOnlineAnalyzerName()), 0) != SUCCESS) {
      ROMEPrint::Error("\nCan not connect to experiment\n");
      return kFALSE;
   }

Can you check if this function is called by adding
cout<<"HERE"<<endl;
before the 'if' line and compile your application ?
If you didn't use -midas option when you run ROMEBuilder, HAVE_MIDAS will not be defined and cm_connect_experiment will not be called.

When nothing is written in <online> section of XML, I think the application tries to connect to the localhost with the experiment name defined in /etc/exptab.

I didn't mean anything specific about odbedit.
I guess if you can connect the MIDAS system with odbedit, then the system is ready to accept analyzer too.
But you could ask also MIDAS experts about this issue.

Ryu

> Dear Ryu,
>
> Thanks for your response. Unfortunately setting these parameters in the XML file does not change the apparent
> behavior and I still cannot connect to the experiment in online mode. I also notice that other colleagues
> working with independent experiments successfully run ROME in the online mode without setting the parameters
> in the <online> section of the XML file.
>
> Can you tell me how I can verify the system is ready to accept the connection with the odbedit command? I can
> verify all basic information such as experiment name, run number, are as expected but I wonder if you mean
> something more specific.
>
> Thank you,
> Joe
  173   16 Nov 2015 Joe GrangeForumRunning ROME in online mode
Dear Ryu,

Thanks very much, indeed it was user error and I did not set -midas option at the compilation stage.

Joe



Ryu Sawada wrote:
Dear Joe,

Did you run ROMEBuilder for your application with -midas option ?
With this option, MIDAS library is linked to the application for communicating with MIDAS experiments.

Actual connection is done with using a function implemented in the MIDAS library.
This is the code where a ROME application connects to MIDAS.
(You can see this in $ROMESYS/src/ROMEMidasDAQ.cpp)
cm_connect_experiment is implemented in $MIDASSYS/src/midas.c
//______________________________________________________________________________
Bool_t ROMEMidasDAQ::ConnectExperiment(ROMEMidasDAQ *localThis)
{
   // Connect to the experiment
#if defined( HAVE_MIDAS )
   if (cm_connect_experiment(const_cast<char*>(gROME->GetOnlineHost()),
                             const_cast<char*>(gROME->GetOnlineExperiment()),
                             const_cast<char*>(gROME->GetOnlineAnalyzerName()), 0) != SUCCESS) {
      ROMEPrint::Error("\nCan not connect to experiment\n");
      return kFALSE;
   }

Can you check if this function is called by adding
cout<<"HERE"<<endl;
before the 'if' line and compile your application ?
If you didn't use -midas option when you run ROMEBuilder, HAVE_MIDAS will not be defined and cm_connect_experiment will not be called.

When nothing is written in <online> section of XML, I think the application tries to connect to the localhost with the experiment name defined in /etc/exptab.

I didn't mean anything specific about odbedit.
I guess if you can connect the MIDAS system with odbedit, then the system is ready to accept analyzer too.
But you could ask also MIDAS experts about this issue.

Ryu

> Dear Ryu,
>
> Thanks for your response. Unfortunately setting these parameters in the XML file does not change the apparent
> behavior and I still cannot connect to the experiment in online mode. I also notice that other colleagues
> working with independent experiments successfully run ROME in the online mode without setting the parameters
> in the <online> section of the XML file.
>
> Can you tell me how I can verify the system is ready to accept the connection with the odbedit command? I can
> verify all basic information such as experiment name, run number, are as expected but I wonder if you mean
> something more specific.
>
> Thank you,
> Joe
  180   18 Feb 2016 Joe GrangeForumOnline mode issue
Hello all,

I'm having an issue with getting rome to run in online mode in some cases only.
 That is, when I run the analyzer that accesses the INPT bank (standard for PSI
slow control buses) the online mode works just fine.  But when I access other
banks, when I run in online mode only blank canvases are updated and no data
appears.

I can run all of these analyzers in offline mode and they all work as expected
so this eliminates many common user bugs.  Any ideas how I might debug further?
 I also tried printing the data in the various tasks and indeed in online mode
no data is being accessed.

Thanks,
Joe
  183   02 Mar 2016 Ryu SawadaForumOnline mode issue
Dear Joe

There is a working example for the online access to midas.

Please see,
https://bitbucket.org/muegamma/rome3/wiki/Midas
The example is $ROMESYS/examples/midas.
There is a README file in the directory.
The example works with an example experiment in MIDAS package so you can try.
If you look at ADC2 tab, the histograms should be updated when DAQ is running.

The "Trigger" events are polled in the MIDAS frontend, and "Scaler" data are taken periodically.
So I guess the "Scaler" corresponds to your INPT and "Trigger" corresponds to your other event types.

You may compare the examples and your analyzer/frontend for finding the cause of your problem.

Ryu

> Hello all,
> 
> I'm having an issue with getting rome to run in online mode in some cases only.
>  That is, when I run the analyzer that accesses the INPT bank (standard for PSI
> slow control buses) the online mode works just fine.  But when I access other
> banks, when I run in online mode only blank canvases are updated and no data
> appears.
> 
> I can run all of these analyzers in offline mode and they all work as expected
> so this eliminates many common user bugs.  Any ideas how I might debug further?
>  I also tried printing the data in the various tasks and indeed in online mode
> no data is being accessed.
> 
> Thanks,
> Joe
  185   10 Mar 2016 Farrukh AzfarForumOption to analyse every Nth event
Dear Colleagues

I was wondering if there was an option to analyse only ever N events in ROME. If 
this is doable via an xml switch I am guessing this would be the best and most 
convenient solution.

Else any advice on how to do this in code would be great as well -

many thanks
Farrukh
  187   13 Mar 2016 Ryu SawadaForumOption to analyse every Nth event
I added a new parameter <EventStep> to configuration XML file.
The default is 1.
If you change it to, for example 2, every second events are analyzed.

For using it, you need to
- update ROME
- compile ROME
- re-build and make your project

Once you use an existing config XML file, a new parameter will be automatically added to it.

Ryu

> Dear Colleagues
> 
> I was wondering if there was an option to analyse only ever N events in ROME. If 
> this is doable via an xml switch I am guessing this would be the best and most 
> convenient solution.
> 
> Else any advice on how to do this in code would be great as well -
> 
> many thanks
> Farrukh
  Draft   28 Feb 2018 Francesco RengaForumDB path
Dear all,
           I need to perform a DB query in ROME, where I have to select an array of 
  213   23 Jul 2019 Yusuke UchiyamaForumChange of MIDAS library path
Dear all,

From the recent release of MIDAS, "midas-2019-06", the MIDAS library path is changed:
it was $MIDASSYS/linux/lib, but now $MIDASSYS/lib.
See https://midas.triumf.ca/elog/Midas/1564 for the detail.

Due to this change, ROME analyzers cannot be built with -midas option.

The solution seems easy: change the path in 
$ROMESYS/buildersrc/ROMEBuilderMakeFile.cpp AddDAQLibraries().
However, directly changing the code will loose backward compatibility.
Do you have any suggestions?

Regards,
Yusuke
  7   13 Oct 2004 ryuBug Reportserial number and event ID
In "ROMEEventLoop.cpp"
in function "ReadEvent(Int_t event)"
after "if (gROME->isOnline()&&gROME->isMidas()) {"

gROME should get serial_number and event ID from event header. 
There should be following 2 lines

  gROME->SetCurrentEventNumber(((EVENT_HEADER*)mEvent)->serial_number);
  gROME->SetEventID(((EVENT_HEADER*)mEvent)->event_id);
  9   13 Oct 2004 Matthias SchneebeliBug Reportserial number and event ID
> In "ROMEEventLoop.cpp"
> in function "ReadEvent(Int_t event)"
> after "if (gROME->isOnline()&&gROME->isMidas()) {"
> 
> gROME should get serial_number and event ID from event header. 
> There should be following 2 lines
> 
>   gROME->SetCurrentEventNumber(((EVENT_HEADER*)mEvent)->serial_number);
>   gROME->SetEventID(((EVENT_HEADER*)mEvent)->event_id);

done
  17   12 Nov 2004 Ryu SawadaBug ReportGlobalSteering
When I define several "SteeringParameterGroup"s, builder maked nesting classes instead to make each 
classes.
  19   18 Nov 2004 Matthias SchneebeliBug ReportGlobalSteering
> When I define several "SteeringParameterGroup"s, builder maked nesting classes instead to make each 
> classes.

done
  20   19 Nov 2004 Ryu SawadaBug ReportGlobalSteering
> > When I define several "SteeringParameterGroup"s, builder maked nesting classes instead to make each 
> > classes.
> 
> done
It is still not fixed. In case of following configuration.
"InvalidValue" was in "Switch" class.
Is it invalid to put a SteeringParameterField after SteeringParameterGroup ?

<GlobalSteeringParameters>
  <SteeringParameterGroup>
    <SPGroupName>Switch</SPGroupName>
    <SteeringParameterField>
      <SPFieldName>Piedi</SPFieldName>
      <SPFieldType>Bool_t</SPFieldType>
      <SPFieldInitialization>0</SPFieldInitialization>
      <SPFieldComment>Switch for pedestal calculation</SPFieldComment>
    </SteeringParameterField>
  </SteeringParameterGroup>
  <SteeringParameterField>
    <SPFieldName>InvalidValue</SPFieldName>
    <SPFieldType>Float_t</SPFieldType>
    <SPFieldInitialization>-1000</SPFieldInitialization>
    <SPFieldComment>Invalid value</SPFieldComment>
  </SteeringParameterField>
</GlobalSteeringParameters>
  21   27 Nov 2004 Ryu SawadaBug Reportss_getchar
When romeConfig.xml does not exist. Rome goes to infinite loop.

I think the problem is ss_getchar.
ROMEAnalyzer::ss_getchar does not seem to work on Linux ,because OS_UNIX is not defined.

"ends" is needed in following line.
cout << "Do you like the framework to generate a new configuration file ([y]/n) ? "<<ends;
otherwise this line does not appear before user hits keyboard.
  23   03 Dec 2004 Ryu SawadaBug Report-e option
When I used "-e" option in generated framework. It stopped immediately after starting analysis.

When I commented out following two lines in ROMEEventLoop.cpp. It worked.

  // check event numbers
      int status = gROME->CheckEventNumber(event);
      if (status==0) {
//	this->SetContinue();
//	return true;
      }
  25   06 Dec 2004 Matthias SchneebeliBug Reportss_getchar
> When romeConfig.xml does not exist. Rome goes to infinite loop.
> 
> I think the problem is ss_getchar.
> ROMEAnalyzer::ss_getchar does not seem to work on Linux ,because OS_UNIX is not defined.
> 
> "ends" is needed in following line.
> cout << "Do you like the framework to generate a new configuration file ([y]/n) ? "<<ends;
> otherwise this line does not appear before user hits keyboard.

done
  26   06 Dec 2004 Ryu SawadaBug ReportReadConfiguration
I can not change some global steering parameters.
In my LPConfig::ReadConfiguration in LPConfig.cpp which was generated by builder.

There is a line like
 xml->GetPathValue(path+"/GlobalSteeringParameters/child::SteeringParameterGroup[child::
SPGroupName='Switch']/child::SteeringParameterGroup[child::SPGroupName='RunMode']/child::
SteeringParameterField[child::SPName='Pedestal']/SPValue",fConfigData[index]->fGlobalSteering-
>fRunMode->fPedestal,"");

but it should be
 xml->GetPathValue(path+"/GlobalSteeringParameters/child::SteeringParameterGroup[child::
SPGroupName='RunMode']/child::SteeringParameterField[child::SPName='Pedestal']/
SPValue",fConfigData[index]->fGlobalSteering->fRunMode->fPedestal,"");


****
one small other bug.
when I start my framework with -h option, rome shows
  -i       Configuration file (default ROMEConfig.xml)
but default is romeConfig.xml
***

        <GlobalSteeringParameters>
                <SteeringParameterGroup>
                        <SPGroupName>Switch</SPGroupName>
                             <SteeringParameterField>
                                <SPFieldName>ADC1</SPFieldName>
                                <SPFieldType>Bool_t</SPFieldType>
                                <SPFieldInitialization>1</SPFieldInitialization>                                
                        </SteeringParameterField>
                        <SteeringParameterField>
                                <SPFieldName>WriteDataBase</SPFieldName>
                                <SPFieldType>Bool_t</SPFieldType>
                                <SPFieldInitialization>0</SPFieldInitialization>                                
                        </SteeringParameterField>
                </SteeringParameterGroup>
                <SteeringParameterGroup>
                        <SPGroupName>RunMode</SPGroupName>
                        <SteeringParameterField>
                                <SPFieldName>Pedestal</SPFieldName>
                                <SPFieldType>Short_t</SPFieldType>
                                <SPFieldInitialization>0</SPFieldInitialization>                                
                        </SteeringParameterField>
                        <SteeringParameterField>
                                <SPFieldName>Normal</SPFieldName>
                                <SPFieldType>Short_t</SPFieldType>
                                <SPFieldInitialization>1</SPFieldInitialization>                                
                        </SteeringParameterField>
                </SteeringParameterGroup>
        </GlobalSteeringParameters>
ELOG V3.1.4-2e1708b5