Quick Start

previous.gif Components - Top - Internal features next.gif

This section is under revision to better reflect the latest installation and basic operation of the Midas package.

... This section will... describes step-by-step the installation procedure of the Midas package on several platform as well as the procedure to run a demo sample experiment. In a second stage, the frontend or the analyzer can be moved to another computer to test the remote connection capability.

The Midas Package source and binaries can be found at : PSI or at TRIUMF . An online SVN web site is also available for the latest developments.

Even though Midas is available for multiple platforms, the following description are for Linux installation and Windows installation.


Linux installation

  1. Extraction:
  2. Installation: The installation consists in placing the image files in the /usr/local/ directories. This operation requires superuser privilege. The open "install" from the Makefile will automatically do this installation for you.
    cd /home/mydir/midas
    su - 
    make install
    


  3. Configuration: Several system files needs to be modified for the full Midas implementation.
  4. Experiment definition: Midas system supports multiple experiment running contemporary on the same computer. Even though it may not be efficient, this capability makes sense when the experiments are simple detector lab setups which shared hardware resources for data collection. In order to support this feature, Midas requires a uniquely identified set of parameter for each experiment that is used to define the location of the Online Database.

    Every experiment under Midas has its own ODB. In order to differentiate them, an experiment name and directory are assigned to each experiment. This allows several experiments to run concurrently on the same host using a common Midas installation.

    Whenever a program participating in an experiment is started, the experiment name can be specified as a command line argument or as an environment variable.

    A list of all possible running experiments on a given machine is kept in the file exptab. This file exptab is expected by default to be located under /etc/exptab. This can be overwritten by the Environment variables MIDAS_EXPTAB.

    exptab file is composed of one line per experiment definition. Each line contains three parameters, i.e: experiment name, experiment directory name and user name. Example:
      #
      # Midas experiment list
      midas   /home/midas/online     midas
      decay   /home/slave/decay_daq  slave
    

    Experiments not defined into exptab are not accessible remotely, but can still be accessed locally using the Environment variables MIDAS_DIR if defined. This environment superceed the exptab definition.

  5. Compilation & Build: You should be able to rebuild the full package once the Midas tree structure has been placed in your temporary directory. The compilation and link will try to generate the rmidas application which requires ROOT. The application mana will also be compiled for HBOOK and ROOT. Look in the make listing below for the HAVE_HBOOK, HAVE_ROOT.

      > cd /home/mydir/midas
      > make
      cc -c -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/lib/midas.o src/midas.c
      cc -c -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/lib/system.o src/system.c
      cc -c -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/lib/mrpc.o src/mrpc.c
      cc -c -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/lib/odb.o src/odb.c
      cc -c -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/lib/ybos.o src/ybos.c
      cc -c -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/lib/ftplib.o src/ftplib.c
      rm -f linux/lib/libmidas.a
      ar -crv linux/lib/libmidas.a linux/lib/midas.o linux/lib/system.o linux/lib/mrpc.o 
      linux/lib/odb.o linux/lib/ybos.o linux/lib/ftplib.o
      a - linux/lib/midas.o
      a - linux/lib/system.o
      a - linux/lib/mrpc.o
      a - linux/lib/odb.o
      a - linux/lib/ybos.o
      a - linux/lib/ftplib.o
      rm -f linux/lib/libmidas.so
      ld -shared -o linux/lib/libmidas.so linux/lib/midas.o linux/lib/system.o
      linux/lib/mrpc.o linux/lib/odb.o linux/lib/ybos.o linux/lib/ftplib.o -lutil 
      -lpthread -lc
      cc -c -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC    
      -o linux/lib/mana.o src/mana.c
      cc -Dextname -DHAVE_HBOOK -c -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib 
      -DINCLUDE_FTPLIB -DOS_LINUX -fPIC    -o linux/lib/hmana.o src/mana.c
      ...
      g++ -DHAVE_ROOT -c -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB 
      -DOS_LINUX -fPIC   -D_REENTRANT -I/home1/midas/ root/include -o linux/lib/rmana.o 
      src/mana.c
      g++ -c -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINU 
      -fPIC   -o linux/lib/mfe.o src/mfe.c
      cc -Dextname -c -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib 
      -DINCLUDE_FTPLIB -DOS_LINUX -fPIC    -o linux/lib/fal.o src/fal.c
      ...
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/mserver src/mserver.c -lmidas -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/mhttpd src/mhttpd.c src/mgd.c -lmidas -lutil -lpthread -lm
      g++ -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -DHAVE_ROOT -D_REENTRANT -I/home1/midas/root/include 
      -o linux/bin/mlogger src/mlogger.c -lmidas 
      -L/home1/midas/root/lib -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree
      -lRint -lPostscript -lMatrix -lPhysics -lpthread -lm -ldl -rdynamic -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/odbedit src/odbedit.c src/cmdedit.c -lmidas -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/mtape utils/mtape.c -lmidas -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/mhist utils/mhist.c -lmidas -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/mstat utils/mstat.c -lmidas -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/mcnaf utils/mcnaf.c drivers/bus/camacrpc.c -lmidas -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/mdump utils/mdump.c -lmidas -lz -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/lazylogger src/lazylogger.c -lmidas -lz -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/mchart utils/mchart.c -lmidas -lutil -lpthread
      cp -f utils/stripchart.tcl linux/bin/.
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/webpaw utils/webpaw.c -lmidas -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/odbhist utils/odbhist.c -lmidas -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/melog utils/melog.c -lmidas -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/mlxspeaker utils/mlxspeaker.c -lmidas -lutil -lpthread
      cc -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC   
      -o linux/bin/dio utils/dio.c -lmidas -lutil-lpthread
      g++ -g -O2 -Wall -Iinclude -Idrivers -Llinux/lib -DINCLUDE_FTPLIB -DOS_LINUX -fPIC  
      -DHAVE_ROOT -D_REENTRANT -I/home1/midas/root/include -o linux/bin/rmidas src/rmidas.c 
      -lmidas -L/home1/midas/root/lib -lCore -lCint -lHist -lGraf -lGraf3d -lGpad 
      -lTree -lRint -lPostscript -lMatrix -lPhysics -lGui -lpthread -lm -ldl -rdynamic
      -lutil -lpthread
    


  6. Demo examples: The midas file structure contains examples of code which can be (should be) used for template. In the midas/examples/experiment you will find a full set for frontend and analysis code. The building of this example is performed with the Makefile of this directory. The reference to the Midas package is done relative to your current location (../../include). In the case the content of this directory is copied to a different location (template), you will need to modify the local parameters within the Makefile
      #-------------------------------------------------------------------
      # The following lines define direcories. Adjust if necessary
      #                 
      DRV_DIR   = ../../drivers/bus
      INC_DIR   = ../../include
      LIB_DIR   = ../../linux/lib
    
    Replace by:
      #-------------------------------------------------------------------
      # The following lines define direcories. Adjust if necessary
      #                 
      DRV_DIR   = /home/mydir/midas/drivers/bus
      INC_DIR   = /usr/local/include
      LIB_DIR   = /usr/local//lib
    


      > cd /home/mydir/midas/examples/experiment
      > make 
      gcc -g -O2 -Wall -g -I../../include -I../../drivers/bus -DOS_LINUX -Dextname -c
      -o camacnul.o ../../drivers/bus/camacnul.c
      g++ -g -O2 -Wall -g -I../../include -I../../drivers/bus -DOS_LINUX -Dextname -o
      frontend frontend.c
      camacnul.o ../../linux/lib/mfe.o ../../linux/lib/libmidas.a  -lm -lz -lutil
      -lnsl -lpthread
      g++  -D_REENTRANT -I/home1/midas/root/include -DHAVE_ROOT -g -O2 -Wall -g 
      -I../../include -I../../drivers/bus -DOS_LINUX -Dextname -o analyzer.o 
      -c analyzer.c
      g++  -D_REENTRANT -I/home1/midas/root/include -DHAVE_ROOT -g -O2 -Wall -g 
      -I../../include -I../../drivers/bus -DOS_LINUX -Dextname -o adccalib.o -c adccalib.c
      g++  -D_REENTRANT -I/home1/midas/root/include -DHAVE_ROOT -g -O2 -Wall -g 
      -I../../include -I../../drivers/bus -DOS_LINUX -Dextname -o adcsum.o -c adcsum.c
      g++  -D_REENTRANT -I/home1/midas/root/include -DHAVE_ROOT -g -O2 -Wall -g 
      -I../../include -I../../drivers/bus -DOS_LINUX -Dextname -o scaler.o -c scaler.c
      g++  -o analyzer ../../linux/lib/rmana.o analyzer.o adccalib.o adcsum.o scaler.o 
      ../../linux/lib/libmidas.a  -L/home1/midas/root/lib -lCore -lCint -lHist -lGraf 
      -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lpthread -lm -ldl 
      -rdynamic -lThread -lm -lz -lutil -lnsl -lpthread
    >  
    
    For testing the system, you can start the frontend as follow:
    > frontend
      Event buffer size      :     100000
      Buffer allocation      : 2 x 100000
      System max event size  :     524288
      User max event size    :     10000
      User max frag. size    :     5242880
      # of events per buffer :     10
      
      Connect to experiment ...Available experiments on local computer:
      0 : midas         
      1 : root
      Select number:0                    <---- predefined experiment from exptab file
    
      Sample Frontend connected to <local>. Press "!" to exit                 17:27:47
      ================================================================================
      Run status:   Stopped    Run number 0
      ================================================================================
      Equipment     Status     Events     Events/sec Rate[kB/s] ODB->FE    FE->ODB
      --------------------------------------------------------------------------------
      Trigger       OK         0          0.0        0.0        0          0
      Scaler        OK         0          0.0        0.0        0          0
    
    In a different terminal window
      >odbedit
      Available experiments on local computer:
      0 : midas
      1 : root
      Select number: 0
      [local:midas:S]/>start now
      Starting run #1
      17:28:58 [ODBEdit] Run #1 started
      [local:midas:R]/>
    
    The run has been started as seen in the frontend terminal window. See the /examples/experiment/frontend.c for data generation code.
      Sample Frontend connected to <local>. Press "!" to exit                 17:29:07
      ================================================================================
      Run status:   Running    Run number 1
      ================================================================================
      Equipment     Status     Events     Events/sec Rate[kB/s] ODB->FE    FE->ODB
      --------------------------------------------------------------------------------
      Trigger       OK         865        99.3       5.4        0          9
      Scaler        OK         1          0.0        0.0        0          1
    


Windows installation

  1. Extraction:
  2. Installation:
  3. Configuration:
  4. Experiment definition:
  5. Compilation:
  6. Demo examples:

previous.gif Components - Top - Internal features next.gif


Midas DOC Version 1.9.5 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel - Doxygen - Peter Green - Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Rudi Meier - Glenn Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou - Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk