Day-5 : 15:00 – 17:00 @ 406




       Asia-Pacific Geant4 Workshop
         and Training Course 2009
   7-12 December 200...
A little overflows at
                                  the training session
December 11, 2009   Follow up Session       o...
Catch up overflow

Lesson &
learn from
common
questions
December 11, 2009   Let’s restate ourselves!
                     ...
Aims in this session
                                               Trainer

   Individual Q & A

                        ...
Aims in this session
                                               Trainer




                                          ...
Aims in this session


   You can be a trainer in your institute
                                                 Particip...
Technical matters
orz… Dependency error at the RPM
              installation 
• By default setting on both SL4 & SL5, the DAG repository i...
Failure to link a xerces-c while
 compiling our own application code 
• We should check 2 points
      – What is “make ut...
Do you have libxerces-c.so in /usr/lib64 ?
$ make -n
touch tmp/Linux-g++/exampleN03/exe/obj.last
echo "Using global librar...
Unset G4LIB_*_GDML if you don’t want to link xerces-c!
$ unset G4LIB_USE_GDML
$ unset G4LIB_BUILD_GDML
$ make –n
touch tmp...
Step by step to check xerces-c library

$ rpm -qa | grep xerces-c
xerces-c-devel-2.7.0-1.el5.rf.x86_64
xerces-c-2.7.0-1.el...
How can we remove annoying G4XXX
         environment variables 
  • Copy & paste following shell & do it!
        – Only...
• Check your init file: $HOME/.bashrc and
  $HOME/.bash_profile
      – Also check many init files are placed in the
     ...
Why OGLIX doesn’t display detectors
                   on SL5 ? 
     • It’s a bug on Mesa library for OpenGL
           ...
• Do you want to stay on SL4?
      – You should consider software lifecycle supplied by Redhat
• SL4 can be expected to t...
Can we access repo.cc.kek.jp even
            after the workshop ?
• 24x7
• A bit delayed to official               Yes, w...
Can we run VMs at
                             the same time ?




                                        Yes, we
       ...
Can we use repo.cc.kek.jp even on
                  Fedora ?
• You should not do this!
• Entirely different
  software sta...
Which versions are the best
       combination of Geant4 & CLHEP ?
• We should read a release note of each releases
      ...
Where can we post questions ?
• Geant4 HyperNews
      – http://hypernews.slac.stanford.edu/Hy
        perNews/geant4/cind...
If you hesitate wide communication
    Yes - I can be your 1st line support 

                       Yes, I
             ...
How can we use a ROOT: external
          analysis software with Geant4 ?
 • Very natural requirement 
 • First of all, y...
What’s ROOT ?
• Popular analysis software in HENP
      – ROOT Killed PAW
• Written in C++
      – Very good compatibility...
Source code

                     HELLO WORLD (C++)                       CLI




#include <iostream>                     ...
Source code

                      HELLO WORLD (CINT)                                CLI


$ root                         ...
Check basic functionalities provided by ROOT
$ cp –a $ROOTSYS/share/doc/root/tutorials .
$ cd tutorials/
$ root

Welcome t...
The benchmarks.C should be end with:
---------------ROOT 5.24/00 benchmarks summary (in
ROOTMARKS)-----
   For comparison,...
How can we use ROOT in
                      Geant4 ?
             A quick review of lecture slides given
                ...
Review: How Geant4 processes a Run
              Technical Terminology in Geant4
                   Begin of Run          ...
Review: User’s hooks
                                               Mandate! Others are optional hooks




December 11, 20...
Where should we implement ?
       It’s up to your design of applications
1. Clear histograms
                            ...
G4RunManager
                                        G4UserRunAction* userRunAction
                                      ...
