Back Midas Rome Roody Rootana
  Rome Analyzer Framework, Page 7 of 11  Not logged in ELOG logo
ID Date Author Topic Subjectdown
  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
  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
  87   26 Jun 2005 Yasuko HISAMATSUBug ReportNeed to include stdarg.h in file ROMEString.h
Hello,

It seems some compliers have a problem with making ROME, sending error message
saying,

 In file included from builder/src/ROMEBuilder.cpp:574:
/home/pekochan/rome/20050626/rome/include/ROMEString.h:41: type spec ifier
   omitted for parameter `va_list'
 ...etc


This problem can be fixed in file "ROMEString.h" by adding the following 
either line;

#include <stdarg.h>

or 

#include <Varargs.h>
  88   27 Jun 2005 Matthias SchneebeliBug ReportNeed to include stdarg.h in file ROMEString.h
> Hello,
> 
> It seems some compliers have a problem with making ROME, sending error message
> saying,
> 
>  In file included from builder/src/ROMEBuilder.cpp:574:
> /home/pekochan/rome/20050626/rome/include/ROMEString.h:41: type spec ifier
>    omitted for parameter `va_list'
>  ...etc
> 
> 
> This problem can be fixed in file "ROMEString.h" by adding the following 
> either line;
> 
> #include <stdarg.h>
> 
> or 
> 
> #include <Varargs.h>


Thanks for reporting that problem. 

#include <stdarg.h>
is added now in the cvs.
  91   28 Jun 2005 Ryu SawadaBug ReportNeed to include stdarg.h in file ROMEString.h
