Back Midas Rome Roody Rootana
  Rome Analyzer Framework, Page 4 of 11  Not logged in ELOG logo
ID Date Author Topic Subjectup
  202   15 Apr 2016 Ryu SawadaInfoError with maximum number of tabs in Argus section
Dear Sudeshna

I commit the change to the 'develop' branch.

Ryu

> I've fixed the problem of not being able to define 18 tabs. I edited
> /argus/include/ArgusHistoDisplay.h file:
> I changed the parameter values to:
> 
> class ArgusHistoDisplay : public ArgusTab
> {
> protected:
>    enum {
>       kMaxNumberOfPads = 360,
>       kMaxNumberOfPadsX = 10,
>       kMaxNumberOfPadsY = 20,
>       kNumberOfDisplayViewSelections0 = 54,
>       kNumberOfDisplayViewSelections1 = 10,
>       kNumberOfDisplayViewSelections2 = 10,
>       kMaxNumberOfLines = 81
>    };
> 
> Now I can define 18 tabs with 3 pads in each.
> 
> 
> 
> 
> > Hi Ryu,
> > 
> > I am trying to use <Argus> for tabbing like this:
> >   <Argus>
> >           <Tab>
> >             <TabName>Tab1</TabName>
> >             <ObjectArrayIndex>0</ObjectArrayIndex>
> > 
> >             <Index>0</Index>
> >  </Tab>
> >    <Tab>
> >             <TabName>Tab1</TabName>
> >             <ObjectArrayIndex>1</ObjectArrayIndex>
> >             <Index>1</Index>
> >           </Tab>
> >    <Tab>
> >             <TabName>Tab1</TabName>
> >             <ObjectArrayIndex>2</ObjectArrayIndex>
> > 
> >             <Index>2</Index>
> >           </Tab>
> > 
> > 
> > 
> > 
> > And I need to add 18 tabs with each tab having three pads.
> > Now I when ever I cross Tab6 with three pads on it, it gives me this error:
> > 
> > [sganguly@g2be1 rometest]$ /home/sganguly/dqm/rome/bin/romebuilder.exe -i
> > midas.xml -midas
> > Maximal number of Tabs in the Argus section of Histogram 'h1_wf' reached : 20 !
> > 
> > I have noticed that currently I can define 6 tabs and 5 pads on each tab maximum.
> > 
> > Could you please help me with this?
> > 
> > Thanks a lot!
> > Sudeshna
  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.
  89   28 Jun 2005 Ryu SawadaSuggestionFolder reset.
In Reset method of folders. Support folder members are ignored currently.
Reset method of support folder member had better to be called.

In addition, isModified() should check if the member support folders were modified.

For example

class A : public TObject
{
protected:
   TypeB* B;
   TClonesArray* C;
.
.
public:
   A() {
      B = 0;
      C = 0;
   };
.
.
.
   void Reset() {
      int i;
      fModified = false;
      if(B) B->Reset();
      if(C) for(i=0;i<C->GetEntries();i++) { ((TypeC*)C->At(i))->Reset(); }
   };

   ClassDef(A,1)
};
  72   14 Apr 2005 Ryu SawadaSuggestionGetDataBase, GetActiveDAQ
  There is no check if the pointer returned by GetDataBase,GetActiveDAQ is valid. This can result 
segmentation fault.
  For instance, if one specifies DAQ system as "none", or one does not specify DataBaseName, rome 
stops without error message.

It is better to modify this behavior.


* One way is to stop application like.
ROMEDAQSystem* GetActiveDAQ() {
   if(!fActiveDAQ){
      gAnalyzer->Println("some error message");
      fApplication->Terminate(1);
   }
   return fActiveDAQ;
};

*Other way is to use a dummy DAQSystem and DataBase which does nothing when user does not 
specify DAQ or DataBase.  When dummy is used, warning message must be shown, because it is 
dangerous that users do not realize they are using dummy.
  73   15 Apr 2005 Matthias SchneebeliSuggestionGetDataBase, GetActiveDAQ
>   There is no check if the pointer returned by GetDataBase,GetActiveDAQ is valid. This can result 
> segmentation fault.
>   For instance, if one specifies DAQ system as "none", or one does not specify DataBaseName, rome 
> stops without error message.
> 
> It is better to modify this behavior.
> 
> 
> * One way is to stop application like.
> ROMEDAQSystem* GetActiveDAQ() {
>    if(!fActiveDAQ){
>       gAnalyzer->Println("some error message");
>       fApplication->Terminate(1);
>    }
>    return fActiveDAQ;
> };
> 
> *Other way is to use a dummy DAQSystem and DataBase which does nothing when user does not 
> specify DAQ or DataBase.  When dummy is used, warning message must be shown, because it is 
> dangerous that users do not realize they are using dummy.


done
  197   11 Apr 2016 SUDESHNA GANGULYInfoGetting an error while compiling a code with <ARGUS> tabs for 2-D histograms
Hi Ryu,

I am trying to display a 2-D histogram with the <Argus> tab in the user xml file.
Here is what I have in the xml:


 <Histogram>
      <HistName>h2_Exy</HistName>
      <HistFolderName>CT</HistFolderName>
      <HistArraySize>2</HistArraySize>
      <HistType>TH2F</HistType>
      <HistXLabel>xseg</HistXLabel>
      <HistYLabel>yseg</HistYLabel>
      <HistXNbins>9</HistXNbins>
      <HistXmin>0.5</HistXmin>
      <HistXmax>9.5</HistXmax>
      <HistYNbins>6</HistYNbins>
      <HistYmin>0.5</HistYmin>
      <HistYmax>6.5</HistYmax>

<Argus>                                                                        
                                            
<Tab>                                                                          
                                               <TabName>Summary</TabName>      
                                                                               
               <ObjectArrayIndex>0</ObjectArrayIndex>                          
                                                                <Index>0</Index>
                                                                               
                           </Tab>                                              
                                                                        
</Argus>                                                                       
                                                
</Histogram>

But when I compile the code it throws the following error message:

src/generated/HGUITSummary_Base.cpp:87: error: cannot convert ‘TH1F*’ to ‘TH2F*’
in assignment

I am getting this error when ever I am trying to display 2-D histograms with
<Argus> tabs.

Any help will be much appreciated.

Sudeshna
  17   12 Nov 2004 Ryu SawadaBug ReportGlobalSteering
When I define several "SteeringParameterGroup"s, builder maked nesting classes instead to make each 
classes.
  19   18 Nov 2004 Matthias SchneebeliBug ReportGlobalSteering
> When I define several "SteeringParameterGroup"s, builder maked nesting classes instead to make each 
> classes.

done
  20   19 Nov 2004 Ryu SawadaBug ReportGlobalSteering
> > When I define several "SteeringParameterGroup"s, builder maked nesting classes instead to make each 
> > classes.
> 
> done
It is still not fixed. In case of following configuration.
"InvalidValue" was in "Switch" class.
Is it invalid to put a SteeringParameterField after SteeringParameterGroup ?

<GlobalSteeringParameters>
  <SteeringParameterGroup>
    <SPGroupName>Switch</SPGroupName>
    <SteeringParameterField>
      <SPFieldName>Piedi</SPFieldName>
      <SPFieldType>Bool_t</SPFieldType>
      <SPFieldInitialization>0</SPFieldInitialization>
      <SPFieldComment>Switch for pedestal calculation</SPFieldComment>
    </SteeringParameterField>
  </SteeringParameterGroup>
  <SteeringParameterField>
    <SPFieldName>InvalidValue</SPFieldName>
    <SPFieldType>Float_t</SPFieldType>
    <SPFieldInitialization>-1000</SPFieldInitialization>
    <SPFieldComment>Invalid value</SPFieldComment>
  </SteeringParameterField>
</GlobalSteeringParameters>
  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>
  135   18 Apr 2007 Ryu SawadaInfoI/O system change
I changed default type of dictionaries. By this change we use new I/O system introduced at ROOT version 3.

A newly generated program can not read old files created by old programs by default. Error messages like following will be shown.
Error in <TBuffer::CheckByteCount>: object of class PMTData read too few bytes: 21 instead of 169

There is one flag to avoid this problem. When <DictionaryType> in <Experiment> is 0, romebuilder will
generate a program with old dictionary type.
<Experiment>
   <ExperimentName>MEG Analysis and monitor.</ExperimentName>
   <ExperimentShortCut>MEG</ExperimentShortCut>
   <ProgramName>Analyzer</ProgramName>
   <ProgramDefinitionVersion>3</ProgramDefinitionVersion>
   <FrameworkDescription>MEGAnalyzer is an analysis framework for MEG. It works as monitor as well.</FrameworkDescription>
   <DictionaryType>0</DictionaryType>   <!-- Add this line -->
</Experiment>

During development stage of version 2.9, we will check if there are problems in the new I/O system.
If we don't find any problems, The new I/O system will be the default of ROME version 2.9.
Even if we change the default, users can continue using the old I/O by using the flag.
  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 );
  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
  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.


 
  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
  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
  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)
  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.
ELOG V3.1.4-2e1708b5