Thursday, July 31, 2014

vGate 3.0 ROOT issues

First there were some issues with not being to type quotes inside vGate. Fixed that by going to Ubuntu's System Settings -- Keyboard -- Layout Settings, adding English US there and removing the English US extended international layout.

But ROOT on vGate 3.0 seems to be broken. Screenshot below. libjpeg.so.62 is not found in this case. Trying TBrowser b; also causes "segmentation violation" with some xpm files not found and so on.


Wednesday, July 30, 2014

ROOT font issue

On a fresh install of ROOT with Ubuntu Software Center on Ubuntu 14.04, this error on starting root

Couldn't find font "-adobe-helvetica-medium-r-*-*-10-*-*-*-*-*-iso8859-1",
trying "fixed". Please fix your system so helvetica can be found,
this font typically is in the rpm (or pkg equivalent) package
XFree86-[75,100]dpi-fonts or fonts-xorg-[75,100]dpi.


ROOT continues to run without problems. This issue is mentioned in this discussion, but xfs is not an available package for Ubuntu 14.04. Ignoring for now.

root -l doesn't bring up this error, nor the splash screen. Perhaps this font is used in the splash screen.

rough draft of output with Octave

Imported the ascii file output by the modified GEANT4 example I'm working with into a google spreadsheet. Manually sorted it by PMTNumber, manually added 0 photon counts for the missing PMTNumbers, exported the resulting photon counts into Octave as:

data = load ("Run-PMTHitOrder-PhotonCount-PMTNumber.csv")
for i = 1:8
  for j = 1:8
  matrixed_data(i,j)=data((i-1)*8+j,3);
  endfor

endfor
  my_bar3(matrixed_data)


plotted it using this octave version of bar3:


Tuesday, July 29, 2014

G4BestUnit

In order to check if the GetPMTPos() is working in the modified GEANT4 example I'm working with but returning 0,0,0 due to some units problem, tried to include G4BestUnit in the cout. As an example, LXeSteppingVerbose.cc has
std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")

For this to work, the include file needed is
#include "G4UnitsTable.hh"

But even with this, GetPMTPos() returns zeros - units set to femto-metres! So, we have to work with GetPMTNumber() instead, since that is working fine. 

Sunday, July 27, 2014

using vGATE 3.0 - a virtual machine with GATE, GEANT4, ROOT

vGATE is a virtualbox virtual machine image of Ubuntu 64 bit running GATE and associated tools. Tried it out. Running it on an Ubuntu 13.10 host, would not boot with the default virtualbox settings. On Windows XP, virtualbox was very flakey. The virtualbox control panel would come up only right after an install if "Run virtualbox" was ticked in the last step of the Install wizard. At other times, it would silently fail to start - the process would be seen in task manager for a few seconds before it vanished. Running the virtualbox image directly after a first run, by double-clicking (on Windows XP)

C:\Documents and Settings\Username\VirtualBox VMs\VGATE3VM\VGATE3VM.vbox

would work sometimes, and not work sometimes. Flakey. Also to be noted, the various issues of running Ubuntu with a non-3D-accelerated VM display - becomes very slow.

So I converted the virtualbox image to a VMWare image using the tool supplied with virtualbox,
C:\Full-path-to\VBoxManage clonehd --format VMDK vGATE_v3.0.vdi vGATE_v3.0.vmdk
The process took around half an hour for the 7 GB file on an external USB hard disk.

Running on VMWare Player was much more stable - at least for me on a WinXP host. Enabled 3D acceleration before starting the VM, of course.

Speeds - using a VM with 1.2 G ram, 1 processor,

SPECT benchmark - each acquisition of 37.5 sec was taking around 2 minutes to run.

Running the LXe example of GEANT4, from command-line the virtual machine was not too much slower than the bare-metal Ubuntu install. But with graphical display, was 3x slower.

VM - ./LXe LXe.in

Run Summary
  Number of events processed : 3
  User=0.92s Real=1.17s Sys=0.09s

Ubuntu 13.10 bare metal - ./LXe LXe.in

Run Summary
  Number of events processed : 3
  User=1.05s Real=1.06s Sys=0s

Using GUI, running .LXe and then running the macro with /control/execute LXe.in inside the LXe application, 
VM on VMWarePlayer, WinXP Host - 

Run Summary
Number of events processed : 3
User=1s Real=6.7s Sys=1.57s

Ubuntu 13.10 bare metal - 

Run Summary
Number of events processed : 3
User=1.44s Real=2.11s Sys=0.07s


Some notes on the modified version of Geant4 LXe example

Some graduate students have worked on modifying the LXe example supplied with the geant4 package, here are my notes on understanding and troubleshooting the modifications.


  • cout needs << endl ; at the end, for flushing the buffer, especially when called inside a loop
  • "Find in Files" from commandline -
      grep "string to search for" /path/to/directory -R -n
  • the G4cout statements in the LXe example have an if statement before them, so the macro statement /LXe/eventVerbose 1 should be called if those are to be executed. 
  • the supplied macros in LXe example also have errors -
    COMMAND NOT FOUND
