Smalltalk is an object-oriented programming language that was created in the 1970s at the Xerox Palo Alto Research Center (PARC). It is known for its simple and elegant syntax, dynamic typing, and interactive development environment.
Smalltalk syntax:
receiver messageName: argument
This sends the messageName message to the receiver object with the argument parameter. In Smalltalk, every statement ends with a period.
The Smalltalk Development Environment:
Smalltalk comes with its own development environment called the "Workspace." This environment allows you to write and execute Smalltalk code interactively.
Can download it from here: https://squeak.org/
Online smalltalk compiler https://www.tutorialspoint.com/execute_smalltalk_online.php
Writing and executing Smalltalk code:
|myString|
myString := 'Hello, world!'.
myString display.
In this code, we create a new variable myString, assign it the value "Hello, world!", and then display the value of the variable using the display method.
Smalltalk classes:
Object subclass: #MyClass
instanceVariableNames: 'var1 var2'
classVariableNames: 'ClassVar1 ClassVar2'
poolDictionaries: ''
category: 'MyCategory'
Smalltalk is an object-oriented language, which means that it revolves around classes and objects. This code defines a new class called MyClass, with two instance variables (var1 and var2), two class variables (ClassVar1 and ClassVar2), and belonging to the category MyCategory
Smalltalk methods:
MyClass>>myMethod
|localVar|
localVar := 'Hello, world!'.
^localVar
This code defines a new method called myMethod for the MyClass class. The method creates a new variable called localVar, assigns it the value "Hello, world!", and then returns the value of the variable using the ^ operator.
Smalltalk resource
https://www.youtube.com/watch?v=Lxb4WZyKeCE
tar xvfz geant4....tar.gz
sudo apt install ...
cmake cmake-curses-gui gcc g++ libexpat1-dev qt5-default libxmu-dev libmotif-dev
mkdir build
cd build
ccmake ../
make install
source $G4DIR/bin/geant4.sh
source $G4DIR/share/Geant4-${VERSION}/geant4make/geant4make.sh
mkdir $sourcedir/build
cmake =$G4DIR GEANT4_USE_OPENGL_X11=ON $sourcedir
make
It is convenient to save the stepping information in the GEANT4 simulation.
Geant4.11
SteppingAction.cc
Get EventID
#include "G4Event.hh"
const G4Event *event=G4RunManager::GetRunManager()->GetCurrentEvent();
G4int eventID = event->GetEventID();
Here is a note to install G4CMP from scratch. Although the official website of Geant4 suggests using CentOS 7, it may be easier to install Geant4 on Ubuntu for its package updates. Especially G4CMP will use newer cmake and gcc, it is easy to upgrade cmake or gcc on Ubuntu. Here I installed Ubuntu 22.04.
Install Ubuntu
First update and install packages, like cmake, gcc. Use the command "sudo apt install -y [xxx]"
ROOT install
Download Geant4
Build Geant4
source ~/setup_env.sh
or
cd geant4-vXXX/
mkdir build
cd build
ccmake ../
select necessary packages, including DATA, X11, QT, CLHEP, EXPAT,
Install it with Geant4.10.7 (Geant4.11.2 doesn't work)
source <g4dir>/bin/geant4.sh
source <g4dir>/share/Geant4-${VERSION}/geant4make/geant4make.sh
source ~/pathtoG4CMP/g4cmp_env.sh
make library
mkdir /path/to/G4CMP/../G4CMP-build
cd /path/to/G4CMP-build
cmake -DGeant4_DIR=/path/to/Geant4/lib64/Geant4-${VERSION} -DCMAKE_INSTALL_PREFIX=/path/to/install ../G4CMP
make
make install
Test the examples
mkdir ./charge-build/
cd ./charge-build
export G4CMP_DIR=/path/to/G4CMP/cmake/
cmake -DGeant4_DIR=/usr/local/geant4/10.07.p03/lib/Geant4-10.7.3/ ../G4CMP/examples/charge/
make
./g4cmpIonize ../G4CMP/examples/charge/run.mac
It generates the text data: charge_hits.txt
export G4CMP_HIT_SUFFIX=charge
./g4cmpIonize ../G4CMP/examples/charge/drift_curve.mac
It generates epos_[]v-{G4CMP_HIT_SUFFIX}.txt
python plot_drift_curve.py
It generates Charge_Drift_Speed_{G4CMP_HIT_SUFFIX}.png
cd ./phono-build
./g4cmpPhonon ../single.mac
It generates phonon_hits.txt
rsync [options] [source] [destination]
su to install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
su to install wine
brew install --cask --no-quarantine wine-stable
back to user account
setup environment in .zshrc
export PATH="/opt/homebrew/bin:$PATH"
check if you can run wine
wine --version
clean any old wine environment
rm -rf ~/.wine ~/.wine_srim ~/.wine_srim32
unset WINEARCH
unset WINEPREFIX
initial wine environment
wineboot
force to install the corresponding VB5/6 packages
winetricks --force -q vb5run vb6run riched20 msvbvm50
check if msvbvm50.dll and richtx32.ocx exist in ~/.wine/drive_c/windows/system32/ or ~/.wine/drive_c/windows/syswow64/
if not, download msvbvm50.dll and richtx32.ocx
download msvbvm50.dll at https://www.dll-files.com/msvbvm50.dll.html
save it at ~/.wine/drive_c/syswow64/
download richtx32.ocx at https://www.majorgeeks.com/content/page/richtx32_ocx.html
save it at ~/.wine/drive_c/system32/
register both files
wine regsvr32 msvbvm50.dll
wine regsvr32 richtx32.ocx
download SRIM-2013 at http://www.srim.org/SRIM/SRIM-2013-Std.e
put it at ~/.wine/drive_c/SRIM/
wine ~/.wine/drive_c/SRIM/SRIM-2013-Std.e
extract all files at ~/.wine/drive_c/SRIM/
run SRIM
wine ~/.wine/drive_c/SRIM/SRIM.exe