Back Midas Rome Roody Rootana
  Rome Analyzer Framework, Page 3 of 11  Not logged in ELOG logo
ID Dateup Author Topic Subject
  41   20 Jan 2005 Ryu SawadaSuggestionheaders of midas,xml2 and mysql
> This is not so strong suggestion. I am just wondering.
> 
> Currently ROME include headers of midas, xml2 and mysql.
> There are libraries for windows but no libraries for linux.
> 
> I am afraid that there can be inconsequence between headers and libraries in futrue updates of these 
> libraries, if compiler reads headers from rome/include instead of correct one.
> 
> So, my suggestion is that move midas.h,libxml2 and mysql outside of header files search path for linux.
> 
> for instance
>   Make new directory rome/include/win.
>   Put midas.h,libxml2 and mysql into it.
>   Add $ROMESYS/include/win into header files search path in case of Windows.
> 
> 
> P.S.
> If midas.h is already very different from midas.h in MIDAS. This may be difficult.

I looked into gcc, then I found the header file which is found first is supposed to be used.
In ROME's case $(shell xml2-config --cflags) and $(shell mysql_config --cflags) are located before -I$(ROMESYS)/include/, so in principle 
it is safe.

But about midas.h there still can be inconsequence, because -I$(ROMESYS)/include/ is located before -I$(MIDASSYS)/include/.
It this done on purpose to enable special features for ROME ?


---
One more thing. about libpaths.
If libpaths will be used only for specify the place where midas libraries were put. Followings can also work and more simple.
And I added midascflags, because to use same way as root,xml2 and mysql seems more beautiful. 
And I moved -DHAVE_SQL and -DHAVE_MIDAS to sqlcflags and midascflags.

rootlibs := $(shell root-config --libs)
rootglibs := $(shell root-config --glibs)
rootcflags := $(shell root-config --cflags)
rootthreadlibs := -lThread
xmllibs :=  $(shell xml2-config --libs)
xmlcflags :=  $(shell xml2-config --cflags)
sqllibs := $(shell mysql_config --libs)
sqlcflags := $(shell mysql_config --cflags) -DHAVE_SQL
midaslibs := -L$(MIDASSYS)/lib -lmidas
midascflags := -I$(MIDASSYS)/include -DHAVE_MIDAS
clibs :=-lpthread -lHtml $(SYSLIBS)
clibs += -lutil

Libraries := $(libpaths) $(rootlibs) $(rootglibs) $(rootthreadlibs) $(xmllibs) $(clibs) $(sqllibs) $(midaslibs)
Flags := $(lpuserflags) $(rootcflags) $(xmlcflags) $(sqlcflags) $(midascflags)
Includes := -I$(ROMESYS)/include/ -I. -Iinclude/ -Iinclude/tasks/ -Iinclude/framework/
  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
  44   27 Jan 2005 Matthias SchneebeliSuggestionmessaging system
> About warnings,errors and informations output in online mode.
> 
> Probably we lauch ROME from web interface of MIDAS. And we don't see console of ROME.
> But we need to hear what ROME is saying.
> 
> Normally midas analyzer and other applications use cm_msg function. This function shows messages 
> proper place like web interface or ODBEdit windows and so on.
> 
> I do not have much knowledge about it. Stefan may know better way.

I implemented the cm_msg calls.
  45   27 Jan 2005 Stefan RittSuggestionmessaging system
> I implemented the cm_msg calls.

You should implement a central "message dispatcher". So all errors etc. should go to someting linke
rome_msg(). If compiled with midas online support, rome_msg() should call cm_msg(). If rome is compiled
without midas libraries, a printf() there would be enough. If someone uses rome in a different
environment, only can function needs to be changed to reroute all messages to somewhere else.
  46   28 Jan 2005 Matthias SchneebeliSuggestionmessaging system
> > I implemented the cm_msg calls.
> 
> You should implement a central "message dispatcher". So all errors etc. should go to someting linke
> rome_msg(). If compiled with midas online support, rome_msg() should call cm_msg(). If rome is compiled
> without midas libraries, a printf() there would be enough. If someone uses rome in a different
> environment, only can function needs to be changed to reroute all messages to somewhere else.