> > Hello,
> > 
> > It seems some compliers have a problem with making ROME, sending error message
> > saying,
> > 
> >  In file included from builder/src/ROMEBuilder.cpp:574:
> > /home/pekochan/rome/20050626/rome/include/ROMEString.h:41: type spec ifier
> >    omitted for parameter `va_list'
> >  ...etc
> > 
> > 
> > This problem can be fixed in file "ROMEString.h" by adding the following 
> > either line;
> > 
> > #include <stdarg.h>
> > 
> > or 
> > 
> > #include <Varargs.h>
> 
> 
> Thanks for reporting that problem. 
> 
> #include <stdarg.h>
> is added now in the cvs.
replaced with #include <Varargs.h>
  29   01 Jan 2005 Ryu SawadaBug ReportMultiple TTree writing
When I make two TTree's write flag true. Both TTrees is written in one file. And the other file is empty.

I added some lines to fix it in ROMEEventLoop.cpp

-------
This is other topic.
Probably, to close TFile after each run is good. 
Because, when program runs for several run, 
 even if program aborts after some runs, files of former runs are safe.



-------
  941    // Write non accumulative output tree files
    942    ROMEString filename;
    943    ROMETree *romeTree;
    944    TTree *tree;
    945    TFile *fTreeFile;
    946    ROMEString runNumberString;
    947    gROME->GetCurrentRunNumberString(runNumberString);
    948    for (int j=0;j<gROME->GetTreeObjectEntries();j++) {
    949       romeTree = gROME->GetTreeObjectAt(j);
    950       fTreeFile = fTreeFiles[j];
    951       if (romeTree->isWrite() && !gROME->isTreeAccumulation()) {
    952          tree = romeTree->GetTree();
    953          cout << "Writing Root-File " << tree->GetName() << runNumberString.Data() << ".root" 
<< endl;
    954          fTreeFile->cd();
    955          tree->Write("",TObject::kOverwrite);
    956       }
    957    }
    958    cout << endl;
  30   04 Jan 2005 Matthias SchneebeliBug ReportMultiple TTree writing
> When I make two TTree's write flag true. Both TTrees is written in one file. And the other file is empty.
> 
> I added some lines to fix it in ROMEEventLoop.cpp
> 
> -------
> This is other topic.
> Probably, to close TFile after each run is good. 
> Because, when program runs for several run, 
>  even if program aborts after some runs, files of former runs are safe.
> 
> 
> 
> -------
>   941    // Write non accumulative output tree files
>     942    ROMEString filename;
>     943    ROMETree *romeTree;
>     944    TTree *tree;
>     945    TFile *fTreeFile;
>     946    ROMEString runNumberString;
>     947    gROME->GetCurrentRunNumberString(runNumberString);
>     948    for (int j=0;j<gROME->GetTreeObjectEntries();j++) {
>     949       romeTree = gROME->GetTreeObjectAt(j);
>     950       fTreeFile = fTreeFiles[j];
>     951       if (romeTree->isWrite() && !gROME->isTreeAccumulation()) {
>     952          tree = romeTree->GetTree();
>     953          cout << "Writing Root-File " << tree->GetName() << runNumberString.Data() << ".root" 
> << endl;
>     954          fTreeFile->cd();
>     955          tree->Write("",TObject::kOverwrite);
>     956       }
>     957    }
>     958    cout << endl;



Thanks
  103   17 Oct 2005 Matthias SchneebeliInfoMoved ROME from cvs to subversion
ROME moved from the cvs repository to a subversion repository.

Subversion repositories are much easier to maintain.

For the user almost nothing changes.
'cvs checkout' translates to 'svn checkout' and so on.

Subversion can be downloaded from http://subversion.tigris.org/project_packages.html

I hope this will not cause much inconvenience.

Matthias
  82   07 May 2005 Ryu SawadaBug ReportMismatch of [Set/Append]Formatted
In ROMEBuilder.cpp, there are some mismatchs of formart and argument of ROMEString::Set or 
AppendFormatted.

1000       format.SetFormatted("   void Set%%s%%%ds(%%-%ds %%s%%%ds) { f%%s%%%ds = %%s; };
\n",lb,typeLen,lb,lb,lb); 

3980             format.SetFormatted("   %%s%%s*%%%ds  Get%%sAt(int index)%%%ds\n",typeLen-
folderName[i].Length()-scl,0+nameLen-folderName[i].Length(),lt);

5875    buffer.AppendFormatted("   bool CheckConfiguration(int runNumber);\n",shortCut.Data()); 

6487    buffer.AppendFormatted("#include <TBranchElement.h>\n",shortCut.Data()); 

7231       buffer.AppendFormatted("   return buffer;\n",stringBuffer.Data());

7271                buffer.AppendFormatted("   if (!this->GetDataBase(name.Data())->Read
(values,path,gAnalyzer->GetCurrentRunNumber())) {\n",folderName[i].Data(),valueName[i][j].Data());

7358          buffer.AppendFormatted("%s                  xml->WriteElement(\"HistArrayStartIndex\",\"0\");
\n",blank.Data(),pointerI.Data(),histoName[taskHierarchyClassIndex[i]][j].Data()); 

8771    buffer.AppendFormatted(" obj/%sAnalyzer.obj obj/%sEventLoop.obj obj/%sConfig.obj obj/
main.obj",shortCut.Data(),shortCut.Data(),shortCut.Data(),shortCut.Data(),shortCut.Data());

8815    buffer.AppendFormatted("     g++ $(Flags) -o $@ $(objects) $(Libraries)\n\n",shortCut.Data
(),mainProgName.Data());

8872    buffer.AppendFormatted("obj/%sFAnalyzer.obj: src/framework/%sFAnalyzer.f src/framework/%
sAnalyzer.cpp include/framework/%sAnalyzer.h\n",shortCut.Data(),shortCut.Data(),shortCut.Data());

9341    htmlFile.SetFormatted("%s%sUserHTML.html",outDir.Data(),shortCut.Data(),mainProgName.Data
());
  84   13 May 2005 Ryu SawadaBug ReportMismatch of [Set/Append]Formatted
done.
> In ROMEBuilder.cpp, there are some mismatchs of formart and argument of ROMEString::Set or 
> AppendFormatted.
> 
> 1000       format.SetFormatted("   void Set%%s%%%ds(%%-%ds %%s%%%ds) { f%%s%%%ds = %%s; };
> \n",lb,typeLen,lb,lb,lb); 
> 
> 3980             format.SetFormatted("   %%s%%s*%%%ds  Get%%sAt(int index)%%%ds\n",typeLen-
> folderName[i].Length()-scl,0+nameLen-folderName[i].Length(),lt);
> 
> 5875    buffer.AppendFormatted("   bool CheckConfiguration(int runNumber);\n",shortCut.Data()); 
> 
> 6487    buffer.AppendFormatted("#include <TBranchElement.h>\n",shortCut.Data()); 
> 
> 7231       buffer.AppendFormatted("   return buffer;\n",stringBuffer.Data());
> 
> 7271                buffer.AppendFormatted("   if (!this->GetDataBase(name.Data())->Read
> (values,path,gAnalyzer->GetCurrentRunNumber())) {\n",folderName[i].Data(),valueName[i][j].Data());
> 
> 7358          buffer.AppendFormatted("%s                  xml->WriteElement(\"HistArrayStartIndex\",\"0\");
> \n",blank.Data(),pointerI.Data(),histoName[taskHierarchyClassIndex[i]][j].Data()); 
> 
> 8771    buffer.AppendFormatted(" obj/%sAnalyzer.obj obj/%sEventLoop.obj obj/%sConfig.obj obj/
> main.obj",shortCut.Data(),shortCut.Data(),shortCut.Data(),shortCut.Data(),shortCut.Data());
> 
> 8815    buffer.AppendFormatted("     g++ $(Flags) -o $@ $(objects) $(Libraries)\n\n",shortCut.Data
> (),mainProgName.Data());
> 
> 8872    buffer.AppendFormatted("obj/%sFAnalyzer.obj: src/framework/%sFAnalyzer.f src/framework/%
> sAnalyzer.cpp include/framework/%sAnalyzer.h\n",shortCut.Data(),shortCut.Data(),shortCut.Data());
> 
> 9341    htmlFile.SetFormatted("%s%sUserHTML.html",outDir.Data(),shortCut.Data(),mainProgName.Data
> ());
  22   02 Dec 2004 Ryu SawadaSuggestionMidas event definition
I finished Macintosh porting.
I checked it in offline mode , but not yet online mode.

I needed to add byte swapping code.
For bank swapping, if HAVE_MIDAS is defined it uses bk_swap in midas.h, in the other case it uses 
ROMEEventLoop::bk_swap.
Byte swapping will be done if cpu is PowerPC (MacOSX or Linux on Macintosh). Data should be written 
on little-endian machine like Intel.

Important point is If there is banks whose type is not MIDAS, rome may not work on Macintosh.
I want to propose a new MidasBanks scheme of xml file to fix this problem. Structure of EventDefinition 
is according to EVENT_DEF in mana.c.

When rome reads Midas file(offline) or ODB(odb), if the event ID is listed in xml configuration file and 
"Disabled" is false and Format is MIDAS, rome reads banks listed for the event ID, in the other case rome skips the event and goes to next 
event.

Probably this way will help statistics handling in online mode for also Intel platform. Because at this 
moment, rome assumes "Equipment" in ODB is always "Trigger" and "Scaler". But of coarse there can be 
other equipments. (There is possibility that ODB does not have "Scaler" too)

<MidasBanks>
   <EventHeader>
      <Folder>Event</Folder>
      <EventId>ID</EventId>
      <TriggerMask>Mask</TriggerMask>
      <SerialNumber>Eventnumber</SerialNumber>
      <TimeStamp>Time</TimeStamp>
   </EventHeader>
   <EventDefinition>
      <EventName>Trigger</EventName>
      <EventId>1</EventId>
      <Format>MIDAS</Format>
      <Disabled>false</Disabled>
      <Banks>
         <Bank>
            <BankName>ADC0</BankName>
            <BankType>unsigned short</BankType>
         </Bank>
         <Bank>
            <BankName>TDC0</BankName>
            <BankType>unsigned short</BankType>
         </Bank>
      </Banks>
   </EventDefinition>
   <EventDefinition>
      <EventName>Scaler</EventName>
      <EventId>2</EventId>
         <Format>YBOS</Format>
         <Disabled>true</Disabled>
         <Banks>
            <Bank>
               <BankName>SCLR</BankName>
               <BankType>unsigned long</BankType>
            <Bank>
         </Banks>	
      </EventDefinition>
      <EventDefinition>
         <EventName>HV</EventName>
         <EventId>3</EventId>
         <Format>FIXED</Format>
         <Disabled>true</Disabled>
      </EventDefinition>
</MidasBanks>

P.S.
If there is no plan to support YBOS and FIXED format. <Format> is not needed definitly.
  16   12 Nov 2004 Ryu SawadaSuggestionMakefile
In Makefile xmlibs and sqllibs is defined like this. 
xmllibs := -lxml2 -lz
sqllibs := -lmysql
But this is not correct sometimes.
Actually sqllibs for my environment should be -L'/usr/lib/mysql' -lmysqlclient

If you use the same way as rootlibs. It may be better.

xmllibs := $(shell xml2-config --libs)
xmlcflags := $(shell xml2-config --cflags)
sqllibs := $(shell mysql_config --libs)
sqlcflags := $(shell mysql_config --cflags)
  13   16 Oct 2004 Ryu SawadaInfoMIDAS status update
"Analyzed" fields in MIDAS status display are always 0.0% as you can see in the attached file.
Is it possible to implement function to update this field ?
Attachment 1: midas_status.jpg
midas_status.jpg
  200   14 Apr 2016 SUDESHNA GANGULYInfoIs auto-update available for tabs with user-defined codes (not with <Argus>) ?
Is it possible to have the pads automatically updated with the update frequency
(set at romeConfig.xml) while using user-defined src/tabs codes? 
Suppose I write a tab code under src/tabs where I have created an "update" button. 
Now on the Argus display monitor, if I click on the "update" button, the display
will be updated. But what I've noticed is that clicking on the update button
introduces a delay. By the time the display is actually updated I've missed some
events already. 

Is there any way to sync the update button with the update frequency in the
romeConfig.xml? So that it keeps up with every event?

I would really appreciate if anyone have any suggestion for this situation.

Thanks a lot!
Sudeshna
  201   15 Apr 2016 Ryu SawadaInfoIs auto-update available for tabs with user-defined codes (not with <Argus>) ?
Dear Sudeshna

The easiest way would be to call your "Update" function from EventHandler function of your tabs.

You may or may not have a function named "Update", but I believe you must have a function to update your graphics 
when your "Update" button is clicked.
You can call the same thing from EventHandler function, then it will keep the display updated.

If you want to control the frequency of the update of each tab, you can see two examples,
  $ROMESYS/examples/argus/thread/
  $ROMESYS/examples/argus/timer/
The examples update the display with using different tools (making other update thread or by using TTimer of ROOT).

Ryu

> Is it possible to have the pads automatically updated with the update frequency
> (set at romeConfig.xml) while using user-defined src/tabs codes? 
> Suppose I write a tab code under src/tabs where I have created an "update" button. 
> Now on the Argus display monitor, if I click on the "update" button, the display
> will be updated. But what I've noticed is that clicking on the update button
> introduces a delay. By the time the display is actually updated I've missed some
> events already. 
> 
> Is there any way to sync the update button with the update frequency in the
> romeConfig.xml? So that it keeps up with every event?
> 
> I would really appreciate if anyone have any suggestion for this situation.
> 
> Thanks a lot!
> Sudeshna
  66   29 Mar 2005 Ryu SawadaSuggestionInput file format
I am going to make a new ROME project to analyze MC data. Input file will be ROOT which  is created by 
h2root.
And my friend who is working on dark matter search at Columbia university in NY is going to use 
ROME. His file format is special binary format.

If I understand correctly, currently ROME can read midas and ROOT format.
Midas file names are always assumed as "run99999.mid". (99999 is run number)
ROOT files need to have structure defined in definition xml file. 
I guess this is not enough to analyze special binary format or ROOT files created by h2root.

What I propose is to allow users to have own daq class. It might be something like

<DAQs>
  <DAQ>
    <DAQName>daqname</DAQName>
  </DAQ>
</DAQs>

Then builder creates [shortcut][daqname].h, [shortcut][daqname].cpp.
[shortcut][daqname] class inherits ROMEDAQSystem class, and users must fill GetTimeStamp(), 
Initialize(), Connect(), ReadEvent(int event), Disconnect(), Termination()

When "InputDataFormat" in configuration xml file is "daqname" analyzer uses this class.


 
  68   01 Apr 2005 Matthias SchneebeliInfoInportant !!! -> Changes in the user code requiered
In the current cvs version of ROME several things have changed that require 
changes in the user code.

- Most of the histogram parameters have been moved form the definition file to 
the configuration file. Please consult the users guide.

- Database paths have also been moved to the configuration file. Furthermore 
the format has changed for string replacements. It looks now like this :

<DataBasePath>"/AAA/BBB[0,%s]",/GSP/NumberOfBBB</DataBasePath>
For folders write : '/FolderName/FieldName'.

The format statement must always be %s!

- The tag 'InputDataFormat' has changed to 'DAQSystem' in the configuration 
file.

- All bank access methods have to be accessed by gAnalyzer->GetMidas() not only 
gAnalyzer.

Matthias
  81   06 May 2005 Ryu SawadaInfoIdentical check in builder
About identical check of new and existing file in builder.

Currently there is a limit of file size defined by "bufferLength".
When the file size exceed the size, the file will be always overwritten by builder.
And if the file is existing task cpp file, user will lose a part of his code.

Actually, LPConfig.cpp is larger than that.

So I wrote a simple function. it will be called recursively when the file is larger than buffer.
bufferLength is not necessary to be so large.

bool checkIdentical(const int fileHandle,const char* pattern,bool flag=true)
{
   static int position
   int  i;
   char fileBuffer[bufferLength];

   if(flag)
      position = 0;

   int nb = read(fileHandle,&fileBuffer, sizeof(fileBuffer));
  
   if(nb == bufferLength){
      if((int)strlen(pattern)-position < bufferLength)
         return false;
     
      for (i=0;i<nb;i++)
         if (pattern[position+i] != fileBuffer[i])
            return false;     
      position += bufferLength;
      return checkIdentical(fileHandle,pattern,false);
   }  
   else{
      if (nb != (int)strlen(pattern) - position)
         return false;
     
      for (i=0;i<nb;i++)
         if (pattern[position+i] != fileBuffer[i])
            return false;
   }
   return true;
}


You may use this function in builder like,
   int fileHandle = open("test.txt",O_RDONLY);
   bool identical = checkIdentical(fileHandle,buffer);
   close(fileHandle);

And there is another way. TString can read file. this featrue can be used when you read existing Task cpp file.

   ifstream ifile("test.txt");
   TString fileBuffer;
   str.ReadFile(ifile);
   bool identical = ( fileBuffer == buffer );
  83   13 May 2005 Ryu SawadaInfoIdentical check in builder
done.

> About identical check of new and existing file in builder.
> 
> Currently there is a limit of file size defined by "bufferLength".
> When the file size exceed the size, the file will be always overwritten by builder.
> And if the file is existing task cpp file, user will lose a part of his code.
> 
> Actually, LPConfig.cpp is larger than that.
> 
> So I wrote a simple function. it will be called recursively when the file is larger than buffer.
> bufferLength is not necessary to be so large.
> 
> bool checkIdentical(const int fileHandle,const char* pattern,bool flag=true)
> {
>    static int position
>    int  i;
>    char fileBuffer[bufferLength];
> 
>    if(flag)
>       position = 0;
> 
>    int nb = read(fileHandle,&fileBuffer, sizeof(fileBuffer));
>   
>    if(nb == bufferLength){
>       if((int)strlen(pattern)-position < bufferLength)
>          return false;
>      
>       for (i=0;i<nb;i++)
>          if (pattern[position+i] != fileBuffer[i])
>             return false;     
>       position += bufferLength;
>       return checkIdentical(fileHandle,pattern,false);
>    }  
>    else{
>       if (nb != (int)strlen(pattern) - position)
>          return false;
>      
>       for (i=0;i<nb;i++)
>          if (pattern[position+i] != fileBuffer[i])
>             return false;
>    }
>    return true;
> }
> 
> 
> You may use this function in builder like,
>    int fileHandle = open("test.txt",O_RDONLY);
>    bool identical = checkIdentical(fileHandle,buffer);
>    close(fileHandle);
> 
> And there is another way. TString can read file. this featrue can be used when you read existing Task cpp file.
> 
>    ifstream ifile("test.txt");
>    TString fileBuffer;
>    str.ReadFile(ifile);
>    bool identical = ( fileBuffer == buffer );
ELOG V3.1.4-2e1708b5