Back Midas Rome Roody Rootana
  Rome Analyzer Framework, Page 6 of 11  Not logged in ELOG logo
    Reply  13 Jan 2006, Ryu Sawada, Suggestion, Quit mode 
done.
Users can specify quit mode with option -q or configuration file.
Entry  08 Feb 2006, Ryu Sawada, Bug Report, ROMEEventLoop:Update 
Recently the place to call ROMEEventLoop:Update was moved.
Probably because of this, in MIDAS online mode, event number is always incremented even when DAQ is not running.
Entry  08 Feb 2006, Ryu Sawada, Bug Report, ROMENetFolderServer 
When I run ROME analyzer in online MIDAS mode.
It stopps with making core (segmentation fault).

It seems it makes core after "return" in main.cpp, namely finishing all code.

When I comment out following line in ROMEAnalyzer.cpp, it works propery.
tnet->StartServer(gROME->GetApplication(),gROME->GetPortNumber());

Probably it is relating to ROMENetServer or thread for this.
    Reply  09 Feb 2006, Ryu Sawada, Bug Report, ROMENetFolderServer 
I investigated the problem.

On my machine (Scientific Linux 4.2, gcc3.3.2, glibc2.3.2, ROOT5.08.00), following simple program reproduced the problem.
There was no probelm with ROOT version4.
Is it bug of ROOT ?

When I put -lpthread at the last. This problem stopped.
Actually without this option, my analyzer workes.
I guess -lpthread is not necessary.

I will check more and if not necessary, I will remove -lpthread.

--- Makefile ---
rootlibs := $(shell $(ROOTSYS)/bin/root-config --libs)
rootcflags := $(shell  $(ROOTSYS)/bin/root-config --cflags)

test: main.cpp
	g++ $(rootcflags) -o $@ $< -lpthread $(rootlibs) -lThread
------
--- main.cpp ---
#include <Riostream.h>
#include <TThread.h>

void* TestLoop(void *arg)
{
   return NULL;
}

int main(int argc, char *argv[])
{
   TThread *thread = new TThread("TestLoop", TestLoop);

   cout<<"OK"<<endl;
   return 0;
}  
------
    Reply  22 Feb 2006, Ryu Sawada, Suggestion, Text database suggestion 
I improved TextDataBase as Giovanni suggested.
    Reply  09 Jun 2006, Ryu Sawada, Bug Fix, Unable to run rome analyzer from crontab 
I have made modification on batch mode and daemon mode at rev.1129, 1136 and 1137.
The difference of daemon and batch mode is written in ROME homepage
http://midas.psi.ch/rome/usersGuide.html#fwcommandline

You can disable all graphics with -ng option explicitly. And when ROME failed to open display, it goes into 
no graphics mode automatically.

Please try. And please report when you still have a problem.