-  this is due to the modification noted in the Changes file, in 2013, November 22, 2013 P. Gumplinger (LXe-V09-06-12) - replace Update method and commands with ReinitializeGeometry. So we should just comment out the update lines in the macros. Four cc files have been modified in src - LXeMainVolume.cc, LXeDetectorConstruction.cc,  LXeEventAction.cc and LXePrimaryGeneratorAction.cc.

  • LXePrimaryGeneratorAction.cc sets the gamma energy to be 140 keV.
  • pmt positioning is done originally in LXeMainVolume.cc inside G4PVPlacement function -

    There, the PlacePMTs function calls have been commented out except in the xy plane.
  • G4double lxe_Energy[lxenum]    = { 3.001*eV , 3.000*eV, 2.999*eV, 2.998*eV };
  • is defined in LXeDetectorConstruction.cc - also

    fLXe_mt->AddConstProperty("SCINTILLATIONYIELD",63000./MeV);

    G4double vacuum_RIND[lxenum]={1.,1.,1.,1.};
    (changed from 3 values in orig to 4 values here. seems to be a mistake. - refractive index should be a 3D vector, not 4D.

    In SetDefaults, sizes and numbers defined as

    fScint_x = 5.2*cm;
    fScint_y = 5.2*cm;
    fScint_z = 1*cm;
    fNx = 8;
    fNy = 8;
    fNz = 0;
  • LXeEventAction.cc has the added opfile <<  statements.
    Most of the G4couts in the original are after an if(fVerbose>0)
    that is, LXe/eventVerbose 1 must be set while running LXe for them to execute.
  • vis.mac the default visualization macro has
    /run/verbose 2
    /control/verbose 2

    setting these to 0 reduces some clutter.
  • Somewhere the process verbose is being set to 1, can't seem to override. So all hadron processes etc are listed.
  • 140 keV being deposited in modified version as against 511 in orig.
  • Energy weighted position of hits in LXe is being shown as non-zero in new and old, but in both cases, reconstructed position is 0,0,0

Thursday, July 24, 2014

some Ubuntu tweaks for general working

To add Open in Terminal to the right-click context menu for folders displayed in Ubuntu, followed this page
http://askubuntu.com/questions/207442/how-to-add-open-terminal-here-to-nautilus-context-menu
and installed with
sudo apt-get install nautilus-open-terminal

To install Adoble Flash Plugin, Software Center had Adobe Flash Plugin installer. But even after that, radiosai streams did not work - apparently that was due to absence of mp3 codec. Installing GStreamer plugins for mp3 and so on from Software Center solved that issue.

To avoid having to adjust the brightness every time on reboot, followed this workaround.
cat /sys/class/backlight/acpi_video0/max_brightness
to get the value for max brightness, and then put that or a corresponding value - I used 8 - at the end of /etc/rc.local as
echo 8 > /sys/class/backlight/acpi_video0/brightness

Apparently the correct solution is to fix it in grub, as given here

working with Geant4 on Ubuntu 13.10

Started some preliminary work with the Geant4 C++ toolkit for Monte Carlo simulations. The name comes from GEANT-3, GEometry ANd Tracking.

Also looking at GATE - Geant4 Application for Tomographic Emission as mentioned in this pdf.

Installing Geant4 ran into QT related errors. The solution was here, editing
/usr/include/qt4/QtOpenGL/qgl.h

to have at the end of the if defined includes

#if defined(Q_WS_MAC)
# include
#else
# ifndef QT_LINUXBASE
#   include
# endif
#endif

It turned out that installing in a user directory was more convenient, as that was the method in the install guide. Installed versions 9.6 and 10.0, since the GATE was supposed to work with 9.6. My make string was
cmake -DCMAKE_INSTALL_PREFIX=~/geant4 ../geant4_9_6_p03 -DGEANT4_INSTALL_DATA=ON -DGEANT4_USE_QT=ON -DGEANT4_INSTALL_EXAMPLES=ON 

make -j2 (using two cores for building) ran for 50 minutes to build geant4 v9.6.
make by itself (only one core) took 80 minutes for 10.0.

With this installation, the make string for applications using Geant4 was
cmake -DGeant4_DIR=/home/hari/geant4/lib/Geant4-9.6.3 ../LXe
and so on.

The LXe example needed the path to low energy data to be defined as an environment variable, like
export G4LEDATA=/home/hari/geant4_10/share/Geant4-10.0.2/data/G4EMLOW6.35

In Ubuntu, one method to set environment variables without reboot seems to be to edit /etc/environment to add at the bottom
G4LEDATA=/home/hari/geant4_10/share/Geant4-10.0.2/data/G4EMLOW6.35
Geant4_DIR=/home/hari/geant4_10/lib/Geant4-10.0.2
and then call
source /etc/environment
at the bottom of .bashrc - but that did not seem to work - have to put export statements in .profile, as mentioned in the ubuntu help file. And that will work only after logging in again.

Once these environment variables are set, then the make string does not need the path to Geant4 and so on.




Thursday, July 17, 2014

call forwarding from BSNL landline

According to this BSNL page,
http://www.bsnl.co.in/opencms/bsnl/BSNL/services/landline/plus.html
we can activate call forwarding using the code 114 followed by number to which call is to be forwarded. Did not work in my case. The CLI announcement service at 164 also did not work, so perhaps all these services are not available at our location. 

Wednesday, July 16, 2014

Sunday, July 06, 2014

Avidemux issue

Found that my installation of Avidemux, version 2.6 32 bit, doesn't load files when the VGA cable for 2nd monitor is connected and monitor 2 is enabled with "Extend my Windows desktop onto this monitor". With single display, loads fine.