Back Midas Rome Roody Rootana
  Rome Analyzer Framework, Page 2 of 11  Not logged in ELOG logo
ID Date Author Topic Subjectup
  163   22 Oct 2015 Ryu SawadaInfoAdding Trees and Branches in ROME
Dear Sudeshna Ganguly

It might be my misunderstanding, but do you mean that you want to add a new branch every time when you take one
event ? (namely, the number of branches n equals to the number of events ?)

In ROME, ( and I guess in most of user applications), each entry in the tree (instead of each branch) refers to one
event. Namely, the number of branches n is independent of the number of events; and the number of entries
increases as you take more events.

In the ROME applications, there is a one to one relation between,
- ROME Folder and Branch in Tree
- ROME Field in Folder and Leave in Tree
ROME folder and field are supposed to be defined in an XML file and the implementation (i.e. conversion to C++ code)
is done by ROMEBuilder.

Folders and fileds can be arrays.

I think, in your case, ROME folder could be like one of the followings depending on your data structure and preference,
Since I guess WFD stands for Wave Form Digitizer and guess has many numbers (instead of one), I expect you may use the 2nd or 3rd example,

1) A single variable 'WFD' is in five 'Data' folder instances
            <FolderName>Data</FolderName>
            <ArraySize>5</ArraySize>
            <Field>
                <FieldName>WFD</FieldName>
                <FieldType>Double_t</FieldType>
                <FieldComment>WFD Values</FieldComment>
            </Field>

2) A variable-length array 'WFD' is in five 'Data' folder instances
            <FolderName>Data</FolderName>
            <ArraySize>5</ArraySize>
            <Field>
                <FieldName>WFD</FieldName>
                <FieldType>Double_t</FieldType>
                <ArraySize>vector</ArraySize>
                <FieldComment>WFD Values</FieldComment>
            </Field>

3) A fixed-length array 'WFD' is in five 'Data' folder instances
            <FolderName>Data</FolderName>
            <ArraySize>5</ArraySize>
            <Field>
                <FieldName>WFD</FieldName>
                <FieldType>Double_t</FieldType>
                <ArraySize>1024</ArraySize>
                <FieldComment>WFD Values</FieldComment>
            </Field>

4) An array 'WFD' is in one 'Data' folder instance, and the array size of 'WFD' is five.
            <FolderName>Data</FolderName>
            <Field>
                <FieldName>WFD</FieldName>
                <FieldType>Double_t</FieldType>
                <ArraySize>5</ArraySize>
                <FieldComment>WFD Values</FieldComment>
            </Field>


Once you add a relation between the 'Data' folder and a branch in a tree (as shown <Tree> section of $ROMESYS/examples/midas/midas.xml),
The generated application,
- reads the tree and copies data in to the folder before every event (if the <DAQSystem> in config XML is rome)
- fills the tree with copying data from the folder

So you don't need to write code to read/write tees.
Instead you need to access the folders.

The access method depends on the folder structure. For the example above,

1)
   Int_t nCh = 5;
   for (Int_t iCh = 0; iCh < nCh; iCh++) {
      gAnalyzer->GetDataAt(iCh)->SetWFD(some_number);
   }

2)
   Int_t nCh = 5;
   for (Int_t iCh = 0; iCh < nCh; iCh++) {
      gAnalyzer->GetDataAt(iCh)->SetWFDSize(1024);
      Int_t wfdSize = gAnalyzer->GetDataAt(iCh)->GetWFDSize();
      for (Int_t i = 0; i < wfdSize; i++) {
         gAnalyzer->GetDataAt(iCh)->SetWFDAt(i, some_number);
      }
   }

3)
   Int_t nCh = 5;
   for (Int_t iCh = 0; iCh < nCh; iCh++) {
      for (Int_t i = 0; i < 1024; i++) {
         gAnalyzer->GetDataAt(iCh)->SetWFDAt(i, some_number);
      }
   }