> (sorry for top-reply- I am trying to avoid elcode garbling my answer)
> 
> In the past, I have seen problems like yours, there are at least two issues:
> 
> 1) "non interactive" ROOT running from cron or some other incomplete user
> environment (no DISPLAY, no tty, no user)- a hello world script runs, but large
> app does not, because some silly class somewhere requires an X11 connection. I
> once had to fake it by running Xvnc and telling the cron jobs to use it as a
> DISPLAY. I know ROOT now have a "dummy" graphics module exactly for this
> purpose. I do not know how to activate it from the Rome environement, but I am
> sure it is documented somewhere on the ROOT web site.
> 
> 2) some programs coming from the MIDAS family assume existance of a keyboard and
> display. Sometimes they can be faked by using "program < /dev/null", sometimes
> not, I do not know what Rome does.
> 
> K.O.
> 
> 
> [quote="Todd Bredeweg"]I would like to use a bash script run from cron to
> analyze new midas event files automatically. Below is an abbreviated example
> script to test the way ROOT and ROME handle true batch mode
> 
> [CODE]
> #! /bin/bash
> 
> BASEDIR=/data/0/PostRunQA		# Base directory for output files
> ROMEDIR=${BASEDIR}/dance-rome		# Location of danceanalyzer
> 
> NRUN=7581
> ROMECFG="romeConfig_Continuous.xml";
> 
> # Set PATH and LD_LIBRARY_PATH for correct versions of ...
> # This also sets up the *SYS variables
> source /opt/wnr/new/bin/newVersion --new root rome wnr
> 
> cd ${ROMEDIR};
> 
> # Check that ROOT works correctly
> echo " Running ROOT batch mode test ";
> root -b -q ../jmodScript.C
> 
> # Check that ROME works correctly
> echo " Running danceanalyzer batch mode test ";
> ./danceanalyzer.exe -b -ns -q -i ${ROMECFG} -r ${NRUN}
> [/CODE]
> 
> The results for the ROOT section are the same when the script is run from the
> command line (full interactive environment) or when using at or crontab
> (non-interactive).
> 
> [CODE]
>  Running ROOT batch mode test
>   *******************************************
>   *                                         *
>   *        W E L C O M E  to  R O O T       *
>   *                                         *
>   *   Version   5.10/00      1 March 2006   *
>   *                                         *
>   *  You are welcome to visit our Web site  *
>   *          http://root.cern.ch            *
>   *                                         *
>   *******************************************
>                                                                                
>                                                   
> Compiled on 3 April 2006 for linux with thread support.
>                                                                                
>                                                   
> CINT/ROOT C/C++ Interpreter version 5.16.8, February 9, 2006
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
>  Executing rootlogon.C (31-MAY-2006)...  Finished setup
>                                                                                
>                                                   
> Processing ../jmodScript.C...
> hello world
> This is the end of ROOT -- Goodbye
> [/CODE]
> 
> jmodScript.C is merely a classic "hello world" script. The ROME test, on the
> other hand, returns quite different results for the two cases. When run from the
> command line it works as expected
> 
> [CODE]
>  ...
>  Running danceanalyzer batch mode test
>  Executing rootlogon.C (31-MAY-2006)...  Finished setup
> reading configuration from romeConfig_Continuous.xml
> [bredeweg@enlil PostRunQA]$
> [/CODE]
> 
> but when run from at or crontab we get 
> 
> [CODE] Running danceanalyzer batch mode test
>  Executing rootlogon.C (31-MAY-2006)...  Finished setup
>                                                                                
>                                                   
>  *** Break *** segmentation violation
>  Generating stack trace...
>  0x081ec18b in main + 0x21b from ./danceanalyzer.exe
>  0x0734678a in __libc_start_main + 0xda from /lib/tls/libc.so.6
>  0x080dcd31 in TFile::TFile(char const*, char const*, char const*, int) + 0x51
> from ./danceanalyzer.exe
> /bin/bash: line 22: 28096 Aborted                 ./danceanalyzer.exe -b -ns -q
> -i ${ROMECFG} -r ${NRUN}[/CODE]
> 
> One question that we have been unable to answer as yet is whether rome is
> requiring a real TTY, which I do not believe is provided by cron.
> 
> We are using the following setup:
>     Redhat Enterprise Linux v3
>     ROOT v5.10.00
>     ROME RELEASE_2_4_R1004
> 
> I can provide additional information if needed.
> 
> Thanks in advance.
> 
> tab[/quote]
    Reply  07 Jul 2006, Ryu Sawada, Forum, ROME analyzer crashes on reading midas file.  
I have tested midas file reading on 64 bit CPU. And there was no problem.

My environment is

-- Wring
Linux 2.6.9 SMP pentium4 32bit
ROOT v5.11/06 32 bit
MIDAS rev.3165 32 bit
midas files was written by frontend in midas/examples/experiment

-- Reading
Linux 2.6.17 SMP x86_64 AMD dual-core Athlon 64bit
ROME rev.1223 64 bit
ROOT v5.08/00b 64 bit

midas file was compressed with gzip 1.3.3
    Reply  28 Feb 2007, Ryu Sawada, Forum, Duplicate header file 
> > > I just started using Rome v2.7 and Root v5.14.00. I have run into a rather
> > > interesting issue trying to compile my analyzer. I tracked the problem to the
> > > fact that both Root and Rome are loading their own version of a header file
> > > called TArrayL64.h.
> 
> I have just run into the TArrayL64.h problem myself. I recommend that we resolve
> the clashing header files. We could ask Rene Brun to rename his file or we could
> rename the clashing file in Rome.
> 
> K.O.

As Matthias mensioned, this problem is solved in SVN version of ROME.
I propose to release ROME version 2.8, which will not have this problem.

If there are users who want to continue to use 2.7, we could also release patch release of 2.7. (2.7.1), in which only compatibility problems 
are fixed.

Ryu
    Reply  28 Feb 2007, Ryu Sawada, Forum, Duplicate header file 
> > > > I just started using Rome v2.7 and Root v5.14.00. I have run into a rather
> > > > interesting issue trying to compile my analyzer. I tracked the problem to the
> > > > fact that both Root and Rome are loading their own version of a header file
> > > > called TArrayL64.h.
> > 
> > I have just run into the TArrayL64.h problem myself. I recommend that we resolve
> > the clashing header files. We could ask Rene Brun to rename his file or we could
> > rename the clashing file in Rome.
> > 
> > K.O.
> 
> As Matthias mensioned, this problem is solved in SVN version of ROME.
> I propose to release ROME version 2.8, which will not have this problem.
> 
> If there are users who want to continue to use 2.7, we could also release patch release of 2.7. (2.7.1), in which only compatibility problems 
> are fixed.

