Components - Top - Internal features
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 some 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.
- All the following description expect the midas to be found under the directory $HOME/packages/midas the experiment specific directory is $HOME/online . The user name is johnfoo. Environment variables needs to be setup:
#!/bin/echo You must source
setenv CVS_RSH ssh
setenv MIDASSYS $HOME/packages/midas
setenv ROOTSYS $HOME/packages/root
setenv MIDAS_EXPTAB $HOME/online/exptab
setenv PATH .:$MIDASSYS/linux/bin:$HOME/packages/roody/bin:$ROOTSYS/bin:$PATH
#end
- mkdir $HOME/packages
- Logout and login again, or source .cshrc for the change to take effect.
ROOT Installation
- For full Midas operation ROOT is needed for the data logging and analysis packages.
- Identify the Linux version: RH9 (Red Hat Linux 9), FC3 (Fedora Core 3), RHEL4/SL4 (Red Hat Enterprise LInux 4/Scientific Linux 4): more /etc/redhat-release
- cd $HOME/packages
- ln -s /triumfcs/trshare/olchansk/root/root_vNNN_VVV root, where NNN is the latest available version of ROOT ("ls -l /triumfcs/trshare/olchansk/root") and VVV is the Linux version code (RH9, FC3, SL4, etc). For example: /triumfcs/trshare/olchansk/root/root_v5.10.00_SL40
- Check that ROOT works: "echo $ROOTSYS", "$ROOTSYS/bin/root"
Midas Installation
- The source code can be extracted from the SVN repository. An anonymous access is available under the username svn and password svn which may be required several time. The SVN web interface provides a quick tarball. This suggested extraction method is the following.
- Midas package requires mxml auxiliary package which can be found at the same SVN site as Midas. mxml and midas are extracted at the same directory level.
cd $HOME/packages
svn co svn+ssh:
svn co svn+ssh:
cd midas
make
ls $MIDASSYS/linux/bin ... should contains odbedit and all the midas applications.
ROME installation
- The PSI ROME analysis package can be found at ROME analyzer The same extraction procedure as Midas can be followed. For its operation please refer to the ROME web site.
cd $HOME/packages
svn co svn+ssh:
cd rome
make
ROODY installation
- ROODY is a Histogram display tool ROODY this package is supported by the Triumf DAQ group. Its installation is similar to the midas package.
cd $HOME/packages
svn checkout svn:
cd roody
make
$HOME/packages/roody/bin/roody, run the program
Midas Experiment Setup from scratch
- Assuming that accessibility to hardware such as VME or CAMAC is available and the following packages ROOT, Midas, ROODY have been installed.
- create a new user for this daq system (johnfoo), follow these instructions.
- login as the new user
- mkdir online
- cd online
- mkdir elog history data
- create the exptab file "$HOME/online/exptab" following the example below. The first entry (exptname) is the name if the DAQ system (MIDAS experiment name) , the second entry (/home/USER/online) is the location of MIDAS shared memory buffers (by convention, $HOME/online), the third entry (johnfoo) is your username.
sipmtest1 /home/johnfoo/online johnfoo
- copy start_daq.sh, kill_client.perl and kill_daq.sh from the $MIDASSYS to the online dir.
- copy $MIDASSYS/examples/experiment/* to the online dir.
- make (creates frontend executable)
- odbedit, run these commands, these commands will redirect specific data files to the given directories and define the format of the data files.
odbedit>
set "/Logger/Message file" "/home/johnfoo/online/midas.log"
set "/Logger/Data Dir" "/home/johnfoo/online/data"
create STRING "/Logger/History dir"
set "/Logger/History dir" "/home/johnfoo/online/history"
create STRING "/Logger/Elog dir"
set "/Logger/Elog dir" "/home/johnfoo/online/elog"
set "/Logger/ODB dump file" "/home/johnfoo/online/history/run%05d.xml"
set "/Logger/ODB dump" "y"
set "/Logger/Channels/0/Settings/Filename" "run%05d.mid.gz"
set "/Logger/Channels/0/Settings/Compression" 1
set "/Logger/Channels/0/Settings/ODB Dump" "y"
exit exit
- ./start_daq.sh
- open a web browser http://localhost:8081
- save the url bookmark to the "personal toolbar"
- start run, end run
- back from the shell, restart the DAQ to make sure all changes "take", run:
- ./kill_daq.sh
- ./start_daq.sh
- go back to the midas web page, everything should be green
- start a run
- send signals to the ADC gate
- you should be getting events
- to look at data, proceed with setting up the ROOT analyzer
Installation considerations
- While the above description install Midas under user privilege for standard operation, Midas can be installed in a more general way under root privilege. This method permit to gain remote access to the package through the xinetd daemon mechanism. In order to do so extra steps need to be done. Several system files needs to be modified for the full Midas implementation.
- /etc/services : For remote access. Inclusion of the midas service. Add following line:
# midas service
midas 1175/tcp # Midas server
- /etc/xinetd.d/midas : Daemon definition. Create new file named midas
service midas
{
flags = REUSE NOLIBWRAP
socket_type = stream
wait = no
user = root
server = /usr/local/bin/mserver
log_on_success += USERID HOST PID
log_on_failure += USERID HOST
disable = no
}
- /etc/ld.so.conf : Dynamic Linked library list. Add directory pointing to location of the midas.so file (add /usr/local/lib). The system is now build by default in static which prevent to have to setup the .so path through either the environment LD_LIBRARY_PATH or the ld.so.conf.
- /etc/exptab : Midas Experiment definition file (see below).
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
test /home/johnfoo/online johnfoo
decay /home/jackfoo/decay_daq jackfoo
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.
Demo examples: The midas file structure contains examples of code which can be (should be) used as 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 following lines define direcories. Adjust if necessary
#
DRV_DIR = $(MIDASSYS)/drivers/bus
INC_DIR = $(MIDASSYS)/include
LIB_DIR = $(MIDASSYS)/linux/lib
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 : test
1 : decay
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 : test
1 : decay
Select number: 0
[local:test:S]/>start now
Starting run #1
17:28:58 [ODBEdit] Run #1 started
[local:test:R]/>
The run has been started as seen in the frontend terminal window. See the 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
- Installation:
- All the following description expect the midas to be found under the directory %SystemDrive% the experiment specific directory is %SystemDrive% . The user name is johnfoo.
- The package extraction under Windows is similar to the Linux. The SVN site is used to gather the midas and mxml. The method can be the tarball or the svn using the Tortoise package.
- Using the tarball mechanism:
- Go to http:
- Click "Download tarball"
- Extract trunk to %SystemDrive%
- Rename trunk to midas
- delete trunk.tar.gz
- Go to http:
- Click "Download tarball"
- Extract trunk to %SystemDrive%
- Rename trunk to mxml
- Environment variables needs to be setup prior the midas build; from the "system properties" -> advanced -> Environment Variables, define new system variables MIDASSYS to c: (installation location).
- from the "system properties" -> advanced -> Environment Variables, add to PATH system variables ;%MIDASSYS%
- create file %SystemRoot%
- The Midas build requires the Microsoft Visual C++ (2005) or .NET. the corresponding environment variables for the compiler need to be set prior the Midas build. A batch file can be found under "C:\Program Files Visual Studio 8\Common7\Tools\vsvar32.bat or similar...
cd %MIDASSYS%
nmake -f makefile.nt
- Midas Experiment Setup from scratch
- Assuming that accessibility to hardware is possible and the following package Midasis installed. Open 3 "Command Prompt" windows.
-w1 cd \
-w1 mkdir online
-w1 copy %MIDASSYS%\examples\experiement\frontend.exe .
-w1 frontend.exe
-w2 start mhttpd
-w3 start odbedit
-w3 odbedit> scl
Name Host
Sample Frontend yourhost
ODBEdit yourhost
- Start a web brower and go to http://localhost
- Click Start, confirm run number, click refresh... Stop run.
- Please refer to the rest of the manual for further description of the system operation.
Components - Top - Internal features
Midas DOC Version 2.0.2 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel -
Doxygen - Peter Green -
Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Exaos Lee - Rudi Meier - Glenn
Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou
- Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk