Back Midas Rome Roody Rootana
  Rome Analyzer Framework, Page 6 of 11  Not logged in ELOG logo
ID Date Author Topicup Subject
  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
  24   06 Dec 2004 Ryu SawadaInfoChangeable folder as branch a tree
I tried to make changeable folder a branch of tree.
I could process data. Rome succeeded to write the tree.

But when I tried to draw a leaf of the branch, root complains that the class name is invalid.
  42   24 Jan 2005 Ryu SawadaInfosmall problems
These are not critical, but someone may complain some day.

1. ROMEBuilder.cpp:2315
 I wonder if maxNumberOfTasks should be maxNumberOfSteering.
 // count steering parameters
   2316    numOfSteering[iTask]++;
   2317    currentNumberOfSteerings = numOfSteering[iTask];
   2318    if (numOfSteering[iTask]>=maxNumberOfTasks+1) {
   2319       cout << "Maximal number of steering parameters reached : " << (max   2319 
NumberOfTasks+1) << " !" << endl;
   2320       cout << "Terminating program." << endl;
   2321       return false;
   2322    }

2. ROMEBuilder.cpp:2437
 I wonder if maxNumberOfSteering should be maxNumberOfSteeringField.
    if (numOfSteerFields[iTask][actualSteerIndex]>=maxNumberOfSteer   
   2437 ing) {
   2438             cout << "Maximal number of steering parameter fields in task   2438  '" << 
taskName[iTask].Data() << "' reached : " << maxNumberOfSteering <   2438 < " !" << endl;
   2439             cout << "Terminating program." << endl;
   2440             return false;
   2441          }


3. ROMEBuilder.cpp:6327
 I wonder if ROOTSYS should be ROOTSYS/include.
 6327 #if defined( _MSC_VER )
   6328    buffer.AppendFormatted("-I%%ROMESYS%%/include ");
   6329    buffer.AppendFormatted("-I%%ROOTSYS%% ");
   6330 #endif
   6331 #if defined ( __linux__ ) || defined ( __APPLE__ )
   6332    buffer.AppendFormatted("-I$ROMESYS/include ");
   6333    buffer.AppendFormatted("-I$ROOTSYS ");
   6334 #endif

4. ROMEBuilder.cpp:6806
in ROMEBuilder::isNumber, there are some missing number types such as.
Double32_t,Long64_t,ULong64_t

5. ROMEBuilder.cpp:6821
in ROMEBuilder::isFloatingType, there are some missing floating types such as.
Double32_t
  43   25 Jan 2005 Matthias SchneebeliInfosmall problems
> These are not critical, but someone may complain some day.
> 
> 1. ROMEBuilder.cpp:2315
>  I wonder if maxNumberOfTasks should be maxNumberOfSteering.
>  // count steering parameters
>    2316    numOfSteering[iTask]++;
>    2317    currentNumberOfSteerings = numOfSteering[iTask];
>    2318    if (numOfSteering[iTask]>=maxNumberOfTasks+1) {
>    2319       cout << "Maximal number of steering parameters reached : " << (max   2319 
> NumberOfTasks+1) << " !" << endl;
>    2320       cout << "Terminating program." << endl;
>    2321       return false;
>    2322    }
> 
> 2. ROMEBuilder.cpp:2437
>  I wonder if maxNumberOfSteering should be maxNumberOfSteeringField.
>     if (numOfSteerFields[iTask][actualSteerIndex]>=maxNumberOfSteer   
>    2437 ing) {
>    2438             cout << "Maximal number of steering parameter fields in task   2438  '" << 
> taskName[iTask].Data() << "' reached : " << maxNumberOfSteering <   2438 < " !" << endl;
>    2439             cout << "Terminating program." << endl;
>    2440             return false;
>    2441          }
> 
> 
> 3. ROMEBuilder.cpp:6327
>  I wonder if ROOTSYS should be ROOTSYS/include.
>  6327 #if defined( _MSC_VER )
>    6328    buffer.AppendFormatted("-I%%ROMESYS%%/include ");
>    6329    buffer.AppendFormatted("-I%%ROOTSYS%% ");
>    6330 #endif
>    6331 #if defined ( __linux__ ) || defined ( __APPLE__ )
>    6332    buffer.AppendFormatted("-I$ROMESYS/include ");
>    6333    buffer.AppendFormatted("-I$ROOTSYS ");
>    6334 #endif
> 
> 4. ROMEBuilder.cpp:6806
> in ROMEBuilder::isNumber, there are some missing number types such as.
> Double32_t,Long64_t,ULong64_t
> 
> 5. ROMEBuilder.cpp:6821
> in ROMEBuilder::isFloatingType, there are some missing floating types such as.
> Double32_t


Thanks
  48   28 Feb 2005 Ryu SawadaInfoRun number in online mode
We usually use ROME framework without specifying run number in romeConfig.xml and command line 
in online mode.