I prepared a new release 2.8. It can be downloaded from http://midas.psi.ch/rome/download.html

The new release works with also ROOT 5.14 or 5.15.

At this release, style of configuration file was changed. Please see following message for details. 
https://ladd00.triumf.ca/elog/Rome/129
Entry  18 Apr 2007, Ryu Sawada, Info, I/O system change 
I changed default type of dictionaries. By this change we use new I/O system introduced at ROOT version 3.

A newly generated program can not read old files created by old programs by default. Error messages like following will be shown.
Error in <TBuffer::CheckByteCount>: object of class PMTData read too few bytes: 21 instead of 169

There is one flag to avoid this problem. When <DictionaryType> in <Experiment> is 0, romebuilder will
generate a program with old dictionary type.
<Experiment>
   <ExperimentName>MEG Analysis and monitor.</ExperimentName>
   <ExperimentShortCut>MEG</ExperimentShortCut>
   <ProgramName>Analyzer</ProgramName>
   <ProgramDefinitionVersion>3</ProgramDefinitionVersion>
   <FrameworkDescription>MEGAnalyzer is an analysis framework for MEG. It works as monitor as well.</FrameworkDescription>
   <DictionaryType>0</DictionaryType>   <!-- Add this line -->
</Experiment>

During development stage of version 2.9, we will check if there are problems in the new I/O system.
If we don't find any problems, The new I/O system will be the default of ROME version 2.9.
Even if we change the default, users can continue using the old I/O by using the flag.
    Reply  11 Jun 2015, Ryu Sawada, Info, ROME examples : histoGUI 
Dear Farrukh

The 'histoGUI' example was prepared as an example for displaying histograms.
And the data are generated randomly in FillHisto task instead of reading from an input file.
So the example is using 'none' DAQ as written in romeConfig.xml in the example; the DAQ class is 
implemented in include/ROMENoDAQSystem.h, and it actually does nothing.

With 'none' DAQ, the program simply call Event method continuously without any control of the frequency.

When you run the example, the frequency is not so fast because the CPU is used for updating the display.
If you change <UpdateFrequency>, for example, to 10000, you will find the frequency of events through 
the task is increased because you update the display with a less frequency (thus lower CPU power is 
needed).

If you are going to use ROME for non-event based application, there are two ways to call some functions 
defined in tabs.
1) With GUI parts, like buttons, menus, sliders and so on
2) With calling a function periodically.

1) is suitable if you want to actively control the GUI; a user needs to, for example, click a button for 
operate the tab.

2) is suitable if you want to update the display without any operations.
You can see examples/argus/timer/ and examples/argus/thread as examples.

Best regards,

Ryu

> Dear Colleagues,
> 
> I have succesfully written a ROME application for monitoring MIDAS events and 
> understand that the appearance of a new MIDAS event record triggers the calling 
> of the event method in the Fill Histogram task.
> 
> My two questions are however about the example in $ROMESYS/example/histoGUI - 
> 
> 1) In this example there is no MIDAS event nor event record - what then is 
> triggering the calling of the event method 
> 
> 2) Is it possible to regulate the frequency that the event method is called in 
> this example ?
> 
> best wishes
> Farrukh Azfar
    Reply  11 Jun 2015, Ryu Sawada, Bug Report, Problems with programming tabs when using TGraph 
Dear Farrukh

I presume you implemented your tab which draws the graph.
Which option do you use for Draw function of the graph ?
I am afraid you might forget to add 'A' in the option.
For example, you need to use 'A' like,
  graph->Draw("APL");

Best regards,

Ryu

> Dear Colleagues,
>
> I have been using the ROME framework and have succesfully implemented a program
> to run on MIDAS input and plot histograms.
>
> Not satisfied with the default settings of the Canvas, pads and text sizes etc I
> consulted Ryu who kindly showed me how to implement the event and init and update
> methods in the Tabs to bring the display closer to what I needed.
>
> This has worked fine with histograms. However not with TGraphs:
>
> I noticed that if I implemented the plotting of the TGraphs in the tab class then
> after setting points in the TGraph in the Fill tasks the Tab classes plot was
> empty -> is there something peculiar about TGraph ? Any tips would be great !
>
> many thanks
> Farrukh Azfar
    Reply  11 Jun 2015, Ryu Sawada, Info, ROME examples : histoGUI 
Dear Farrukh

