Positron beam simulation

Dear all, I’m a beginner. I’ve just finally installed successfully Geant4, because I need to simulate a positron beam 45GeV, hitting a Carbonium fixed target having a setted thickness. I just need to count, after the target how many e-e+ -> e+e- and how many e-e+ -> mu+ mu- I got.
Can someoune help me how to start? I never made a Geant4 simulation…

Hello,

a simplest example is $G4INSTALL/example/extended/hadronic/Hadr01

VI

Hi @civanch thank you for your reply.

  1. First of all, I tried to compile the example. I copied all the files in the directory $G4INSTALL/example/extended/hadronic/Hadr01 to the directory C:/Hadr01 then I tried to build the .exe file in this way:

     **C:\Users\faust>cd c:/Hadr01**
    

** c:\Hadr01>mkdir Hadr01-build**

** c:\Hadr01>cd Hadr01-build**

** c:\Hadr01\Hadr01-build>cmake -DGeant4_DIR=“C:/Program Files/geant4_10_05_p01_bin-install/lib/Geant4-10.5.1” “C:/Hadr01”**

-- Building for: Visual Studio 15 2017
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
-- The C compiler identification is MSVC 19.16.27031.1
-- The CXX compiler identification is MSVC 19.16.27031.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/WDExpress/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/WDExpress/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/WDExpress/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/WDExpress/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Hadr01/Hadr01-build

**c:\Hadr01\Hadr01-build>cmake --build . --config Release**
Microsoft (R) Build Engine versione 15.9.21+g9802d43bc3 per .NET Framework
Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati.

  Checking Build System
  Building Custom Rule C:/Hadr01/CMakeLists.txt
  Hadr01.cc
  CheckVolumeSD.cc
  DetectorConstruction.cc
  DetectorMessenger.cc
  EventAction.cc
  EventActionMessenger.cc
  Histo.cc
  HistoManager.cc
  HistoMessenger.cc
  PhysicsList.cc
  PhysicsListMessenger.cc
  PrimaryGeneratorAction.cc
  RunAction.cc
  StackingAction.cc
  StackingMessenger.cc
  TargetSD.cc
  Generazione del codice in corso...
  Hadr01.vcxproj -> C:\Hadr01\Hadr01-build\Release\Hadr01.exe
  Building Custom Rule C:/Hadr01/CMakeLists.txt

**c:\Hadr01\Hadr01-build>cd Release**

** c:\Hadr01\Hadr01-build\Release>Hadr01.exe**
Available UI session types: [ Win32, GAG, csh ]

-------- WWWW ------- G4Exception-START -------- WWWW -------

*** ExceptionHandler is not defined ***
*** G4Exception : UI0002
      issued by : G4UIExecutive::G4UIExecutive()
Specified session type is not build in your system,
or no session type is specified.
A fallback session type is used.
*** This is just a warning message. ***
-------- WWWW ------- G4Exception-END -------- WWWW -------


**************************************************************
 Geant4 version Name: geant4-10-05-patch-01    (17-April-2019)
                       Copyright : Geant4 Collaboration
                      References : NIM A 506 (2003), 250-303
                                 : IEEE-TNS 53 (2006), 270-278
                                 : NIM A 835 (2016), 186-225
                             WWW : http://geant4.org/
**************************************************************

Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...

You have successfully registered the following graphics systems.
Current available graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
OpenGLImmediateWin32 (OGLIWin32, OGLI)
OpenGLStoredWin32 (OGLSWin32, OGL, OGLS)

Registering model factories...

You have successfully registered the following model factories.
Registered model factories:
  generic
  drawByAttribute
  drawByCharge
  drawByOriginVolume
  drawByParticleID
  drawByEncounteredVolume

Registered filter factories:
  attributeFilter
  chargeFilter
  originVolumeFilter
  particleFilter
  encounteredVolumeFilter

You have successfully registered the following user vis actions.
Run Duration User Vis Actions: none
End of Event User Vis Actions: none
End of Run User Vis Actions: none

Some /vis commands (optionally) take a string to specify colour.
"/vis/list" to see available colours.
PreInit>

but I can’t read information about particles…

  1. Moreover…I need to modify the example (I need a positron beam 45GeV hitting a C fixed lenght target)
    I found the hadr01.in file in $G4INSTALL/example/extended/hadronic/Hadr01 directory that is

     #================================================
    

    Macro file for hadr01

    06.06.2006 V.Ivanchneko

    #================================================
    /control/verbose 2
    /run/verbose 2
    /tracking/verbose 0

    /testhadr/TargetMat G4_Al
    /testhadr/TargetRadius 1 cm
    /testhadr/TargetLength 10 cm
    /testhadr/NumberDivZ 100
    /testhadr/PrintModulo 10

    /run/setCut 1 mm
    /testhadr/Physics QBBC

    /run/initialize

    /gun/particle proton
    /gun/energy 3. GeV
    /run/beamOn 100

then…is it enough to modify this file in this way ? (In bold my changes)

#================================================

Macro file for hadr01

06.06.2006 V.Ivanchneko

#================================================
/control/verbose 2
/run/verbose 2
/tracking/verbose 0

/testhadr/TargetMat G4_C
/testhadr/TargetRadius 1 cm
/testhadr/TargetLength 2 cm
/testhadr/NumberDivZ 100
/testhadr/PrintModulo 10

/run/setCut 1 mm
/testhadr/Physics QBBC

/run/initialize

/gun/particle positron
/gun/energy 45. GeV
/run/beamOn 100