4)
   Int_t nCh = 5;
   for (Int_t iCh = 0; iCh < nCh; iCh++) {
      gAnalyzer->GetData()->SetWFDAt(iCh, some_number);
   }

You can read the variables by using GetWFD (or GetWFDAt if WFD is an array) function.


You can find more example of the folder structure in $ROMESYS/examples/argus/folders/folderEntries.xml.

Ryu

> Hi,
>
> I need to add a tree, the tree will have n branches. Each branch will refer to
> one event. Now Each branch will have 5 leaves. Each leaf will have data from one
> WFD channel. There are data from total 5 WFD channels per event in our midas bank.
>
> I have seen some examples of trees and branches in ROME, but I don't know how I
> can loop over one channel to another channel and save those data into each leaf.
>
> Any help will be appreciated greatly.
>
> Sudeshna Ganguly
  181   01 Mar 2016 SUDESHNA GANGULYInfoAdding different tabs under a single parent tab
Hi Everyone,

Is there any way I can put different tabs under a single click-able menu in ROME?
Suppose I have tabs A, B, C, D. Each one of these tabs contains histograms. Can
I now, put A, B, C, D under another click-able menu called "calorimeters" ?

So that when I click on "calorimeters", I will see A, B, C, D. And then when I
click on A/B/C/D I will see the histograms.

Can that be done?
Is there any example available?

Thanks for any help!
Sudeshna
  182   02 Mar 2016 Ryu SawadaInfoAdding different tabs under a single parent tab
Yes, it can be done easily by nesting the tab definition in your definition XML file.
An example is $ROMESYS/examples/argus/tabs

Ryu

> Hi Everyone,
> 
> Is there any way I can put different tabs under a single click-able menu in ROME?
> Suppose I have tabs A, B, C, D. Each one of these tabs contains histograms. Can
> I now, put A, B, C, D under another click-able menu called "calorimeters" ?
> 
> So that when I click on "calorimeters", I will see A, B, C, D. And then when I
> click on A/B/C/D I will see the histograms.
> 
> Can that be done?
> Is there any example available?
> 
> Thanks for any help!
> Sudeshna
  178   22 Jan 2016 SUDESHNA GANGULYSuggestionAdding texts on a histigram while using <Argus> block for tabbing
Hi,

I am defining a histogram in the xml file like this:

<Histogram>
  <HistName>h2_dt_tcpgotheader</HistName>
  <HistFolderName>BC</HistFolderName>
  <HistType>TH2D</HistType>
<HistXLabel>time(us)</HistXLabel>
  <HistYLabel>Entries</HistYLabel>
  <HistXNbins>300000</HistXNbins>
  <HistXmin>-20000</HistXmin>
  <HistXmax>100000</HistXmax>
  <HistYNbins>10</HistYNbins>
  <HistYmin>0.0</HistYmin>
  <HistYmax>10</HistYmax>-->
  <Argus>
    <Tab>
      <TabName>SummaryBCBank</TabName>
      <Index>0</Index>
    </Tab>
  </Argus>
<Histogram>
  <HistName>h2_dt_tcpgotheader</HistName>
  <HistFolderName>BC</HistFolderName>
  <HistType>TH2D</HistType>
<HistXLabel>time(us)</HistXLabel>
  <HistYLabel>Entries</HistYLabel>
  <HistXNbins>300000</HistXNbins>
  <HistXmin>-20000</HistXmin>
  <HistXmax>100000</HistXmax>
  <HistYNbins>10</HistYNbins>
  <HistYmin>0.0</HistYmin>
  <HistYmax>10</HistYmax>-->
  <Argus>
    <Tab>
      <TabName>SummaryBCBank</TabName>
      <Index>0</Index>
    </Tab>
  </Argus>
</Histogram>

Now I want to add few texts and arrows on the same pad where the histogram is
being written.