If you want to control the frequency of update of all tabs, maybe, you could use the same method (namely using 'none' DAQ') for calling event methods of tasks and tabs also for non-event based
application.
You may add a task in which you only call 'sleep' function for controlling the frequency.
For allowing you to use GUI buttons also during the sleep, you need to call the sleep function like following.
ProcessEvents function allows you to use GUI parts also during the sleep.
   Int_t sec = GetSP()->GetSleepTime();

   if (sec > 0) {
      struct timespec req, rem;
      req.tv_sec = 0;
      req.tv_nsec = 100000000; // sleep time in loop

      struct timeval endTime, currentTime;
      gettimeofday(&currentTime, 0);
      endTime.tv_sec = currentTime.tv_sec + sec;
      endTime.tv_usec = currentTime.tv_usec;

      int ret;

      while(1) {
         memset(&rem, 0, sizeof(rem));
         ret = nanosleep(&req, &rem);

         gettimeofday(&currentTime, 0);
         if (currentTime.tv_sec > endTime.tv_sec ||
             (currentTime.tv_sec == endTime.tv_sec && currentTime.tv_usec > endTime.tv_usec)) {
            break;
         }

         gSystem->ProcessEvents();
      }
   }

gettimeofday is defined in sys/time.h header file in UNIX-like OS.
gSystem is in TSystem.h

For controlling the frequency, in this example, I added a new steering parameter for the task, which is defined like,
     <Task>
  ... other definition of tasks ...
        <SteeringParameters>
          <SteeringParameterField>
            <SPFieldName>SleepTime</SPFieldName>
            <SPFieldType>Int_t</SPFieldType>
            <SPFieldInitialization>10</SPFieldInitialization>
            <SPFieldComment>Sleep time in sec</SPFieldComment>
          </SteeringParameterField>
        </SteeringParameters>
     </Task>

Best regards,

Ryu

> Dear Farrukh
>
> The 'histoGUI' example was prepared as an example for displaying histograms.
> And the data are generated randomly in FillHisto task instead of reading from an input file.
> So the example is using 'none' DAQ as written in romeConfig.xml in the example; the DAQ class is
> implemented in include/ROMENoDAQSystem.h, and it actually does nothing.
>
> With 'none' DAQ, the program simply call Event method continuously without any control of the frequency.
>
> When you run the example, the frequency is not so fast because the CPU is used for updating the display.
> If you change <UpdateFrequency>, for example, to 10000, you will find the frequency of events through
> the task is increased because you update the display with a less frequency (thus lower CPU power is
> needed).
>
> If you are going to use ROME for non-event based application, there are two ways to call some functions
> defined in tabs.
> 1) With GUI parts, like buttons, menus, sliders and so on
> 2) With calling a function periodically.
>
> 1) is suitable if you want to actively control the GUI; a user needs to, for example, click a button for
> operate the tab.
>
> 2) is suitable if you want to update the display without any operations.
> You can see examples/argus/timer/ and examples/argus/thread as examples.
>
> Best regards,
>
> Ryu
>
> > Dear Colleagues,
> >
> > I have succesfully written a ROME application for monitoring MIDAS events and
> > understand that the appearance of a new MIDAS event record triggers the calling
> > of the event method in the Fill Histogram task.
> >
> > My two questions are however about the example in $ROMESYS/example/histoGUI -
> >
> > 1) In this example there is no MIDAS event nor event record - what then is
> > triggering the calling of the event method
> >
> > 2) Is it possible to regulate the frequency that the event method is called in
> > this example ?
> >
> > best wishes
> > Farrukh Azfar
    Reply  15 Jun 2015, Ryu Sawada, Info, ROME examples : histoGUI 
Dear Farrukh

ProcessEvents is nothing to do with ROME.
It is a ROOT function to process events called by timer, click, sockets etc.
"event" is not MIDAS event, but for example, an event where someone clicked a button.
For example, if you click an "update" button, ROOT needs to call a function connected to the button; ProcessEvents does the job.
So if you want to use the GUI during the sleep of a task, you need to call ProcessEvents sometimes.

https://root.cern.ch/root/html604/TSystem.html#TSystem:ProcessEvents

You need not to overwrite ProcessEvents.

Best regards,

Ryu


Farrukh Azfar wrote:
Dear Ryu,

many thanks for your reply that's very useful.

For my knowledge and for the sake of understanding the basics.

1) Its the line : gSystem->ProcessEvents(); that calls all the event methods in the Fill classes and the Tabs classes yes ?

2) This way I am controlling the filling of the tabs at an interval regulated by "sleep" then what has happened to the program itself calling ProcessEvents ? Have I overriden that call by calling ProcessEvents or will it continue to be called - perhaps I just set the <UpdateFrequency> 0</UpdateFrequency> to disable the programs own calling and only use mine ?

I hope I've been clear. Thanks very much for your continued help.

-Farrukh




Ryu Sawada wrote:
Dear Farrukh