Then it warns that "Error in <TArrayI::At>: index 0 out of bounds" when gROME-
>GetRunNumberStringAt(runNumberString,0) is called in ROMEEventLoop::Initialize.
  53   11 Mar 2005 Ryu SawadaInfomake build
I added new make target "build" in ARGUS. It may be useful also for ROME users.

in WriteMakefile(char* xmlFile)
.
.
.
  int pdnameend = 0;
   int pbnamestart = 0;
   ROMEString xmlfile = xmlFile;
   while((pdnameend = xmlfile.Index("/",1,pbnamestart,TString::kExact))!=-1)
      pbnamestart = pdnameend+1;
   ROMEString xmlbasename = xmlfile(pbnamestart,xmlfile.Length());
   buffer.AppendFormatted("build::\n");
   buffer.AppendFormatted("     $(ROMESYS)/bin/romebuilder.exe -i %s -o .",xmlbasename.Data());
   if (makeOutput)
      buffer.AppendFormatted(" -v");
   if(noLink)
      buffer.AppendFormatted(" -nl");
   if(midas)
      buffer.AppendFormatted(" -midas");
   if(!sql)
      buffer.AppendFormatted(" -nosql");
   buffer.AppendFormatted("\n");
.
.
.
  54   13 Mar 2005 Ryu SawadaInfoWarning message from compiler (These are just warnings, not problems)
I will summarize some points which g++ warned.  
  
(1) I fixed following points.  
*Made destructor of ROMEConfig and ROMEDataBase virtual.  
  
*Removed or comment out unused variables.  
    int i                            in ROMEPATH::~ROMEPath()  
    char* defaultRow                 in ROMESQL::ReadField  
    char* c                          in ROMEString::SetFormatted  
     int istart,iend,iValue,jValue   in ROMEXMLDataBase::Read  
    int istep,iValue,jValue          in ROMEXMLDataBase::Write  
    ROMEStrArray *array              in ROMEXMLDataBase::Write  
  
(2) Following points are not fixed yet.  
* There can be unused "int i" in several codes which builder generates. (ex. XXAnalyzer::InitMidasBanks  
)  
  This is not a problem, but a little bit annoying. If it is very easy, please fix it. 
  
* Please make sure this is not a problem.  
   in ROMEAnalyzer:: ResponseFunction  
      while (obj = iterFolders->Next()) {  
            ROMEString str;  
            str.SetFormatted("%s",obj->GetName());  
            names->Add(new TObjString(str.Data()));  
      }  
  
*ROMEString.cpp:74: warning: `int numberOfDigits' might be used uninitialized in this function  
*ROMEXMLDataBase.cpp:80: warning: `ROMEXML*xml' might be  used uninitialized in this function  
  
  
(3) This is not warning from g++, but request from me.  
  If it is very easy, please make ROMEString::SetFormatted,AppendFormatted to check that number of  
arguments is correct.  
  55   18 Mar 2005 Ryu SawadaInfoxmlwriter.h
I realized that some unix system distribution does not provide xmlwriter.h in standard libxml2-devel 
package.

For instance, scientific linux (also PSI linux) does not.
I installed it from source.

Macintosh has xmlreader.h by default, and does not xmlwriter.h.
I installed it by using FINK.
(FINK is a unix package porter like CYGWIN.)

Someone may ask about it someday. 
A problem is that compiler will find xmlwriter.h even if the system does not have it, because ROME has.
This may make it hard that users find out the problem.


How to install libxml2.
----  UNIX OS ----
In most cases, to use standard way of the system is good. But some system does not provide xmlwriter.h. In this case you may need to 
install it from source.
1. download source from http://xmlsoft.org/.
2. decompress it and go to created directory.
3. % ./configure [options as you like];
4. % make;
5. become super user, if you are going to install it in system.
6. % make install