I want to add this piece of code:

  TLatex title;
  title.SetTextFont(12);
  title.SetTextSize(0.03);
  title.SetNDC();


      title.SetTextColor(2);
      title.DrawLatex(0.01,0.32,"tcp header #rightarrow");
      title.SetTextColor(3);
      title.DrawLatex(0.01,0.4,"tcp data  #rightarrow");
      title.SetTextColor(4);
      title.DrawLatex(0.01,0.48,"copy to GPU #rightarrow");
      title.SetTextColor(5);
      title.DrawLatex(0.01,0.56,"GPU processing #rightarrow");
      title.SetTextColor(6);
      title.DrawLatex(0.01,0.64,"MFE start #rightarrow");
      title.SetTextColor(7);
      title.DrawLatex(0.01,0.72,"MFE stop #rightarrow");

The problem is that if I add this piece of code in the src/tasks, where I fill
in the histogram, then the problem is that this histogram replaces whatever is
on the last tab on the canvas.

As I recall that I am not supposed to add extra tabbing codes in the src codes
when I am using the <Argus> block for tabbing.

So where can I add these texts while still using <Argus> block for tabbing?

Any help might be very much appreciated.
  179   28 Jan 2016 Ryu SawadaSuggestionAdding texts on a histigram while using <Argus> block for tabbing
Dear Sudeshna

Unfortunately, with the current ROME, it is not possible to insert own code when you use <Argus> blocks for 
which the source code is supposed to be generated automatically (and not editable).

If you want to do more than the automatically generated code, you can use the normal type tabs although you 
need to program it by yourself (as you program tasks).

An example is $ROMESYS/examples/midas.
In midas.xml, you can find <Tabs> section where several normal tabs are defined.
Corresponding source files will be generated in src/tabs when you run romebuilder after modifying the 
definition 
XML.

As for source files of tasks, you can edit the source files of tabs as you want.
ROMEbuilder will not overwrite the files.
You can draw any ROOT GUI objects in the tabs including text.

You can get the pointer of histograms associated to a task.
For example, in the midas example, src/tabs/MIDTADCTab.cpp, a pointer of a histogram 'ADC' of 
'FillHistogram' 
task is obtained by
  gAnalyzer->GetFillHistogramTask()->GetADCAt(i)

Please let me know if you have any problems to write code for your tabs.

Best regards,

Ryu



> Hi,
> 
> I am defining a histogram in the xml file like this:
> 
> <Histogram>
>   <HistName>h2_dt_tcpgotheader</HistName>
>   <HistFolderName>BC</HistFolderName>
>   <HistType>TH2D</HistType>
> <HistXLabel>time(us)</HistXLabel>
>   <HistYLabel>Entries</HistYLabel>
>   <HistXNbins>300000</HistXNbins>
>   <HistXmin>-20000</HistXmin>
>   <HistXmax>100000</HistXmax>
>   <HistYNbins>10</HistYNbins>
>   <HistYmin>0.0</HistYmin>
>   <HistYmax>10</HistYmax>-->
>   <Argus>
>     <Tab>
>       <TabName>SummaryBCBank</TabName>
>       <Index>0</Index>
>     </Tab>
>   </Argus>
> <Histogram>
>   <HistName>h2_dt_tcpgotheader</HistName>
>   <HistFolderName>BC</HistFolderName>
>   <HistType>TH2D</HistType>
> <HistXLabel>time(us)</HistXLabel>
>   <HistYLabel>Entries</HistYLabel>
>   <HistXNbins>300000</HistXNbins>
>   <HistXmin>-20000</HistXmin>
>   <HistXmax>100000</HistXmax>
>   <HistYNbins>10</HistYNbins>
>   <HistYmin>0.0</HistYmin>
>   <HistYmax>10</HistYmax>-->
>   <Argus>
>     <Tab>
>       <TabName>SummaryBCBank</TabName>
>       <Index>0</Index>
>     </Tab>
>   </Argus>
> </Histogram>
> 
> Now I want to add few texts and arrows on the same pad where the histogram is
> being written.
> 
> I want to add this piece of code:
> 
>   TLatex title;
>   title.SetTextFont(12);
>   title.SetTextSize(0.03);
>   title.SetNDC();
> 
> 
>       title.SetTextColor(2);
>       title.DrawLatex(0.01,0.32,"tcp header #rightarrow");
>       title.SetTextColor(3);
>       title.DrawLatex(0.01,0.4,"tcp data  #rightarrow");
>       title.SetTextColor(4);
>       title.DrawLatex(0.01,0.48,"copy to GPU #rightarrow");
>       title.SetTextColor(5);
>       title.DrawLatex(0.01,0.56,"GPU processing #rightarrow");
>       title.SetTextColor(6);
>       title.DrawLatex(0.01,0.64,"MFE start #rightarrow");
>       title.SetTextColor(7);
>       title.DrawLatex(0.01,0.72,"MFE stop #rightarrow");
> 
> The problem is that if I add this piece of code in the src/tasks, where I fill
> in the histogram, then the problem is that this histogram replaces whatever is
> on the last tab on the canvas.
> 
> As I recall that I am not supposed to add extra tabbing codes in the src codes
> when I am using the <Argus> block for tabbing.
> 
> So where can I add these texts while still using <Argus> block for tabbing?
> 
> Any help might be very much appreciated.
  96   21 Jul 2005 Ryu SawadaSuggestionAn idea of file I/O