If you want to control the frequency of update of all tabs, maybe, you could use the same method (namely using 'none' DAQ') for calling event methods of tasks and tabs also for non-event based
application.
You may add a task in which you only call 'sleep' function for controlling the frequency.
For allowing you to use GUI buttons also during the sleep, you need to call the sleep function like following.
ProcessEvents function allows you to use GUI parts also during the sleep.
   Int_t sec = GetSP()->GetSleepTime();

   if (sec > 0) {
      struct timespec req, rem;
      req.tv_sec = 0;
      req.tv_nsec = 100000000; // sleep time in loop

      struct timeval endTime, currentTime;
      gettimeofday(&currentTime, 0);
      endTime.tv_sec = currentTime.tv_sec + sec;
      endTime.tv_usec = currentTime.tv_usec;

      int ret;

      while(1) {
         memset(&rem, 0, sizeof(rem));
         ret = nanosleep(&req, &rem);

         gettimeofday(&currentTime, 0);
         if (currentTime.tv_sec > endTime.tv_sec ||
             (currentTime.tv_sec == endTime.tv_sec && currentTime.tv_usec > endTime.tv_usec)) {
            break;
         }

         gSystem->ProcessEvents();
      }
   }

gettimeofday is defined in sys/time.h header file in UNIX-like OS.
gSystem is in TSystem.h

For controlling the frequency, in this example, I added a new steering parameter for the task, which is defined like,
     <Task>
  ... other definition of tasks ...
        <SteeringParameters>
          <SteeringParameterField>
            <SPFieldName>SleepTime</SPFieldName>
            <SPFieldType>Int_t</SPFieldType>
            <SPFieldInitialization>10</SPFieldInitialization>
            <SPFieldComment>Sleep time in sec</SPFieldComment>
          </SteeringParameterField>
        </SteeringParameters>
     </Task>

Best regards,

Ryu

> Dear Farrukh
>
> The 'histoGUI' example was prepared as an example for displaying histograms.
> And the data are generated randomly in FillHisto task instead of reading from an input file.
> So the example is using 'none' DAQ as written in romeConfig.xml in the example; the DAQ class is
> implemented in include/ROMENoDAQSystem.h, and it actually does nothing.
>
> With 'none' DAQ, the program simply call Event method continuously without any control of the frequency.
>
> When you run the example, the frequency is not so fast because the CPU is used for updating the display.
> If you change <UpdateFrequency>, for example, to 10000, you will find the frequency of events through
> the task is increased because you update the display with a less frequency (thus lower CPU power is
> needed).
>
> If you are going to use ROME for non-event based application, there are two ways to call some functions
> defined in tabs.
> 1) With GUI parts, like buttons, menus, sliders and so on
> 2) With calling a function periodically.
>
> 1) is suitable if you want to actively control the GUI; a user needs to, for example, click a button for
> operate the tab.
>
> 2) is suitable if you want to update the display without any operations.
> You can see examples/argus/timer/ and examples/argus/thread as examples.
>
> Best regards,
>
> Ryu
>
> > Dear Colleagues,
> >
> > I have succesfully written a ROME application for monitoring MIDAS events and
> > understand that the appearance of a new MIDAS event record triggers the calling
> > of the event method in the Fill Histogram task.
> >
> > My two questions are however about the example in $ROMESYS/example/histoGUI -
> >
> > 1) In this example there is no MIDAS event nor event record - what then is
> > triggering the calling of the event method
> >
> > 2) Is it possible to regulate the frequency that the event method is called in
> > this example ?
> >
> > best wishes
> > Farrukh Azfar
    Reply  15 Jun 2015, Ryu Sawada, Bug Report, Problems with programming tabs when using TGraph 
Dear Farrukh

If you attach your code related to the problem, I can investigate the problem.

Best regards,

Ryu


Farrukh Azfar wrote:
Hi Ryu,

thanks for your reply. yes I am(was) using it.


Ryu Sawada wrote:
Dear Farrukh

I presume you implemented your tab which draws the graph.
Which option do you use for Draw function of the graph ?
I am afraid you might forget to add 'A' in the option.
For example, you need to use 'A' like,
  graph->Draw("APL");

Best regards,

Ryu

> Dear Colleagues,
>
> I have been using the ROME framework and have succesfully implemented a program
> to run on MIDAS input and plot histograms.
>
> Not satisfied with the default settings of the Canvas, pads and text sizes etc I
> consulted Ryu who kindly showed me how to implement the event and init and update
> methods in the Tabs to bring the display closer to what I needed.
>
> This has worked fine with histograms. However not with TGraphs:
>
> I noticed that if I implemented the plotting of the TGraphs in the tab class then
> after setting points in the TGraph in the Fill tasks the Tab classes plot was
> empty -> is there something peculiar about TGraph ? Any tips would be great !
>
> many thanks
> Farrukh Azfar
    Reply  03 Sep 2015, Ryu Sawada, Forum, ARGUS display with canvas and pads ...  
