Back Midas Rome Roody Rootana
  Rome Analyzer Framework  Not logged in ELOG logo
Message ID: 74     Entry time: 15 Apr 2005
Author: Ryu Sawada 
Topic: Suggestion 
Subject: About parameters in definition and configuration file 
At first there must be several opinions and discussions. Following is just my opinion.
Probably asking opinion some users before changing ROME is better.

There are some properties for histograms and databases.

* database name
* database type and connection
* field database name and path
* histogram properties

I assume that definition file is shared by several persons in experimental group and configuration files 
are created for each users at the first execution. If you assume that we should share also configuration 
file, story written below is different.

My basic concept is that
 *Parameters which is complicated or will be shared among several users should be in definition file.
 *Parameters which can be often changed at run time should be in configuration file.

The good point to specify values in definition file is that they are flexible, because we can use 
ROMEString::SetFormatted.
It is outstanding point of ROME that we can design framework very flexibly due to builder.

Other point is that parameters in definition file will be written by programer while those in 
configuration file can be written by non-experts. It is better that the application can work with few 
changes of configuration file as possible. In my feeling, to specify database paths and histogram 
parameters in configuration file correctly is too tough for normal users.

In my opinion, they are separated like,
Definition file:
* field database name and path
* histogram properties

Configuration file:
* database type and connection
* (histogram properties)

-- about database path
Normally, users share the same database structure. So I think it should be in definition file. I don't think 
paths are changed so often.

-- about database type and connection
At first type and connection can be written in one line like,
   xml://directory_of_database/database_name
   mysql://[user_name]:[passwd]@[hostname]:[port]/database_name
   none://
      (  odb://[host_name]/[experiment] or odb://experiment@host_name  )
(parameters in [] are optional)

These parameters will be changed user by user, because they can have xml files in different place, and 
they can use replicated SQL servers.
Password can be written in connection. So it should be in configuration file.

-- about histogram parameters
We can specify them with calculation if they are in definition file. I think it should be in definition file.
And to allow to overwrite in configuration file is also attractive. In my opinion overwriting with normal 
type like Float_t,Int_t... is enough.

---------
In result, my opinion is like following.
Database name, database paths and histogram parameters are in definition file.
In default configuration file, config class writes database entries appeared in definition file.
Config class writes histogram parameters entries with empty values if the histogram is <Configurable>. 
Only when 
some value is written there, analyzer overwrite these parameters.

As I wrote above I think normal number like following are enough as values of histogram parameters in 
configuration file.
   <HistXmax>1000</HistXmax>
I don't think following is necessary.
   </HistXmax>/GSP/parameter</HistXmax>


Definition file
    <Folder>
        <FolderName>foldername</FolderName>
        <DataBaseAccess>true</DataBaseAccess>
        <Field>
          <FieldName>fieldname</FieldName>
          <FieldType>Float_t</FieldType>
          <DataBaseName>first_database</DataBaseName>
          <DataBasePath>"/Path/to/record"</DataBasePath>
        </Field>
       <Field>
          <FieldName>fieldname2</FieldName>
          <FieldType>Float_t</FieldType>
          <DataBaseName>second_database</DataBaseName>
          <DataBasePath>"/Path/to/record2"</DataBasePath>
        </Field>
   </Folder>
...
     <Histogram>
        <HistName>histname</HistName>
        <Configurable>true</Configurable>
        <HistType>TH1F</HistType>
        <HistTitle>ADC0 Bank</HistTitle>
        <HistFolderTitle>ADC</HistFolderTitle>
        <HistArraySize>gAnalyzer->GetGSP()->GetNumberOfADC()</HistArraySize>
        <HistXNbins>4094</HistXNbins>
        <HistXmin>1</HistXmin>
        <HistXmax>4095</HistXmax>
      </Histogram>

Default configuration file
    <DataBases>
      <DataBase>
        <Name>first_database</Name>
        <Connection>none://</Connection>
      </DataBase>
     <DataBase>
        <Name>second_database</Name>
        <Connection>none://</Connection>
      </DataBase>
    </DataBases> 
...
     <Histogram>
        <HistName>histname</HistName>
        <HistFolderTitle></HistFolderTitle>
        <HistArraySize></HistArraySize>
        <HistXNbins></HistXNbins>
        <HistXmin></HistXmin>
        <HistXmax></HistXmax>
      </Histogram>
ELOG V3.1.4-2e1708b5