---- MacOSX ----
By default, Macintosh does not have xmlwriter.h. You can follow the same way as other UNIX OS. And other way is to use FINK. (I hope 
many users already installed it.)
1. install FINK (http://fink.sourceforge.net)
2. become super user.
3. apt-get update;
4. apt-get install libxml2 libxml2-shlibs libxml2-bin
If you are goint to use also MySQL.
5. apt-get install mysql12-dev mysql12-shlibs
(* package name can be changed in future, you may find it with "apt-cache search libxml2" or "apt-cache search mysql")
  57   21 Mar 2005 Matthias SchneebeliInfoRun number in online mode
> We usually use ROME framework without specifying run number in romeConfig.xml and command line 
> in online mode.
> 
> Then it warns that "Error in <TArrayI::At>: index 0 out of bounds" when gROME-
> >GetRunNumberStringAt(runNumberString,0) is called in ROMEEventLoop::Initialize.

done
  61   23 Mar 2005 Matthias SchneebeliInfoxmlwriter.h
> I realized that some unix system distribution does not provide xmlwriter.h in standard libxml2-devel 
> package.
> 
> For instance, scientific linux (also PSI linux) does not.
> I installed it from source.
> 
> Macintosh has xmlreader.h by default, and does not xmlwriter.h.
> I installed it by using FINK.
> (FINK is a unix package porter like CYGWIN.)
> 
> Someone may ask about it someday. 
> A problem is that compiler will find xmlwriter.h even if the system does not have it, because ROME has.
> This may make it hard that users find out the problem.
> 
> 
> How to install libxml2.
> ----  UNIX OS ----
> In most cases, to use standard way of the system is good. But some system does not provide xmlwriter.h. In this case you may need to 
> install it from source.
> 1. download source from <a href="http://xmlsoft.org/">http://xmlsoft.org/</a>.
> 2. decompress it and go to created directory.
> 3. % ./configure [options as you like];
> 4. % make;
> 5. become super user, if you are going to install it in system.
> 6. % make install
> 
> ---- MacOSX ----
> By default, Macintosh does not have xmlwriter.h. You can follow the same way as other UNIX OS. And other way is to use FINK. (I hope 
> many users already installed it.)
> 1. install FINK (<a href="http://fink.sourceforge.net">http://fink.sourceforge.net</a>)
> 2. become super user.
> 3. apt-get update;
> 4. apt-get install libxml2 libxml2-shlibs libxml2-bin
> If you are goint to use also MySQL.
> 5. apt-get install mysql12-dev mysql12-shlibs
> (* package name can be changed in future, you may find it with "apt-cache search libxml2" or "apt-cache search mysql")

I have replaced libxml with mxml (written by Stefan) which is now included in the rome distribution.
So there's no install problem on linux anymore.
  63   24 Mar 2005 Ryu SawadaInfoCVS_RSH
I recommended to my friend trying ROME, but he couldn't download it, because he didn't set CVS_RSH.
There is no instruction for setting CVS_RSH in ROME download page.

You had better to write about it.
  65   29 Mar 2005 Ryu SawadaInfoHistograms
It does not seem that fHistoNameTitleOverWritten,fHistoNameFolderTitleOverWritten and so on are not 
initialized.

I'm afraid it is not safe
,because when ***OverWritten is "true" parameters are not supposed to be initialized.

In my case, framework tries to make a histogram whose number of bins is 1701143923.

This is my definition of the histogram. Do I need to add something?
<Histogram>
  <HistName>hXeQsum</HistName>
  <HistTitle>Qsum</HistTitle>
  <HistFolderName>Xenon</HistFolderName>
  <HistFolderTitle>Xenon</HistFolderTitle>
  <HistType>TH1F</HistType>
  <HistXNbins>4096</HistXNbins>
  <HistXmin>0</HistXmin>
  <HistXmax>5e5</HistXmax>
</Histogram>
  67   30 Mar 2005 Matthias SchneebeliInfoCVS_RSH
> I recommended to my friend trying ROME, but he couldn't download it, because he didn't set CVS_RSH.
> There is no instruction for setting CVS_RSH in ROME download page.
> 
> You had better to write about it.

Yes, thanks
  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
  70   07 Apr 2005 Ryu SawadaInfoCompiler warning
Followings are warning message from compiler, please check if they are correct.
When I changed line-490 like,
     490       while ((obj = iterFolders->Next())) {
warning disappeared.

ROMEAnalyzer.cpp:490: warning: suggest parentheses around assignment used as truth value
//get folder names
     485       TObject *obj;
     486       TObjArray *names = new TObjArray(100);
     487 
     488       TCollection *folders = folder->GetListOfFolders();
     489       TIterator *iterFolders = folders->MakeIterator();
     490       while (obj = iterFolders->Next()) {
     491          ROMEString str;
     492          str.SetFormatted("%s",obj->GetName());
     493          names->Add(new TObjString(str.Data()));
     494       }
     495 


ROMEString.cpp:74: warning: `int numberOfDigits' might be used uninitialized in this function
ROMEXMLDataBase.cpp:83: warning: `ROMEXML*xml' might be used uninitialized in this function
  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 );
  102   14 Oct 2005 Ryu SawadaInfoEventID
It seems that when tasks have different eventID from 'a', event methods are not executed.

I modified ROMETask.cpp for temporary solution like
else if ( strncmp(gROME->GetNameOfActiveDAQ(),"midas",5) ||
( !strncmp(&fEventID,"a",1) || !strncmp(option,&fEventID,1) )
) {
fCurrentEventMethod = "Event";
TimeStart();
if (gROME->isFillEvent())
Event();
TimeEnd();
}
By this change, eventID does not have meaning for DAQSystems other than midas.

If eventID should have meaning also in root mode, please impleament something to fill ROMEAnalyzer::fEventID in this mode.
  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
  104   16 Nov 2005 Matthias SchneebeliInfoChanged Root DAQ to Rome DAQ
I have changed the name of ROMEs input/output DAQ system from Root to Rome.
This has to implications for the user :

1. One has to select 'rome' intead of 'root' for the <DAQSystem> tag in the romeConfig file.

2. To access this DAQ system one has to call GetRome() instead of GetRoot()

Matthias
ELOG V3.1.4-2e1708b5