Dear Farrukh

What you want to do is probably possible ( I will write a possible method later.).
However TPad has already several mouse operations (zoom, right-click menu, select active pad and so on); so I am not sure it is the best idea to add own mouse operation (which 
could override other pre-implemented operations.)
I will write three solutions below.
I wrote an example of the first method.

== Method 1 : Menu ==
For this solutions, I modified an example in the ROME package.
The update is done only in the 'develop' branch.
You can read the example by 'git checkout develop' command after you clone the ROME package.
The example is in $ROMESYS/examples/argus/menu and the third tab (T3) is one for that.
In ROME, you can easily add menu items in the menu bar. In the example, menu items to open and save a specific tab are prepared.

== Method 2 : dedicated buttons ==
If you prefer buttons instead of menu, you can put dedicated buttons to trigger "OpenPad" function in the example instead of adding menus. The buttons can be implemented 
either of the following two methods,
 1) TGTextButton, which can work as the same way as your Save button
 2) Writing own class derived from TBox or TMarker. A box or maker can be put on each canvas.

I hope the first method is obvious for you. You can make another button similar to your Save button and call "OpenPad" function.

The second method is a little more complicated; you make your own class and override "ExecuteEvent" method.
In the overriding function, you can call any functions when the box or marker is single-clicked, double-clicked, mouse-over and so on.
A disadvantage is that the box or marker is always visible, and will be drawn in the output PDF files too.

== Method 3: click on Pad ==
You can probably do what you write with making own class derived from TPad; then you override "ExecuteEvent" function for calling a function to make a separated canvas and 
draw a clone of itself.
You may also need own TCanvas and TRootEmbeddedCanvas for using the customized classes instead of regular TPad and TCanvas.

If you are satisfied with the first method, please try the example.
The second method with TGTextButton must not be very difficult.

If you prefer the second (using TBox or TMarker) and third method, I will investigate if it is actually possible.
For the two methods, I think you need to write your own classes.

Best regards,

Ryu

> Dear Colleagues,
> 
> We are succesfully running a ROME executable both online and offline with an 
> ARGUS display with a canvas that has multiple pads on it. We have also 
> implemented a "Save" button which one can click on and save the _entire_ canvas 
> (containing all the pads) and saves it to pdf.
> 
> I was wondering how one would go about making the following modification :
> 
> When a user moves a mouse over to a particular pad and clicks on it - then only 
> the histogram on that pad is displayed on a separate canvas (so the user can 
> examine it closely) and also save just this one histogram - with a save button 
> similar to the one we've already written.
> 
> many thanks for any insight
> 
> Farrukh 
    Reply  04 Sep 2015, Ryu Sawada, Forum, ARGUS display with canvas and pads ...  
Dear Farrukh

It is not necessary to build in 'develop' branch of ROME.

Ryu

> Hi Ryu 
> 
> thanks ever so much. 
> 
> We will modify our code as per your example - is it neccesary to build in development as well or is that only where your example is
> 
> -Farrukh
> 
> > Dear Farrukh
> > 
> > What you want to do is probably possible ( I will write a possible method later.).
> > However TPad has already several mouse operations (zoom, right-click menu, select active pad and so on); so I am not sure it is the best idea to add own mouse operation (which 
> > could override other pre-implemented operations.)
> > I will write three solutions below.
> > I wrote an example of the first method.
> > 
> > == Method 1 : Menu ==
> > For this solutions, I modified an example in the ROME package.
> > The update is done only in the 'develop' branch.
> > You can read the example by 'git checkout develop' command after you clone the ROME package.
> > The example is in $ROMESYS/examples/argus/menu and the third tab (T3) is one for that.
> > In ROME, you can easily add menu items in the menu bar. In the example, menu items to open and save a specific tab are prepared.
> > 
> > == Method 2 : dedicated buttons ==
> > If you prefer buttons instead of menu, you can put dedicated buttons to trigger "OpenPad" function in the example instead of adding menus. The buttons can be implemented 
> > either of the following two methods,
> >  1) TGTextButton, which can work as the same way as your Save button
> >  2) Writing own class derived from TBox or TMarker. A box or maker can be put on each canvas.
> > 
> > I hope the first method is obvious for you. You can make another button similar to your Save button and call "OpenPad" function.
> > 
> > The second method is a little more complicated; you make your own class and override "ExecuteEvent" method.
> > In the overriding function, you can call any functions when the box or marker is single-clicked, double-clicked, mouse-over and so on.
> > A disadvantage is that the box or marker is always visible, and will be drawn in the output PDF files too.
> > 
> > == Method 3: click on Pad ==
> > You can probably do what you write with making own class derived from TPad; then you override "ExecuteEvent" function for calling a function to make a separated canvas and 
> > draw a clone of itself.
> > You may also need own TCanvas and TRootEmbeddedCanvas for using the customized classes instead of regular TPad and TCanvas.
> > 
> > If you are satisfied with the first method, please try the example.
> > The second method with TGTextButton must not be very difficult.
> > 
> > If you prefer the second (using TBox or TMarker) and third method, I will investigate if it is actually possible.
> > For the two methods, I think you need to write your own classes.
> > 
> > Best regards,
> > 
> > Ryu
> > 
> > > Dear Colleagues,
> > > 
> > > We are succesfully running a ROME executable both online and offline with an 
> > > ARGUS display with a canvas that has multiple pads on it. We have also 
> > > implemented a "Save" button which one can click on and save the _entire_ canvas 
> > > (containing all the pads) and saves it to pdf.
> > > 
> > > I was wondering how one would go about making the following modification :
> > > 
> > > When a user moves a mouse over to a particular pad and clicks on it - then only 
> > > the histogram on that pad is displayed on a separate canvas (so the user can 
> > > examine it closely) and also save just this one histogram - with a save button 
> > > similar to the one we've already written.
> > > 
> > > many thanks for any insight
> > > 
> > > Farrukh 
    Reply  04 Sep 2015, Ryu Sawada, Forum, ARGUS display with canvas and pads ...  