Of course, that's the way I implemented that.
  47   05 Feb 2005 Ryu SawadaBug Reportsmall problem of XML definition file
About <EventHeader> in xml definition file.

In description page in ROME homepage, It is wirtten that <EventId> specifies the field.
But It seems that 'd' shoud be capital.
  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.
  49   06 Mar 2005 Ryu SawadaSuggestionCint mode on online
We sometimes want to use trees in ROME.

One way is to read it by TSocket connection. But treees are larger than histograms in general, and it 
takes time to download. 
 And I need to make shared library when I changed the structure of folders.

So, I want to propose is to prepare Cint mode with continueing analysis in background.

Currently, when user press "i", ROME stops analysis and goes into cint mode. This is good for offline 
mode, but this is not good for online mode. So I propose that when user press "I", ROME goes cint 
mode, and continue analysis in background.

Then we can see Trees at run time.

In addition, If you are going to implement this feature, please prepare short way to call trees in cint mode.
If I understand correctly, the way to call a tree is like,
gAnalyzer->GetTreeObjectAt(0)->GetTree()->Draw("");
but it is too long to use in interactively and we need to remeber the number of trees.
gAnalyzer->GetTree("trigger")->Draw();  is better.
  50   09 Mar 2005 Ryu SawadaBug ReportUnanalyzed events
In online mode, ROME often stops before finishing to analyze all events of runs. 
 When it happens, gAnalyzer->GetCurrentEventNumber() starts not from 1 but from analyzed event 
number at previous run. And unanalyzed events at the previous run are mixed with the new run.

In mana.c of MIDAS, I found a part to wait until all events in buffers are analyzed when analyzer gets 
TR_STOP signal, while ROME does not have.

I personaly don't need that all events are analyzed, but it is really problem that data of two runs are 
mixed.

One way is to take similar way as midas analyzer, and the another way is just discard unanalyzed 
events.
  51   09 Mar 2005 Ryu SawadaBug Reportdefault values in romeConfig.xml
Recently, default values of steering parameters in romeConfig.xml are always 0. They are not as same 
as values in SPFieldInitialization of definition XML file.
  52   10 Mar 2005 Ryu SawadaBug ReportResetFolders
In ROMEEventLoop.cpp::ReadEvent
this->ResetFolders is called before fActiveDAQ->ReadEvent, so data in event headers are not updated 
properly.
  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")
  56   21 Mar 2005 Matthias SchneebeliBug Reportsmall problem of XML definition file
> About <EventHeader> in xml definition file.
> 
> In description page in ROME homepage, It is wirtten that <EventId> specifies the field.
> But It seems that 'd' shoud be capital.

done
  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
  58   21 Mar 2005 Matthias SchneebeliBug ReportResetFolders
> In ROMEEventLoop.cpp::ReadEvent
> this->ResetFolders is called before fActiveDAQ->ReadEvent, so data in event headers are not updated 
> properly.

done
  59   21 Mar 2005 Matthias SchneebeliBug ReportUnanalyzed events
> In online mode, ROME often stops before finishing to analyze all events of runs. 
>  When it happens, gAnalyzer->GetCurrentEventNumber() starts not from 1 but from analyzed event 
> number at previous run. And unanalyzed events at the previous run are mixed with the new run.
> 
> In mana.c of MIDAS, I found a part to wait until all events in buffers are analyzed when analyzer gets 
> TR_STOP signal, while ROME does not have.
> 
> I personaly don't need that all events are analyzed, but it is really problem that data of two runs are 
> mixed.
> 
> One way is to take similar way as midas analyzer, and the another way is just discard unanalyzed 
> events.

done
  60   21 Mar 2005 Ryu SawadaBug ReportResetFolders
> > In ROMEEventLoop.cpp::ReadEvent
> > this->ResetFolders is called before fActiveDAQ->ReadEvent, so data in event headers are not updated 
> > properly.
> 
> done
I wonder if this is the reason why Jan couldn't read scaler events.
Event ID was shifted by two events, so when scaler event comes, ROME can always recognize it as trigger events.
ELOG V3.1.4-2e1708b5