Setup MIDAS experiment: Difference between revisions

From DaqWiki
Jump to navigation Jump to search
m (51 revisions imported)
 
(34 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== Prepare the user account ===
#REDIRECT https://midas.triumf.ca/MidasWiki/index.php/Setup_MIDAS_experiment
 
* Setup the user account for running this instance of midas. For machines part of the LADD cluster, follow these <a href="http://daq-plone.triumf.ca/SM/docs/local/NewLaddUser">instructions</a></li>
* check that the account is using the /bin/tcsh shell
* make $HOME/.cshrc look like this:
<pre>
#!/bin/echo You must source
 
setenv LANG C
setenv SVN_EDITOR "emacs -nw"
setenv CVS_RSH ssh
setenv MIDASSYS $HOME/packages/midas
setenv ROOTSYS  $HOME/packages/root
setenv MIDAS_EXPTAB $HOME/online/exptab
 
# setup the MIDAS mserver
 
switch (`hostname`)
case ladd05*:
    unsetenv MIDAS_SERVER_HOST
    breaksw
default:
    setenv MIDAS_SERVER_HOST ladd05.triumf.ca:7071
endsw
 
# select 64-bit or 32-bit MIDAS and ROOT
 
switch (`uname -i`)
case i386:
    #export ROOTSYS=/triumfcs/trshare/olchansk/root/root_v5.20.00_SL45_32
    setenv ROOTSYS /triumfcs/trshare/olchansk/root/root_v5.28.00_SL55_32
    setenv PATH .:$MIDASSYS/linux-m32/bin:$PATH
    breaksw
default:
    #export ROOTSYS=/triumfcs/trshare/olchansk/root/root_v5.26.00b_SL54_64
    #setenv ROOTSYS /triumfcs/trshare/olchansk/root/root_v5.28.00_SL55_64
    setenv ROOTSYS $HOME/packages/root
    setenv PATH .:$MIDASSYS/linux/bin:$PATH
endsw
 
setenv PATH .:$HOME/online/bin:$HOME/packages/roody/bin:$ROOTSYS/bin:$PATH
 
#end
</pre>
* mkdir $HOME/packages
* Logout and login again, for .cshrc changes to take effect
 
=== Install ROOT ===
 
* Identify the Linux version: RH9 (Red Hat Linux 9), FC3 (Fedora Core 3), RHEL4/SL4 (Red Hat Enterprise LInux 4/Scientific Linux 4), SL5, SL6: more /etc/redhat-release
* Decide to use 32-bit or 64-bit ROOT
* cd $HOME/packages
* ls -l /triumfcs/trshare/olchansk/root/ ### to see all available ROOT packages
* ln -s /triumfcs/trshare/olchansk/root/root_vNNN_VVV_BB root, where NNN is the latest available version of ROOT ("ls -l /triumfcs/trshare/olchansk/root"), VVV is the Linux version code (RH9, FC3, SL4, etc) and BB is "_32" or "_64" for 32-bit or 64-bit ROOT. For example: /triumfcs/trshare/olchansk/root/root_v5.10.00_SL40
* Check that ROOT works: "echo $ROOTSYS", "$ROOTSYS/bin/root"
 
=== Install MIDAS ===
 
* cd $HOME/packages
* svn co svn+ssh://svn@savannah.psi.ch/repos/meg/midas/trunk midas, password "svn". (password has to be entered twice)
* svn co svn+ssh://svn@savannah.psi.ch/repos/meg/mxml/trunk mxml
* cd midas
* make
* (only if needed) make linux32 ### build the 32-bit MIDAS libraries
* ls -l linux/bin/odbedit ### check that odbedit has been created (do not run it yet)
 
=== Install ROOTANA ===
 
* cd $HOME/packages
* svn checkout https://ladd00.triumf.ca/svn/rootana/trunk rootana (say "p" to accept the ladd00 ssl certificate, use username "svn", password "svn")
* cd rootana
* make
 
=== Install ROODY ===
 
* cd $HOME/packages
* svn checkout https://ladd00.triumf.ca/svn/roody/trunk roody
* cd roody
* make
* $HOME/packages/roody/bin/roody, run the program
 
=== Prepare VME hardware ===
 
Hardware check list:
* VME crate
* VME processor (supported are V77xx, V7805, V7865)
* On all VME modules, set the VME address jumpers as described here: http://daq-plone.triumf.ca/SM/docs/local/vme_jumpers
* run vmescan to confirm correct VME addresses
** cd $HOME/packages
** svn checkout https://ladd00.triumf.ca/svn/daqsvn/trunk/vme
** cd vme
** make
** ./vmescan.exe (or _gef.exe, depending on the VME driver in use)
 
=== Setup the experiment environement ===
 
* decide which computer will host MIDAS (where MIDAS shared memory buffers will reside). This computer will run the mserver, mlogger and mhttpd.
* in .cshrc put the name of this computer into the section for setting MIDAS_SERVER_HOST. Note that multiple experiments can run on the same computer by using different mserver ports (7071, mhttpd ports (8081) and roody ports (9091)
* mkdir $HOME/online
* cd $HOME/online
* mkdir bin src elog history
* mkdir -p /ladd/data1/t2kvme5/data; ln -s /ladd/data1/t2kvme5/data $HOME/online
* 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 (kopio03) is your username.
<pre>exptname /home/kopio03/online kopio03</pre>
* logout and login again for all changes to take effect
 
=== Setup experiment startup scripts ===
 
* login to the experiment host computer
* echo $MIDAS_SERVER_HOST ### to check correct value - should be blank
* create $HOME/online/bin/start_daq.sh, replacing XXX with the hostname of the machine running the experiment (and changing the mserver and mhttpd ports, as needed), replacing machine names in the access control list for mhttpd and mserver as needed. (NOTE: mhttpd ladd00 permission is for password-protecting the experiment via the password protected SSL proxy at https://ladd00.triumf.ca/expt/dragon/, see ladd00:/etc/httpd/conf.d/ssl.conf)
<pre>
#!/bin/sh
 
cd $HOME/online
 
case `hostname` in
XXX*)
    echo "Good, we are on XXX!"
    ;;
*)
    echo "The start_daq script should be executed on XXX"
    exit 1
    ;;
esac
 
odbedit -c clean
 
mhttpd  -p 8081 -D -a ladd00.triumf.ca -a localhost -a XXX.triumf.ca
mserver -p 7071 -D -a localhost -a lxdragon01.triumf.ca -a lxdragon02.triumf.ca -a XXX.triumf.ca
mlogger -D
 
#end file
</pre>
 
=== Create experiment ODB ===
 
        <li>run $HOME/online/bin/start_daq.sh</li><li>open the midas status page at http://localhost:8081 (you will see most stuff "red" as nothing is running yet)
        </li><li>cd $HOME/online/src, copy Makefile, fevme.cxx
        </li>
        <li>make (creates fevme.exe executable)
        </li><li>run ./fevme.exe (on the computer with the VME interface, could be different from computer hosting the experiment)<br /></li>
        <li>odbedit, run these commands: (replace user names and directory names)
<pre>set "/Logger/Message file" "/home/kopio03/online/midas.log"
set "/Logger/Data Dir"    "/home/kopio03/online/data"
create STRING "/Logger/History dir"
set "/Logger/History dir"  "/home/kopio03/online/history"
create STRING "/Logger/Elog dir"
set "/Logger/Elog dir"    "/home/kopio03/online/elog"
exit</pre>
</li>
        <li> run $HOME/online/bin/start_daq.sh</li>
        <li>odbedit, run these commands: (replace user names and directory names)
<pre>set "/Logger/ODB dump file" "/home/kopio03/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</pre>
</li><li>open web browser firefox http://localhost:8081
        </li>
        <li>save the url bookmark to the "personal toolbar"
        </li>
        <li>start run, end run
        </li><li>...<br /></li>
       
        <li>go back to the midas web page, everything should be green
        </li>
        <li>start a run
        </li>
        <li>send signals to the ADC gate
        </li>
        <li>you should be getting events
        </li>
        <li>to look at data, proceed with setting up the <a href="../../../SR/rootana">ROOT analyzer</a>
        </li></ul>
 
<h2>Install VMIC VME driver (universe-II pci/vme bridge)<br /></h2>
<ul>
        <li>login as root (ssh root@localhost)</li>
        <li>get latest version of vmic driver from ladd00: scp username@ladd00:/home/olchansk/daq/vmisft-7433-NNN-KOMMM.tar.gz .</li>
        <li>tar xzvf vmisft-7433-3.5-KO2.tar.gz</li>
        <li>chown -R root.root vmisft-7433-3.5-KO2</li>
        <li>cd vmisft-7433-3.5-KO2</li>
        <li>cd vme_universe</li>
        <li>make</li>
        <li>make install</li>
        <li>cd ..</li>
        <li>make</li>
        <li>edit /etc/rc.local, add these lines:
<pre>modprobe vme_universe
mkdir -p /dev/bus/vme
mknod /dev/bus/vme/ctl c 221 8
chmod a+wr /dev/bus/vme/ctl</pre>
</li>
        <li>run "modprobe vme_universe", run "lsmod" to check that the vme_universe module was loaded</li>
        <li>run "ls -l /dev/bus/vme/ctl" to check that the VME device file exists, it should be "crw-rw-rw-  1 root root 221, 8 Feb 17 15:47 /dev/bus/vme/ctl"</li></ul>
<p>&nbsp;</p>
<h2>Install GEF VME driver (tsi148 pci/vme bridge)<br /></h2>
<ul><li>login as root (ssh root@localhost)</li><li>yum install kernel-devel<br /></li><li>get latest version of the driver from ladd00: scp username@ladd00:/home/olchansk/daq/v7865/v7865-sdk-linux-R01.00-KONNN.tar.gz<br /></li><li>tar xzvf v7865-sdk-linux-R01.00-KO6.tar.gz<br /></li><li>chown -R root.root v7865-sdk-linux-R01.00-KO6<br /></li><li>cd v7865-sdk-linux-R01.00-KO6/gefvme/module</li><li>make</li><li>make install</li><li>cd $HOME</li><li>edit /etc/rc.local, verify that it has these 2 lines:<br />
<pre>modprobe gefvme
sh /root/gefvme-makedevs</pre>
</li><li>run "modprobe gefvme", run "lsmod" to check that the gefvme module was loaded</li><li>run
"/home/olchansk/daq/vme/vmescan_gef.exe" to check that vme access works.</li><br /></ul>

Latest revision as of 10:19, 2 February 2022