Dear Farrukh

The menu items are defined in,
examples/argus/menu/menu.xml, in the part for 'T3' tab.

Did you modify the definition XML for your program ?

Ryu


> Dear Ryu,
> 
> we've coded up our own example menu based on what you made for us - and thank you very much 
for that - we notice however that the resulting menu is nowhere to be seen on the frame.
> 
> When we did buttons we had to associate them with a frame - and I note that there seems to be no 
association to a frame in the code you wrote for us - so we never see a menu - is 
> this what is to be expceted ?
> 
> thanks 
> Farrukh
> 
> > Hi Ryu
> > 
> > thanks very much - I will certainly look at this example. In the meantime we are having some 
issues with out save buttons - I will post a thread separately
> > -Farrukh
> > 
> > > Dear Farrukh
> > > 
> > > What you want to do is probably possible ( I will write a possible method later.).
> > > However TPad has already several mouse operations (zoom, right-click menu, select active pad 
and so on); so I am not sure it is the best idea to add own mouse operation (which 
> > > could override other pre-implemented operations.)
> > > I will write three solutions below.
> > > I wrote an example of the first method.
> > > 
> > > == Method 1 : Menu ==
> > > For this solutions, I modified an example in the ROME package.
> > > The update is done only in the 'develop' branch.
> > > You can read the example by 'git checkout develop' command after you clone the ROME 
package.
> > > The example is in $ROMESYS/examples/argus/menu and the third tab (T3) is one for that.
> > > In ROME, you can easily add menu items in the menu bar. In the example, menu items to open 
and save a specific tab are prepared.
> > > 
> > > == Method 2 : dedicated buttons ==
> > > If you prefer buttons instead of menu, you can put dedicated buttons to trigger "OpenPad" 
function in the example instead of adding menus. The buttons can be implemented 
> > > either of the following two methods,
> > >  1) TButton, which can work as the same way as your Save button
> > >  2) Writing own class derived from TBox or TMarker. A box or maker can be put on each 
canvas.
> > > 
> > > I hope the first method is obvious for you. You can make another button similar to your Save 
button and call "OpenPad" function.
> > > 
> > > The second method is a little more complicated; you make your own class and override 
"ExecuteEvent" method.
> > > In the overriding function, you can call any functions when the box or marker is single-clicked, 
double-clicked, mouse-over and so on.
> > > A disadvantage is that the box or marker is always visible, and will be drawn in the output PDF 
files too.
> > > 
> > > == Method 3: click on Pad ==
> > > You can probably do what you write with making own class derived from TPad; then you 
override "ExecuteEvent" function for calling a function to make a separated canvas and 
> > > draw a clone of itself.
> > > You may also need own TCanvas and TRootEmbeddedCanvas for using the customized classes 
instead of regular TPad and TCanvas.
> > > 
> > > If you are satisfied with the first method, please try the example.
> > > The second method with TButton must not be very difficult.
> > > 
> > > If you prefer the second (using TBox or TMarker) and third method, I will investigate if it is 
actually possible.
> > > For the two methods, I think you need to write your own classes.
> > > 
> > > Best regards,
> > > 
> > > Ryu
> > > 
> > > > Dear Colleagues,
> > > > 
> > > > We are succesfully running a ROME executable both online and offline with an 
> > > > ARGUS display with a canvas that has multiple pads on it. We have also 
> > > > implemented a "Save" button which one can click on and save the _entire_ canvas 
> > > > (containing all the pads) and saves it to pdf.
> > > > 
> > > > I was wondering how one would go about making the following modification :
> > > > 
> > > > When a user moves a mouse over to a particular pad and clicks on it - then only 
> > > > the histogram on that pad is displayed on a separate canvas (so the user can 
> > > > examine it closely) and also save just this one histogram - with a save button 
> > > > similar to the one we've already written.
> > > > 
> > > > many thanks for any insight
> > > > 
> > > > Farrukh 
    Reply  07 Sep 2015, Ryu Sawada, Bug Fix, TMTT3.cpp -offset in index of the pads  