Current file handling of ROME is based on run number. This way is simple and easy to understand. But 
there are some arguments on it.

(i) In case of .mid file. ROME assume the file name is like run00001.mid. But this is not always true. 
MIDAS users can have different name.

(ii) ROME saves one TTree in one file. But there are cases that user want to save several TTrees in a file

(iii) Especially rare event search experiments like MEG, one file may contain signal candidate events 
from several runs.

To solve this issue one idea is to move from run base I/O to filename base I/O.

* Input
Users may specify filename instead of run number with command line option like.
XXXanalyzer.exe -f run00001.mid,run00002.mid

Then ROMEAnalyzer provides information of filename to DAQ class.

How files are handled is depending on DAQ class. Normally each files will be read one by one.
But in case of bartender program, they will be read in parallel to mix.

In case of .mid file, run number is written in run header of files.
ROMEMidas should change current run number at the BeginOfRun.

* Output
For the output filename we can employ same technique as database path.
This way users can use also run number and some other parameters.
And they can store several TTrees in a file.

  <Tree>
      <TreeName>tree</TreeName>
      <TreeOutputFileName>"%s#.root",gAnalyzer->GetGSP()->GetFilePrefix()<TreeOutputFileName>
      <Branch>
        <BranchName>kine</BranchName>
        <RelatedFolder>Kinematics</RelatedFolder>
      </Branch>
  </Tree>
 

This change is quite big, and it affects all ROME users.
We have to discuss enough on it before changing.

(One choice is to remain run number base I/O.)
  14   09 Nov 2004 Ryu SawadaSuggestionBank size check
in ROMEEventLoop::ReadEvent(), if  gROME->isOffline() and gROME->isMidas(),
ROME checks if bank size is greater than 0.

But It can happen that the bank size is 0 in normal file.
(Actually in my midas file bank size of "environment data" is 0 at this moment)