Examples of Implementation
                  At the BeginOfRunAction
    void MyRunAction::MyRunAction()
    {
      theEd...
Examples of Implementation
                 At the EndOfEventAction
    void MyEventAction::EndOfEventAction(const G4Event...
Examples of Implementation
                At the EndOfRunAction
 void MyRunAction::EndOfRunAction(const G4Run* aRun)
 {
 ...
GNUmakefile
name := exampleXX                                              GNUmakefile
G4TARGET := $(name)
G4EXLIB := true...
Tips for make utility
 (can be applied GNU version, not for make nor nmake)
Usage               Explanation
make -n       ...
And offline…
                    TBrowser may help us




December 11, 2009          Follow up Session   39
Interactive in ROOT CLI
 root   [0]   f = new TFile(“mydata.root”)                 // Open a file “mydata.root”
 root   [1...
Using a Macro
void draw()
{                                                     draw.cc
  f = new TFile("mydata.root");
  ...
Summary of using ROOT in Geant4
• On the CLI (CINT)
      – To execute a macro: .x macro.C
      – To load a macro: .L mac...
Why compiler shows messages we
         have never seen before ?
• More generic question
• A couple of reasons are expecte...
My PhysicsList follows example code
       (N03) provided by Geant4
• If you copy & paste PhysicsList from
  ExN03PhysicsL...
Recommended VRML viewer
• Use vrmlview
• Note: VRML is 10 years ago solution




December 11, 2009   Follow up Session   45
Survey on Training Course
• We don’t assume 100% of participants satisfy
• The personal goal is 80% of participants satisf...
Any other overflows?




December 11, 2009          Follow up Session   47
Upcoming SlideShare
Loading in …5
×

Followup Session in Asia-Pacific Geant4 Workshop and Training Course 2009 held at Epochal, Tsukuba, Japan during 7-12 Dec 2009

1,237 views

Published on

A couple of sillover from training course, lecture session, and working session could be followed up in this Followup Session on Friday.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,237
On SlideShare
0
From Embeds
0
Number of Embeds
135
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Followup Session in Asia-Pacific Geant4 Workshop and Training Course 2009 held at Epochal, Tsukuba, Japan during 7-12 Dec 2009

  1. 1. Day-5 : 15:00 – 17:00 @ 406 Asia-Pacific Geant4 Workshop and Training Course 2009 7-12 December 2009 @ Tsukuba International Congress Center (Epochal), Tsukuba, Japan Follow up Lectures & Working Session Go Iwai, KEK/CRC go.iwai@kek.jp http://kds.kek.jp/sessionDisplay.py?sessionId=31&slotId=0&confId=3898#2009-12-11
  2. 2. A little overflows at the training session December 11, 2009 Follow up Session on Monday 2
  3. 3. Catch up overflow Lesson & learn from common questions December 11, 2009 Let’s restate ourselves! Follow up Session 3
  4. 4. Aims in this session Trainer Individual Q & A ? ? ? Participants Most of your questions are common questions December 11, 2009 Follow up Session 4
  5. 5. Aims in this session Trainer Participants Knowledge sharing December 11, 2009 Follow up Session 5
  6. 6. Aims in this session You can be a trainer in your institute Participants December 11, 2009 Follow up Session Your colleagues 6
  7. 7. Technical matters
  8. 8. orz… Dependency error at the RPM installation  • By default setting on both SL4 & SL5, the DAG repository is set as enabled=0 that means never look up DAG. Since a GDML in Geant4 depends on software in DAG, you should revise it just enabled=1 in /etc/yum.repos.d/dag.repo. • Did you place kek.repo in properly? – http://repo.cc.kek.jp/SL4/kek.repo for SL4 and other RH4 clones – http://repo.cc.kek.jp/SL5/kek.repo for SL5 and other RH5 clones – We don’t have solution to resolve your distribution dynamically so far  – $ sudo yum clean all – We can resolve your architecture dynamically  see a repo file • A GDML module might be separated into the another sub package in future, e.g. geant4-gdml December 11, 2009 Follow up Session 8
  9. 9. Failure to link a xerces-c while compiling our own application code  • We should check 2 points – What is “make utility” doing ? – Have you installed libxerces-c.so ? Let’s see examples of solution on SL5 x86_64 December 11, 2009 Follow up Session 9
  10. 10. Do you have libxerces-c.so in /usr/lib64 ? $ make -n touch tmp/Linux-g++/exampleN03/exe/obj.last echo "Using global libraries ..." if [ ! -d ./bin/Linux-g++ ] ; then mkdir ./bin/Linux-g++ ;fi echo Linking exampleN03 g++ -W -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings - Wpointer-arith -Woverload d-virtual -pipe -O2 -DG4OPTIMISE -Iinclude - I/opt/clhep/include -DG4LIB_USE_GDML -I/usr/include -DG4VERBOSE -DG4_STORE_TRAJECTORY - DG4UI_USE_TCSH -DG4UI_USE_GAG -DG4UI_USE -DG4VIS_USE_DAWNFILE -DG4VIS_USE_HEPREPFILE DG4VIS_USE_RAYTRACER -DG4VIS_USE_VRMLFILE -DG4VIS_USE_ASCIITREE -DG4VIS_USE_GAGTREE - DG4VIS_USE_DAWN -DG4VIS USE_OPENGLX -DG4VIS_USE_OPENGLXM -DG4VIS_USE_OPENGL - DG4VIS_USE_RAYTRACERX -DG4VIS_USE_VRML -DG4VIS_USE -I/i clude -I/usr/X11R6/include - I/usr/include/X11/extensions -I/usr/include/X11 -I/opt/geant4/include ¥ -o ./bin/Linux-g++/exampleN03 ./tmp/Linux-g++/exampleN03/exe/exampleN03.o -L/opt/clhep/lib64 - /opt/geant4/lib64/Linux-g++ -L./tmp/Linux-g++/exampleN03 -Wl,- rpath ./tmp/Linux-g++/exampleN03 ¥ -lexampleN03 -lG4FR -lG4visHepRep -lG4RayTracer -lG4VRML -lG4Tree -lG4OpenGL -lG4vis_management lG4modeling -lG4interfaces -lG4persistency -lG4error_propagation - lG4readout -lG4physicslists -lG4run -lG4ev nt -lG4tracking -lG4parmodels -lG4processes - lG4digits_hits -lG4track -lG4particles -lG4geometry -lG4materia s -lG4graphics_reps - lG4intercoms -lG4global -L/usr/lib64 -lxerces-c -L/lib64 -lGLU -lGL -lXm -lXpm -L/usr/ 11R6/lib64 -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE -lCLHEP -lm if [ ¥( -f ./bin/Linux-g++/exampleN03 ¥) ]; then ¥ echo "... Done!"; fi December 11, 2009 Follow up Session 10
  11. 11. Unset G4LIB_*_GDML if you don’t want to link xerces-c! $ unset G4LIB_USE_GDML $ unset G4LIB_BUILD_GDML $ make –n touch tmp/Linux-g++/exampleN03/exe/obj.last echo "Using global libraries ..." if [ ! -d ./bin/Linux-g++ ] ; then mkdir ./bin/Linux-g++ ;fi echo Linking exampleN03 g++ -W -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long -Wwrite-strings - Wpointer-arith -Woverloaded-virtual -pipe -O2 -DG4OPTIMISE -Iinclude - I/opt/clhep/include -DG4VERBOSE -DG4_STORE_TRAJECTORY -DG4UI_USE_TCSH -DG4UI_USE_GAG - DG4UI_USE -DG4VIS_USE_DAWNFILE -DG4VIS_USE_HEPREPFILE -DG4VIS_USE_RAYTRACER - DG4VIS_USE_VRMLFILE -DG4VIS_USE_ASCIITREE -DG4VIS_USE_GAGTREE -DG4VIS_USE_DAWN - DG4VIS_USE_OPENGLX -DG4VIS_USE_OPENGLXM -DG4VIS_USE_OPENGL -DG4VIS_USE_RAYTRACERX - DG4VIS_USE_VRML -DG4VIS_USE -I/include -I/usr/X11R6/include - I/usr/include/X11/extensions -I/usr/include/X11 -I/opt/geant4/include ¥ -o ./bin/Linux-g++/exampleN03 ./tmp/Linux-g++/exampleN03/exe/exampleN03.o -L/opt/clhep/lib64 -L/opt/geant4/lib64/Linux-g++ -L./tmp/Linux-g++/exampleN03 -Wl,- rpath ./tmp/Linux-g++/exampleN03 ¥ -lexampleN03 -lG4FR -lG4visHepRep -lG4RayTracer -lG4VRML -lG4Tree -lG4OpenGL -lG4vis_management -lG4modeling -lG4interfaces -lG4persistency -lG4error_propagation - lG4readout -lG4physicslists -lG4run -lG4event -lG4tracking -lG4parmodels -lG4processes - lG4digits_hits -lG4track -lG4particles -lG4geometry -lG4materials -lG4graphics_reps - lG4intercoms -lG4global -L/lib64 -lGLU -lGL -lXm -lXpm -L/usr/X11R6/lib64 -lXmu -lXt - lXext -lX11 -lXi -lSM -lICE -lCLHEP -lm if [ ¥( -f ./bin/Linux-g++/exampleN03 ¥) ]; then ¥ echo "... Done!"; fi December 11, 2009 Follow up Session 11
  12. 12. Step by step to check xerces-c library $ rpm -qa | grep xerces-c xerces-c-devel-2.7.0-1.el5.rf.x86_64 xerces-c-2.7.0-1.el5.rf.x86_64 $ rpm -ql xerces-c | grep libxerces /usr/lib64/libxerces-c.so.27 /usr/lib64/libxerces-c.so.27.0 /usr/lib64/libxerces-depdom.so.27 /usr/lib64/libxerces-depdom.so.27.0 $ rpm -ql xerces-c-devel | grep libxerces /usr/lib64/libxerces-c.so /usr/lib64/libxerces-depdom.so December 11, 2009 Follow up Session 12
  13. 13. How can we remove annoying G4XXX environment variables  • Copy & paste following shell & do it! – Only for bash users – Unset G4* & CLHEP* & CXX envs=`env | egrep '^G4|^CLHEP' > /dev/null 2>&1` if test "x${envs+x}" = "xx"; then for env in "$envs"; do name=`echo "$env" | cut -d'=' -f1` unset $name done unset name env fi unset envs if test "x${CXX+x}" = "xx"; then unset CXX fi December 11, 2009 Follow up Session 13
  14. 14. • Check your init file: $HOME/.bashrc and $HOME/.bash_profile – Also check many init files are placed in the /etc/profile.d • It could be good idea to recreate as a clean user if you have root privileges  – $ sudo useradd tempuser December 11, 2009 Follow up Session 14
  15. 15. Why OGLIX doesn’t display detectors on SL5 ?  • It’s a bug on Mesa library for OpenGL – This can be seen both on x32 & x64 of SL5 • Solution: – VRML2FILE or DAWNFILE as visualization !? driver instead of OGLIX – Use SL4 instead of SL5 # vis.mac # /vis/open OGLIX # comment out here # /vis/open DAWNFILE # you should install dawn # /vis/open VRML2FILE # you should install vrmlview # and set G4VRMLFILE_VIEWER=vrmlview VRML with vrmlview DAWN with gv December 11, 2009 Follow up Session 15
  16. 16. • Do you want to stay on SL4? – You should consider software lifecycle supplied by Redhat • SL4 can be expected to terminate in 2012 – We usually migrate newer release, e.g. SL5, a few year earlier than the end of support http://www.redhat.com/security/updates/errata/ https://www.scientificlinux.org/distributions/roadmap December 11, 2009 Follow up Session 16
  17. 17. Can we access repo.cc.kek.jp even after the workshop ? • 24x7 • A bit delayed to official Yes, we Geant4 release can! December 11, 2009 Follow up Session 17
  18. 18. Can we run VMs at the same time ? Yes, we can! December 11, 2009 Follow up Session 18
  19. 19. Can we use repo.cc.kek.jp even on Fedora ? • You should not do this! • Entirely different software stacks between Fedora & Redhat! • Build from complete No, we source tree of Geant4 if you want to work on can’t! Fedora! December 11, 2009 Follow up Session 19
  20. 20. Which versions are the best combination of Geant4 & CLHEP ? • We should read a release note of each releases – http://www.geant4.org/geant4/support/ReleaseNotes4.9.2.html • CLHEP 2.0.4.5 for Geant4 9.3 December 11, 2009 Follow up Session 20
  21. 21. Where can we post questions ? • Geant4 HyperNews – http://hypernews.slac.stanford.edu/Hy perNews/geant4/cindex • Problem Tracker (Bugzilla) – http://bugzilla-geant4.kek.jp/ • Geant4 Japanese Users Mail List – http://www- geant4.kek.jp/mailman/listinfo/geant4 -users December 11, 2009 Follow up Session 21
  22. 22. If you hesitate wide communication Yes - I can be your 1st line support  Yes, I can! Go Iwai, KEK/CRC go.iwai@kek.jp As goiwai on December 11, 2009 Follow up Session 22
  23. 23. How can we use a ROOT: external analysis software with Geant4 ? • Very natural requirement  • First of all, you should download & build & install ROOT – http://root.cern.ch/ • You must set two kind of environment valuables below at least $ export ROOTSYS=/opt/root $ export PATH=$ROOTSYS/bin:$PATH December 11, 2009 Follow up Session 23
  24. 24. What’s ROOT ? • Popular analysis software in HENP – ROOT Killed PAW • Written in C++ – Very good compatibility with Geant4 – Python/Ruby interface • What can we do ? – Create & Display histograms • By using C++ like macro • From CLI & execution file December 11, 2009 Follow up Session 24
  25. 25. Source code HELLO WORLD (C++) CLI #include <iostream> hello.cc int main() { std::cout << “HELLO WORLD” << std::endl; return 0; } $ g++ -o hello.exe hello.cc # compile & link hello.cc $ ./hello.exe # execute hello.exe HELLO WORLD # result of hello.exe December 11, 2009 Follow up Session 25
  26. 26. Source code HELLO WORLD (CINT) CLI $ root # execute ROOT root [0] std::cout << “HELLO WORLD” << std::endl; // cout from CLI HELLO WORLD // result root [1] .q // Terminate ROOT void hello(const char* greeting = “HELLO WORLD”) { hello.C std::cout << greeting << std::endl; return; } root [0] .x hello.C // same with gROOT->Macro(“hello.C”) instead of .x HELLO WORLD // result of hello.C root [1] .q // Terminate ROOT root [0] .L hello.C // same with gROOT->LoadMacro(“hello.C”) root [1] hello(“HELLO ROOT”) // invoke hello() function HELLO ROOT // result of hello() root [2] .q // Terminate ROOT December 11, 2009 Follow up Session 26
  27. 27. Check basic functionalities provided by ROOT $ cp –a $ROOTSYS/share/doc/root/tutorials . $ cd tutorials/ $ root Welcome to the ROOT tutorials Type ".x demos.C" to get a toolbar from which to execute the demos Type ".x demoshelp.C" to see the help window ==> Many tutorials use the file hsimple.root produced by hsimple.C ==> It is recommended to execute hsimple.C before any other script root [0] .x benchmarks.C December 11, 2009 Follow up Session 27
  28. 28. The benchmarks.C should be end with: ---------------ROOT 5.24/00 benchmarks summary (in ROOTMARKS)----- For comparison, a Pentium IV 2.4Ghz is benchmarked at 600 ROOTMARKS hsimple = 333.85 RealMARKS, = 373.91 CpuMARKS hsum = 469.08 RealMARKS, = 423.53 CpuMARKS fillrandom = 389.62 RealMARKS, = 77.42 CpuMARKS fit1 = 236.87 RealMARKS, = 112.50 CpuMARKS tornado = 1148.15 RealMARKS, = 600.00 CpuMARKS na49 = 292.91 RealMARKS, = 356.41 CpuMARKS geometry = 295.10 RealMARKS, = 308.57 CpuMARKS na49view = 311.26 RealMARKS, = 375.00 CpuMARKS ntuple1 = 1126.42 RealMARKS, = 420.00 CpuMARKS **************************************************** * Your machine is estimated at 432.43 ROOTMARKS * **************************************************** root [1] December 11, 2009 Follow up Session 28
  29. 29. How can we use ROOT in Geant4 ? A quick review of lecture slides given by Asai-san December 11, 2009 Follow up Session 29
  30. 30. Review: How Geant4 processes a Run Technical Terminology in Geant4 Begin of Run Stepping Event generation Post-tracking (e.g. Particle injection) Event End of Begin of Begin of Post- End of Generati Pre-track Stepping Run on Event track event run Begin of Event End of Event Pre-tracking End of Run • A Track consists of one or more Step(s). • A Event consists of one or more Track(s). • A Run consists of one or more Event(s). December 11, 2009 Follow up Session 30
  31. 31. Review: User’s hooks Mandate! Others are optional hooks December 11, 2009 Follow up Session 31
  32. 32. Where should we implement ? It’s up to your design of applications 1. Clear histograms 1. Collect your Hit Collections 2. Fill data into your histograms My tips is naturally thinking about data taking models in 1. Open a file real world 2. Write histograms 3. Close a file December 11, 2009 Follow up Session 32
  33. 33. G4RunManager G4UserRunAction* userRunAction G4UserEventAction* userEventAction Related classes provided You should register your by Geant4 void SetUserAction(G4UserRunAction*) Action classes into void SetUserAction(G4UserEventAction*) G4RunManager! G4UserRunAction G4UserEventAction G4Run* GenerateRun() void BeginOfEventAction(const G4Event*) You can override hook functions in your void BeginOfRunAction(const G4Run*) void EndOfRunAction(const G4Run*) void EndOfEventAction(const G4Event*) inherited classes. If we don’t override? Answer is that Geant4 doesn’t anything. MyUserRunAction MyUserEventAction G4Run* GenerateRun() User defined classes void BeginOfEventAction(const G4Event*) void BeginOfRunAction(const G4Run*) void EndOfEventAction(const G4Event*) void EndOfRunAction(const G4Run*) December 11, 2009 Follow up Session 33
  34. 34. Examples of Implementation At the BeginOfRunAction void MyRunAction::MyRunAction() { theEdepHist = new TH1D(“edep”, “TITLE”, 100, 0.0, 50.0); // “edep” is an unique ID to identify a histogram // TITLE is a title shown on the canvas // last 3 arguments in TH1D: // 100: number of bins // 0.0: x minimum // 50.0: x maximum G4UserRunAction } void MyRunAction::BeginOfRunAction(const G4Run* aRun) { // clear the content of histogram theEdepHist->Reset(); return; } MyUserRunAction • Just one time instantiation of a histogram in the constructor – Of course, you can create/delete a histogram object in every Run void BeginOfRunAction(const G4Run*) • It’s up to your design which class has a histogram object void EndOfRunAction(const G4Run*) • Note: You should implement a Get interface to histograms if you would like to access from other classes December 11, 2009 Follow up Session 34
  35. 35. Examples of Implementation At the EndOfEventAction void MyEventAction::EndOfEventAction(const G4Event* anEvent) { // Fill energy deposition into the histogram theEdepHist->Fill(total_edep); return; } • Collect your hit collections (omitted in this G4UserEventAction examples) • Get physical quantities you have interest • Fill them in the histogram • You should get a histogram object via MyRunAction – G4RunManager::GetRunManager()- MyUserEventAction >GetUserRunAction() – You may need to cast to the type “MyRunAction” if you use specific functions in MyRunAction void EndOfEventAction(const G4Event*) December 11, 2009 Follow up Session 35
  36. 36. Examples of Implementation At the EndOfRunAction void MyRunAction::EndOfRunAction(const G4Run* aRun) { TFile* f = new TFile(“mydata.root”, “RECREATE”); // Open a file theEdepHist->Write(); // Write histogram in a file delete f; // Close a file return; } G4UserRunAction • If you would like to create a data file in every run • If you have two or more histograms, you should call Write() method each – Histo1->Write(); MyUserRunAction – Histo2->Write(); – HistoX->Write(); void BeginOfRunAction(const G4Run*) void EndOfRunAction(const G4Run*) December 11, 2009 Follow up Session 36
  37. 37. GNUmakefile name := exampleXX GNUmakefile G4TARGET := $(name) G4EXLIB := true G4WORKDIR = . Typical makefile in Geant4 .PHONY: all all: lib bin include $(G4INSTALL)/config/binmake.gmk CPPFLAGS += $(shell $(ROOTSYS)/bin/root-config --cflags) LDFLAGS += $(shell $(ROOTSYS)/bin/root-config --libs) Insert just 2 lines additionally if you would like to use December 11, 2009 ROOT functions inup Session application Follow your 37
  38. 38. Tips for make utility (can be applied GNU version, not for make nor nmake) Usage Explanation make -n Print the commands that would be executed, but do not execute them. Helpful if you would like to know what/how is going to be happened  make –k Continue as much as possible after an error. make –f filename Use filename as a makefile. make –p Print the data base (rules and variable values) that results from reading the makefiles. Helpful because too many macro values are encapsulated by Geant4. make -jN Specifies the number of jobs to run simultaneously. If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously. Just 10 minutes to complete Geant4 installation with a -j8 on my desktop !! Thanks for multi core technologies  December 11, 2009 Follow up Session 38
  39. 39. And offline… TBrowser may help us December 11, 2009 Follow up Session 39
  40. 40. Interactive in ROOT CLI root [0] f = new TFile(“mydata.root”) // Open a file “mydata.root” root [1] cv = new TCanvas(“cv”, “canvas title”) // Create a canvas to show a histogram root [2] edep->Draw() // Draw a histogram root [3] cv->Print(“mydata.png”) // Save as an image • You can access histogram as “edep” that is specified at the instantiation inside your Geant4 application, remember that: – theEdepHist = new TH1D(“edep”, “TITLE”, 100, 0.0, 50.0); • The canvas can be created automatically at the invocation of Draw() method – Don’t do this – not a good manner! • At the invocation of Print(), you can save an image file as a couple of formats, e.g. PNG, GIF, or PS, depend on ROOT version & building December 11, 2009 Follow up Session 40
  41. 41. Using a Macro void draw() { draw.cc f = new TFile("mydata.root"); cv = new TCanvas("cv", "canvas title"); // set title on X-axis edep->GetXaxis()->SetTitle(“Energy deposition (MeV)”); // set title on Y-axis edep->GetYaxis()->SetTitle(“# of events”); edep->Draw(); cv->Print("mydata.ps"); return; } December 11, 2009 Follow up Session 41
  42. 42. Summary of using ROOT in Geant4 • On the CLI (CINT) – To execute a macro: .x macro.C – To load a macro: .L macro.C • Implementation in Hooks – Clear a histogram at BeginOfRunAction() – Save a file at EndOfRunAction() – Fill contents in a histograms at EndOfEventAction() • GNUmakefile should be slightly modified – Just insert 2 lines CPPFLAGS & LDFLAGS • For offline analysis – Open a file: f = new TFile(“filename.root”) – Specify an unique identifier, e.g. edep, vtx, etc, call Draw() method • This very basic scheme can be applied even if you would like to other analysis software, e.g. GNU plot, PAW, Excel, etc. December 11, 2009 Follow up Session 42
  43. 43. Why compiler shows messages we have never seen before ? • More generic question • A couple of reasons are expected: – You may use different version of compiler, check it • In general, newer compiler is implemented strictly to be compliant with standard specification – You should check it is Error or Warning • Sometimes, we don’t understand well – Copy & paste messages and ask Google – Google is a rather better teacher than me  December 11, 2009 Follow up Session 43
  44. 44. My PhysicsList follows example code (N03) provided by Geant4 • If you copy & paste PhysicsList from ExN03PhysicsList.cc, you should copy & paste again and follow Geant4 • Keep up to date your PhysicsList December 11, 2009 Follow up Session 44
  45. 45. Recommended VRML viewer • Use vrmlview • Note: VRML is 10 years ago solution December 11, 2009 Follow up Session 45
  46. 46. Survey on Training Course • We don’t assume 100% of participants satisfy • The personal goal is 80% of participants satisfy – 50% of participants can be satisfied in my self evaluation… Perhaps reflecting my bias  • To improve our course structure & materials in the rest of the 30% – We need your help! • http://www- geant4.kek.jp/g4ws09/survey.php December 11, 2009 Follow up Session 46
  47. 47. Any other overflows? December 11, 2009 Follow up Session 47

×