Thank you.

You are right.
I modified and pushed the code.

Ryu

> Hi Ryu,
> 
> I fixed the problem about the offset in the indexing of the pads. It's just in
> the TMTT3.cpp source code, 
> Instead of wrtiting:
>  case TMWindow::M_T3_Open_Pad1:
>       OpenPad(0);
>       break;
> one should write:
> 
>  case TMWindow::M_T3_Open_Pad1:
>       OpenPad(1);
>       break;
    Reply  07 Sep 2015, Ryu Sawada, Forum, ARGUS display with canvas and pads ...  
I found rather easy way for the Method 3 (click on pad).

I implemented in the same example,
namely, the third tab in $ROMESYS/examples/argus/menu.

You can add a macro which is executed when an event occurs on each pad  with,
   fCanvas->GetCanvas()->GetPad(1)->AddExec("ex1", ".x OpenCanvas.C");

Then you can write any function in the macro.
In this example, it opens a copy of canvas and save the clicked pad into a PDF file.

Ryu

> Dear Farrukh
> 
> What you want to do is probably possible ( I will write a possible method later.).
> However TPad has already several mouse operations (zoom, right-click menu, select active pad 
and so on); so I am not sure it is the best idea to add own mouse operation (which 
> could override other pre-implemented operations.)
> I will write three solutions below.
> I wrote an example of the first method.
> 
> == Method 1 : Menu ==
> For this solutions, I modified an example in the ROME package.
> The update is done only in the 'develop' branch.
> You can read the example by 'git checkout develop' command after you clone the ROME package.
> The example is in $ROMESYS/examples/argus/menu and the third tab (T3) is one for that.
> In ROME, you can easily add menu items in the menu bar. In the example, menu items to open and 
save a specific tab are prepared.
> 
> == Method 2 : dedicated buttons ==
> If you prefer buttons instead of menu, you can put dedicated buttons to trigger "OpenPad" function 
in the example instead of adding menus. The buttons can be implemented 
> either of the following two methods,
>  1) TGTextButton, which can work as the same way as your Save button
>  2) Writing own class derived from TBox or TMarker. A box or maker can be put on each canvas.
> 
> I hope the first method is obvious for you. You can make another button similar to your Save button 
and call "OpenPad" function.
> 
> The second method is a little more complicated; you make your own class and override 
"ExecuteEvent" method.
> In the overriding function, you can call any functions when the box or marker is single-clicked, 
double-clicked, mouse-over and so on.
> A disadvantage is that the box or marker is always visible, and will be drawn in the output PDF files 
too.
> 
> == Method 3: click on Pad ==
> You can probably do what you write with making own class derived from TPad; then you override 
"ExecuteEvent" function for calling a function to make a separated canvas and 
> draw a clone of itself.
> You may also need own TCanvas and TRootEmbeddedCanvas for using the customized classes 
instead of regular TPad and TCanvas.
> 
> If you are satisfied with the first method, please try the example.
> The second method with TGTextButton must not be very difficult.
> 
> If you prefer the second (using TBox or TMarker) and third method, I will investigate if it is actually 
possible.
> For the two methods, I think you need to write your own classes.
> 
> Best regards,
> 
> Ryu
> 
> > Dear Colleagues,
> > 
> > We are succesfully running a ROME executable both online and offline with an 
> > ARGUS display with a canvas that has multiple pads on it. We have also 
> > implemented a "Save" button which one can click on and save the _entire_ canvas 
> > (containing all the pads) and saves it to pdf.
> > 
> > I was wondering how one would go about making the following modification :
> > 
> > When a user moves a mouse over to a particular pad and clicks on it - then only 
> > the histogram on that pad is displayed on a separate canvas (so the user can 
> > examine it closely) and also save just this one histogram - with a save button 
> > similar to the one we've already written.
> > 
> > many thanks for any insight
> > 
> > Farrukh 
ELOG V3.1.4-2e1708b5