---------------------------------------------
 else if (gROME->isOffline()&&gROME->isMidas()) {
      // read event header
      EVENT_HEADER *pevent = (EVENT_HEADER*)gROME->GetMidasEvent();
      bool readError = false;
               .
               .
               .
         if (pevent->data_size <= 0) readError = true;
         else {
            n = read(fMidasFileHandle, pevent+1, pevent->data_size);
            if (n != (int) pevent->data_size) readError = true;
	    if ((int) ((BANK_HEADER*)(pevent+1))->data_size < 0) readError = true;    <-- I changed here
         }
      }
      // check input
      if (readError) {
         if (n > 0) cout << "Unexpected end of file\n";
         this->SetEndOfRun();
         return true;
  15   10 Nov 2004 Ryu SawadaSuggestionBank size check
> in ROMEEventLoop::ReadEvent(), if  gROME->isOffline() and gROME->isMidas(),
> ROME checks if bank size is greater than 0.
> 
> But It can happen that the bank size is 0 in normal file.
> (Actually in my midas file bank size of "environment data" is 0 at this moment)

Point may be that data format of "environment data" in my midas file is "FIXED".
According to MIDAS document, MIDAS analyzer cannnot work with this format too.
I guess it can happen that bank size seems negative when ROME reads FIXED data.
  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.
  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
  206   06 May 2016 SUDESHNA GANGULYInfoCan we reset histograms at the middle of a run in ROME?
Hi All,

Suppose I want to pause a run, at the middle, and change some run conditions. So
I want to clear histograms at the middle of a run. Is that possible to do in ROME?

That when I pause the run, I want to clear histograms. So with the new run
conditions, when we resume that run, we will get clear pads and histograms will
be filled in new.


Thanks a lot!
Sudeshna
  207   11 May 2016 Ryu SawadaInfoCan we reset histograms at the middle of a run in ROME?
Dear Sudeshna,

I added a new button to clear histograms.


Please update your ROME and use the 'develop' branch.

Best regards,

Ryu

> Hi All,
>
> Suppose I want to pause a run, at the middle, and change some run conditions. So
> I want to clear histograms at the middle of a run. Is that possible to do in ROME?
>
> That when I pause the run, I want to clear histograms. So with the new run
> conditions, when we resume that run, we will get clear pads and histograms will
> be filled in new.
>
>
> Thanks a lot!
> Sudeshna
  213   23 Jul 2019 Yusuke UchiyamaForumChange of MIDAS library path
Dear all,

From the recent release of MIDAS, "midas-2019-06", the MIDAS library path is changed:
it was $MIDASSYS/linux/lib, but now $MIDASSYS/lib.
See https://midas.triumf.ca/elog/Midas/1564 for the detail.

Due to this change, ROME analyzers cannot be built with -midas option.

The solution seems easy: change the path in 
$ROMESYS/buildersrc/ROMEBuilderMakeFile.cpp AddDAQLibraries().
However, directly changing the code will loose backward compatibility.
Do you have any suggestions?

Regards,
Yusuke
  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.
  123   09 Jun 2006 Matthias SchneebeliInfoChangeableClassFile in Definition XML removed
We removed the <ChangeableClassFile> under <Task> in the project definition XML file. ROME will always make a user editable class file.

This change does not affect your project.

You may get errors when validating the xml file. This can simply be fixed by removing all <ChangeableClassFile> tags under <Task> in your project definition file.
  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
  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.
  203   18 Apr 2016 SUDESHNA GANGULYInfoClear histogram/group of histograms at the beginning of run in ROME
Hi All,

Is there any way in ROME that I can clear histograms at:

    1)Run start.
    2) Clear by group (tab) ?


Thanks a lot!
Sudeshna
  204   21 Apr 2016 Ryu SawadaInfoClear histogram/group of histograms at the beginning of run in ROME
Dear Sudeshna,

In ROME, histograms are associated with a task (not with a tab).

Histograms are reset at the beginning of runs when "HistAccumulate" is false.
You can set it in your configuration XML like,
          <Histogram>
            <HistName>MyHisto</HistName>
            <HistAccumulate>false</HistAccumulate>
          </Histogram>

If you want to clear by hand, you can use ResetHisto() function of your tasks; the function is automatically implemented by ROMEbuilder.

Ryu

> Hi All,
>
> Is there any way in ROME that I can clear histograms at:
>
> 1)Run start.
> 2) Clear by group (tab) ?
>
>
> Thanks a lot!
> Sudeshna
  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
ELOG V3.1.4-2e1708b5