Forum: Event and Track Management Not Logged In (login)
Show subscribers

This forum is a discussion of steps, tracks, events and the event manager.

The email gateway for this forum is: eventtrackmanage-g4hn@slac.stanford.edu


Inline Depth:
 0 0
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

Question gdb debug  by wangym <wangym>,   Nov 14, 07:32
I set debug mode when I compile Geant4 source.I can run Geant4 code step by step.But when I run code step by step ,I can not list the source code in bottom function and can not display variable value. I use gdb. list and print command have been used.

1 Idea: Re: gdb debug   (wangym - Nov 14, 18:42) new
(_ Question: Re: gdb debug   (wangym - Nov 14, 19:25) new
(_ None: RE: gdb debug   (Penny, Robert D. - Nov 15, 13:25) new
(_ Question: Re: RE: gdb debug   (wangym - Nov 16, 00:57) new
(_ Question: Re: RE: gdb debug   (wangym - Nov 16, 00:59) new
(_ Question: Re: RE: gdb debug   (wangym - Nov 16, 01:00) new
(_ Idea: Re: RE: gdb debug   (wangym - Nov 16, 02:41) new
Question Energy loss of Gamma  by Rohin <Rohin>,   Nov 12, 06:17
Hallo

I am trying to measure the energy lost by a beam of gamma particle (20 MeV) while propagating through a thin layer(50 Micrometers)of Silicon.

How can I find the energy lost by gamma.

GetTotalEnergyDeposit() function of G4Step gives only the energy lost in the medium.

Is there any method to find out to account for the total energy lost in a aStep (which includes the energy lost in pair creation and delta ray productions)

Thank you..

1 Feedback: Re: Energy loss of Gamma   (Gumplinger Peter - Nov 12, 11:58) new
(_ Question: Re: Energy loss of Gamma   (Rohin - Nov 13, 08:01) new
(_ Feedback: Re: Energy loss of Gamma   (Gumplinger Peter - Nov 13, 10:24) new
(_ None: Re: Energy loss of Gamma   (Robert D. Penny - Nov 13, 10:50) new
(_ None: Re: Energy loss of Gamma   (michel maire - Nov 14, 06:11) new
(_ Ok: Re: Energy loss of Gamma   (Rohin - Nov 16, 05:56) new
(_ Ok: Re: Energy loss of Gamma   (michel maire - Nov 16, 07:44) new
None G4Navigator and NPP  by Jean-Pascal Laedermann <Jean-Pascal Laedermann>,   Oct 31, 08:16
Hi,

I need to localize the material at a given point of the geometry. In standard volumes, it is possible to use a G4Navigator and the method LocateGlobalPointAndSetup, and then the GetMaterial method of the LogicalVolume where is the point. But this doesn't work when using the nested parameterisation. How can I do ?

Thanks and best regards.

Jean-Pascal

Idea G4GPSasPrimaryGeneratorAction?  by Mathieu Trocmé <Mathieu Trocmé>,   Sep 29, 11:23
Hi there,

Could it be possible to add a "generic PrimaryGeneratorAction" for the GPS in order not to have to create
a PrimaryGeneratorAction.hh file and a PrimaryGeneratorAction.cc file
each time one wants to create a simulation with only the GPS as a primary generator action.

The only thing to do would then be to call it in the main.cc:
> #include "G4GPSasPrimaryGeneratorAction.hh"
> // ...
> runManager->SetUserInitialization ( new (G4GPSasPrimaryGeneratorAction()) ) ;

Cheers,
Mathieu


PS: The implementation (somewhere in G4) should look like this...


********************************************************************************
* "G4GPSasPrimaryGeneratorAction.hh"
********************************************************************************

#ifndef G4GPSasPrimaryGeneratorAction_hh
#define G4GPSasPrimaryGeneratorAction_hh

#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4GeneralParticleSource.hh"
#include "G4Event.hh"

class G4GPSasPrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
  private :
    G4GeneralParticleSource* fGeneralParticleSource ;

  public :
    G4GPSasPrimaryGeneratorAction () ;
    ~G4GPSasPrimaryGeneratorAction () ;
    void GeneratePrimaries (G4Event* anEvent) ;
} ;

#endif


********************************************************************************
* "G4GPSasPrimaryGeneratorAction.cc"
********************************************************************************

#include "G4GPSasPrimaryGeneratorAction.hh"

G4GPSasPrimaryGeneratorAction::G4GPSasPrimaryGeneratorAction ()
{
  fGeneralParticleSource = new G4GeneralParticleSource () ;
}

G4GPSasPrimaryGeneratorAction::~G4GPSasPrimaryGeneratorAction ()
{
  delete fGeneralParticleSource ; fGeneralParticleSource = NULL ;
}

void G4GPSasPrimaryGeneratorAction::GeneratePrimaries (G4Event* anEvent)
{
  fGeneralParticleSource->GeneratePrimaryVertex (anEvent) ;
  return ;
}

Question Slow tracking in voxelized phantom  by Jorge Cabello <Jorge Cabello>,   Sep 29, 02:01
Hi, my specific application is mammography and I am trying to simulate a voxelized phantom (over 5 10^6 voxels) in a typical mammography setup. As expected, tracking of X-ray photons is incredibly slow in this phantom. I have read that this problem is due to the fact that when particles are close to a boundary it has to recalculate the path length with high accuracy, therefore, for a voxelized phantom, it is recalculating the path length continuously. I am aware that this problem is being investigated for applications using GATE by checking if the next voxel is of the same material, thus the boundary is not considered, but I haven't found anything for Geant4. Can anybody hint me where to look at? Thanks Jorge

1 Feedback: Re: Slow tracking in voxelized phantom   (Pedro Arce - Sep 29, 02:25)
Question Passing info to tracks  by Jean-Pascal Laedermann <Jean-Pascal Laedermann>,   Sep 12, 06:42
Hello,

For each event, I have a bunch of inital particles I need to mark individually for the tracking.

As M. Asai suggested (26 may 2006), I made a PrimaryParticleInfo attached to each primary vertex, but I don't know how to transfer this info to track. M. Asai said that G4Track has a pointer to PrimaryParticle if it is a primary track, but this pointer doesn't appear in the G4Track class.

So I modified the ParticleDefinition class in adding an index before passing it to the ParticleGun.

Another problem appears : in PreUserTrackingAction, the track is stated as const, so it is not straightforward to add the info. The only ways I found is to use the G4TrackingManager::GetTrack () to retrieve the track as non const, or to uncast the track with const_cast<G4Track*> (which is a bit heretic ...)

Has somebody a more elegant solution ?

Regards.

Jean-Pascal

1 None: Re: Passing info to tracks   (Tom Roberts - Sep 12, 08:22)
Question FarOutsideCurrentVolume exceptions  by Johannes Hoppenau <Johannes Hoppenau>,   Sep 10, 07:50
Hi,

I am having a Problem with FarOutsideCurrentVolume exceptions. My geometrical setup it the following:

There is a core (WCCore) surrounded by an annulus (WCBarrelAnnulus). The annulus is divided in cells (WCBarrelCell) using Z-Phi replicas. All Volumes are polyhedra and filled with water. Everything is embedded in the WCBox volume. I am appending a dump of these volumes.

When I run the simulation with /geometry/navigator/check_mode true it crashes with the following output:

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0 4.58e+03 1.45e+04 1.79e+04  2.81e-06        0        0         0      WCCore initStep
    1 3.02e+03 1.66e+04 1.51e+04  2.81e-06        0 3.86e+03  3.86e+03       WCBox Transportation
    2 3.02e+03 1.66e+04 1.51e+04  2.81e-06        0        0  3.86e+03      WCCore Transportation
    3 -1.21e+04 1.19e+04 -1.87e+03  2.81e-06        0 2.32e+04   2.7e+04 WCBarrelCell Transportation
WARNING - G4ReplicaNavigation::ComputeStep()
          Point (16674.257,2788.9713,-1865.4617) is outside current volume WCBarrelAnnulus
          Estimated isotropic distance to solid (distToIn)= 45.743315

*** G4Exception : FarOutsideCurrentVolume
      issued by : G4ReplicaNavigation::ComputeStep()
Point is far outside Current Volume !
*** Fatal Exception *** core dump ***

*** G4Exception: Aborting execution *** Abort

The point where the error occurs is different for every run, but is outside of annulus every time. How can I figure out, why Geant4 assumes, that the particle should be inside the annulus?

The Volumes: -----------------------------------------------------------
    *** Dump for solid - WCCore ***
    ===================================================
 Solid type: G4Polyhedra
 Parameters: 
    starting phi angle : 18 degrees 
    ending phi angle   : 378 degrees 
    number of Z planes: 2
              Z values: 
              Z plane 0: -17920
              Z plane 1: 17920
              Tangent distances to inner surface (Rmin): 
              Z plane 0: 0
              Z plane 1: 0
              Tangent distances to outer surface (Rmax): 
              Z plane 0: 17580.4
              Z plane 1: 17580.4
    number of RZ points: 4
              RZ values (corners): 
                         0, 17920
                         0, -17920
                         17580.4, -17920
                         17580.4, 17920
-----------------------------------------------------------
Checking overlaps for volume WCCore ... OK! 

-----------------------------------------------------------
    *** Dump for solid - WCBarrelAnnulus ***
    ===================================================
 Solid type: G4Polyhedra
 Parameters: 
    starting phi angle : 18 degrees 
    ending phi angle   : 378 degrees 
    number of Z planes: 2
              Z values: 
              Z plane 0: -5997
              Z plane 1: 5997
              Tangent distances to inner surface (Rmin): 
              Z plane 0: 17580.4
              Z plane 1: 17580.4
              Tangent distances to outer surface (Rmax): 
              Z plane 0: 17959
              Z plane 1: 17959
    number of RZ points: 4
              RZ values (corners): 
                         17580.4, 5997
                         17580.4, -5997
                         17959, -5997
                         17959, 5997
-----------------------------------------------------------
Checking overlaps for volume WCBarrelAnnulus ... OK! 

-----------------------------------------------------------
    *** Dump for solid - WCBarrelCell ***
    ===================================================
 Solid type: G4Polyhedra
 Parameters: 
    starting phi angle : 0 degrees 
    ending phi angle   : 36 degrees 
    number of Z planes: 2
              Z values: 
              Z plane 0: -5997
              Z plane 1: 5997
              Tangent distances to inner surface (Rmin): 
              Z plane 0: 17580.4
              Z plane 1: 17580.4
              Tangent distances to outer surface (Rmax): 
              Z plane 0: 17959
              Z plane 1: 17959
    number of RZ points: 4
              RZ values (corners): 
                         17580.4, 5997
                         17580.4, -5997
                         17959, -5997
                         17959, 5997
-----------------------------------------------------------

1 Note: Re: FarOutsideCurrentVolume exceptions   (Johannes Hoppenau - Sep 10, 13:03)
(_ Note: Re: FarOutsideCurrentVolume exceptions   (Gumplinger Peter - Sep 16, 14:50)
None Geant4 File I/O  by <jdswado@gatech.edu>,   Sep 09, 09:36
Hey All,

I'm recording the energies of compton scatter events and I'd like to output that data to a csv file. I've tried normal c++ I/O but I'm not sure what syntax I need to make it work with Geant.

Quick example of what I'd like to do:

In SteppingAction.cc

if(ProcessName == "compt") { outfile << Energy <<","; }

Thanks!

Question Infinite loop in GPS when using an user defined energy spectrum  by David Dennetiere <David Dennetiere>,   Sep 09, 07:45
Hello,

I am trying to use an user defined energy spectrum with GPS, using the "gps/hist/type" Arb option.

But GEANT4 seems to get stuck in an infinite loop when i ask it to run it. Here is my beam macro :

# GPS Specifications

/gps/particle gamma

/gps/position -2.5 0 0 m

/gps/ang/type iso

/gps/ene/type Arb

/gps/ene/min 0.02 MeV

/gps/ene/max 3. MeV

/gps/ene/diffspec false

/gps/hist/type arb

/gps/hist/point 0.030000 961.430176

/gps/hist/point 0.033000 957.592163

/gps/hist/point 0.036000 953.769409

/gps/hist/point 0.039000 949.961975

/gps/hist/point 0.042000 946.169678

/gps/hist/point 0.045000 942.392578

/gps/hist/point 0.048000 938.630554

/gps/hist/point 0.051000 934.883545

/gps/hist/point 0.054000 931.151428

/gps/hist/point 0.057000 927.434265

/gps/hist/point 0.060000 923.731934

/gps/hist/point 0.063000 920.044434

/gps/hist/point 0.066000 916.371582

...

/gps/hist/point 2.994000 18.475063

/gps/hist/point 2.997000 18.401312

1

/gps/verbose 1

/run/beamOn 1

There is less than 1000 points for info.

Has anyone any idea to solve my problem?

Thank you,

David Dennetiere

CEA (France)

1 Feedback: Re: Infinite loop in GPS when using an user defined energy spectrum   (Giovanni Santin - Sep 09, 10:14)
(_ Sad: Re: Infinite loop in GPS when using an user defined energy spectrum   (David Dennetiere - Sep 09, 12:28)
(_ Ok: Re: Infinite loop in GPS when using an user defined energy spectrum   (David Dennetiere - Sep 10, 00:04)
Question Storing Photon's kinetic energy  by Antonio Magalhaes <Antonio Magalhaes>,   Sep 02, 05:40
Hi!

I'm trying to analyze the kinetic energy of some photons that pass through a region defined as SD. However, I am not able to write the right code for processHits using G4Track to call the GetKineticEnergy() function. I looked at the example AnaEx01, but the file only uses G4Step. Can someone show me how to do this part of code?

After that I want to store this data in a file hbook, someone knows a simple way to do it? The file AnalysisManager.cc from AnaEx01 is the only way? Thank you very much.

1 None: Re: Storing Photon's kinetic energy   (michel maire - Sep 02, 06:53)
Question Same two steps repeat again and again  by Ioannis Sechopoulos <Ioannis Sechopoulos>,   Aug 31, 13:52
A simulation I have been using for a long time now is giving me problems in that after a certain number of events (varies depending on the random number seed), it gets stuck performing the same two steps. The output of "/tracking/verbose 4" for these two steps is the following:

#Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    7     84.1     -182     44.4     0.016        0 4.64e-15       660       World Transportation

 >>AlongStepDoIt (process by process):    Process Name = Transportation

    ++G4Step Information 
      Address of G4Track    : 0x19666c0
      Step Length (mm)      : 0
      Energy Deposit (MeV)  : 0
      -----------------------------------------------------------------------
        StepPoint Information               PreStep            PostStep
      -----------------------------------------------------------------------
         Position - x (mm)   :    84.08523386931844   84.08523386931844
         Position - y (mm)   :     -181.75378512735    -181.75378512735
         Position - z (mm)   :     44.4354460094737    44.4354460094737
         Global Time (ns)    :    2.201048285186674   2.201048285186674
         Local Time (ns)     :    2.201048285186674   2.201048285186674
         Proper Time (ns)    :                    0                   0
         Momentum Direct - x :   0.4601418205088121  0.4601418205088121
         Momentum Direct - y :   0.7169432097626749  0.7169432097626749
         Momentum Direct - z :   0.5237002377257712  0.5237002377257712
         Momentum - x (MeV/c): 0.0073622691281409940.007362269128140994
         Momentum - y (MeV/c):   0.0114710913562028  0.0114710913562028
         Momentum - z (MeV/c):  0.00837920380361234 0.00837920380361234
         Total Energy (MeV)  :                0.016               0.016
         Kinetic Energy (MeV):                0.016               0.016
         Velocity (mm/ns)    :           299.792458          299.792458
         Volume Name         :                World               World
         Safety (mm)         :                5e-10               5e-10
         Polarization - x    :                    0                   0
         Polarization - y    :                    0                   0
         Polarization - Z    :                    0                   0
         Weight              :                    1                   1
         Step Status         :           Geom Limit          Geom Limit
         Process defined Step:       Transportation      Transportation
      -----------------------------------------------------------------------
          !Note! Safety of PostStep is only valid after all DoIt invocations.

    ++G4ParticleChange Information 
      -----------------------------------------------
        G4ParticleChange Information  
      -----------------------------------------------
        # of 2ndaries       :                    0
      -----------------------------------------------
        Energy Deposit (MeV):                    0
        Non-ionizing Energy Deposit (MeV):                    0
        Track Status        :                Alive
        True Path Length (mm) :                    0
        Stepping Control      :                    0
        Mass (GeV)   :                    0
        Charge (eplus)   :                    0
        MagneticMoment   :                    0
                :  =                    0*[e hbar]/[2 m]
        Position - x (mm)   :                 84.1
        Position - y (mm)   :                 -182
        Position - z (mm)   :                 44.4
        Time (ns)           :                  2.2
        Proper Time (ns)    :                    0
        Momentum Direct - x :                 0.46
        Momentum Direct - y :                0.717
        Momentum Direct - z :                0.524
        Kinetic Energy (MeV):                0.016
        Polarization - x    :                    0
        Polarization - y    :                    0
        Polarization - z    :                    0
        Touchable (pointer) :             0xc8ac20

    ++List of secondaries generated (x,y,z,kE,t,PID):  No. of secodaries = 0

 >>AlongStepDoIt (after all invocations):
    ++List of invoked processes 
      1) Transportation

    ++G4Step Information 
      Address of G4Track    : 0x19666c0
      Step Length (mm)      : 0
      Energy Deposit (MeV)  : 0
      -----------------------------------------------------------------------
        StepPoint Information               PreStep            PostStep
      -----------------------------------------------------------------------
         Position - x (mm)   :    84.08523386931844   84.08523386931844
         Position - y (mm)   :     -181.75378512735    -181.75378512735
         Position - z (mm)   :     44.4354460094737    44.4354460094737
         Global Time (ns)    :    2.201048285186674   2.201048285186674
         Local Time (ns)     :    2.201048285186674   2.201048285186674
         Proper Time (ns)    :                    0                   0
         Momentum Direct - x :   0.4601418205088121  0.4601418205088121
         Momentum Direct - y :   0.7169432097626749  0.7169432097626749
         Momentum Direct - z :   0.5237002377257712  0.5237002377257712
         Momentum - x (MeV/c): 0.0073622691281409940.007362269128140994
         Momentum - y (MeV/c):   0.0114710913562028  0.0114710913562028
         Momentum - z (MeV/c):  0.00837920380361234 0.00837920380361234
         Total Energy (MeV)  :                0.016               0.016
         Kinetic Energy (MeV):                0.016               0.016
         Velocity (mm/ns)    :           299.792458          299.792458
         Volume Name         :                World               World
         Safety (mm)         :                5e-10               5e-10
         Polarization - x    :                    0                   0
         Polarization - y    :                    0                   0
         Polarization - Z    :                    0                   0
         Weight              :                    1                   1
         Step Status         :           Geom Limit          Geom Limit
         Process defined Step:       Transportation      Transportation
      -----------------------------------------------------------------------

    ++List of secondaries generated (x,y,z,kE,t,PID):  No. of secodaries = 0

 >>PostStepDoIt (process by process):    Process Name = Transportation

    ++G4Step Information 
      Address of G4Track    : 0x19666c0
      Step Length (mm)      : 0
      Energy Deposit (MeV)  : 0
      -----------------------------------------------------------------------
        StepPoint Information               PreStep            PostStep
      -----------------------------------------------------------------------
         Position - x (mm)   :    84.08523386931844   84.08523386931844
         Position - y (mm)   :     -181.75378512735    -181.75378512735
         Position - z (mm)   :     44.4354460094737    44.4354460094737
         Global Time (ns)    :    2.201048285186674   2.201048285186674
         Local Time (ns)     :    2.201048285186674   2.201048285186674
         Proper Time (ns)    :                    0                   0
         Momentum Direct - x :   0.4601418205088121  0.4601418205088121
         Momentum Direct - y :   0.7169432097626749  0.7169432097626749
         Momentum Direct - z :   0.5237002377257712  0.5237002377257712
         Momentum - x (MeV/c): 0.0073622691281409940.007362269128140994
         Momentum - y (MeV/c):   0.0114710913562028  0.0114710913562028
         Momentum - z (MeV/c):  0.00837920380361234 0.00837920380361234
         Total Energy (MeV)  :                0.016               0.016
         Kinetic Energy (MeV):                0.016               0.016
         Velocity (mm/ns)    :           299.792458          299.792458
         Volume Name         :                World           physiSkin
         Safety (mm)         :                5e-10               5e-10
         Polarization - x    :                    0                   0
         Polarization - y    :                    0                   0
         Polarization - Z    :                    0                   0
         Weight              :                    1                   1
         Step Status         :           Geom Limit          Geom Limit
         Process defined Step:       Transportation      Transportation
      -----------------------------------------------------------------------

    ++G4ParticleChange Information 
      -----------------------------------------------
        G4ParticleChange Information  
      -----------------------------------------------
        # of 2ndaries       :                    0
      -----------------------------------------------
        Energy Deposit (MeV):                    0
        Non-ionizing Energy Deposit (MeV):                    0
        Track Status        :                Alive
        True Path Length (mm) :                    0
        Stepping Control      :                    0
        Mass (GeV)   :                    0
        Charge (eplus)   :                    0
        MagneticMoment   :                    0
                :  =                    0*[e hbar]/[2 m]
        Position - x (mm)   :                 84.1
        Position - y (mm)   :                 -182
        Position - z (mm)   :                 44.4
        Time (ns)           :                  2.2
        Proper Time (ns)    :                    0
        Momentum Direct - x :                 0.46
        Momentum Direct - y :                0.717
        Momentum Direct - z :                0.524
        Kinetic Energy (MeV):                0.016
        Polarization - x    :                    0
        Polarization - y    :                    0
        Polarization - z    :                    0
        Touchable (pointer) :             0xc8ab70

    ++List of secondaries generated (x,y,z,kE,t,PID):  No. of secodaries = 0

 **PostStepDoIt (after all invocations):
    ++List of invoked processes 
      1) Transportation
      2) LowEnPhotoElec (Forced)

    ++G4Step Information 
      Address of G4Track    : 0x19666c0
      Step Length (mm)      : 0
      Energy Deposit (MeV)  : 0
      -----------------------------------------------------------------------
        StepPoint Information               PreStep            PostStep
      -----------------------------------------------------------------------
         Position - x (mm)   :    84.08523386931844   84.08523386931844
         Position - y (mm)   :     -181.75378512735    -181.75378512735
         Position - z (mm)   :     44.4354460094737    44.4354460094737
         Global Time (ns)    :    2.201048285186674   2.201048285186674
         Local Time (ns)     :    2.201048285186674   2.201048285186674
         Proper Time (ns)    :                    0                   0
         Momentum Direct - x :   0.4601418205088121  0.4601418205088121
         Momentum Direct - y :   0.7169432097626749  0.7169432097626749
         Momentum Direct - z :   0.5237002377257712  0.5237002377257712
         Momentum - x (MeV/c): 0.0073622691281409940.007362269128140994
         Momentum - y (MeV/c):   0.0114710913562028  0.0114710913562028
         Momentum - z (MeV/c):  0.00837920380361234 0.00837920380361234
         Total Energy (MeV)  :                0.016               0.016
         Kinetic Energy (MeV):                0.016               0.016
         Velocity (mm/ns)    :           299.792458          299.792458
         Volume Name         :                World           physiSkin
         Safety (mm)         :                5e-10               5e-10
         Polarization - x    :                    0                   0
         Polarization - y    :                    0                   0
         Polarization - Z    :                    0                   0
         Weight              :                    1                   1
         Step Status         :           Geom Limit          Geom Limit
         Process defined Step:       Transportation      Transportation
      -----------------------------------------------------------------------

    ++List of secondaries generated (x,y,z,kE,t,PID):  No. of secodaries = 0
      [Note]Secondaries from AlongStepDoIt included.

    ++G4Track Information 
      -----------------------------------------------
        G4Track Information  
      -----------------------------------------------
        Step number         :                    8
        Position - x (mm)   :                 84.1
        Position - y (mm)   :                 -182
        Position - z (mm)   :                 44.4
        Global Time (ns)    :                  2.2
        Local Time (ns)     :                  2.2
        Momentum Direct - x :                 0.46
        Momentum Direct - y :                0.717
        Momentum Direct - z :                0.524
        Kinetic Energy (MeV):                0.016
        Polarization - x    :                    0
        Polarization - y    :                    0
        Polarization - z    :                    0
        Track Length        :                  660
        Track ID #          :                    1
        Parent Track ID #   :                    0
        Next Volume         :            physiSkin 
        Track Status        :                Alive
        Vertex - x (mm)     :                    0
        Vertex - y (mm)     :                 -236
        Vertex - z (mm)     :                  694
        Vertex - Px (MomDir):                0.126
        Vertex - Py (MomDir):                0.081
        Vertex - Pz (MomDir):               -0.989
        Vertex - KineE (MeV):                0.016
        Creator Process     :      Event Generator
      -----------------------------------------------

#Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    8     84.1     -182     44.4     0.016        0        0       660   physiSkin Transportation

 >>AlongStepDoIt (process by process):    Process Name = Transportation

    ++G4Step Information 
      Address of G4Track    : 0x19666c0
      Step Length (mm)      : 4.643365327944604e-15
      Energy Deposit (MeV)  : 0
      -----------------------------------------------------------------------
        StepPoint Information               PreStep            PostStep
      -----------------------------------------------------------------------
         Position - x (mm)   :    84.08523386931844   84.08523386931844
         Position - y (mm)   :     -181.75378512735    -181.75378512735
         Position - z (mm)   :     44.4354460094737    44.4354460094737
         Global Time (ns)    :    2.201048285186674   2.201048285186674
         Local Time (ns)     :    2.201048285186674   2.201048285186674
         Proper Time (ns)    :                    0                   0
         Momentum Direct - x :   0.4601418205088121  0.4601418205088121
         Momentum Direct - y :   0.7169432097626749  0.7169432097626749
         Momentum Direct - z :   0.5237002377257712  0.5237002377257712
         Momentum - x (MeV/c): 0.0073622691281409940.007362269128140994
         Momentum - y (MeV/c):   0.0114710913562028  0.0114710913562028
         Momentum - z (MeV/c):  0.00837920380361234 0.00837920380361234
         Total Energy (MeV)  :                0.016               0.016
         Kinetic Energy (MeV):                0.016               0.016
         Velocity (mm/ns)    :           299.792458          299.792458
         Volume Name         :            physiSkin           physiSkin
         Safety (mm)         :                5e-10               5e-10
         Polarization - x    :                    0                   0
         Polarization - y    :                    0                   0
         Polarization - Z    :                    0                   0
         Weight              :                    1                   1
         Step Status         :           Geom Limit          Geom Limit
         Process defined Step:       Transportation      Transportation
      -----------------------------------------------------------------------
          !Note! Safety of PostStep is only valid after all DoIt invocations.

    ++G4ParticleChange Information 
      -----------------------------------------------
        G4ParticleChange Information  
      -----------------------------------------------
        # of 2ndaries       :                    0
      -----------------------------------------------
        Energy Deposit (MeV):                    0
        Non-ionizing Energy Deposit (MeV):                    0
        Track Status        :                Alive
        True Path Length (mm) :             4.64e-15
        Stepping Control      :                    0
        Mass (GeV)   :                    0
        Charge (eplus)   :                    0
        MagneticMoment   :                    0
                :  =                    0*[e hbar]/[2 m]
        Position - x (mm)   :                 84.1
        Position - y (mm)   :                 -182
        Position - z (mm)   :                 44.4
        Time (ns)           :                  2.2
        Proper Time (ns)    :                    0
        Momentum Direct - x :                 0.46
        Momentum Direct - y :                0.717
        Momentum Direct - z :                0.524
        Kinetic Energy (MeV):                0.016
        Polarization - x    :                    0
        Polarization - y    :                    0
        Polarization - z    :                    0
        Touchable (pointer) :             0xc8ab70

    ++List of secondaries generated (x,y,z,kE,t,PID):  No. of secodaries = 0

 >>AlongStepDoIt (after all invocations):
    ++List of invoked processes 
      1) Transportation

    ++G4Step Information 
      Address of G4Track    : 0x19666c0
      Step Length (mm)      : 4.643365327944604e-15
      Energy Deposit (MeV)  : 0
      -----------------------------------------------------------------------
        StepPoint Information               PreStep            PostStep
      -----------------------------------------------------------------------
         Position - x (mm)   :    84.08523386931844   84.08523386931844
         Position - y (mm)   :     -181.75378512735    -181.75378512735
         Position - z (mm)   :     44.4354460094737    44.4354460094737
         Global Time (ns)    :    2.201048285186674   2.201048285186674
         Local Time (ns)     :    2.201048285186674   2.201048285186674
         Proper Time (ns)    :                    0                   0
         Momentum Direct - x :   0.4601418205088121  0.4601418205088121
         Momentum Direct - y :   0.7169432097626749  0.7169432097626749
         Momentum Direct - z :   0.5237002377257712  0.5237002377257712
         Momentum - x (MeV/c): 0.0073622691281409940.007362269128140994
         Momentum - y (MeV/c):   0.0114710913562028  0.0114710913562028
         Momentum - z (MeV/c):  0.00837920380361234 0.00837920380361234
         Total Energy (MeV)  :                0.016               0.016
         Kinetic Energy (MeV):                0.016               0.016
         Velocity (mm/ns)    :           299.792458          299.792458
         Volume Name         :            physiSkin           physiSkin
         Safety (mm)         :                5e-10               5e-10
         Polarization - x    :                    0                   0
         Polarization - y    :                    0                   0
         Polarization - Z    :                    0                   0
         Weight              :                    1                   1
         Step Status         :           Geom Limit          Geom Limit
         Process defined Step:       Transportation      Transportation
      -----------------------------------------------------------------------

    ++List of secondaries generated (x,y,z,kE,t,PID):  No. of secodaries = 0

 >>PostStepDoIt (process by process):    Process Name = Transportation

    ++G4Step Information 
      Address of G4Track    : 0x19666c0
      Step Length (mm)      : 4.643365327944604e-15
      Energy Deposit (MeV)  : 0
      -----------------------------------------------------------------------
        StepPoint Information               PreStep            PostStep
      -----------------------------------------------------------------------
         Position - x (mm)   :    84.08523386931844   84.08523386931844
         Position - y (mm)   :     -181.75378512735    -181.75378512735
         Position - z (mm)   :     44.4354460094737    44.4354460094737
         Global Time (ns)    :    2.201048285186674   2.201048285186674
         Local Time (ns)     :    2.201048285186674   2.201048285186674
         Proper Time (ns)    :                    0                   0
         Momentum Direct - x :   0.4601418205088121  0.4601418205088121
         Momentum Direct - y :   0.7169432097626749  0.7169432097626749
         Momentum Direct - z :   0.5237002377257712  0.5237002377257712
         Momentum - x (MeV/c): 0.0073622691281409940.007362269128140994
         Momentum - y (MeV/c):   0.0114710913562028  0.0114710913562028
         Momentum - z (MeV/c):  0.00837920380361234 0.00837920380361234
         Total Energy (MeV)  :                0.016               0.016
         Kinetic Energy (MeV):                0.016               0.016
         Velocity (mm/ns)    :           299.792458          299.792458
         Volume Name         :            physiSkin               World
         Safety (mm)         :                5e-10               5e-10
         Polarization - x    :                    0                   0
         Polarization - y    :                    0                   0
         Polarization - Z    :                    0                   0
         Weight              :                    1                   1
         Step Status         :           Geom Limit          Geom Limit
         Process defined Step:       Transportation      Transportation
      -----------------------------------------------------------------------

    ++G4ParticleChange Information 
      -----------------------------------------------
        G4ParticleChange Information  
      -----------------------------------------------
        # of 2ndaries       :                    0
      -----------------------------------------------
        Energy Deposit (MeV):                    0
        Non-ionizing Energy Deposit (MeV):                    0
        Track Status        :                Alive
        True Path Length (mm) :             4.64e-15
        Stepping Control      :                    0
        Mass (GeV)   :                    0
        Charge (eplus)   :                    0
        MagneticMoment   :                    0
                :  =                    0*[e hbar]/[2 m]
        Position - x (mm)   :                 84.1
        Position - y (mm)   :                 -182
        Position - z (mm)   :                 44.4
        Time (ns)           :                  2.2
        Proper Time (ns)    :                    0
        Momentum Direct - x :                 0.46
        Momentum Direct - y :                0.717
        Momentum Direct - z :                0.524
        Kinetic Energy (MeV):                0.016
        Polarization - x    :                    0
        Polarization - y    :                    0
        Polarization - z    :                    0
        Touchable (pointer) :             0xc8ac20

    ++List of secondaries generated (x,y,z,kE,t,PID):  No. of secodaries = 0

 **PostStepDoIt (after all invocations):
    ++List of invoked processes 
      1) Transportation
      2) LowEnPhotoElec (Forced)

    ++G4Step Information 
      Address of G4Track    : 0x19666c0
      Step Length (mm)      : 4.643365327944604e-15
      Energy Deposit (MeV)  : 0
      -----------------------------------------------------------------------
        StepPoint Information               PreStep            PostStep
      -----------------------------------------------------------------------
         Position - x (mm)   :    84.08523386931844   84.08523386931844
         Position - y (mm)   :     -181.75378512735    -181.75378512735
         Position - z (mm)   :     44.4354460094737    44.4354460094737
         Global Time (ns)    :    2.201048285186674   2.201048285186674
         Local Time (ns)     :    2.201048285186674   2.201048285186674
         Proper Time (ns)    :                    0                   0
         Momentum Direct - x :   0.4601418205088121  0.4601418205088121
         Momentum Direct - y :   0.7169432097626749  0.7169432097626749
         Momentum Direct - z :   0.5237002377257712  0.5237002377257712
         Momentum - x (MeV/c): 0.0073622691281409940.007362269128140994
         Momentum - y (MeV/c):   0.0114710913562028  0.0114710913562028
         Momentum - z (MeV/c):  0.00837920380361234 0.00837920380361234
         Total Energy (MeV)  :                0.016               0.016
         Kinetic Energy (MeV):                0.016               0.016
         Velocity (mm/ns)    :           299.792458          299.792458
         Volume Name         :            physiSkin               World
         Safety (mm)         :                5e-10               5e-10
         Polarization - x    :                    0                   0
         Polarization - y    :                    0                   0
         Polarization - Z    :                    0                   0
         Weight              :                    1                   1
         Step Status         :           Geom Limit          Geom Limit
         Process defined Step:       Transportation      Transportation
      -----------------------------------------------------------------------

    ++List of secondaries generated (x,y,z,kE,t,PID):  No. of secodaries = 0
      [Note]Secondaries from AlongStepDoIt included.

    ++G4Track Information 
      -----------------------------------------------
        G4Track Information  
      -----------------------------------------------
        Step number         :                    9
        Position - x (mm)   :                 84.1
        Position - y (mm)   :                 -182
        Position - z (mm)   :                 44.4
        Global Time (ns)    :                  2.2
        Local Time (ns)     :                  2.2
        Momentum Direct - x :                 0.46
        Momentum Direct - y :                0.717
        Momentum Direct - z :                0.524
        Kinetic Energy (MeV):                0.016
        Polarization - x    :                    0
        Polarization - y    :                    0
        Polarization - z    :                    0
        Track Length        :                  660
        Track ID #          :                    1
        Parent Track ID #   :                    0
        Next Volume         :                World 
        Track Status        :                Alive
        Vertex - x (mm)     :                    0
        Vertex - y (mm)     :                 -236
        Vertex - z (mm)     :                  694
        Vertex - Px (MomDir):                0.126
        Vertex - Py (MomDir):                0.081
        Vertex - Pz (MomDir):               -0.989
        Vertex - KineE (MeV):                0.016
        Creator Process     :      Event Generator
      -----------------------------------------------

(sorry for the length of the output, but I don't know what might be an important part of the output). The next steps are repeats of these two, with everything exactly the same but the step numbers. To the best of my knowledge, there are no geometry overlaps (I checked with DAVID) and I have been using this simulation geometry for a long time. The only thing that changed recently is that I upgraded to the new patch 2 of 9.2. Can anybody give me an idea of what I could try to avoid/fix this or let me know if you need me to try anything different and provide the output here?

Thanks! Ioannis

1 Question: Re: Same two steps repeat again and again   (Gabriele Cosmo - Sep 01, 04:37)
(_ Question: Re: Same two steps repeat again and again   (Ioannis Sechopoulos - Sep 01, 06:55)
(_ More: Re: Same two steps repeat again and again   (Gabriele Cosmo - Sep 01, 07:06)
(_ More: Re: Same two steps repeat again and again   (Ioannis Sechopoulos - Sep 01, 15:16)
(_ More: Re: Same two steps repeat again and again   (Gabriele Cosmo - Sep 02, 02:57)
(_ None: Re: Same two steps repeat again and again   (Robert Penny - Sep 30, 14:49)
(_ More: Re: Same two steps repeat again and again   (Gabriele Cosmo - Sep 30, 15:24)
(_ Question: Re: Same two steps repeat again and again   (Ron Mathis - Oct 02, 07:11)
(_ Feedback: Re: Same two steps repeat again and again   (Gabriele Cosmo - Oct 05, 01:19)
Question Do user trajectories work?  by Robert Penny <Robert Penny>,   Aug 25, 15:05
I'm writing code to try and install both custom track information and a custom trajectory. I install these in my TrackingAction code:

void
BS_TrackingAction::PreUserTrackingAction (const G4Track * aTrack)
{
#ifdef G4_BS_INSTALL_USER_TRACK_INFORMATION
  // Attach some additional information to the track
  if (aTrack->GetUserInformation () == 0)
    {
      G4cout 
	<< "BS_TrackingAction::PreUserTrackingAction "
	<< "BS_TrackInformation attached." << G4endl;

      BS_TrackInformation *infoNew = new BS_TrackInformation ();
      ((G4Track *) aTrack)->
	SetUserInformation ((G4VUserTrackInformation *) infoNew);
    }
#endif

  // Also install a custom trajectory object

#ifdef G4_BS_INSTALL_CUSTOM_TRAJECTORY
  G4VTrajectory *trj;
  trj = new BS_Trajectory( aTrack );
  fpTrackingManager->SetTrajectory ((G4VTrajectory *)trj);
#endif
  fpTrackingManager->SetStoreTrajectory (1);
}

However, I don't see any evidence that my custom trajectory is being installed. Furthermore, digging into the GEANT library source code, I don't see how a custom trajectory can ever be used. Note how in the G4TrackingManager::ProcessOneTrack code, the fpTrajectory pointer is zeroed out prior to the case statement assigning one of the standard trajectories.

//////////////////////////////////////////////////////////////// void G4TrackingManager::ProcessOneTrack(G4Track* apValueG4Track) //////////////////////////////////////////////////////////////// {

  // Receiving a G4Track from the EventManager, this funciton has the
  // responsibility to trace the track till it stops.
  fpTrack = apValueG4Track;
  EventIsAborted = false;

  // Clear 2ndary particle vector
  //  GimmeSecondaries()->clearAndDestroy();    
  //  std::vector<G4Track*>::iterator itr;
  size_t itr;
  //  for(itr=GimmeSecondaries()->begin();itr=GimmeSecondaries()->end();itr++){ 
  for(itr=0;itr<GimmeSecondaries()->size();itr++){ 
     delete (*GimmeSecondaries())[itr];
  }
  GimmeSecondaries()->clear();  

  if(verboseLevel>0 && (G4VSteppingVerbose::GetSilent()!=1) ) TrackBanner();

  // Give SteppingManger the pointer to the track which will be tracked 
  fpSteppingManager->SetInitialStep(fpTrack);

  // Pre tracking user intervention process.
  fpTrajectory = 0;
  if( fpUserTrackingAction != NULL ) {
     fpUserTrackingAction->PreUserTrackingAction(fpTrack);
  }
#ifdef G4_STORE_TRAJECTORY
  // Construct a trajectory if it is requested
  if(StoreTrajectory&&(!fpTrajectory)) { 
    // default trajectory concrete class object
    switch (StoreTrajectory) {
    default:
    case 1: fpTrajectory = new G4Trajectory(fpTrack); break;
    case 2: fpTrajectory = new G4SmoothTrajectory(fpTrack); break;
    case 3: fpTrajectory = new G4RichTrajectory(fpTrack); break;
    }
  }
#endif
...

Am I missing something? If a custom trajectory is installed does this section of code get bypassed somehow?

For reference, I'm running Geant 4.9.2-r2 under Gentoo.

Thanks,

-Rob

1 None: Re: Do user trajectories work?   (Robert Penny - Aug 25, 15:44)
None Storing Path Lengths  by <jdswado@gatech.edu>,   Aug 24, 05:41
Hi all,

I've got a scintillation detector model and I'm interested in seeing how many times the optical photons bounce around inside of the detector before escaping or being absorbed. Therefore I'd like to do something like GetStepLength() for each step of an optical photon, add them up, and store that value in an array of many similar values for other optical photons.

My problem is trying to tell Geant when to start counting the pathlength anew for a new optical photon. In other words, after one photon has "died" how can I say: add all the step lengths you have up and store that value, reset to zero and start counting again for a new optical photon? Currently I'm just counting all the step lengths from many photons because I don't know how to make Geant distinguish between or "name" seperate photons and store their calculations seperately.

Ideas?

Thanks!

1 None: RE: Storing Path Lengths   (Asai, Makoto - Aug 24, 06:07)
2 None: Re: Storing Path Lengths   (michel maire - Aug 24, 13:02)
3 Feedback: Re: Storing Path Lengths   (Gumplinger Peter - Aug 25, 11:50)
Question Finding "mother particle"  by Kyrre Ness Sjøbæk <Kyrre Ness Sjøbæk>,   Jul 31, 07:17
Hello!

I am currently simulating an experimental setup with a Sr90 source. To do this, I use G4RadioactiveDecay, and a general particle source.

However, as 90Sr has a beta-decay to 90Y which again has another beta-decay (and then there are some gamma's etc), I get two betas per event. As I am using a G4PSEnergyDeposit to generate hits, this means that the energy in one single "real" hit could be over-estimated if both electrons hit the same SD in the same event, or the triggering (done in an external program by requiring that the energy deposit in a scintilator has to be larger than a set value) could be wrong if i get one electron in the trigger, and one in the "device under test".

Thus I have started to implement a G4VSDFilter (*very* much not finished!), shown below:

#ifndef FilterMotherIon_hh
#define FilterMotherIon_hh

#include "G4VSDFilter.hh"
#include "globals.hh"

/*
 * Filter for a simple detector, in order to filter
 * hits depending on the originally decaying ion.
 *
 *
 */

class FilterMotherIon : public G4VSDFilter {
public:
  FilterMotherIon(G4String name, G4int z, G4int a) :
    G4VSDFilter(name), Z(z), A(a) {};

  G4bool Accept(const G4Step* origStep) const;

private:
  G4int Z;
  G4int A;
};

#endif

#include "FilterMotherIon.hh"
#include "G4Track.hh"
#include "G4ParticleDefinition.hh"

G4bool FilterMotherIon::Accept(const G4Step* origStep) const {
  /*
   * Run down the particle tree until either condition is met:
   * - Correct particle is found (accept)
   * - Primary particle is found (not found - reject)
   *
   * Remark: As the correct particle may be the primary particle,
   * check (1) before (2)!
   */
  while (true) {
    G4ParticleDefinition* thisDef = origStep->GetTrack()->GetDefinition();
    if (thisDef->GetAtomicNumber() == Z && thisDef->GetAtomicMass() == A) {
      //Gold!
      //G4cout << "GOLD!" << G4endl;
      return true;
    }
    else {
      //Dig deeper?
      G4int parentID = origStep->GetTrack()->GetParentID();

      G4cout << parentID << G4endl;
    }
  }
}

However, while I can get the ID of the parent track, I do not know how to translate this into a G4ParticleDefinition of the parent track, which I need to do recursively...

--- Kyrre Ness Sjøbæk (Geant4 novice)

1 Feedback: Re: Finding   (Gumplinger Peter - Jul 31, 20:07)
(_ Feedback: Re: Finding   (Gumplinger Peter - Jul 31, 20:13)
(_ None: Re: Finding (grand^n)mother particle of a track [solved]   (Kyrre Ness Sjøbæk - Aug 01, 05:57)
None Killing Photons  by Greg Damhorst <Greg Damhorst>,   Jul 24, 03:16
Hello, I'm a new GEANT user and I'm trying to do a very simple simulation of optical photons on a scintillating fiber. To do this, I create optical photons isotropically at the center of a single-clad fiber using G4ParticleGun.

What I found is that somewhere between the 20th and 30th photon in a run of 100, I hit a "sweet-spot" momentum direction where my photon bounces around inside the fiber and never leaves (thus the program continues to calculate millions of steps for a single photon and, as far as I can tell, will never stop).

I'd like to kill a photon like this (say, after a certain number of steps) so my program can move on and calculate the next photon trajectory. Any ideas on the simplest way to do this?

I've tried G4UserLimits and G4UserSpecialCuts in DetectorConstruction and PhysicsList, respectively, as an example I found seemed to describe. However, this compiles successfully and then can't run (I get errors telling me I need to construct electrons!), so if you suggest these methods please be very specific about what I need.

I've also tried to set an absorption length in the fiber material, but when I do this the application ignores the boundary process/refractive indexes I've set and just shoots photons straight through my material.

Any insight is certainly appreciated.

Greg Damhorst

1 Disagree: Re: Killing Photons   (Gumplinger Peter - Jul 24, 15:01)
(_ None: Re: Killing Photons   (Greg Damhorst - Jul 25, 06:41)
Question Track modeling, example N03  by Daniel Egger <Daniel Egger>,   Jul 14, 13:14
Dear All,

I'm trying to reproduce some animations like in example N03 however I am facing a few problems:

When runing the .loop:

/vis/ogl/set/startTime {startTime} ns {timeRange} ns

My tracks do not seem to be sliced up. I only see the light cone propagating with no other tracks. I'm not very sure where the errors are comming from so I can't be very specifique. However here are a few points I made sure:

- I checked the timing to make sure that I am looking at the right time interval.

- I made sure I was using G4RichTrajectory.

I wanted to compare my TrackingAction with ExN03 but there isn't one so I am a little confused.

Does someone have any ideas on what could be wrong?

Thank you for your help

Cheers, Daniel

None Tracking output problem  by Collin Reynolds <Collin Reynolds>,   Jul 13, 11:05
I have created a UserSteppingAction class, and I'm outputting the track location from the step object to an external text file. I print out the track ID and the parent track ID, and I noticed that I'm missing some things. It will print the location of Track #1 for awhile, and then Track #71 with parent track #1, and then track #77 with parent track #72 without an actual track #72 (this is just an example). So I'm wondering why I'm not getting these other tracks.

Thanks, Collin Reynolds

1 Feedback: Re: Tracking output problem   (Gumplinger Peter - Jul 13, 11:20)
None GPS source energy sampling  by Shawn Kang <Shawn Kang>,   Jul 09, 12:44
Hello

I am using the GPS to specify the integral spectrum in a macro like below.

/gps/ene/type Arb

/gps/hist/type arb

/gps/hist/point 0.1 9890000

/gps/hist/point 0.2 9160000

/gps/hist/point 0.3 8420000

/gps/hist/point 0.5 7160000

/gps/hist/inter Log

I would like to see what energy is sampled for each event at the starting point. Please help.

Thanks,

Shawn

1 Ok: Re: GPS source energy sampling   (Shawn Kang - Jul 09, 15:23)
Question help with stuck track work around  by Jacob Castilow <Jacob Castilow>,   Jul 08, 12:15
Hi, I'm using Geant4 V9.1, yet I still get stuck tracks. I'm using a cylindrical calorimeter setup. It's built using G4Replica, if that helps. I consistently get stuck tracks in the detector and setting a minimum kinetic energy thinking the particle is at rest would do the trick, but rather I think Geant4 already kills at rest particles that don't have further processes. If someone knows how to work around this that would be really helpful. I saw a patch for the ATLAS program that fixed this, but ... I'm still getting a problem. Thanks for any help in advance

Question stopping simulation once reached a condition  by Antonio De Simone <Antonio De Simone>,   Jun 25, 08:31
I'm a novice user of geant4, for working reason i'm developing a simulation about a Medical Linac and i would like to know how to stop the simulation once i accumulated a predefined energy deposition in a voxel. Thank you for all your help.

Best regards

1 Idea: Re: stopping simulation once reached a condition   (Jacob Castilow - Jul 09, 11:30)
Question Memory Bloating on Hit Tracking and Sensitive Detector  by Kyle Pastor <Kyle Pastor>,   Jun 22, 07:37
Hello, I am fairly new and am simulating a simple geometry tracking photoneutrons. The problem I am having is that after every run the % memory consumption does not fall. So as I do multiple runs the memory consumption increments as a result. This of course means that the computer eventually freezes and the game is over. I have narrowed it down to my Hit class. It looks like the hit collections are not deallocated after the event is finished. I was wondering if there is any tricky implementation of G4Allocator that I have done wrong or if anyone has any ideas regarding this problem.

Thanks in advance for your time and help,

-Kyle

Question how to write binary output files  by Magda Constantin <Magda Constantin>,   Jun 17, 08:30
Dear All,

I am stuck with the following problem. I have an application which produces phase space files containing the position, direction, energy and type of the particles at a certain plane defined in DetectorConstruction.cc. This output file is an ASCII file.

I need to save this information in a binary output file instead. Does anybody know how this can be achieved in Geant4.9.2.p01? Is there an example that I could use? Thank you in advance for your help.

Sincerely,

Magda

Question How to visualize only the hit?  by Pradip Datta <Pradip Datta>,   Jun 10, 06:33
Hi all,

Is it possible to visualize only the interaction points inside a detector vol without drawing the tracks?

With best regards,

Pradip

1 None: Re: How to visualize only the hit?   (sauvestre - Jun 10, 06:48)
(_ Ok: Re: How to visualize only the hit?   (Pradip Datta - Jun 12, 00:18)
Sad replicas+sensitive detectors  by Eleni <Eleni>,   Jun 07, 06:32
Hello all I ran into a problem with replicas and how do I determine that each slice of my block is an individual sensitive detector. Searching the forum I noticed that I should use :

---------------------------------------------------------------
// get info which detector box was hit
  G4Step aStep;
  G4int repDepth = aStep->GetPreStepPoint()->GetTouchable()->GetHistory()->GetDepth()
  G4int repNrX   = aStep->GetPreStepPoint()->GetTouchable()->GetHistory()->GetReplicaNo(repDepth-1);
  G4int repNrY   = aStep->GetPreStepPoint()->GetTouchable()->GetHistory()->GetReplicaNo(repDepth);
  G4int repNrZ   = aStep->GetPreStepPoint()->GetTouchable()->GetHistory()->GetReplicaNo(repDepth-2);
------------------------------------------------------------------ 

The problem is that I don't know how to deal with that. Is there any example in G4 that uses the code above?

Thanks in advance

1 Feedback: Re: replicas+sensitive detectors   (Gumplinger Peter - Jun 08, 11:46)
None Identical track data from different simulations  by Gaëlle Angellier <Gaëlle Angellier>,   May 28, 17:14
Hello,

I am facing a weird problem using GEANT4 (geant4-09-01-patch-03).
I am simulating a protontherapy facility just like the hadrontherapy example available with the GEANT4 package.
I want to launch randomly created particles and to retrieve the characteristics of the particles at a particular point into the geometry.

Therefore I follow several steps:
1. I set the internal seed for the ranecu random engine (e.g. setTheSeed(0)).
2. I compile and run the application.
3. I launch 200 000 (or more) particles (IDLE > /run/beamOn 200000).
4. Within the SteppingAction class, I check if the particle of interest reached the particular point of the geometry and if so, I save its name, parentId, position, momentum and kinetic energy to a file.
5. Once the run is over, I stop the application (IDLE > exit), I set the internal seed to a different value (setTheSeed(2)) and I compile and run the application again
6. By the end I compare the two files containing the particles properties to each other.

The problem I am facing is that some of the particles from the different files are exactly identical.

I managed to reproduce the issue with the Hadrontherapy example althought I had to modify a little bit the code:

#### FILE Hadrontherapy.cc:
I replaced

  // Set the Random engine

  CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine());

with

  // Set the Random engine

  CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine());
  CLHEP::HepRandom::setTheSeed(2);

in order to manually set the internal seed.


#### FILE HadrontherapySteppingAction.cc
I replaced

  // Electromagnetic and hadronic processes of primary particles in the phantom
 
 if ((aStep -> GetTrack() -> GetTrackID() == 1) &&
    (aStep -> GetTrack() -> GetVolume() -> GetName() == "PhantomPhys") &&
    (aStep -> GetPostStepPoint() -> GetProcessDefinedStep() != NULL))
        {
          G4String process = aStep -> GetPostStepPoint() ->
        GetProcessDefinedStep() -> GetProcessName();
 
          if ((process == "Transportation") || (process == "StepLimiter")) {;}
          else {
        if ((process == "msc") || (process == "hLowEIoni") || (process == "hIoni"))
          {
                    runAction -> AddEMProcess();
          }
        else
                 {
           runAction -> AddHadronicProcess();

                   if ( (process != "LElastic") && (process != "ProtonInelastic") && (process != "hElastic") )
             G4cout << "Warning! Unknown proton process: "<< process << G4endl;
         }
          }
        }

with

    G4double prePointX = aStep->GetPreStepPoint() ->GetPosition().getX();
    G4double postPointX = aStep->GetPostStepPoint()->GetPosition().getX();
    G4Track* track = aStep -> GetTrack();
   
    // Retrieving the particles properties at X = -1900
    if (prePointX <= -1900 && postPointX > -1900)
    {
        G4String name = track -> GetDefinition()-> GetParticleName();
       
        G4bool isPrimary;
        if ( track -> GetParentID() != 0 )
            isPrimary = true;
        else
            isPrimary = false;

        G4double xP = track -> GetPosition().getX();
        G4double yP = track -> GetPosition().getY();
        G4double zP = track -> GetPosition().getZ();
       
        G4double zM = track -> GetMomentumDirection().getZ();
        G4double xM = track -> GetMomentumDirection().getX();
        G4double yM = track -> GetMomentumDirection().getY();
       
        G4double energy = track -> GetKineticEnergy();
       
        G4int trackId = track -> GetTrackID();
   
        // Saving particle status to a file
        std::ofstream outFile;
        outFile.open ("/home/utilisateur/TEST/hadrontherapy/particlesStatus.csv", std::ofstream::app);
        outFile << name << "," << isPrimary << "," << xP << "," << yP << "," << zP << "," << xM << "," << yM << "," << zM << "," << energy << "\n";
        outFile.close();
   
        // To accelerate the simulation
        track->SetTrackStatus(fKillTrackAndSecondaries );
    }

in order to save the particles properties at a X coordinate of -1900. (I do not care of the phantom !!!)

By the end I am using the following macro file :

    /control/verbose 1
    /tracking/verbose 0
    /run/verbose 0
    /event/verbose 0

    # SETTING FOR THE PHYSICS MODELS
    /physics/addPhysics Decay
    /physics/addPhysics EM-Photon-EPDL
    /physics/addPhysics EM-Electron-EEDL
    /physics/addPhysics EM-Positron-Standard
    /physics/addPhysics EM-HadronIon-LowE
    /physics/addPhysics EM-Muon-Standard
    /physics/addPhysics HadronicEl-HadronIon-LElastic
    /physics/addPhysics HadronicInel-ProtonNeutron-LEP
    /physics/addPhysics HadronicInel-Ion-LEP
    /physics/addPhysics HadronicInel-Pion-LEP
    /physics/addPhysics HadronicAtRest-MuonMinus-Capture

    # i add to initialize the GEANT4 kernel manually
    /run/initialize

    /run/beamOn 200000


Here are the results of the comparison of the two files generated for seeds 0 and 2 (200000 particles generated for eached simulation):

#### File 01 :
Seed : 0
Number of particles retrieved : 66801
sample :
line.836 - unique : "proton,0,-1899.92,0.176738,-4.19289,0.999802,0.0190303,-0.0058769,61.8651"
line.837 - unique : "proton,0,-1899.94,7.2854,4.45091,0.999976,0.00599902,0.00333688,61.8491"
line.838 - unique : "proton,0,-1899.94,0.25033,-5.00707,0.999988,0.001683,-0.00468154,62.1691"
line.839 - identical : "proton,0,-1899.99,-2.74354,-0.371709,0.999977,-0.0066578,-0.00120971,61.6171"
line.840 - identical : "proton,0,-1900,-2.51559,10.5889,0.999507,0.0113911,-0.0292686,37.6647"
line.841 - identical : "proton,0,-1899.98,3.19159,10.5675,0.999918,-0.00566967,0.0115149,61.5095"
line.842 - identical : "proton,0,-1899.97,7.62178,-4.92185,0.999858,0.0145265,-0.00858155,61.2452"

#### File 02 :
Seed : 2
Number of particles retrieved : 67034
sample :
line.18833 - unique : "proton,0,-1899.93,3.95119,-2.77882,0.999983,0.00444051,-0.00380069,61.4057"
line.18834 - unique : "proton,0,-1899.93,-3.49538,9.41306,0.999918,0.00556569,0.0115234,61.1341"
line.18835 - unique : "proton,0,-1899.92,19.1916,-1.34642,0.999412,0.0338261,-0.00559045,42.6244"
line.18836 - identical : "proton,0,-1899.99,-2.74354,-0.371709,0.999977,-0.0066578,-0.00120971,61.6171"
line.18837 - identical : "proton,0,-1900,-2.51559,10.5889,0.999507,0.0113911,-0.0292686,37.6647"
line.18838 - identical : "proton,0,-1899.98,3.19159,10.5675,0.999918,-0.00566967,0.0115149,61.5095"

Number of identical particles : 48199


You can notice that the order of the identical particles is exactly the same (e.g. particle line.839 is identical to particle line.18836; then particle line.840 is identical to particle line.18837 etc).

I am running GEANT4 (geant4-09-01-patch-03) on Ubuntu 8.10.
I have been wondering if there could be some memory leak when using the particles stacks which could cause particles generated during old simulations to appear again in other simulations.

I launched the applications one after the other (so there can't be multi core mistakes) and I tried to restart my computer between the two simulations without solving the issue.

Does anybody have encountered that kind of problem ?
Any help would be very appreciated !!!!

Regards,
Gaëlle Angellier
1 Idea: Re: Identical track data from different simulations   (Tom Roberts - May 28, 18:12)
(_ Question: Re: Identical track data from different simulations   (Gaëlle Angellier - May 29, 10:48)
(_ None: Re: Identical track data from different simulations   (Paul Nicholas Colin Gloster - May 31, 12:11)
(_ Ok: Re: Identical track data from different simulations   (Gaëlle Angellier - Oct 26, 12:12)
None netron detector EventAction problem  by Davinder Siwal <Davinder Siwal>,   23 May, 2009
Hii all

i am trying to simulate the neutron detector array to calculate the cross talk and following i am showing the the EventAction.cc

#include "psimNeutronDetector1Hit.hh"
#include "psimNeutronDetector2Hit.hh"
#include "psimEventAction.hh"
//#include "psimEventActionMessenger.hh"
#ifdef G4ANALYSIS_USE
#include "psimAnalysisManager.hh"
#endif // G4ANALYSIS_USE

#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4HCofThisEvent.hh"
#include "G4VHitsCollection.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4VVisManager.hh"
#include "G4SDManager.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"

psimEventAction::psimEventAction()
{
  G4String colName;
  G4SDManager* SDman = G4SDManager::GetSDMpointer();
   ND1HCID = SDman->GetCollectionID(colName="NeutronDetector1");
   ND2HCID = SDman->GetCollectionID(colName="NeutronDetector2");

#ifdef G4ANALYSIS_USE
  plotter = 0;
  tuple = 0;
  nd1Hits = nd2Hts = 0;

  // Do some analysis

  psimAnalysisManager* analysisManager = psimAnalysisManager::getInstance();
  IHistogramFactory* hFactory = analysisManager->getHistogramFactory();

  if (hFactory)
  {
    // Create some histograms
    nd1Hits = hFactory->createHistogramID("Neutron Detector 1 Hits",10,0,10);
    nd2Hits = hFactory->createHistogramID("Neutron Detector 2 Hits",10,0,10);   

    plotter = analysisManager->createPlotter();
    if (plotter)
    {
        plotter->createRegions(1,2);
        plotter->region(0)->plot(*nd1Hits);
        plotter->region(1)->plot(*nd2Hits);  

       plotter->show();
     }
  }

  // Create a Tuple

  ITupleFactory* tFactory = analysisManager->getTupleFactory();
  if (tFactory)
  {
    tuple = tFactory->create("myhisto","myhisto","int nd1Hits, nd2Hits","");

  }
#endif // G4ANALYSIS_USE
}

psimEventAction::~psimEventAction() {

}

void psimEventAction::BeginOfEventAction(const G4Event*) { }

void psimEventAction::EndOfEventAction(const G4Event* evt) {

    G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
    psimNeutronDetector1HitsCollection* ND1HC = NULL;
    psimNeutronDetector2HitsCollection* ND2HC = NULL;

// A01NeutrondetectorHitsCollection* ND1HC = 0;

  if(HCE)
  {
     ND1HC = (psimNeutronDetector1HitsCollection*)(HCE->GetHC(ND1HCID));
     ND2HC = (psimNeutronDetector2HitsCollection*)(HCE->GetHC(ND2HCID));

  }

#ifdef G4ANALYSIS_USE
  // Fill some histograms

  if(ND1HC)
  {
     int n_hit1 = ND1HC->entries();
     nd1Hits->Fill(n_hit1);

  }

  if(ND2HC)
  {
   int n_hit2 = ND2HC->entries();
   nd2Hits->Fill(n_hit2);

  }

  // Fill the tuple

  if (tuple)
  {
    if(ND1HC) tuple->fill(0,ND1HC->entries());
    if(ND2HC) tuple->fill(1,ND2HC->entries()); 

  }
  if (plotter) plotter->refresh();
#endif // G4ANALYSIS_USE

 when i am compliling the program it is not recogonising the psimNeutronDetector1HitsCollection and psimNeutronDetector2HitsCollection  what should i do to remove this error 

did anybody knows the answer...............

1 None: Re: netron detector EventAction problem   (Paul Nicholas Colin Gloster - May 26, 12:04)
Question How to simulate neutron generation process?  by Eric Lu <Eric Lu>,   18 May, 2009
I am just learning Geant4 and has no background in high energy physics. At this moment, one of my project demands to simulate the process: accelerate deuterons into a tritium target in the neutron generator, thus produce coincident neutrons and alpha particles in opposite directions. So my question is, how to define this process (define energy of deuterons and get direction and velocity of neutrons, etc.). I am new to physics and Geant4 so I don't know if anyone really understand my question. Thanks very much.

Question Final step information for parent particle  by Cristian Bungau <Cristian Bungau>,   18 May, 2009
Hi,

I have to find the last step information of the parent particle for certain muon tracks, especially the final energy. I know that G4ParticleChange holds the information of the final values of the kinematic variables for parent particles, but I don't know how to implement or use this class.

Is there a simple way of accessing the final step variables of parent particles, or does anyone know an example I could use to implement the G4ParticleChange class into my code?

Thank you,

Cristian

1 None: Re: Final step information for parent particle   (Tom Roberts - 18 May, 2009)
(_ Question: Re: Final step information for parent particle   (Cristian Bungau - 19 May, 2009)
(_ None: Re: Final step information for parent particle   (Tom Roberts - 19 May, 2009)
(_ None: Re: Final step information for parent particle   (Tom Roberts - 19 May, 2009)
(_ Ok: Re: Final step information for parent particle   (Cristian Bungau - 19 May, 2009)
(_ Feedback: Re: Final step information for parent particle   (Gumplinger Peter - 19 May, 2009)
(_ Question: Re: Final step information for parent particle   (Cristian Bungau - 20 May, 2009)
(_ Ok: Re: Final step information for parent particle   (Cristian Bungau - 20 May, 2009)
Question program crashes with undefined step status & process defined step  by Cristian Bungau <Cristian Bungau>,   15 May, 2009
Hi,

My code crashes after one event with the following error:

 *** Break *** segmentation violation
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
Attaching to program: /proc/819/exe, process 819
[Thread debugging using libthread_db enabled]
[New Thread -1208576304 (LWP 819)]
0x006c640e in __kernel_vsyscall ()
#1  0x0348b463 in __waitpid_nocancel () from /lib/libc.so.6
#2  0x03430cdf in do_system () from /lib/libc.so.6
#3  0x007601dd in system () from /lib/libpthread.so.0
#4  0x00fdb14d in TUnixSystem::Exec () from /home/cb67/root/lib/libCore.so
#5  0x00fe05d7 in TUnixSystem::StackTrace ()
   from /home/cb67/root/lib/libCore.so
#6  0x00fdf5de in TUnixSystem::DispatchSignals ()
   from /home/cb67/root/lib/libCore.so
#7  0x00fdf6ad in SigHandler () from /home/cb67/root/lib/libCore.so
#8  0x00fd8634 in sighandler () from /home/cb67/root/lib/libCore.so
#9  <signal handler called>
#10 0x081fff2b in DMSteppingAction::UserSteppingAction ()
#11 0x088d7088 in G4SteppingManager::Stepping ()
#12 0x088c650d in G4TrackingManager::ProcessOneTrack ()
#13 0x088a0a4e in G4EventManager::DoProcessing ()
#14 0x0836327f in G4RunManager::DoEventLoop ()
#15 0x08362675 in G4RunManager::BeamOn ()
#16 0x083671f2 in G4RunMessenger::SetNewValue ()
#17 0x08a69a11 in G4UIcommand::DoIt ()
#18 0x08a71d26 in G4UImanager::ApplyCommand ()
#19 0x082d184b in G4UIterminal::ExecuteCommand ()
#20 0x082d1390 in G4UIterminal::SessionStart ()
#21 0x081f23cf in main ()
*** glibc detected *** ADSR: double free or corruption (out): 0x095e3520 ***
======= Backtrace: =========
/lib/libc.so.6[0x3463b16]
/lib/libc.so.6(cfree+0x90)[0x3467070]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x2e7a731]
ADSR(_ZN29G4CrossSectionDataSetRegistry5CleanEv+0x26)[0x880a1d6]
ADSR(_ZN29G4CrossSectionDataSetRegistryD1Ev+0x17)[0x880a587]
/lib/libc.so.6(exit+0xe9)[0x34269d9]
/home/cb67/root/lib/libCore.so(_ZN11TUnixSystem4ExitEib+0x93)[0xfdc5b3]
/home/cb67/root/lib/libCore.so(_ZN11TUnixSystem15DispatchSignalsE8ESignals+0x17e)[0xfdf66e]
/home/cb67/root/lib/libCore.so[0xfdf6ad]
/home/cb67/root/lib/libCore.so[0xfd8634]
[0x6c6420]
ADSR(_ZN17G4SteppingManager8SteppingEv+0x448)[0x88d7088]
ADSR(_ZN17G4TrackingManager15ProcessOneTrackEP7G4Track+0x11d)[0x88c650d]
ADSR(_ZN14G4EventManager12DoProcessingEP7G4Event+0x4ce)[0x88a0a4e]
ADSR(_ZN12G4RunManager11DoEventLoopEiPKci+0xaf)[0x836327f]
ADSR(_ZN12G4RunManager6BeamOnEiPKci+0x65)[0x8362675]
ADSR(_ZN14G4RunMessenger11SetNewValueEP11G4UIcommand8G4String+0x292)[0x83671f2]
ADSR(_ZN11G4UIcommand4DoItE8G4String+0x8f1)[0x8a69a11]
ADSR(_ZN11G4UImanager12ApplyCommandEPKc+0x4d6)[0x8a71d26]
ADSR(_ZN12G4UIterminal14ExecuteCommandE8G4String+0x3b)[0x82d184b]
ADSR(_ZN12G4UIterminal12SessionStartEv+0x50)[0x82d1390]
ADSR(main+0x1ff)[0x81f23cf]
/lib/libc.so.6(__libc_start_main+0xdc)[0x3410dec]
ADSR[0x81f1f01]

i used /tracking/verbose 1 to see what is happening at the last step and here is the output:

*********************************************************************************************************
* G4Track Information:   Particle = Pb208[0.0],   Track ID = 12132,   Parent ID = 11381
*********************************************************************************************************

Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
    0  1.567 m  69.944 cm -2.533 m   3.826 eV  0.000 eV  0.000 fm  0.000 fm    shielding    initStep

 >>AlongStepDoIt (after all invocations):
    ++List of invoked processes 
      1) Transportation
      2) msc
      3) ionIoni

    ++G4Step Information 
      Address of G4Track    : 0xd9ce1c8
      Step Length (mm)      : 0.0000010202088467
      Energy Deposit (MeV)  : 0.0000038263436721
      -----------------------------------------------------------------------
        StepPoint Information               PreStep            PostStep
      -----------------------------------------------------------------------
         Position - x (mm)   : 1567.27765963370961801567.2776596336154853
         Position - y (mm)   : 699.4386211998188401699.4386211998308909
         Position - z (mm)   : -2532.7490623218909604-2532.7490623218100154
         Global Time (ns)    : 3162436807.72044229507446293162436807.7204422950744629
         Local Time (ns)     :   0.0000000000000000  0.0000000000000000
         Proper Time (ns)    :   0.0000000000000000  0.0000000661626187
         Momentum Direct - x :  -0.7558429182600837 -0.7558429182600837
         Momentum Direct - y :   0.0969188606897272  0.0969188606897272
         Momentum Direct - z :   0.6475401279910658  0.6475401279910658
         Momentum - x (MeV/c):  -0.9202153549539388 -0.0000000000000000
         Momentum - y (MeV/c):   0.1179957126497015  0.0000000000000000
         Momentum - z (MeV/c):   0.7883600604446994  0.0000000000000000
         Total Energy (MeV)  : 193687.6297092104505282193687.6297053841117304
         Kinetic Energy (MeV):   0.0000038263436721  0.0000000000000000
         Velocity (mm/ns)    :   0.0018844158386698  0.0000000000000000
         Volume Name         :            shielding           shielding
         Safety (mm)         :   0.0000000000000000 21.5478726224121608
         Polarization - x    :   0.0000000000000000  0.0000000000000000
         Polarization - y    :   0.0000000000000000  0.0000000000000000
         Polarization - Z    :   0.0000000000000000  0.0000000000000000
         Weight              :   1.0000000000000000  1.0000000000000000
         Step Status         :            Undefined     AlongStep Proc.
         Process defined Step:            Undefined             ionIoni
      -----------------------------------------------------------------------

    ++List of secondaries generated (x,y,z,kE,t,PID):  No. of secodaries = 0

 **PostStepDoIt (after all invocations):
    ++List of invoked processes 
      1) Transportation
      2) msc

    ++G4Step Information 
      Address of G4Track    : 0xd9ce1c8
      Step Length (mm)      : 0.0000010202088467
      Energy Deposit (MeV)  : 0.0000038263436721
      -----------------------------------------------------------------------
        StepPoint Information               PreStep            PostStep
      -----------------------------------------------------------------------
         Position - x (mm)   : 1567.27765963370961801567.2776596336154853
         Position - y (mm)   : 699.4386211998188401699.4386211998308909
         Position - z (mm)   : -2532.7490623218909604-2532.7490623218100154
         Global Time (ns)    : 3162436807.72044229507446293162436807.7204422950744629
         Local Time (ns)     :   0.0000000000000000  0.0000000000000000
         Proper Time (ns)    :   0.0000000000000000  0.0000000661626187
         Momentum Direct - x :  -0.7558429182600837 -0.7558429182600837
         Momentum Direct - y :   0.0969188606897272  0.0969188606897272
         Momentum Direct - z :   0.6475401279910658  0.6475401279910658
         Momentum - x (MeV/c):  -0.9202153549539388 -0.0000000000000000
         Momentum - y (MeV/c):   0.1179957126497015  0.0000000000000000
         Momentum - z (MeV/c):   0.7883600604446994  0.0000000000000000
         Total Energy (MeV)  : 193687.6297092104505282193687.6297053841117304
         Kinetic Energy (MeV):   0.0000038263436721  0.0000000000000000
         Velocity (mm/ns)    :   0.0018844158386698  0.0000000000000000
         Volume Name         :            shielding           shielding
         Safety (mm)         :   0.0000000000000000 21.5478726224121608
         Polarization - x    :   0.0000000000000000  0.0000000000000000
         Polarization - y    :   0.0000000000000000  0.0000000000000000
         Polarization - Z    :   0.0000000000000000  0.0000000000000000
         Weight              :   1.0000000000000000  1.0000000000000000
         Step Status         :            Undefined     AlongStep Proc.
         Process defined Step:            Undefined             ionIoni
      -----------------------------------------------------------------------

    ++List of secondaries generated (x,y,z,kE,t,PID):  No. of secodaries = 0
      [Note]Secondaries from AlongStepDoIt included.

#Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
    1  1.567 m  69.944 cm -2.533 m   0.000 eV  3.826 eV  1.020 nm  1.020 nm    shielding     ionIoni

 *** Break *** segmentation violation

I noticed the "Undefined" step status and process defined step and I would be very grasteful for any suggestions in getting the code up and running.

Thank you,

Cristian

1 Idea: Re: program crashes with undefined step status & process defined step   (Vladimir Ivanchenko - 18 May, 2009)
(_ None: Re: program crashes with undefined step status & process defined step   (Cristian Bungau - 18 May, 2009)
None Program Crashes when Compton Scatter in Air  by <jdswado@gatech.edu>,   13 May, 2009
Hello all,

I've having an issue with my program that I don't understand. The program runs fine if the Compton scattering process is removed or the material Air is replaced with something else. Other wise it crashes. Therefore I believe there to be some sort of issue with the compton scatter process in air.

Relevant Code:

 -------------------------In DetectorConstruction.cc---------------------
const G4int nEntries = 38;

G4double RefractiveIndex2[nEntries] =
            { 1.00028393, 1.00028332, 1.00028276, 1.00028225, 1.00028177, 1.00028133, 1.00028091, 1.00028053, 1.00028018, 1.00027985, 1.00027954, 1.00027925, 1.00027897, 1.00027872, 1.00027848, 1.00027825, 1.00027804, 1.00027784, 1.00027765, 1.00027747, 1.0002773, 1.00027714, 1.00027698, 1.00027684, 1.0002767, 1.00027657, 1.00027644, 1.00027632, 1.00027621, 1.0002761, 1.000276, 1.0002759, 1.0002758, 1.00027571, 1.00027563, 1.00027554, 1.00027546, 1.00027539};

  G4MaterialPropertiesTable* myMPT2 = new G4MaterialPropertiesTable();
  myMPT2->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex2, nEntries);

 G4double z;
 G4double a;
 G4double density;
  //Air
  G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
  G4Element* O = new G4Element("Oxygen"  , "O", z=8., a= 16.00*g/mole);

  G4Material* Air = new G4Material("Air", density= 0.00129*g/cm3, 2);
  Air->AddElement(N,0.7);
  Air->AddElement(O,0.3);
  Air->SetMaterialPropertiesTable(myMPT2);

---------------------------------------------------------------------

---------------------In PhysicsList.cc-------------------------------

#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"

if (particleName == "gamma") {
      // gamma         
      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
      pmanager->AddDiscreteProcess(new G4ComptonScattering);
      pmanager->AddDiscreteProcess(new G4GammaConversion);

     } else if ........

----------------------------------------------------------------------

Like I said, if I comment out pmanager->AddDiscreteProcess(new G4ComptonScattering) or if I replace air from the logic volumes it is contained in with some other material, this runs fine. But as is this crashes every time.

Any ideas?

Thanks!

1 None: Re: UPDATE   (jdswado@gatech.edu - 17 May, 2009)
(_ Idea: Re: UPDATE   (Vladimir Ivanchenko - 18 May, 2009)
(_ Ok: Resolved   (jdswado@gatech.edu - Jun 11, 12:32)
None Distinguishing between final step  by <jdswado@gatech.edu>,   07 May, 2009
Hello everyone,

My geant application prints out the sum of the energy deposited by the incident particle in a certain volume and this part works fine. However, currently it prints out the sum of the energy deposited in the volume at every step and I really only care about what the total is at the end of the run. Is there a way (in SteppingAction.cc) to tell it to only print this out after the last step of the experiment is run?

Relevant Code:

void SteppingAction::UserSteppingAction(const G4Step* aStep) // was void { G4StepPoint* postPoint = aStep->GetPostStepPoint(); G4VPhysicalVolume* volume = postPoint->GetPhysicalVolume();

if (volume->GetName() != "tracker") return;

 G4double EdepStep = aStep->GetTotalEnergyDeposit();
 TotalEnergyDeposit += EdepStep;

 G4cout << "EnergyDeposited: " << TotalEnergyDeposit << G4endl;
}

So, I'd like the last G4cout statement to only occur if that step is the last one of the experiment.

Thanks greatly for your help!

1 Feedback: Re: Distinguishing between final step   (Gumplinger Peter - 07 May, 2009)
Question How to get hits of parent particle?  by <viet.nga.thi.la@cern.ch>,   22 Apr, 2009
Hi all,

I have a parent particle come in the sensitive detector. Then, I obtain hits. But I don't know: these hits are parent particle's hits? or they include the parent particle's hits and second particles ' hits? If they include the parent particle's hits + second particles ' hits, how to get the hits of parent particle?

Thanks verry much!

Viet Nga

1 Idea: Re: How to get hits of parent particle?   (Vladimir Ivanchenko - 18 May, 2009)
Question Problem with GetGlobalTime() / GetLocalTime() for optical photons  by Paul Papacz <Paul Papacz>,   16 Apr, 2009
Hello Experts,

I have been working with the GEANT-framework for a few months now and I found many solutions and ideas in this forum. Thanks for this.

But now I have a problem I cannot solve.

I am simulating a piece of scintillating material with an embedded WLS fiber.

Here I find a problem when accessing the GlobalTime/LocalTime of the optical photons.

In some cases (about 1 of 100) the GetGlobalTime()/GetLocalTime() method delivers a "nan" value. The photon still exists, propagates and can be visualised and detected in a sensitive detector, but no time information is available.

Here's a little excerpt of the tracking of such a photon:

*********************************************************************************************************
* G4Track Information:   Particle = opticalphoton,   Track ID = 6286,   Parent ID = 3164
*********************************************************************************************************

Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
    0   -219 um   1.09 mm  -2.36 cm   2.64 eV      0 eV      0 fm      0 fm   WLSFiberCore    initStep
    1   -145 um   1.03 mm  -2.38 cm   2.64 eV      0 eV    220 um    220 um   WLSFiberCore  Transportation

UserSteppingAction: theStep->GetPreStepPoint()->GetGlobalTime(): 4.6064893
UserSteppingAction: theStep->GetPreStepPoint()->GetLocalTime(): 0
UserSteppingAction: theStep->GetPostStepPoint()->GetGlobalTime(): nan
UserSteppingAction: theStep->GetPostStepPoint()->GetLocalTime(): nan
UserSteppingAction: theStep->GetDeltaTime(): nan

UserSteppingAction: theTrack->GetGlobalTime(): nan
UserSteppingAction: theTrack->GetLocalTime(): nan
UserSteppingAction: theTrack->GetTrackID(): 6286
UserSteppingAction: theTrack->GetKineticEnergy(): 2.6379985e-06

    2   -145 um   1.03 mm  -2.38 cm   2.64 eV      0 eV      0 fm    220 um   av_1_impr_1_InnerCladPart_log_pv_3  Transportation

UserSteppingAction: theStep->GetPreStepPoint()->GetGlobalTime(): nan
UserSteppingAction: theStep->GetPreStepPoint()->GetLocalTime(): nan
UserSteppingAction: theStep->GetPostStepPoint()->GetGlobalTime(): nan
UserSteppingAction: theStep->GetPostStepPoint()->GetLocalTime(): nan
UserSteppingAction: theStep->GetDeltaTime(): nan

UserSteppingAction: theTrack->GetGlobalTime(): nan
UserSteppingAction: theTrack->GetLocalTime(): nan
UserSteppingAction: theTrack->GetTrackID(): 6286
UserSteppingAction: theTrack->GetKineticEnergy(): 2.6379985e-06

    3    470 um   1.55 mm  -2.55 cm   2.64 eV      0 eV   1.83 mm   2.05 mm   WLSFiberCore  Transportation

UserSteppingAction: theStep->GetPreStepPoint()->GetGlobalTime(): nan
UserSteppingAction: theStep->GetPreStepPoint()->GetLocalTime(): nan
UserSteppingAction: theStep->GetPostStepPoint()->GetGlobalTime(): nan
UserSteppingAction: theStep->GetPostStepPoint()->GetLocalTime(): nan
UserSteppingAction: theStep->GetDeltaTime(): nan

UserSteppingAction: theTrack->GetGlobalTime(): nan
UserSteppingAction: theTrack->GetLocalTime(): nan
UserSteppingAction: theTrack->GetTrackID(): 6286
UserSteppingAction: theTrack->GetKineticEnergy(): 2.6379985e-06

    4    470 um   1.55 mm  -2.55 cm   2.64 eV      0 eV      0 fm   2.05 mm   av_1_impr_1_InnerCladPart_log_pv_2  Transportation

UserSteppingAction: theStep->GetPreStepPoint()->GetGlobalTime(): nan
UserSteppingAction: theStep->GetPreStepPoint()->GetLocalTime(): nan
UserSteppingAction: theStep->GetPostStepPoint()->GetGlobalTime(): nan
UserSteppingAction: theStep->GetPostStepPoint()->GetLocalTime(): nan
UserSteppingAction: theStep->GetDeltaTime(): nan

UserSteppingAction: theTrack->GetGlobalTime(): nan
UserSteppingAction: theTrack->GetLocalTime(): nan
UserSteppingAction: theTrack->GetTrackID(): 6286
UserSteppingAction: theTrack->GetKineticEnergy(): 2.6379985e-06

...

As you can see time information is only available at the very first PreStepPoint!

I would be glad about every help/idea.

Thanks Paul P.

1 Feedback: Re: Problem with GetGlobalTime() / GetLocalTime() for optical photons   (Gumplinger Peter - 06 May, 2009)
2 None: Re: Problem with GetGlobalTime() / GetLocalTime() for optical photons   (Paul Papacz - Jul 23, 10:36)
1 Feedback: Re: Problem with GetGlobalTime() / GetLocalTime() for optical photons   (Gumplinger Peter - Jul 23, 12:56)
Question How to generate more primary particles simultaneously (in a particle bunch) ?  by Cristian Bungau <Cristian Bungau>,   13 Apr, 2009
Hi,

In my application I have to generate more particles in a particle bunch, at the same time. I tried using different numbers of particles in my PrimaryGeneratorAction:

particleGun = new G4ParticleGun(100); // for 100 particles

but it didn't seem to work. I would be very grateful for any help or suggestions.

If this is not possible in Geant4, could you please let me know if it would be possible to generate ~10 primary particles within the first ~10-50 nanoseconds from the beginning of the event?

Thank you,

Cristian

1 Feedback: Re: How to generate more primary particles simultaneously (in a particle bunch) ?   (Gumplinger Peter - 06 May, 2009)
(_ Agree: Re: How to generate more primary particles simultaneously (in a particle bunch) ?   (Cristian Bungau - 15 May, 2009)
(_ Disagree: Re: How to generate more primary particles simultaneously (in a particle bunch) ?   (Gumplinger Peter - 15 May, 2009)
Question How to Distinguish Fluorescence Photon from Bremsstrahlung Photon? Check the Process Creat the Track?  by Colin Huang <Colin Huang>,   02 Apr, 2009
Hi there,

I really need your expertise.

I am doing simulation with electron of 55~80keV hitting Gd target. Both bremsstrahlung photon and fluorescence photon are created, but I am interested in counting only the photons created by fluorescence. My questions are:

1. How can I count only the fluorescence photon? I am thinking about using check the process creat the track. Is this reasonable?

2. In order to get fluorescence photons. Should I just use G4LowEnergyIonisation? Can I use G4PenelopeIonisation to get these photons?

3. In order to trace the process creating the track of fluorescence photon, what is the right code to do that? I did some research on this part but still didn't get clue what should I write.

Could anybody familiar with this kind of simulation please give me several lines of code that I can make use of, or tell me which example program has similar function which I can refer to, of tracing the process that creats fluorescence photon or any other particles.

Any suggestion and help of any kind are highly appreciated.

Sincerely,

Colin

None Determining Particle Fluence in and Particle Fluence out  by <jdswado@gatech.edu>,   31 Mar, 2009
Hi everyone,

I'm trying to figure out how to count the number of primaries leaving a certain volume and the number of primaries exiting that same volume.

I've tried something like the following:

In SteppingAction.cc

void SteppingAction::UserSteppingAction(const G4Step* aStep)

{ if(aStep->GetParentID() == 0)
    { G4StepPoint* point = aStep->GetPreStepPoint();
      if (point->GetStepStatus() == fGeomBoundary)
          inparticlecount ++;}
      }

etc. But this doesn't work and even if it did I'm not sure how I'd specify that "point" needed to be in the boundary of "detector_log" volume.

Any ideas?

Thanks greatly, Jason

1 Feedback: Re: Determining Particle Fluence in and Particle Fluence out   (Gumplinger Peter - 31 Mar, 2009)
(_ Ok: Re: Determining Particle Fluence in and Particle Fluence out   (jdswado@gatech.edu - 14 Apr, 2009)
Question aStep->IsFirstStepInVolume()==false  by <viet.nga.thi.la@cern.ch>,   31 Mar, 2009
Hi all,

This is a portion in my program:

 if (aStep->IsFirstStepInVolume()==true){
    G4StepPoint*  preStepPoint = aStep->GetPreStepPoint();
    E1 = preStepPoint->GetKineticEnergy();
    G4cout<<"E1 = "<<E1<<G4endl;
  }

I get aStep->IsFirstStepInVolume(), but it don't return "true". It return "false".

So I use the value "false", aStep->IsFirstStepInVolume()==false), how do it influence to my result?

Thanks.

Viet Nga

1 Warning: Re: aStep->IsFirstStepInVolume()==false   (Gumplinger Peter - 31 Mar, 2009)
Question how to get local energy deposite via G4ParticleChange ?   by <viet.nga.thi.la@cern.ch>,   30 Mar, 2009
Hi, My problem is that I don't know how to implement G4ParticleChange in my program. My program includes :

ExN02DetectorConstruction.hh ExN02RunAction.hh ExN02TrackerSD.hh ExN02EventAction.hh ExN02SteppingAction.hh ExN02PhysicsList.hh ExN02PrimaryGeneratorAction.hh ExN02TrackerHit.hh

I have started with Geant4 since 2 weeks. Thus I don't know it well.

Help me!

Thanks verry much.

1 Feedback: Re: how to get local energy deposite via G4ParticleChange ?   (Gumplinger Peter - 30 Mar, 2009)
None training lecture problem  by wangym <wangym>,   30 Mar, 2009
In training lecture,"Particles and Processes",page 12 , you write "Apply PostStepDoIt() action(s) sequentially, as long as the particle is alive ¨apply PostStepDoIt() of the process which proposed the smallest step length"

But in my opinion , in one step ,the first ,determine the step length , the second, determine which process occure .they are independent from each other. I do not know why you white this.

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/03/30/07.00-78073-E._processes.pdf

1 Disagree: Re: training lecture problem   (Gumplinger Peter - 30 Mar, 2009)
(_ Question: Re: training lecture problem   (wangym - 31 Mar, 2009)
1 Feedback: Re: training lecture problem   (Gumplinger Peter - 31 Mar, 2009)
2 Question: Re: training lecture problem   (wangym - 31 Mar, 2009)
1 Question: Re: training lecture problem   (wangym - 31 Mar, 2009)
... 9 Message(s)
Question how to get local energy deposite via G4ParticleChange ?  by <viet.nga.thi.la@cern.ch>,   30 Mar, 2009
Hi,

I need extract the local energy deposite in my detector via G4ParticleChange. But I don't know how do use it.

Can you help me? I need an example or some guides.

thanks verry much.

Viet Nga

Question X, Y positions beyond lead layer and Energy threshold (EM cascade in lead)  by Jan Malinowski <Jan Malinowski>,   23 Mar, 2009
Dear colleagues,

I simulate EM cascade in the thin layer of lead (5 cm).

1) I need x, y positions of all secondary particles beyond this layer. 2) I would like to cut these results by Energy threshold.

The problems are probably simple but I can’t make it long time using manuals.
I will be happy to see any suggestions for these subjects.
Regards,
   JM

1 Feedback: Re: X, Y positions beyond lead layer and Energy threshold (EM cascade in lead)   (Gumplinger Peter - 23 Mar, 2009)
2 None: Re: X, Y positions beyond lead layer and Energy threshold (EM cascade in lead)   (michel maire - 24 Mar, 2009)
Question building detector to step energy  by Antonio Magalhaes <Antonio Magalhaes>,   20 Mar, 2009
I'm an undergraduate in physics and new with Geant4 and OOP, and I trying to get the energy deposited along a water phantom. I saw an exemple with a phantom, using 320 slices disposed along the Z axis and I think it's look like a good way... however, I don't now how to build this slices, i can use replicas with the same phantom's material? what's the best way? Another point is how to output the energy in a file, with 2 simple columns (energy vs Z)? I appreciate your help...

1 None: Re: building detector to step energy   (michel maire - 21 Mar, 2009)
(_ Question: Re: building detector to step energy   (Antonio Magalhaes - 30 Mar, 2009)
Question Training lecture problem  by wangym <wangym>,   18 Mar, 2009
In training lecture,"Particles and Processes",page 12 , you write

"Apply PostStepDoIt() action(s) sequentially, as long as the particle is alive ¨Capply PostStepDoIt() of the process which proposed the smallest step length"

But in my opinion , in one step ,the first ,determine the step length , the second, determine which process occure .they are independent from each other. I do not know why you white this.

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/03/18/07.46-32812-gs_wym_×ÀÃæ_processes.pdf

Question How would I "score" electron energy deposition and the # of electrons created  by <jdswado@gatech.edu>,   13 Mar, 2009
Hello all,

I'm trying to create a simple NaI(Tl) scintillation detector model but I suppose my question is general enough to be applied to many other scenarios. In any case, my detector model is simply a heavily modified version of ExN01 with some of the scintillation and optical elements from ExN06 included into it. I'd like to know how many electrons were produced by my incoming gamma radiation and how much energy they deposited in the crystal volume. If possible could you point me in the right direction?

Many thanks!! Jason

1 Feedback: Re: How would I   (Gumplinger Peter - 13 Mar, 2009)
None Setting TrackID  by Tom Roberts <Tom Roberts>,   09 Mar, 2009
What is the proper way to set the TrackID of a track inside my GeneratePrimaries(G4Event *event) ?

Note that this does not work (specifically the last line of this snippet), and the track's TrackID gets reset to 1 at the start of tracking:

        particleGun->SetParticleTime(time);
        particleGun->SetParticlePosition(pos);
        particleGun->SetParticleEnergy(ke);
        particleGun->SetParticleMomentumDirection(direction);
        particleGun->GeneratePrimaryVertex(event);
        event->SetEventID(eventID);
        event->GetPrimaryVertex()->SetWeight(weight);
        event->GetPrimaryVertex()->GetPrimary()->SetTrackID(trackId);

I am reading a file of existing tracks, and I want to: a) preserve the TrackID's of all tracks, and b) ensure that generated secondaries do not duplicate any TrackIDs that came from the file. Here there is just a single track in the event, but soon I'll have multiple tracks (and possibly multiple vertexes).

Note that my code does not use the primary vertex at all, except to pass a weight into the track. Is there some way I can just create some G4Track-s myself and stack them, rather than jumping through hoops to use G4ParticleGun?

A quick glance at G4EventManager.cc indicates to me that this appears to be impossible, unless I re-write TrackIDs in UserStackingAction or PreUserTrackingAction, which would be complex and fragile. Or do I need to write my own RunManager and EventManager?

Has nobody ever done this before? (I have been living with re-numbered TrackIDs for years, but now it has become a problem.)

1 None: Re: Setting TrackID   (Makoto Asai - 11 Mar, 2009)
Question Capture system state information   by Dragos Constantin <Dragos Constantin>,   04 Mar, 2009
Hello everybody,

For simplicity let's say I only have a particle gun positioned at (0, 0, 0) and I shoot particles predominantly in the +z direction. Let's consider the plane at z0(>0) perpendicular to the z-axis. 

I would like to record each particle position as its track intersects the plane. Also, I would like to know the particle direction of propagation and its energy at that position. 

What would be the strategy? Should I use a sensitive detector or/and track information? Are any examples where something like this is achieved?

Thank you,
Dragos

1 Feedback: Re: Capture system state information   (Gumplinger Peter - 04 Mar, 2009)
2 None: Re: Capture system state information   (Tom Roberts - 04 Mar, 2009)
Question Can a upperhalf bone slice and a lowerhalf water sensitive share the same detector?  by Kent Wong <Kent Wong>,   26 Feb, 2009
 Hello, 

   I have a water cube phantom of 20cm. Originally I had a bone slice of dimensions (20cm,20cm,1cm) placed at the 2cm of that water cube. When 200MeV protons go through that phantom, my output seems fine.

   Now I want an upperhalf bone slice of dimensions (20cm,10cm,1cm) at the 2cm position and a lowerhalf water sensitive of the same dimensions right underneath that upperhalf bone. But there are times that the bonedetector cannot record the proton hit at that 2cm position. 

   What should I do?
Thanks,
Kent

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/02/26/19.59-76998-c_DetectorConstruction.cc
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/02/26/19.59-3668-P_code_src_EventAction.cc
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2009/02/26/20.08-58698-_code_src_BoneDetector.cc

Question How To Turn Physics Completely Off?  by ozgur ates <ozgur ates>,   21 Feb, 2009
Hi,

How can I turn physics completely off in my simulation. Here is some piece of code relevant to phy on/off. would you tell me what the meaning of these numbers(right hand side)is? Thank you

//Muon Plus Physics

  pManager = G4MuonPlus::MuonPlus()->GetProcessManager();

  pManager->AddProcess(&fMuPlusMultipleScattering,-1,  1, 1);
  pManager->AddProcess(&fMuPlusIonisation,        -1,  2, 2);
  pManager->AddProcess(&fMuPlusBremsstrahlung,    -1,  3, 3);
  pManager->AddProcess(&fMuPlusPairProduction,    -1,  4, 4);

  pManager->AddDiscreteProcess(&fMuPlusNucleusProcess);
  pManager->AddDiscreteProcess(&fMuPlusNuclearInteraction);

1 None: Re: How To Turn Physics Completely Off?   (michel maire - 21 Feb, 2009)
2 None: Re: How To Turn Physics Completely Off?   (Tom Roberts - 21 Feb, 2009)
Question Times or positions don't seem correct in synchrotron production in atmosphere model  by Scott Nutter <Scott Nutter>,   28 Jan, 2009
I have been trying to figure this out for months to no avail. It's time to consult the experts.

I have a model of the atmosphere using G4Orbs embedded like "Russian dolls" with equal depth (20 mg/cm2) between layers.  I have a model of the Earth's magnetic field, and set 
        myField = new CrestMagField(latitude, longitude, time);
        G4FieldManager* fieldMgr
            = G4TransportationManager::GetTransportationManager()
              ->GetFieldManager();
        fieldMgr->SetDetectorField(myField);
        fieldMgr->CreateChordFinder(myField);
after constructing all of my geometry.  Field strengths are ~0.5 gauss and electron energies are ~10 TeV.  A more detailed description of my geometry is in a recent posting in the Geometry section.

I record all synchrotron photon hit locations and times at a certain height. I should be able to look at two close together (within meters) photons and reconstruct their zenith angle using their time and position differences. However, the resulting zenith angle is always nearly vertical, meaning either the times are too close together or the positions are too far apart. I carefully tag photons when produced by synchrotron and not undergoing any other physics, such as Compton scattering, before getting to my recording height. So unless the Transportation process itself can change directions, these should have traveled in a straight line. I verified the photns and the primary electron travel at c_light.

The zenith angle reconstruction method works fine with an old "flat earth" model based on the old GEANT3 Runge-Kutta tracker, so that works fine.

The default values for the Chordfinder are

fieldMgr->GetDeltaIntersection(): 1 um

fieldMgr->GetDeltaOneStep(): 10 um

End of run statistics for one track for the chordfinder are
G4ChordFinder statistics report:
  No trials: 4842  No Calls: 4701  Max-trial: 2
  Parameters:   fFirstFraction 0.999  fFractionLast 1  fFractionNextEstimate 0.98

Any ideas? I don't know where else to pursue this.

None hadron penetrating the emulsion chamber  by Jan Malinowski <Jan Malinowski>,   22 Jan, 2009
Dear GEANT4 users,

I am the beginner user of the GEANT4 system. I would like to simulate penetrating of hadrons throw the emulsion chamber, used in the cosmic ray experiments. The detector is rtg-film or sheet of emulsion.

I have done my first step and build the chamber, defined electromagnetic processes and run the primary electron, like the example EN03.

My problem is how to count number of secondary electrons on the registration level.

Best regards,
   Janek.

1 Feedback: Re: hadron penetrating the emulsion chamber   (Gumplinger Peter - 26 Jan, 2009)
(_ Question: Re: hadron penetrating the emulsion chamber   (Jan Malinowski - 20 Feb, 2009)
Question Simulate only events that will produce muons of certain energies  by Adriana Bungau <Adriana Bungau>,   21 Jan, 2009
Hi

I am trying to speed up a simulation of 10^13 protons on a graphite target by simulating only those events that are of interest for the experiment i.e. that will produce in the end muons with certain energies.

Could you please let me know if it's possible to skip the events that will not produce such muons?

Thank you,

Adriana

1 None: Re: Simulate only events that will produce muons of certain energies   (Paul Nicholas Colin Gloster - 21 Jan, 2009)
(_ Question: Re: Simulate only events that will produce muons of certain energies   (Adriana Bungau - 21 Jan, 2009)
1 None: Re: Simulate only events that will produce muons of certain energies   (Paul Nicholas Colin Gloster - 21 Jan, 2009)
2 Warning: Re: Simulate only events that will produce muons of certain energies   (Gumplinger Peter - 21 Jan, 2009)
1 Question: Re: Simulate only events that will produce muons of certain energies   (Adriana Bungau - 22 Jan, 2009)
Question fGeomBoundary and SensitiveDetector problem  by Gergely Soti <Gergely Soti>,   19 Jan, 2009
Dear all,

I am trying to make an "ideal" detector, which records the particle energy when it enters the detector. I do this in SensitiveDetector::ProcessHits, and in it the following condition:

G4StepPoint* point1 = theStep->GetPreStepPoint();
if(point1->GetStepStatus()==fGeomBoundary){
   ...
}

However, this condition is true only when the particle leaves the detector. I was expecting that it will be true only when it enters the detector (since I use GetPreStepPoint, not GetPostStepPoint). I looked at other similar functions, but from this forum I learned that the function IsFirstStepInVolume is not working. Does anyone has some ideas?

Gergely

p.s. maybe I should try to use the SteppingAction but this would be easier for me.

1 Disagree: Re: fGeomBoundary and SensitiveDetector problem   (Gumplinger Peter - 19 Jan, 2009)
(_ More: Re: fGeomBoundary and SensitiveDetector problem   (Gergely Soti - 20 Jan, 2009)
(_ Feedback: Re: fGeomBoundary and SensitiveDetector problem   (Gumplinger Peter - 20 Jan, 2009)
(_ More: Re: fGeomBoundary and SensitiveDetector problem   (Gergely Soti - 22 Jan, 2009)
(_ Sad: Re: fGeomBoundary and SensitiveDetector problem   (Gumplinger Peter - 22 Jan, 2009)
Question jump to OutofWorld in tracking through large spheres  by Scott Nutter <Scott Nutter>,   10 Jan, 2009
I have a model of the atmosphere consisting of layers of concentric spheres of different densities (so sphere radii are very large). I start >TeV electrons at the top of the atmosphere (400 km) and keep track of photons produced via synchrotron and brem. When sending an electron straight down, if the magnetic field is on, tracking occurs as expected. If off, the electron is sent to OutofWorld at the boundary between the first and second layers. Angled incidence is OK. I recall an issue with tracking on spheres in the user's guide with the suggestion that a small gap be placed between layers to ensure proper tracking. I already have 1 micron above and below each layer in place, and increasing that gap does not help. (You can see the first micron in the tracking output below. "atmosphere" is the mother volume.) The problem is still present for straight down electrons for larger gaps and any energy.

Specifics:
PhysicsList is from examples/electromagnetic/TestEm16
Geometry (last few layers of atmosphere):
layer#    height above    sphere radius (km)   density
          Earth (km)       REarth+Height       (g/cm3)
375       339.68927398    6717.826274         1e-22
376       389.68927398    6767.826274         1e-22
377       400             6778.137            1e-22

Electrons start at 400 km (top of layer 377) going down into layer 376. Tracking output for a straightdown electron, no magnetic field on:

*********************************************************************************************************
* G4Track Information:   Particle = e-,   Track ID = 1,   Parent ID = 0
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0        0        0 6.78e+09     1e+06        0        0         0  atmosphere initStep
    1        0        0 6.78e+09     1e+06 3.06e-29    0.001     0.001 atmlayer376 Transportation
    2        0        0 6.77e+09     1e+06 3.15e-19 1.03e+07  1.03e+07  OutOfWorld Transportation
1 events processed

A normal event at incidence angles other than vertical will continue to track through the variable thickness layers (first few steps shown below for off-vertical incident track):

*********************************************************************************************************
* G4Track Information:   Particle = e-,   Track ID = 1,   Parent ID = 0
*********************************************************************************************************

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0        0        0 6.78e+09     1e+06        0        0         0  atmosphere initStep
    1 0.000223 0.000166 6.78e+09     1e+06 3.17e-29  0.00104   0.00104 atmlayer376 Transportation
    2 2.29e+06 1.71e+06 6.77e+09     1e+06 3.27e-19 1.07e+07  1.07e+07  atmosphere Transportation
    3 2.29e+06 1.71e+06 6.77e+09     1e+06 6.34e-29  0.00208  1.07e+07 atmlayer375 Transportation
    4 1.34e+07    1e+07 6.72e+09     1e+06 1.59e-18 5.19e+07  6.26e+07  atmosphere Transportation
    5 1.34e+07    1e+07 6.72e+09     1e+06 6.35e-29  0.00208  6.26e+07 atmlayer374 Transportation
    6 2.46e+07 1.83e+07 6.67e+09     1e+06 6.11e-17 5.19e+07  1.15e+08  atmosphere Transportation

Any help in getting this to work would be appreciated. Straight down events are good checks of geometry and physics since depth (g/cm2) is known.

Scott Nutter

Question process terminating a track  by Cristian Bungau <Cristian Bungau>,   09 Jan, 2009
Hi,

I am trying to find with what process and in what volume a neutron track ends. I tried using the variable G4Step* aStep; aStep->IsLastStepInVolume(), but this variable is always false, so it cannot be used. Could you please let me know how it can be done, apart from trying to read all the lines in the tracking/verbose 1 output?

Thank you,

Cristian

1 Ok: Re: process terminating a track PROBLEM SOLVED PLEASE IGNORE   (Cristian Bungau - 09 Jan, 2009)
None Problem with G4.9.2: step length and/or energy deposit was illegal  by <zhenwei.yang@gmail.com>,   07 Jan, 2009
Hi, My G4 application could be run successfully in G4.9.0.p01, but when I ran it in the new installed G4.9.2, something wrong happened, with the error information as followed. As indicated by the error information, the step length and/or energy deposit was illegal. My application is a very simple one, which defines a box of lead, and the incident particle is electron. The step lengths of electron in the detector are summed in the sensitive detector(the whole box is set to be sensitive).

Is there anyone who can give me some hints how this problem could be fixed?

Best regards, Dionusos

*** G4Exception : 100
      issued by : G4VParticleChange::CheckIt
step length and/or energy deposit was  illegal
*** Event Must Be Aborted 

 *** Break *** segmentation violation
Attaching to program: /proc/9582/exe, process 9582
[Thread debugging using libthread_db enabled]
[New Thread 0xb3dbd6e0 (LWP 9582)]
0xb80d6430 in __kernel_vsyscall ()
error detected on stdin
The program is running.  Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]

Question read from input in PrimaryGeneratoraction and get event no  by Tapasi Ghosh <Tapasi Ghosh>,   06 Jan, 2009
Dear All
I was trying to read a data file of the form
px   py    pz
1     2     3
4     5      6
...   ...    ...
...    ...    ...
in PrimaryGeneratorAction class. I want to use each particle (i.e. each set of px,py,pz) as each event.
What I have done is following :
IcalPrimaryGeneratorAction::IcalPrimaryGeneratorAction()
{
  gun = new G4ParticleGun(1);

}

IcalPrimaryGeneratorAction::GeneratePrimaries(g4Event*evt)
{
  infile.open("file")
  while loop {
  infile>>px>>py>>pz; 
  G4ThreeVector mom3v(px,py,pz);
  gun->SetParticleDefinition("primary_particle_type");
  gun->SetPrimaryParticleMomentumDirection(mom3v.unit());
  gun->SetParticleEnergy(mom3v.mag());
  gun->SetParticlePosition(G4ThreeVector("position_of_primary_vertex");
  gun->GeneratePrimaryvertex(evt);
  "end of while loop"
infile.close();
} 

But when I am giving /run/beamOn 1 It is reading the whole file but event remains 1. Please give suggesstion how to get 10 events suppose if there are 10 particles in the file. Happy new year to all of you. With regards. Tapasi

1 Feedback: Re: read from input in PrimaryGeneratoraction and get event no   (Gumplinger Peter - 07 Jan, 2009)
None how to flag events with PhotonInelastic/ElectronNuclear/PositronNuclear reactions in SteppingAction.cc  by Emil Frlez <Emil Frlez>,   23 Dec, 2008
 Hi,

 I have a simple question (that might have been answered before ;8-).

 I use a physics list with the ElectroNuclearPhysics():

....
void PhysicsList::ConstructProcess()
{
  AddTransportation();
  AddDecay();
  emPhysicsList->ConstructProcess();
  for(size_t i=0; i<hadronPhys.size(); i++) hadronPhys[i]->ConstructProcess();
  AddStepMax();
  ElectroNuclearPhysics();
}
...

 In my SteppingAction.cc I would like to flag the events
 with the PhotonInelastic, ElectronNuclear, PositronNuclear reactions.

 What would be the appropriate "if" statement? I use 

void SteppingAction::UserSteppingAction(const G4Step* aStep)
{
 const G4Track* track = aStep->GetTrack();
 ...

 So what is the condition?

 Flag=0;
 if ( aStep->GetTrack()-> ????? ) Flag=1;

                                         Regards, and TIA, Emil

1 Feedback: Re: how to flag events with PhotonInelastic/ElectronNuclear/PositronNuclear reactions in SteppingAction.cc   (Gumplinger Peter - 07 Jan, 2009)
Question Particle artificially moved from one volume to another.  by alexandre Creusot <alexandre Creusot>,   03 Dec, 2008
Hi,

  An optical photon is on the border between glass and vacuum, i.e. preStepPoint is in the glass and postStepPoint is in the vacuum. 
Via a created process, I move the postStepPoint back to the glass (position, momentum and time are changed).

  If I look at the step information, everything works fine... new momentum, new position and new time are the ones I wanted for the output photon. 
But before this output, I have a null size step in the glass (where I moved the photon) which is, I guess, 
needed by the manager to change the volume of the postStepPoint from vacuum to glass 
(actually the only thing changing in this step is the volume: from vacuum to glass, the rest has the output photon characteristics). 

  I would like to know if this change of volume has any influence on the photon characteristics. 
More generally, I would like to know if you can move freely a particle from one volume to another one.

Thanks a lot,

Alexandre Creusot.

1 Warning: Re: Particle artificially moved from one volume to another.   (Gumplinger Peter - 03 Dec, 2008)
Question Time/distance of particle in the current volume  by Angela Lucaci-Timoce <Angela Lucaci-Timoce>,   13 Nov, 2008
Dear all, is there a way in GEANT4 to get the time spent by a particle in the current volume, that is from the time entering the volume, untill the interaction? I hoped that aStep->GetLocalTime() would do the job, but it is allways the same as the global time.

Or could I get the distance left behind the particle from the volume boundary untill the interaction point? I also thought that doing some loops untill I get to the primary step will work, but I've just learned from this forum that the flag IsFirstStepInVolume is not properly implemented.

Another question: I had a look at the track velocity, and it seems that for small step lenghts, around 50-60 micrometers, the velocity is zero, while in most cases it is the speed of light. Is this the expected behaviour?

Thank you in advance for taking your time to answer my questions.

Regards, Angela

1 Feedback: Re: Time/distance of particle in the current volume   (Gumplinger Peter - 13 Nov, 2008)
Question How to apply time cut?  by Angela Lucaci-Timoce <Angela Lucaci-Timoce>,   11 Nov, 2008
Hello, I wonder what is the best method to reject particles which come later than a certain time t (this is to take into account time window of the electronics, since signals coming later may not be all detected, hence decreasing the efficiency).

I'm aware of 2 possibilities:

a) set uTimeMax in G4UserLimits

b) reject later particle in the sensitive detector's ProcesHits, something like:

 G4double hitTime = aStep->GetPostStepPoint()->GetGlobalTime();
 if (hitTime > myTimeLimit) return true...

Could you please tell me which is the best way to implement this?

Thank you in advance for your time, Angela

1 Feedback: Re: How to apply time cut?   (Gumplinger Peter - 11 Nov, 2008)
Question Recording the number of compton scatterings in an event  by <ticesty>,   23 Oct, 2008
Greetings-

I have a geant model where gammas enter a detector volume and the total energy each one deposits is recorded. I would like have the number of times the gamma compton scatters as well. Does anyone know how to do this?

Thanks,

David

1 None: Re: Recording the number of compton scatterings in an event   (michel maire - 23 Oct, 2008)
(_ Question: Re: Recording the number of compton scatterings in an event   (ticesty - 24 Oct, 2008)
(_ None: Re: Recording the number of compton scatterings in an event   (michel maire - 26 Oct, 2008)
Sad event terminated for unknown reason  by Cristian Bungau <Cristian Bungau>,   22 Oct, 2008
Hi I am trying to run one event with 10 primaries and it crashes for a reason I can't understand. I would be very grateful for any suggestions. Here is the gdb output:

### Run 0 start. Start Run processing.

---> Begin of event: 0

--------- Ranecu engine status ---------
 Initial seed (index) = 0
 Current couple of seeds = 9876, 54321
----------------------------------------
terminate called after throwing an instance of 'std::bad_alloc'
  what():  St9bad_alloc

Program received signal SIGABRT, Aborted. [Switching to Thread -1208625456 (LWP 31182)] 0x00d95410 in __kernel_vsyscall ()

(gdb) backtrace

#0  0x00d95410 in __kernel_vsyscall ()
#1  0x04214d20 in raise () from /lib/libc.so.6
#2  0x04216631 in abort () from /lib/libc.so.6
#3  0x041b7c60 in __gnu_cxx::__verbose_terminate_handler ()
   from /usr/lib/libstdc++.so.6
#4  0x041b56c5 in std::set_unexpected () from /usr/lib/libstdc++.so.6
#5  0x041b5702 in std::terminate () from /usr/lib/libstdc++.so.6
#6  0x041b583a in __cxa_throw () from /usr/lib/libstdc++.so.6
#7  0x041b5cbe in operator new () from /usr/lib/libstdc++.so.6
#8  0x041b5d9d in operator new[] () from /usr/lib/libstdc++.so.6
#9  0x00fde6e2 in G4NeutronHPLegendreStore::SampleElastic ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4had_neu_hp.so
#10 0x00fa79f2 in G4NeutronHPElasticFS::ApplyYourself ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4had_neu_hp.so
#11 0x00f96e7c in G4NeutronHPChannel::ApplyYourself ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4had_neu_hp.so
#12 0x00fa962c in G4NeutronHPElastic::ApplyYourself ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4had_neu_hp.so
#13 0x00398318 in G4UHadronElasticProcess::PostStepDoIt ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4hadronic_coherent_elastic.so
#14 0x00bf9f94 in G4SteppingManager::InvokePSDIP ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4tracking.so
#15 0x00bfa30f in G4SteppingManager::InvokePostStepDoItProcs ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4tracking.so
#16 0x00bfae60 in G4SteppingManager::Stepping ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4tracking.so
#17 0x00c00dfd in G4TrackingManager::ProcessOneTrack ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4tracking.so
#18 0x0500ca5b in G4EventManager::DoProcessing ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4event.so
#19 0x0500d0ab in G4EventManager::ProcessOneEvent ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4event.so
#20 0x003fab73 in G4RunManager::DoEventLoop ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4run.so
#21 0x003fa4f1 in G4RunManager::BeamOn ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4run.so
#22 0x003fe4aa in G4RunMessenger::SetNewValue ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4run.so
#23 0x0199debf in G4UIcommand::DoIt ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4intercoms.so
#24 0x019aa1a9 in G4UImanager::ApplyCommand ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4intercoms.so
#25 0x019aa4c6 in G4UImanager::ApplyCommand ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4intercoms.so
#26 0x0062ec06 in G4UIterminal::ExecuteCommand ()
   from /home/cb67/geant4/geant4.9.1.p02/lib/Linux-g++/libG4UIbasic.so
---Type <return> to continue, or q <return> to quit---

Thank you,

Cristian

Question Random particle trajectory  by Oscar Larsson <Oscar Larsson>,   22 Oct, 2008
Hi

I'm trying to get eant4 to randomly set the parameters in the ThreeVector-function giving the particle it's trajectory in the mySimEventAction.cc-file.

I would like to use the seeds from the random engine Ranecu. So my question is how do I call the seeds in my EventAction.cc-file to use them as input for the random engine producung my velocity vectors?

Cheers! Oscar

Question How to Disregard Secondary Particles  by ozgur ates <ozgur ates>,   08 Oct, 2008
Hi,

In my EventAction, I need to fill my Root Tree just by Primary Particle, not by secondary particles. I need to disregard them all. Could you guide me, here my codes as follows:

Thanks

....

void EventAction::EndOfEventAction(const G4Event* evt) {

  G4int event_id = evt->GetEventID();  

  if (event_id%1000 == 0) 
    G4cout <<"Event " << evt->GetEventID() << G4endl;

  G4HCofThisEvent * HCE = evt->GetHCofThisEvent();
  if(HCE) {
    G4int CollSize=HCE->GetNumberOfCollections();
    G4int hci=0;

    for(G4int i=0;i<CollSize;i++){
      DetectorHitsCollection* hc;

      while(!(hc=static_cast<DetectorHitsCollection*>(HCE->GetHC(hci++))));
      G4int hc_nhits=hc->entries();

     if(hc->GetName().contains("Cathode")){
	for(G4int i=0;i<hc_nhits;i++){
 	  DetectorHit* hit=static_cast<DetectorHit*>(hc->GetHit(i));
	  det   = 1;
	  pdef  = hit->GetPDef();
	  pos   = hit->GetPos();
	  mom   = hit->GetMom();
	  time  = hit->GetTime();
	  edep  = hit->GetEdep();
	  id    = hit->GetID();
          theta = hit->GetTheta();
          phi   = hit->GetPhi();
	}

 anaManager->FillTree(det,pdef,pos,mom,theta,phi,time,edep,id);	

 }

1 None: Re: How to Disregard Secondary Particles   (ercan - 12 Dec, 2008)
None G4Track* track->SetCreatorProcess(G4VProcess*)  by Niklas <Niklas>,   08 Oct, 2008
Hello,

I tried to compile the following:

---------------------------------------------

G4Track* pCurrentTrack;

[..]

G4DynamicParticle* particle=new G4DynamicParticle ( G4Gamma::GammaDefinition(),globalDir,m_nCurrentEnergy );

G4Track* secondary = new G4Track(particle,time, globalPos );

secondary->SetCreatorProcess(pCurrentTrack->GetCreatorProcess());

[..]

-----------------------------------------------

This does not compile because

G4Track::GetCreatorProcess returns a "const G4VProcess*"
   and
G4Track::SetCreatorProcess takes a "G4VProcess*"

I can avoid the compilation error by using a const_cast:

secondary->SetCreatorProcess(const_cast<G4VProcess*>(pCurrentTrack->GetCreatorProcess()));

Is this save?

I would like to clone a track exept for the position and momentum direction. Is it better/save to use

G4Track::CopyTrackInfo(const G4Track&)

and then set the position and momentum direction later?

Note:

Is there a reason for the non-constness of fpCreatorProcess in G4Track? G4Track does not seem to modify the creator process. Perhaps "fpCreatorProcess" could be defined "const G4VProcess*" and G4Track::SetCreatorProcess (const G4VProcess*) declared?

Thanks

Niklas

1 Agree: Re: G4Track* track->SetCreatorProcess(G4VProcess*)   (Hisaya Kurashige - 24 Oct, 2008)
Question simulating 2E13 primary particles / events?  by Cristian Bungau <Cristian Bungau>,   06 Oct, 2008
Hi,

I have to simulate 2E13 events, and since any integer has to be less than 2.147E09, the code will not simulate more than 2.147E09 primaries / events.

I would be very grateful for a suggestion on how I could do this.

Thank you,

Cristian

1 Idea: Re: simulating 2E13 primary particles / events?   (Gergely Soti - 07 Oct, 2008)
2 None: Re: simulating 2E13 primary particles / events?   (Makoto Asai - 07 Oct, 2008)
3 Ok: Re: simulating 2E13 primary particles / events?   (Cristian Bungau - 07 Oct, 2008)
Question particleGun with novice Example 02  by Bijan Berenji <Bijan Berenji>,   04 Sep, 2008
When I use HEPEvt interface in ExN02PrimaryGeneratorAction, hits get recorded in the tracker layers, and the tracks are visualized. However, this is not optimal for my use because I want to set different initial primary particle positions. When I use particleGun and read in from a text file the energy, momentum direction, particle type, and position, I get visualized trajectories, but no hits get recorded, even when tracks pass through tracker layers. I need hits for measurement of deposited energy. What could be the issue here? Do I have to use HepMCInterface instead (I'd rather not)?

   Attachment:
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2008/09/04/15.29-12533-PrimaryGeneratorAction.cc
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2008/09/04/15.29-13858-maryGeneratorMessenger.cc
      http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2008/09/04/15.29-51886-ExN02EventAction.cc

Question Warning message from new Regular Navigator - should I be concerned?  by Ioannis Sechopoulos <Ioannis Sechopoulos>,   14 Aug, 2008
I am using the new Regular Navigator for voxelized geometries (it is great! thank you!) as in the DICOM example. For a few runs per million I get the following warning:

*** G4Exception : Bad-location-of-point
      issued by : G4Navigator::ComputeStep()
Point is relocated in voxels, while it should be outside!
*** This is just a warning message.

Should I be concerned? Are my results suspect? Anything I am doing wrong?

Thanks!

1 Feedback: Re: Warning message from new Regular Navigator - should I be concerned?   (Pedro Arce - 20 Aug, 2008)
Question Energy Deposit in Silicon via GetKineticEnergy()?  by Bryan C. Callahan <Bryan C. Callahan>,   06 Aug, 2008
I'm trying to recreate a basic Mulassis (http://reat.space.qinetiq.com/mulassis/) simulation in Geant4 (http://cern.ch/geant4).

I have a 10cm slab of silicon and am shooting 10,000 electrons directly at it with a 1 MeV energy. I want to bin the energy deposit in the material into 10 KeV chunks and plot the histogram. My Geant4 results closely match that of Mulassis except for the highest energy bin (1 MeV in this case).

I'm recording the energy deposit in the below routine via the GetKineticEnergy() parameter (see below).

Routine Name: TrackerSD::ProcessHits(G4Step* aStep, G4TouchableHistory*)
Parameter: aStep->GetTrack()->GetKineticEnergy();
URL: http://www.lcsim.org/software/geant4/doxygen/html/classG4Track.html#15b86adef8509e75a9ed3ebd9f9b0cd5

Would anyone be able to offer some insight as to what might be wrong?

Thanks a bunch,

Bryan C. Callahan
Research Assistant, Space Plasma Group (http://lasp.colorado.edu/spg)
Laboratory for Atmospheric and Space Physics (http://lasp.colorado.edu/)
University of Colorado (http://www.colorado.edu/)
1 Feedback: Re: Energy Deposit in Silicon via GetKineticEnergy()?   (Gumplinger Peter - 06 Aug, 2008)
(_ Question: Re: Energy Deposit in Silicon via GetKineticEnergy()?   (Aram Teymurazyan - 10 Sep, 2008)
(_ Idea: Re: Energy Deposit in Silicon via GetKineticEnergy()?   (Vladimir Ivanchenko - 23 Sep, 2008)
Question G4Step->IsFirstStepInVolume()   by Aram Teymurazyan <Aram Teymurazyan>,   01 Aug, 2008
Hi All,

Is the fFirstStepInVolume suppose to be updated anytime a particle enters a new volume? I was trying to use G4Step->IsFirstStepInVolume() but it seems to always return a "false" for all particles.

thanks in advance, Aram

1 Warning: Re: G4Step->IsFirstStepInVolume()   (Gumplinger Peter - 01 Aug, 2008)
(_ Note: Re: G4Step->IsFirstStepInVolume()   (Aram Teymurazyan - 01 Aug, 2008)
Question Particle Question (Novice Level)  by E Askan <E Askan>,   30 Jul, 2008
I have posted this question in both the tracking and hit sections, as those sections seem closely related enough so that a question like this could belong in either one. Of course, any insight someone has in either forum would be highyl appreciated.

I am working on a Cerenkov simulation that uses Cerenkov electrons to set a beam of photons towards a set of 4 mirrors and reflect into PMTs. I also have a metal plane positioned in front of the four mirrors that photons can either pass through or kill, presuming I make the threshold energy for the photons to be killed high enough. The plane I have in front of the 4 mirrors is drawn as follows:

G4double Plane_x = 4.0*m;
  G4double Plane_y = 4.0*m;
  G4double Plane_z = 0.25*m;

  G4Box* MirPlane
     = new G4Box("MirPlane",Plane_x,Plane_y,Plane_z);

G4LogicalVolume *logicMirPlane;
  logicMirPlane = new G4LogicalVolume( solidCerMirPlane , Cu , "MirPlane", 0 , 0 , 0 );

  G4double planeposX = 0;
  G4double planeposY = 0;
  G4double planeposZ = -MirrRadii * cos( MirrTiltAngle ) + MirrZpos + 1.0 *cm ;

G4VPhysicalVolume *physMirPlane;
  physMirPlane = new G4PVPlacement( 0 , G4ThreeVector( planeposX , planeposY, planeposZ ), logicMirPlane , "plane" , logicCerMirPlane , false , 0 );

Now, I was wondering if anyone knew how to create program code that causes all photons that pass through this plane to be "killed" and then records and prints out all of the photons that pass through this plane. I was under the impression that you can set up an arbitrarily determined plane, as I have here to be placed in front of 4 Cerenkov mirrors, and have all photons that pass through it be "killed" and for all photons killed in the plane to be recorded.

I also cannot recall offhand the code needed for geant4 to record all photons that enter the PMTs-this is after the plane is removed, the goal is to compare the number of photons collected by the PMTs to the # of photons passing through the plane in front of the mirror. So if anyone has the code for recording all photons that enter the PMTs and printing it, that would be appreciated.

Thanks for providing this forum.

1 Feedback: Re: Particle Question (Novice Level)   (Gumplinger Peter - 30 Jul, 2008)
(_ Question: Re: Particle Question (Novice Level)   (E Askan - 30 Jul, 2008)
Question CutForProton  by wangym <wangym>,   18 Jul, 2008
Hi in my PhysicsList,I can not set cut for proton, only set cut for e+, e- ,gamma, How can I set cut for proton. For example , energy threshold is 10MeV. thanks

1 Idea: Re: CutForProton   (Vladimir Ivanchenko - 23 Jul, 2008)
None how to produce a point like particle inside a restricted solid angle  by ozgur ates <ozgur ates>,   06 Jul, 2008
how can I randomly generate point like particles (i.e kaons) inside a restricted solid angle..such as theta=pi/3 and phi=pi/12..thanks

1 None: Re: how to produce a point like particle inside a restricted solid angle   (michel maire - 06 Jul, 2008)
Question How to determine the volume from position?  by Nikola Jovancevic <Nikola Jovancevic>,   02 Jul, 2008
Dear all,

I would like to generate my particles in given (complex) volume. In the function PrimaryGeneratorAction::GeneratePrimaries I randomly pick the coordinates, but I need to find the method to check whether that position is inside my volume (it is very complicated to do with if-then combinations). I would like to do this before I generate the primary vertex. I tried this:

                  G4int X = G4UniformRand();
                  G4int Y = G4UniformRand();
                  G4int Z = G4UniformRand();
                  G4StepPoint mypoint;
                  mypoint.SetPosition(G4ThreeVector(X,Y,Z));
                  G4VPhysicalVolume* myvolume = mypoint.GetPhysicalVolume();

But the program crashes when I try to read out some information about the volume:

                  G4cout << myvolume->GetName() << G4endl;

Does anyone has some ideas?

Thank you in advance, Nikola

1 Feedback: Re: How to determine the volume from position?   (Gumplinger Peter - 02 Jul, 2008)
(_ Ok: Re: How to determine the volume from position?   (Nikola Jovancevic - 07 Jul, 2008)
None calculate NonIonizingEnergyDeposit  by wangym <wangym>,   28 Jun, 2008
Hi,I will calculate NonIonizingEnergyDeposit. In class G4Step.icc,

inline 
     G4double G4Step::GetNonIonizingEnergyDeposit() const
     { 
      return fNonIonizingEnergyDeposit; 
     }
How do I explain it. 

1 None: Re: calculate NonIonizingEnergyDeposit   (wangym - 28 Jun, 2008)
Question How should I slice up a volume to tabulate charge deposition?  by Mark Looper <Mark Looper>,   17 Jun, 2008

I've been using EGSnrc (and formerly EGS4) to simulate the way that spacecraft insulators build up a charge in the energetic-electron environment of Earth orbit. I need depth profiles of the charge deposition with fairly fine resolution (e.g., many slices through the thickness of a circuit board), and EGSnrc has tracking problems with very small geometrical sizes, so I'm looking to port my simulations to Geant4. However, I'm not sure as to the best way to slice and dice my simulation volume to tabulate the distribution of charge deposition.

In searching these forums, I found a question from a year ago about a similar problem for energy deposit. The questioner was defining one geometric volume per histogram bin, and the answerers suggested that he should use geometric volumes only for actual physical pieces of the geometry and instead tabulate the energy deposit on the fly, apportioning each step's continuous energy deposit to the bins crossed by that step. To avoid the tracking problems I mentioned above for EGSnrc, I have already been doing that for charge deposit; however, since charge deposit is a discrete process, I have to track down each kind of physical interaction that can cause it (ejection of a delta ray, stopping of a charged particle, Compton scattering, ...) and set a trap for each. I'm not a sophisticated-enough user of Geant4 to be confident that I could manage to do this in Geant4, though!

The primitive-scorer classes G4PSCellCharge and G4PSCellCharge3D appear to return to the model of one geometric volume per histogram bin: you assign a scorer to a volume, and it counts the difference between the charge of the particles entering the volume and that of the particles leaving it, allowing the details of how charge is liberated or captured to stay hidden inside the volume. My question amounts to "am I missing something here?" At the energies of interest to me, I wouldn't be wasting a lot of extra processing time unnecessarily interrupting the flight of gammas at region boundaries, so there'd be little benefit to my learning how to set a physical-volumes-only geometry for gammas and a sliced-and-diced geometry for charged particles. However, is there some way that I could instead replicate my EGSnrc procedure (and that of the answers to the question I mentioned above), getting hold of the actual charge-deposition events and localizing them to individual bins? This would avoid a lot of time wasted by interrupting the tracking on artificial "bin" region boundaries just to cancel out the entry and exit of all the particles that don't cause charge-deposition events in a given bin.

Many thanks!

1 None: RE: How should I slice up a volume to tabulate charge deposition?   (Asai, Makoto - 17 Jun, 2008)
(_ None: Re: RE: How should I slice up a volume to tabulate charge deposition?   (Mark Looper - 19 Jun, 2008)
(_ Ok: Re: RE: How should I slice up a volume to tabulate charge deposition?   (Mark Looper - 10 Sep, 2008)
None overlapping lots of events  by Cristian Bungau <Cristian Bungau>,   09 Jun, 2008
Hi,

In Geant4 usually an event is generated after the previous event has come to an end, however, in order to reproduce what is really happening, I have to generate (many) new events while the first event is still being processed and the isotopes produced in the first event have not decayed yet. This is because secondaries generated in the following events have to interact with the isotopes that are produced in the first event.

However in my code the second event is generated only after the first event isotopes have all decayed and therefore there is no interaction between the second event secondaries and the first event isotopes...

I was wondering what would be the best way to generate lots of new events (~1e6) while the first event is still being processed, so secondaries in the new events will interact with isotopes in previous events. Would multiple sources work? I would probably need about 1e6 multiple sources...

Or do I have to change the material on an event by event basis?

Thank you,

Cristian

Question How to flag a scattered track  Keywords: scattered photons, flag track
by Francisco <Francisco>,   05 Jun, 2008
Hi
I am trying to do this by myself, but I give up.
I have my detector and a water phantom underneath. I want to get both primary 
and backscattered spectra for the energy deposition. The scattered spectrum 
should be the one due to photons that have scattered in the water phantom, so
I need to have two outputs, one for energy deposition in my detector 
due to primary or scattered photons in any volume apart from the phantom, and
other for scattered photons coming from the phantom. So when I do the following 

for stepping action:

if (volume==epitaxial){

  G4double EdepStep = aStep->GetTotalEnergyDeposit();
  if (EdepStep > 0.) {  
     runAction->AddEdep(EdepStep);
     eventAction->AddEdep(EdepStep);
  } 

 ..............
 ..............
}


for event action (I retrieve the deposited energy):

totE += (*CHC)[i]->GetEdep();

 .............
 .............

  ofstream outfile3("EnergyDeposited.dat", ios::app);
  outfile3.precision(3);
  outfile3.setf(ios::scientific);
  outfile3 << TotalEnergyDeposit/keV << G4endl;


Geant4 obviously does not differentiate between photons coming from my phantom
and those from anywhere else. So my question is:

How can I make Geant4 to put a flag in the tracks scattering in my water phantom
in such a way that when they hit my detector (in the volume called epitaxial)
the energy deposited by them can be retrieved apart from any other interaction in 
any other volume.  

Thanks
1 Feedback: Re: How to flag a scattered track   (Peter Gumplinger - 05 Jun, 2008)
Question Setting a minimum kinetic energy threshold in G4NeutronTrackingCut  Keywords: G4NeutronTrackingCut PrimitiveScorers
by phillip koehn <phillip koehn>,   03 Jun, 2008
Hi,

I am using some primitive scorers get some information on neutrons 
that are created in a logical volume. I would like to use 
G4NeutronTrackingCut to eliminate neutrons below a kinetic energy 
threshold. However no matter what threshold I set, it looks like all 
neutrons are killed. And when the neutrons are killed, primitive scorer 
quantities like energy deposition and track length are lost.

Two questions (assumimg I'm not setting the ke threshold properly):
  
  How does one properly set the kinetic energy threshold for 
  G4NeutronTrackingCut?
  
  Is there a way to save the neutron track information up until the 
  point the neutron is killed?

Thanks in advance,

Phillip Koehn
None Problem with GetProcessName()  by Aram <ateymura@yahoo.com>,   25 May, 2008

Hi All,

If I call aTrack->GetCreatorProcess()->GetProcessName() in a ProcessHits function of a sensitive detector or in the SteppingAction my program crashes.

///  
  G4Track* aTrack = aStep->GetTrack();
  if(aTrack->GetTrackID()==1)
    G4cout<<aTrack->GetCreatorProcess()->GetProcessName()<<G4endl;
///

if I modify the above shown lines to look like:

///  
  G4Track* aTrack = aStep->GetTrack();
  if(aTrack->GetTrackID()==1)
    aTrack->GetCreatorProcess()->GetProcessName();
///

the problem goes away. I noticed that the program is crashing only for tackID=1.
 I am puzzled.. is this the intended behavior for GetProcessName?

thanks you,

-Aram

1 None: Re: Problem with GetProcessName()   (Marc Verderi - 26 May, 2008)
(_ None: Re: Problem with GetProcessName()   (Aram - 26 May, 2008)
Question InvokePostStepDoIt question  Keywords: InvokePostStepDoItProc
by Fernando Rannou <rannou@diinf.usach.cl>,   23 May, 2008

Hello, sorry to bother you again with this question, but I'm not sure whether this function is buggy or not:

Please take a look at G4SteppingManager::InvokePostStepDoItProcs():

for (size_t np=0; np < MAXofPostStepLoops; np++) {
   G4int Cond = (*fSelectedPostStepDoItVector)[MAXofPostStepLoops-np-1];
   if (Cond != ...)
   {
       InvokePSDIP(np);
   }
  ...

}

notice that the "if" tests fSelectedPostStepDoItVector[MAXofPostStepLoops-np-1] but the np process is called.

Is this correct?

Thanks Fernando Rannou

1 None: Re: InvokePostStepDoIt question   (Marc Verderi - 26 May, 2008)
None secondaries from cascades  by <kroeger@phy.olemiss.edu>,   22 May, 2008

I would like to run QGSP-BERT and in each event to analyze the secondaries from the cascade separately from the secondaries in pre-equilibrium decays and nuclear breakup etc.

Can this be done in a straightforward manner?
 

None How to count the number and their energies of secondary electrons from ionisation  Keywords: Geant4 secondary electron in ionization chamber
by Xiaoning Ding <xiaoningding@yahoo.com>,   12 May, 2008

I am investigate the possible of using Geant4 to simulate the respond of ionization chamber in a proton beam. What I am interested is the secondary electrons which are generated in the ionization chamber -- their number and energies.

In order to check the secondary electron out, I implemented my approach in the method of PreUserTrackingAction () in class TrackingAction to count the number and energy for secondary electron generated in the ionization chamber.

One problem I have is that all secondary electrons generated in the ionization chamber have their energies > 1 KeV, without a single exception. Is it somehow related to the energy cut ?

Is there any better approch for counting secondary electron generated in ionization chamber ? Thank you so much in advance.

1 None: Re: How to count the number and their energies of secondary electrons from ionisation   (Vladimir IVANTCHENKO - 13 May, 2008)
(_ None: Re: How to count the number and their energies of secondary electrons from ionisation   (Xiaoning Ding - 15 May, 2008)
None A problem about beamOn  Keywords: beamOn,event
by <yfdeng@student.dlut.edu.cn>,   12 May, 2008

Hello, I have problem about /run/beamOn. I want to simulate about 1 000 000 perticles. In the PhysicsList, 
the standard EM model is set and the cut value is set as 1.0mm. In the PrimaryAction, the particlegun is 
used and shoot one electron ench event.
   So at the command Idel>, I type the command /run/beamOn 1000000. However, when the event id goes to 126693,
the G4 terminate in an unusual way. The Screen output "This application has requested the Runtime to terminate
it in an unusual way.Please contact the application's support team for more information."

   And I attempt to resolve the problem, but every time my effort in vain. However, I confirm that the event of 
No.126692 has been completely simulated, because I let the code to output a sign at end of the event.  Also, I let 
the code to output the sign at the beginning of the each event. But when the G4 goes to simulate the event of 
No.126693, the G4 teminates and the beginning sign of the event does not appear.
   So what is the problem and how to cope with it? Thank you very much.

Question Problems obtaining energy deposition spectrum  Keywords: Silicon Energy Deposition
by Ashley Cullen <Ashley Cullen>,   11 May, 2008

Hey all, I'm a newcomer to GEANT4. I have created a relatively basic thin silicon detector geometry in GEANT4 and I'm trying to obtain the energy deposition spectrum from 150keV monochromatic gammas from a point source.

I am using G4Step to obtain the total energy deposit per step, sum this for each step and then output the total deposit (as a rounded integer) to my RunAction class. From there, I bin the energy as a count in an array, which is eventually output to a file.

I have graphed the output for 150M runs, and the compton features are clearly discernable, but I have a gaussian feature peaking at 159keV... 9keV higher than my incident beam. Note that the start of this gaussian feature is at 150keV and has a FWHM of the order of 8 keV.

I was wondering if anyone knows why this is?

Thanks in advance to anyone able to help, Ash

==== Here is the bulk of my Sensitive Detector class: ==== SensitiveDetector::SensitiveDetector(G4String name) : G4VSensitiveDetector(name){}

SensitiveDetector::~SensitiveDetector(){;}

void SensitiveDetector::Initialize(G4HCofThisEvent* HCE){
    totaledep = 0;
}

G4bool SensitiveDetector::ProcessHits(G4Step* theStep, G4TouchableHistory*){
	const G4double edep = (theStep->GetTotalEnergyDeposit() * keV);
	if(edep > 0.){
	    totaledep += edep;
	}
  return true;
}

void SensitiveDetector::EndOfEvent(G4HCofThisEvent*)
{
	if(totaledep > 0){
		if (totaledep > 0.5)
		{
			totaledep_int = (G4int)(totaledep+0.5);
		}
		else totaledep_int = 0;
	    RunAction* myRunAction = (RunAction*)(G4RunManager::GetRunManager()->GetUserRunAction());
	    if(myRunAction)
		myRunAction->ProcessCountEvent(totaledep_int);
	}	
}

==== and the Run Action class ====
RunAction::RunAction(DetectorConstruction* DC){
	max_energy = 250;
	counts = new int[max_energy];
    myDC = DC;

	G4String Filename = "spectrum.txt";
    outfile.open(Filename);
}

RunAction::~RunAction(){
    outfile.close();
}

void RunAction::BeginOfRunAction(const G4Run* aRun){

	for (i=0; i<max_energy; i++)
	{
		counts[i] = 0;
	}

}

void RunAction::ProcessCountEvent(const G4int edeptotal){
	if (edeptotal < max_energy)
	{
		counts[edeptotal]++;
	}
}
void RunAction::EndOfRunAction(const G4Run* aRun){
    G4double NumberOfEvents = aRun->GetNumberOfEventToBeProcessed();
	for (i=0; i<max_energy; i++)
	{	
		if (counts[i]>0) (G4cout << i << " kev: " << counts[i] << " counts." << G4endl);
		outfile << i << " " << counts[i] << endl;
	}  
}

1 Note: Re: Problems obtaining energy deposition spectrum (fixed... kind of?)   (Ashley Cullen - 11 May, 2008)
3 Feedback: Re: Problems obtaining energy deposition spectrum   (Peter Gumplinger - 20 May, 2008)
Question Discrete process calling order in InvokePostStepDoItProcs()  Keywords: Discrete Process calling
by Fernando Rannou <rannou@diinf.usach.cl>,   07 May, 2008
Hello
In G4SteppingManager::InvokePostStepDoItProcs() we find that the for-loop
is

for (size_t np=0; np < MAXofPostStepLoops; np++) {
   G4int Cond = (*fSelectedPostStepDoItVector)[MAXofPostStepLoops-np-1];
   if (Cond != ...)
   {
       InvokePSDIP(np);
   }
  ...

}

So, even though the if-test is on the [MAXofPostStepLoops-np-1] process
cond, the [np] process is called. What is the relation between the two?

Is this correct? 

Thanks
Fernando Rannou
None SteppingVerbose::VerboseTrack()  by <stadnik.piote@gmail.com>,   01 May, 2008
Hi,

I have a problem with SteppingVerbose class, I want to display only thigs printed by StepInfo() method, and dont display things from VerboseTrack() method.

VerboseTrack() method prits this:
*********************************************************************************************************
* G4Track Information:   Particle = e-,   Track ID = 682,   Parent ID = 670
*********************************************************************************************************

How can I override it?
1 None: Re: SteppingVerbose::VerboseTrack()   (michel maire - 01 May, 2008)
None Step Size in pre-packaged physics list  by Maurizio <ungaro@jlab.org>,   23 Apr, 2008

I'm trying to use SetUserLimits to limit the max step in my sensitive detectors.

This works if I add the G4StepLimiter to my particles in my physics list:

pmanager->AddProcess(new G4StepLimiter, -1,-1,3);

I would like to use not only my physics list but also the various QGSP, LHEP, etc.

Is there a way to limit the step size in this case?

thanks, mauri

1 Feedback: Re: Step Size in pre-packaged physics list   (Peter Gumplinger - 23 Apr, 2008)
None problems with specific particle and geometry  by Jasmine Ma <Jasmine Ma>,   18 Apr, 2008

Hi- I'm having trouble debugging the following error: I have a simulation that works on average about half of the time. When it doesnt work, it returns the error

#1 0x006c8ff3 in __waitpid_nocancel () from /lib/tls/libc.so.6

Cannot access memory at address 0x1 WARNING - Attempt to delete the physical volume store while geometry closed ! WARNING - Attempt to delete the logical volume store while geometry closed ! WARNING - Attempt to delete the solid store while geometry closed !

 for each run where it doesnt work, I've narrowed it down to one particle (the same particle in an ntuple always causes the problem)
 Kinematically, the offending particles do not seem to have anything in common, and as far as I can tell,
 the problem takes place at different geometric locations.

I've run the program with many points of output. and as far as I can tell, it must be happening at the end
 of or after "StackingAction"  but before the next "SteppingAction"

It seems to be random, except for the fact that the -same- particle always causes the problem.

I'm not sure what to do next, because the amount of output I'm getting tracking this thing is getting excessive. Are the errors about the geometry indicative of anything other than the obvious?

Thanks

Jasmine

None ? how reduce the size of output  by Joy Tan <Joy Tan>,   17 Apr, 2008

I disabled the tracking step information print out in my SteppingVerbose.cc, but the some words for each event in output are still there like below. So how to disable them all in output. Thanks

=====================================
  G4EventManager::ProcessOneEvent()  
=====================================
1 primaries are passed from G4EventTransformer.
!!!!!!! Now start processing an event !!!!!!!
### pop requested out of 1 stacked tracks.

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 1,   Parent ID = 0
*********************************************************************************************************

Track (trackID 1, parentID 0) is processed with stopping code 2
### pop requested out of 0 stacked tracks.
### 0 waiting tracks are re-classified to
     0 urgent tracks and 0 waiting tracks.
NULL returned from G4StackManager.
Terminate current event processing.
>>> Event 1

1 None: RE: ? how reduce the size of output   (Makoto Asai - 17 Apr, 2008)
Question Count all particles only once without "killing" the track  Keywords: counting particles
by Cristian Bungau <Cristian Bungau>,   17 Apr, 2008

Hi,

I would like to count all particles of a given type (e.g. electrons) that are present in my detector within a given time slice. However I cannot "kill" the e- once it is counted as it may interact further and produce additional electrons. Also my problem is that if I don't "kill" the track once it is counted, I must make sure I don't count the same e- twice, as after a new interaction the track ID will change. I would be very grateful if someone could please let me know if there is a way to count specific particles (only once) without stopping tracking them.

Thank you very much,

Cristian

1 None: RE: Count all particles only once without "killing" the track   (Makoto Asai - 17 Apr, 2008)
None simulation output define  by Joy Tan <Joy Tan>,   15 Apr, 2008

Thank you all for helping on my question before. I appreciate if any suggestion

I disabled the tracking step information print out in my SteppingVerbose.cc, but the some words for each event in output are still there like below. So how to disable them all in output. Thanks

=====================================
  G4EventManager::ProcessOneEvent()  
=====================================
1 primaries are passed from G4EventTransformer.
!!!!!!! Now start processing an event !!!!!!!
### pop requested out of 1 stacked tracks.

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 1,   Parent ID = 0
*********************************************************************************************************

Track (trackID 1, parentID 0) is processed with stopping code 2
### pop requested out of 0 stacked tracks.
### 0 waiting tracks are re-classified to
     0 urgent tracks and 0 waiting tracks.
NULL returned from G4StackManager.
Terminate current event processing.
>>> Event 1

None How to do event tracking selection  by Joy Tan <Joy Tan>,   14 Apr, 2008

I wonder how to add some tracking selection my Geant4 code. It's something like if the event has some particular interactions in particular volumes, the tracking of this event will stop and the system will jump to the next event. I suppose it will reduce my simulation time.Thanks

1 None: RE: How to do event tracking selection   (Makoto Asai - 14 Apr, 2008)
1 None: RE: How to do event tracking selection   (tan9@uiuc.edu - 14 Apr, 2008)
1 None: RE: How to do event tracking selection   (Makoto Asai - 14 Apr, 2008)
... 1 Message(s)
3 None: RE: How to do event tracking selection   (tan9@uiuc.edu - 15 Apr, 2008)
None size limitation on input file for generating an event made of multiple particles  by Victor_Makarov <Victor_Makarov>,   09 Apr, 2008

Hello! For my investigations I have to start lots of particles with individual parameters. For this I use an input file in ParticleGeneratorAction with all the particles and their info. I had no problem dealing with files of size about 5–10 megabytes. But my needs have risen and now I have to work with files of about 20-100 Mbytes. Geant gives me segmentation error when trying to read those. Is there any possibility to solve the problem without involving cycles and dividing one big input file into many small ones? Thank you.

Question Problem with G4SteppingManager::Stepping():DefinePhysicalStepLength()  by Yapeng Zhang <y.p.zhang@impcas.ac.cn>,   09 Apr, 2008
Hi, everybody,

I use Geant4.8.1.p02 with gcc 3.4.3, CLHEP 1.9.2.3 and the GDML_2_9_0.
There is no error in compiling process. I can get a proper geometric structure of detector in both OGLIX and Wired environment. 
But when I run the command "/run/beamOn 1" in Idle state, I get the following crash messages. 
Then, I found the crash point is  at "G4SteppingManager::Stepping():DefinePhysicalStepLength()".
The following is the values of some private variables of G4SteppingManager class before runing the Stepping():DefinePhysicalStepLength()function,  
"physIntLength  1.79769e+308,  fCondition  7117256, fGPIlSelection  536870912".
------------------------------------------------------------------------------------
 *** Break *** segmentation violation
(no debugging symbols found)
Using host libthread_db library "/lib/tls/libthread_db.so.1".
Attaching to program: /proc/28761/exe, process 28761
[Thread debugging using libthread_db enabled]
[New Thread 2305843009367821664 (LWP 28761)]
0xa000000000010641 in ?? ()
#1  0x20000000090c4eb0 in waitpid () from /lib/tls/libc.so.6.1
#2  0x2000000009013810 in do_system () from /lib/tls/libc.so.6.1
#3  0x200000000149c6c0 in TUnixSystem::Exec () from /cern/root/lib/libCore.so
#4  0x20000000014a9da0 in TUnixSystem::StackTrace ()
   from /cern/root/lib/libCore.so
#5  0x20000000014a2390 in TUnixSystem::DispatchSignals ()
   from /cern/root/lib/libCore.so
#6  0x20000000014a2700 in SigHandler () from /cern/root/lib/libCore.so
#7  0x20000000014a01a0 in sighandler () from /cern/root/lib/libCore.so
#8  <signal handler called>
#9  0x20000000052ec410 in G4VEnergyLossProcess::GetMeanFreePath ()
   from /cern/geant4/geant4.8.1.p02/lib/Linux-g++/libG4muons.so
#10 0x20000000052e2c80 in G4VContinuousDiscreteProcess::PostStepGetPhysicalInter
actionLength () from /cern/geant4/geant4.8.1.p02/lib/Linux-g++/libG4muons.so
#11 0x2000000007529200 in G4SteppingManager::DefinePhysicalStepLength ()
   from /cern/geant4/geant4.8.1.p02/lib/Linux-g++/libG4tracking.so
#12 0x2000000004c4cef0 in G4SteppingManager::Stepping ()
   from /home/ypzhang/geant4/HplusLib/Linux-g++/libHplus.so
#13 0x2000000004c50d30 in G4TrackingManager::ProcessOneTrack ()
   from /home/ypzhang/geant4/HplusLib/Linux-g++/libHplus.so
#14 0x200000000745d310 in G4EventManager::DoProcessing ()
   from /cern/geant4/geant4.8.1.p02/lib/Linux-g++/libG4event.so
#15 0x200000000745de90 in G4EventManager::ProcessOneEvent ()
   from /cern/geant4/geant4.8.1.p02/lib/Linux-g++/libG4event.so
#16 0x2000000004c44640 in G4RunManager::DoEventLoop ()
   from /home/ypzhang/geant4/HplusLib/Linux-g++/libHplus.so
#17 0x2000000004c41710 in G4RunManager::BeamOn ()
   from /home/ypzhang/geant4/HplusLib/Linux-g++/libHplus.so
#18 0x2000000006e3ea90 in G4RunMessenger::SetNewValue ()
   from /cern/geant4/geant4.8.1.p02/lib/Linux-g++/libG4run.so
#19 0x2000000007e03280 in G4UIcommand::DoIt ()
   from /cern/geant4/geant4.8.1.p02/lib/Linux-g++/libG4intercoms.so
#20 0x2000000007e1fd10 in G4UImanager::ApplyCommand ()
   from /cern/geant4/geant4.8.1.p02/lib/Linux-g++/libG4intercoms.so
#21 0x2000000007e203c0 in G4UImanager::ApplyCommand ()
   from /cern/geant4/geant4.8.1.p02/lib/Linux-g++/libG4intercoms.so
#22 0x20000000055dea40 in G4UIterminal::ExecuteCommand ()
   from /cern/geant4/geant4.8.1.p02/lib/Linux-g++/libG4UIbasic.so
#23 0x20000000055e1560 in G4UIterminal::SessionStart ()
   from /cern/geant4/geant4.8.1.p02/lib/Linux-g++/libG4UIbasic.so
#24 0x4000000000003a70 in main ()
WARNING - Attempt to delete the physical volume store while geometry closed !
WARNING - Attempt to delete the logical volume store while geometry closed !
WARNING - Attempt to delete the solid store while geometry closed !
WARNING - Attempt to delete the region store while geometry closed !
------------------------------------------------------------------------------
Any advice would be greatly appreciated.

Thans a lot!

Yapeng Zhang
1 None: Re: Problem with G4SteppingManager::Stepping():DefinePhysicalStepLength()   (Vladimir IVANTCHENKO - 10 Apr, 2008)
Question How to count the number of electrons generated and the locally deposited energy?  Keywords: Number of electrons, locally deposited energy
by Francisco <Francisco>,   02 Apr, 2008

Hi I already posted a question similar, but without answer. I will be grateful if someone can help me.

1. I need to know the total number of electrons created in my detector per volume. I know this information is available when you put: /tracking/verbose 1 or 2, but I need to have the total number, without seeing the whole history.

2. I also need to know the locally deposited energy. The one deposited by electrons below the threshold to know an estimation of those electrons.

Thanks in advance

Francisco

1 None: Re: How to count the number of electrons generated and the locally deposited energy?   (michel maire - 02 Apr, 2008)
(_ None: Re: How to count the number of electrons generated and the locally deposited energy?   (Francisco - 03 Apr, 2008)
(_ None: Re: How to count the number of electrons generated and the locally deposited energy?   (michel maire - 04 Apr, 2008)
None Track ID number and reactions  by AdamKl <AdamKl>,   02 Apr, 2008

Hi everybody I am a Geant4 novice. I inject a particle into a dense medium and want to see what comes out. In addition I want to sort events according to reaction type that occured inside that medium. My primary particle is neutron and I am specially interested in elastic and inelastic scattering events. So I collect G4Track objects and try to recognise "who is who" in such a collection of tracks. but I have a problem with ID number of tracks. I noticed that in the process of inelastic scattering on a nucleus the primary neutron (with track ID=1) somehow vanishes, its kinetic energy drops to 0 and then reappears but described by the track with id number=2. I have no means to check if it is the same neutron or reemitted one...Does anyone know how actually the track id numbers behave? Is there any order in assigning numbers, which for example would correspond to time axis in the simulation or it is rather random? What happens with the track IDs during a binary collision? Another problem is storing pointers to generated tracks. I guess that after a particle produced stops in the material, its track is deleted and keeping pointer to non-exisiting track is not only senseless but also dangerous, since geant internals my use this memory block for holding another track. Am I right? So I copy all tracks created during the programm execution, keep them on the heap and then analyse them at the end of each event. I look only for particles with non-zero kinetic energies, just to avoid analysing particles that died in the simulation. But I discovered that copy constructor of G4Track is very simple one, although G4Track objects hold pointers...is it secure? Perhaps you have better and a proven idea of how one could differentiate between various reactions? thanks and sorry for that long post Adam

None energy depostition of an individual track  by Victor_Makarov <Victor_Makarov>,   02 Apr, 2008

Hello. I would like to obtain e.d. per one track, but not per step or event. I thought it would be possible to use testem4 example policy with some modifications. In that example e.d. per step is sent and summed in EventAction and in the end of every event the summ is sent to histograms (e.d. per event)

This is the scheme that I used:

E.d. per step -----> it is sent and accumulated in TrackingAction ----> at the end of every track I send the summ to histo. Unfortnately, the sceme doesn't seem to work right. It seems that I make a mistake in sequence of making pointers. Here are the corresponding parts of my program:

-- part of main program ---

 runManager->SetUserAction(new PrimaryGeneratorAction);
  RunAction* RunAct     = new RunAction;
  runManager->SetUserAction(RunAct);
  EventAction* EvAct    = new EventAction(RunAct);  
  runManager->SetUserAction(EvAct);
TrackingAction* TrAct = new TrackingAction(RunAct);
  runManager->SetUserAction(new SteppingAction(TrAct));

  //Initialize G4 kernel
  runManager->Initialize();

 --- part of stepping action ----

void SteppingAction::UserSteppingAction(const G4Step* aStep)
{
  G4String pname = aStep->GetTrack()->GetDefinition()->GetParticleName();
G4double EdepStep = 0;
  if(pname=="gamma")  EdepStep = aStep->GetTotalEnergyDeposit();
  if (EdepStep > 0.) trackingAction->addEdep(EdepStep);	 
}

-- part of trackingaction.cc ----

void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
{
#ifdef G4ANALYSIS_USE
  Run->GetHisto(0)->fill(TotalEnergyDeposit/MeV);
#endif
}

--part of trackingaction.hh

class TrackingAction : public G4UserTrackingAction {

  public:  
    TrackingAction(RunAction*);
   ~TrackingAction() {};
     void addEdep(G4double Edep)     {TotalEnergyDeposit += Edep;};      
    G4double GetEnergyDeposit()     {return TotalEnergyDeposit;};    
    void PreUserTrackingAction(const G4Track*);
    void PostUserTrackingAction(const G4Track*);

  private:
    RunAction* Run;    
    G4double TotalEnergyDeposit;   
};

BIG THANKS IN ADVANCE!

P.s: Also I can't understand how in line of EventAction of TestEm4 Run->GetHisto(0)->fill(TotalEnergyDeposit/MeV) we obtain TotalEnergyDeposit value because GetEnergyDeposit method was not used in EventAction.cc Or is this method applied directly from EventAction.hh?

1 None: Re: energy depostition of an individual track   (michel maire - 02 Apr, 2008)
(_ None: Re: energy depostition of an individual track   (Victor_Makarov - 02 Apr, 2008)
None Tracking original x-ray  Keywords: Tracking original ray
by John <calculus7@gmail.com>,   31 Mar, 2008

I am writing a program to send x-rays through a detector. How would I color the original x-ray (the first one) blue? I know that it has something to do with the trackID being 1.

None Parallel Tracking  by Tom Roberts <Tom Roberts>,   24 Mar, 2008

I would like to open a discussion of tracking in parallel. At the last Geant4 forum it was mentioned that multi-threaded tracking would at least be investigated (if not implemented) in 2008. My need is slightly less ambitious, as I want to use a single thread but invert the loops and manager classes such that I have a std::vector<G4Track*> and can take a single step in each track, perform a computation involving the entire vector of tracks, and then take another step in each track, etc. This is for the simulation of collective effects in particle beams, and that computation can modify the individual tracks (which is why the standard order of tracking won't work).

I have found that in addition to the G4Track*, each track instance needs an individual copy of: G4Event, G4SteppingManager, G4Navigator, and G4ProcessManager (including a copy of each process). A copy of G4GlobalField might conceivably be needed, but not for my implementation.

I have written my own RunManager that implements this without changing any Geant4 code; in essence it incorporates the EventManager, the TrackingManager, and parts of the SteppingManager. Basically for each entry in the track vector it sets up all the above classes for the tracking, calls G4SteppingManager::Stepping() to take one step, restores the original class pointers, and then moves on to the next entry in the vector. This works for geantino-s, but not for mu+ or other particles. The basic problem is the initialization of the physics processes.

Remember that there is a G4ProcessManager for each particle, and the process manager contains a list of processes that apply to the particle. The individual processes are written with the assumption that only a single track is being tracked, so they maintain internal state. It is possible to exchange process managers for a given particle, and that is how my code works, keeping an individual copy of the process manager (and its processes) for each track. Remember also that the construction of the process list for each particle is done in user code (so there is little control over it).

The problem is getting the processes initialized correctly. I have tried several work-arounds that create multiple process mangers for a particle, and setup the list of processes in the process manager, but none of them work for the energy loss processes. There may well be other processes for which they don't work.

I have concluded that I need to change Geant4 code to do this (no big surprise). The obvious way is to implement a clone() function in G4ProcessManager, and it will need a virtual clone() function in G4VProcess. Each clone() function should perform a deep copy of the object, using a reference to read-only data (such as large physics tables) and copying the class object and any other writable data objects that maintain tracking state. This will require a valid copy constructor for all of the relevant classes (most of which have a deliberately unimplemented private copy constructor specifically to prevent its use). It might also require a re-design if there are classes that maintain both a tracking state and some other non-tracking state (I hope this does not happen). All this requires knowledge of each process to determine how to correctly implement the copy constructor and the clone() function for the process class.

That is an arduous task, as it involved understanding each and every process and implementing the new functions appropriately. Initially I can get by with only the transportation, decay, and EM processes for muons and electrons, but eventually I'll want them all.

Note that any type of parallel tracking will need to address this same problem. This includes multiple-thread tracking to support the multi-CPU systems that are now common.

Does anyone have any suggestions? Comments?

(Note: this discussion many need to move to some physics process forum, as that is where the problem lies.)

1 None: Re: Parallel Tracking   (Tom Roberts - 30 Jun, 2008)
Question How to record the exit point of a particle in the detector?  Keywords: Exit point of a gamma
by Carlos Martinez <astrocometin@gmail.com>,   20 Mar, 2008

Hello, I'm sort of a new user to Geant4. I have a square detector and I'm trying to record the exit point (coordinates x,y,z) of a gamma that I'm generating, but I haven't been able to do it. If anybody can help me it will be greatly appreciated.

Thanks in advance.

Carlos

1 Feedback: Re: How to record the exit point of a particle in the detector?   (Peter Gumplinger - 20 Mar, 2008)
3 None: Re: How to record the exit point of a particle in the detector?   (michel maire - 21 Mar, 2008)
Question Need some help with G4StepLimitter, G4UserLimits, and other things  Keywords: SteppLimiter; UserLimits; SetEnergyRange; step size
by Miguel Couceiro <Miguel Couceiro>,   17 Mar, 2008
Hi all,

I am performing a very simple simulation for computing the number
of primary ionization clusters produced in a gas when a pion passes
through it. I am using LowEnergyProcesses for Photons and Electrons,
with energy cuts of 100 eV, and range cuts of 1 nm.

G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100.0*eV, 100.0*GeV);

To all particles that I am interested in setting a step limitation,
I had the line

pManager->AddDiscreteProcess(new G4StepLimiter());

at the end of the process manager. I thought that in this way all
the other processes would be treated first, and then the step
limitation would be applied.

In my detector construction I have inserted the line

m_pDetector_log->SetUserLimits(new G4UserLimits(fract*m_fDetectorThickness)); 

My gas volume has a 1 mm thick, and I am using a fixed seed for my
simulations. When I comment the above line, I get, in the first event,
two steps of 0.5 mm for which of them I get “msc”. When I activate
the UserLimits with fract < 0.5, I get SteppLimitter as the process,
instead of “msc”. Besides, if I use fract = 0.1 and fract 0.01, with
the same initial seed, the total energy deposit in the gas, the point
from where the pion leaves the gas, as well as it's momentum direction
will be different.

Since the cuts and seed are all the same, I would expect to obtain
the same results when I reduce “fact”, but with more precise local
energy deposit. Is this correct, or the step size will also influence
the physics results?

Another question concerns the step size on the boundary surfaces
to take into account more realistic backscattering effects. How can
I implement this step limitation, or were can I find some more
information about it? (The user manual is not clear to me in this point.)

At last, some papers discuss the possibility to use LowEnergyProceses
down to 100 eV. Since I am interested in electron avalanches, and since
gas ionization energies are of the order of 10 to 20 eV, is it possible
to use GEANT4 to study the primary ionization cluster statistics,
as well as electron avalanche statistics? Some papers also discuss the
fact that, since LowEnergyProcesses rely on EEDL data, they should be
applicable to energies down to 10 eV? However, cross sections and
stopping powers from EPDL97 and EEDL for 10 eV have large errors,
mainly EDL97. Since the command 

G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100.0*eV, 100.0*GeV);

sets the energy cuts for both photons and electrons, then the results
for photons shouldn't be very reliable. Is this correct, or one can
in fact set the low energy cut down to 10 eV, without significant loss
of accuracy?

Thanks in advance,
Miguel
1 None: Re: Need some help with G4StepLimitter, G4UserLimits, and other things   (Vladimir IVANTCHENKO - 18 Mar, 2008)
None Does any body calculate flux [1/cm^2]?  by Yuri Burmistenko <Yuri Burmistenko>,   15 Mar, 2008

Is there in G4 a builtin option to calculate Flux, to achive [1/cm^2]?

Question Problems for transportation of high energy optical photons  Keywords: optical photon transportation OpAbsorption
by Keito Horie <kate@rcnp.osaka-u.ac.jp>,   11 Mar, 2008

Hello.

I would like to ask the treatment of photons which have the energy higher than 3.6 eV.(350nm) in GEANT4. I found that such a high energy “opticalphoton” cannot be transported in materials. Opticalphotons (> 3.6eV) were generated in G4MaterialPropertiesTable, and ABSLENGTH and RINDEX were also set. It is needless to say that low energy photons have no problem. High energy photons were once generated, but surely killed in the first step, which can be easily recognized by using G4UserSteppingAction. The following is the information which I encountered in the study of the above problem.

(1)PhysicsList:

G4Cerenkov, G4OpAbsorption, G4OpRayleigh, and G4OpBoundaryProcess were activated.

(2) ABSLENGTH parameter:

The situation was not changed if I used too exaggerated setting such as 1.e30m. In special case that I did not set ABSLENGTH by commenting out “myMPT->AddProperty("ABSLENGTH",PhotonEnergy, Absorption,nEntries);” in G4VUserDetectorConstruction, the photons were turned out to be not killed.

(3) materials:

The situation was not changed if I used Air, glass, and so on.

(4) Log message:

The following is log message displayed in “/tracking/verbose 1” mode. Message of

** Photon absorbed! **
    1   -2.3 mm  -80.1 um   65.4 um    3.8 eV      0 eV      0 fm      0 fm
  Layer3  OpAbsorption

was shown, indicating photons were surely killed by OpAbsorption.

Best regards, Keito Horie

 

1 Feedback: Re: Problems for transportation of high energy optical photons   (Peter Gumplinger - 12 Mar, 2008)
(_ None: Re: Problems for transportation of high energy optical photons   (Keito Horie - 17 Mar, 2008)
(_ Disagree: Re: Problems for transportation of high energy optical photons   (Peter Gumplinger - 17 Mar, 2008)
(_ None: Re: Problems for transportation of high energy optical photons (solved.)   (Keito Horie - 18 Mar, 2008)
None Isotropic source how to specify???  by Yuri Burmistenko <Yuri Burmistenko>,   11 Mar, 2008

I am sorry to ask such a silly thing, but really can't find how to do this :/

1 None: Re: Isotropic source how to specify???   (Victor_Makarov - 12 Mar, 2008)
None counting decays at rest separately from decays in flight  by Bari Osmanov <Bari Osmanov>,   06 Mar, 2008

 Hello, I am simulating the experiment on interaction of 1 GeV protons with mercury target.
 I am counting secondary pions produced that further decay to muons and neutrinos.
 In the past I simply counted all the pions and muons that decay. However, now I need to count
separately pions/muons that decay at rest and in flight.
 I will appreciate if someone tells me the way to do that.

 Thank you.

1 Feedback: Re: counting decays at rest separately from decays in flight   (Peter Gumplinger - 06 Mar, 2008)
(_ None: Re: counting decays at rest separately from decays in flight   (barry_osm@yahoo.com - 06 Mar, 2008)
Question Tracking particles  by <sdreda@hotmail.fr>,   06 Mar, 2008

Hi all,

Hello , I am a new user of GEANT4. I simulated interaction of carbone12 on water target, and I am looking the differents fragments producted in my phantom. I am in the class of MySteppingAction and I want to have the number of the nucleus C10 pruducted Vs Depth(z) of my phantom . What is the instruction which give me this solution?

The instruction :
 G4Track* track = s->GetTrack(); 
 G4String Name = particule->GetParticleName();
 if(Name=="C10[0.0]"){
 G4double Z = track->GetPosition().z();
  ..... 
}
 doesn't give ma what I want.

Any suggestions would be appreciated.

Thanks

Question GENERATION OF SPECTRUM IN PRIMARYGENERATORACTION  Keywords: PrimaryGeneratorAction, Spectrum input
by Francisco <Francisco>,   04 Mar, 2008

Hi I have a problem with PrimaryGeneratorAction. I have a file with a spectrum first column is Energy and second is NofParticles. The code works well for a small number of particles. For the following code the program crashes in the third line. Can someone give me some help?

PrimaryGeneratorAction::PrimaryGeneratorAction()
{
  G4int n_particle = 1; 
  particleGun = new G4ParticleGun(n_particle);
  G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
  G4String particleName;
  particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="gamma"));
  rBeam   = 0.65*cm; 
}
PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
  delete particleGun;
}

void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
   ifstream indata;                           
   G4double Energy;
   G4int NofParticles;                                 

  indata.open("/g4work/examples/extended/electromagnetic/TestEm4/spectrum30keV-1mA.dat");                  
   if(!indata) {                            
      G4cerr << "Error: file could not be opened" << G4endl;
      exit(1);
   }
   G4cout << "GIVE THE NUMBER OF ENERGIES OF THE SPECTRUM: " << G4endl; 
   G4int N;
   G4cin >> N; 

   for (G4int j=0; j<N ; j++) {
     indata >> Energy;
     indata >> NofParticles; 

     G4int i=0;
        while (i < NofParticles) {   
	 i++;

	   G4double y0 = 0.5*cm;
           G4double beam  = rBeam;
           G4double x0 =  (2*G4UniformRand()-1.)*rBeam;
           G4double z0 = (2*G4UniformRand()-1.)*rBeam;
           particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
           particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,-1.,0.));
           particleGun->SetParticleEnergy(Energy*keV);
           particleGun->GeneratePrimaryVertex(anEvent);        
	 }
    }

indata.close(); }

This is a piece of the spectrum where it crashes: 9 keV- 15529/ 10 keV- 65569/ 11 keV- 1359686/

Thanks in advance

1 Feedback: Re: GENERATION OF SPECTRUM IN PRIMARYGENERATORACTION   (Peter Gumplinger - 06 Mar, 2008)
(_ None: Re: GENERATION OF SPECTRUM IN PRIMARYGENERATORACTION   (Francisco - 07 Mar, 2008)
(_ None: Re: GENERATION OF SPECTRUM IN PRIMARYGENERATORACTION   (Francisco - 11 Mar, 2008)
Question dumping neutron energy at point of creation  by Adam Hecht <Adam Hecht>,   29 Feb, 2008

I'm striking an object with protons and I'd like to measure the energy that is otherwise carried away by secondary neutrons. Is there a way to force the secondary neutrons to deposit all their energy immediately in a sensitive detector?

An alternative approach is to record only neutrons which travel out of the target region and surround the target with a thick sensitive detector. Any suggestions?

Thanks Adam

None Select trajectories  Keywords: Selecting only choice tracks
by Chibueze Zimuzo <Chibueze Zimuzo>,   23 Feb, 2008

Hi All,

Please can someone tell me how I can optionally select and output choice tracks. I am simulating Compton camera arrangement (incoming photons< 1MeV) and need to output only the photons that meet specify requirements(Compton Scattering in first detector and photo-absorption in the second detector). It has been difficult for me to figure out this for sometime now.

Below is my SteppinAction file and error message.

Thanks for useful advice. ]

CC01SteppingAction::CC01SteppingAction() {;}

CC01SteppingAction::~CC01SteppingAction() {;}

void CC01SteppingAction::UserSteppingAction(const G4Step * theStep)
{
  G4Track * theTrack = theStep->GetTrack();

  // check if it is alive
  if(theTrack->GetTrackStatus()!=fAlive) { return; }

  // check if it is primary
  if(theTrack->GetParentID()!=0) { return; }

   G4StepPoint * thePrePoint = theStep->GetPreStepPoint();
  G4VPhysicalVolume * thePrePV1 = thePrePoint->GetPhysicalVolume* physiScatterer();
  G4String thePrePVname = G4RunMan->GetName();
  if(thePrePVname(0,9) =="Scatterer" &&) {
      if(theTrack->GetCreatorProcess()->GetProcessName() == "PenCompton")
      theTrack->SetTrackStatus(fAlive);
      else
	  theTrack->SetTrackStatus(fSuspend);
  }

    if(thePrePVname(0,8) == "Absorber" &&) {
	if(theTrack->GetCreatorProcess()->GetProcessName() == "PenCompton")  
	    theTrack->SetTrackStatus(fAlive);
}
    else
	theTrack->SetTrackStatus(fSuspend);

Error Message

czu1@magneto:~/GATE/geant4.8.1.p02/1> gmake Making dependency for file CC01.cc ... Making dependency for file src/CC01SteppingAction.cc ... Compiling CC01SteppingAction.cc ... src/CC01SteppingAction.cc: In member function ‘virtual void CC01SteppingAction::UserSteppingAction(const G4Step*)’: src/CC01SteppingAction.cc:31: error: expected primary-expression before ‘)’ token src/CC01SteppingAction.cc:39: error: expected primary-expression before ‘)’ token

gmake: *** [tmp/Linux-g++/CC01/CC01SteppingAction.o] Error 1

Cheers,

Chibueze.

1 Feedback: Re: Select trajectories   (Peter Gumplinger - 25 Feb, 2008)
3 None: Re: Select trajectories   (Makoto Asai - 26 Feb, 2008)
Question Special time Stack  Keywords: stack time
by Kevin Xie <Kevin Xie>,   21 Feb, 2008
Hello,
  Can I use a Stack in which the tracks will be traced according to the 
GlobleTime? Ie. the earliest track should be traced firstly, it is not 
the common used last-in-first-out Stacks but useful in simulation. 
  The other question is how can I get the infomation of any 
StackedTrack (not only the last and first StackedTrack) in 
G4TrackStack?

  Best regards,
  Kevin Xie
1 More: Re: Special time Stack   (Peter Gumplinger - 22 Feb, 2008)
1 None: Re: Special time Stack   (Kevin Xie - 23 Feb, 2008)
3 None: Re: Special time Stack   (Makoto Asai - 26 Feb, 2008)
Question problems on boundaries  Keywords: boundary
by giuseppe <giuseppe>,   11 Feb, 2008
Hi,

I'm considering a 250 MeV proton beam in a detector composed of
a polystyrene layer (thickness of 1 mm),
a MS20 tissue layer (thickness of 6 micron) and
a water layer (thickness of 1 mm).
I’m using

tracking/verbose 1
/testem/phys/addPhysics  standard		#em physics
PhysicsList::AddPhysicsList: <standard>
/testem/phys/addPhysics  binary 		#hadronic physics
PhysicsList::AddPhysicsList: <binary>
/testem/phys/addPhysics  binary_ion		#hadronic physics
PhysicsList::AddPhysicsList: <binary_ion>
/testem/phys/addPhysics  elastic		#hadronic physics
PhysicsList::AddPhysicsList: <elastic>
PhysicsList::SetCuts:CutLength : 10 nm

When I store and save the information about the number
of secondary electrons with energy equal to 0 lying on the
two interface planes (polystyrene- MS20) and (MS20- water),
I obtain the following result:

Nel(polystyrene- MS20 interface) = 20 * Nel(MS20- water interface)

Why is the number of secondary electrons with energy equal
to 0 on the interface (polystyrene- MS20) about 20 times greater
than the number of secondary electrons with energy equal to 0 on
the interface (MS20- water) ??

Please help me.
 
Thanks a lot. 

Giuseppe
1 None: Re: problems on boundaries   (Vladimir IVANTCHENKO - 11 Feb, 2008)
1 None: Re: problems on boundaries   (giuseppe - 12 Feb, 2008)
2 None: Re: problems on boundaries   (michel maire - 12 Feb, 2008)
1 None: Re: problems on boundaries   (giuseppe - 12 Feb, 2008)
3 None: Re: problems on boundaries   (giuseppe - 12 Feb, 2008)
None Can I chage the step size durring a single event?  Keywords: change step size
by pete <pete>,   29 Jan, 2008
Greetings,

I currently use " logicWorld->SetUserLimits (new G4UserLimits(stuff)); "
to set the maximum step size for my simulations.

I perform this call in my DetectorConstruction.cc file.


In my simulation I only need a small step size in a certain range.
Is it possible to change the stepsize during an event based on the 
kinematics of my particle? (for instance in SteppingAction.cc)

-pete
1 None: Re: Can I chage the step size durring a single event?   (michel maire - 30 Jan, 2008)
(_ None: Re: Can I chage the step size durring a single event?   (pete - 30 Jan, 2008)
(_ None: Re: Can I chage the step size durring a single event?   (michel maire - 30 Jan, 2008)
(_ None: Re: Can I chage the step size durring a single event?   (pete - 07 Feb, 2008)
1 None: Re: Can I chage the step size durring a single event?   (Marc Verderi - 07 Feb, 2008)
2 None: Re: Can I chage the step size durring a single event?   (michel maire - 08 Feb, 2008)
None Cutoff of number of events using PYTHIA event generator  Keywords: Cutoff of number of events using PYTHIA event generator
by Stephanie Hickford <svh13@student.canterbury.ac.nz>,   23 Jan, 2008

Hi,

I am using novice exampleN04 to simulate production of muons. I am using PYTHIA as my event generator and have .data files with 10,000 events. I have a macro called run.mac in which I have the command run/beamOn xxx. I have set this event number to 10, 100, 500 and 1,000 but GEANT does not appear to execute the correct number of events. For example, I get the follwing number of muons for each number of events:

10 events : 4,622 muons

100 events : 28,284 muons

500 events : 95,690 muons

1,000 events : 95,690 muons

It appears to me that GEANT is probably doing somewhere between 100 and 500 events and then just stopping (with no error message). My question is : is there somewhere in GEANT that limits the number of events that can be processed in this way?

Thanks, Stephanie

1 None: RE: Cutoff of number of events using PYTHIA event generator   (Makoto Asai - 23 Jan, 2008)
None Query: Function to perform tracking for 1 G4Track  by Tom Roberts <Tom Roberts>,   09 Jan, 2008

I have two different problems for which it would be very useful if I had a simple function to track a G4Track. I want it to track the track until it is killed, with any secondaries pushed onto the usual stack. The results I need from the tracking will be handled by the usual user action callbacks and/or processes attached to the various particles. This is in some sense turning "inside out" the combination of G4RunManager and G4EventManager.

I envision a program structure basically like this:

    // MyRunManager is derived from G4RunManager
    MyRunManager *mgr = new MyRunManager();
    .... code to setup all the user action callbacks
    mgr->initialize();
    mgr->startRun(int runnum);
    mgr->startEvent(G4int evnum);
    loop {
        ... code that calls mgr->doTracking(G4Track &track)
        ... code that handles secondaries pushed onto the stack(s)
    }
    mgr->endEvent();
    mgr->endRun();
    delete mgr;
    ::exit(0);

There might be loops over runs and/or events. The call to doTracking() might be inside the FCN of TMinuit (from Root).

Any suggestions on how to do this? It requires delving deeply into the innards of the Geant4 run, event, tracking, and stacking managers, and probably copying code from them into MyRunManager (G4RunManager is the only one of them that is supposed to be sub-classed by users).

1 None: Re: Query: Function to perform tracking for 1 G4Track   (Tom Roberts - 16 Jan, 2008)
None How can I reach the particle name through the Step or Track class in my hit file ?  by David Oxley <David Oxley>,   07 Jan, 2008

Hi,

I am trying to retrieve the particle name in order to output it along with other information to a csv file. I know how to manually go through if /tracking/verbose 1. I am ideally looking for something along the lines of aStep->GetTrack()->GetParticle()->GetParticleName()

However I know that doesn't work.

Section 5.1.2 of the manual claims I can gain a pointer to the dynamic particle from the track/step. Does anyone know if this will help me ?

Any help is appreciated and sorry, if this is more than a little stupid.

Dave

1 Feedback: Re: How can I reach the particle name through the Step or Track class in my hit file ?   (Peter Gumplinger - 07 Jan, 2008)
(_ None: Re: How can I reach the particle name through the Step or Track class in my hit file ?   (David Oxley - 07 Jan, 2008)
None a question on StackingAction  by Victor_Makarov <Victor_Makarov>,   06 Dec, 2007

When I use aTrack->GetVertexKineticEnergy() in StackingAction::ClassifyNewTrack(const G4Track * aTrack), it returns zero. Why? How can I get initial energy of a track in stacking action? Thanks

1 None: Re: a question on StackingAction   (Makoto Asai - 26 Feb, 2008)
Question Segmentation violation when accessing secondary tracks from SteppingAction  Keywords: Tracking Secondaries Segmentation violation
by Michael Gericke <Michael Gericke>,   18 Nov, 2007

Hi,

I am simulating cold neutron capture on some materials. I am trying to get track information out of the secondaries vector, in the function UserSteppingAction, as shown below. The problem is that for some events (very few) the simulation crashes (see further down for messages), not allowing me to access any information.

Two remarks:

1) the problem does not occur with 4.8.2, but does with 4.9.0.p01

2) if I remove the code shown below, the problem goes away

Has anyone encountered this problem:

  for(G4int i = GetTrackVectorSize()-nSecTotal; i < GetTrackVectorSize(); i++){

    G4VUserTrackInformation *test = ((*fSecondary)[i]->GetUserInformation()); <--- crashes here
    //     infoNew = (N3HeSimTrackInformation*)test;
    //     infoNew  = (*fSecondary)[i]->GetUserInformation();

    if(test == 0){//(*fSecondary)[i]->GetUserInformation()==0){

      infoNew = new N3HeSimTrackInformation();

      infoNew->StoreParentTrackID(theTrack->GetTrackID());
      infoNew->StoreParentEnergy(theTrack->GetKineticEnergy());
      infoNew->StoreEventNumber(myUserInfo->GetPrimaryEventNumber());
      infoNew->SetNewFlag(true);
      (*fSecondary)[i]->SetUserInformation(infoNew);
    }
    else{
      infoNew = (N3HeSimTrackInformation*)test;
      //       infoNew = (N3HeSimTrackInformation*)((*fSecondary)[i]->GetUserInformation());
      infoNew->StoreParentTrackID(theTrack->GetTrackID());
      infoNew->StoreParentEnergy(theTrack->GetKineticEnergy());
    }

    etc ...

Note: 

       GetTrackVectorSize() just return (*fSecondary).size()

1 None: Re: Segmentation violation when accessing secondary tracks from SteppingAction   (Michael Gericke - 18 Nov, 2007)
3 Idea: Re: Segmentation violation when accessing secondary tracks from SteppingAction   (Peter Gumplinger - 19 Nov, 2007)
None Transmission of gamma ray  by John <calculus7@gmail.com>,   05 Nov, 2007

The program that I am working on requires me to determine if a gamma ray is sent straight through a metal detector (transmitted without producing electrons in the metal). I have decided to do this by seeing if the direction at the end of its path is the same as at the beginning of its path. I tried implementing this in my code through the PreUserTrackingAction and PostUserTrackingAction parts of the TrackingAction class and sending flags to runaction. I do not get expected results. Am I doing something wrong? Any suggestions would be very appreciated.

1 None: Re: Transmission of gamma ray   (michel maire - 07 Nov, 2007)
(_ None: Re: Transmission of gamma ray   (John - 09 Nov, 2007)
(_ None: Re: Transmission of gamma ray   (michel maire - 10 Nov, 2007)
(_ Agree: Re: Transmission of gamma ray   (John - 10 Nov, 2007)
(_ None: Re: Transmission of gamma ray   (michel maire - 12 Nov, 2007)
(_ Question: Re: Transmission of gamma ray   (John - 19 Nov, 2007)
(_ None: Re: Transmission of gamma ray   (michel maire - 20 Nov, 2007)
Question a question on special cuts per region  by Victor_Makarov <Victor_Makarov>,   01 Nov, 2007

Hello. This is my problem. My aim is to eliminate electrons', positrons', and gammas' creation in uran. For this purpose I created a region, assigned it to a logical volume of uran. My default production cuts (I used QGSP_BERT_HP list with 10 cm) are also used for my created region if I do not manually set special ones, right? Here's a printout where one can see that very high energy thresholds are used for uran. But further we can see that low energy gammas and electrons are still created in uran. Please, could somebody point at my mistake? Thanks in advance.

Region <DefaultRegionForTheWorld> -- appears in <VAC> world volume
 Root logical volume(s) : VAC 
 Pointers : G4VUserRegionInformation[00000000], G4UserLimits[00000000], G4FastSimulationManager[00000000], G4UserSteppingAction[00000000]
 Materials : Air 
 Production cuts :  gamma 10 cm     e- 10 cm     e+ 10 cm 

Region <Uregion> -- appears in <VAC> world volume
 Root logical volume(s) : Uran 
 Pointers : G4VUserRegionInformation[00000000], G4UserLimits[00000000], G4FastSimulationManager[00000000], G4UserSteppingAction[00000000]
 Materials : EU 
 Production cuts :  gamma 10 cm     e- 10 cm     e+ 10 cm 

========= Table of registered couples ==============================

Index : 0     used in the geometry : Yes     recalculation needed : No 
 Material : Air
 Range cuts        :  gamma 10 cm     e- 10 cm     e+ 10 cm 
 Energy thresholds :  gamma 1.19365 keV    e- 86.3701 keV    e+ 84.7899 keV
 Region(s) which use this couple : 
    DefaultRegionForTheWorld

Index : 1     used in the geometry : Yes     recalculation needed : No 
 Material : EU
 Range cuts        :  gamma 10 cm     e- 10 cm     e+ 10 cm 
 Energy thresholds :  gamma 2.88022e+295 J      e- 1.82628 GeV    e+ 1.73853 GeV
 Region(s) which use this couple : 
    Uregion

====================================================================

Start closing geometry. G4GeometryManager::ReportVoxelStats -- Voxel Statistics

    Total memory consumed for geometry optimisation:   0 kByte
    Total CPU time elapsed for geometry optimisation: 0 seconds

    Voxelisation: top CPU users:
    Percent   Total CPU    System CPU       Memory  Volume
    -------   ----------   ----------     --------  ----------
       0.00         0.00         0.00            0k VAC

    Voxelisation: top memory users:
    Percent     Memory      Heads    Nodes   Pointers    Total CPU    Volume
    -------   --------     ------   ------   --------   ----------    ----------
     100.00          0k         1        3          4         0.00    VAC
### Run 0 start.
*******************
*** AUTOSEED ON ***
*******************

--------- Ranecu engine status ---------
 Initial seed (index) = 0
 Current couple of seeds = 1193925577, 403480289
----------------------------------------
Start Run processing.

---> Begin of Event: 0

*********************************************************************************************************
* G4Track Information:   Particle = neutron,   Track ID = 1,   Parent ID = 0
*********************************************************************************************************

Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
    0      0 fm      0 fm  -49.9 m      14 MeV     0 eV      0 fm      0 fm         Uran    initStep
    1      0 fm      0 fm  -49.9 m       0 eV      0 eV   5.91 cm   5.91 cm         Uran  HadronFission
    :----- List of 2ndaries - #SpawnInStep=  2(Rest= 0,Along= 0,Post= 2), #SpawnTotal=  2 ---------------
    :      0 fm      0 fm  -49.9 m    20.2 MeV   neutron
    :      0 fm      0 fm  -49.9 m    1.73 MeV   neutron
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------

*********************************************************************************************************
* G4Track Information:   Particle = neutron,   Track ID = 3,   Parent ID = 1
*********************************************************************************************************

Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
    0      0 fm      0 fm  -49.9 m    1.73 MeV     0 eV      0 fm      0 fm         Uran    initStep
    1   -174 um  -67.7 um  -49.9 m       0 eV      0 eV    348 um    348 um         Uran  NeutronInelastic
    :----- List of 2ndaries - #SpawnInStep=  3(Rest= 0,Along= 0,Post= 3), #SpawnTotal=  3 ---------------
    :   -174 um  -67.7 um  -49.9 m    1.68 MeV   neutron
    :   -174 um  -67.7 um  -49.9 m     7.2 keV U235[0.0]
    :   -174 um  -67.7 um  -49.9 m    51.6 keV     gamma
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------

*********************************************************************************************************
* G4Track Information:   Particle = gamma,   Track ID = 6,   Parent ID = 3
*********************************************************************************************************

Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
    0   -174 um  -67.7 um  -49.9 m    51.6 keV     0 eV      0 fm      0 fm         Uran    initStep
    1   -240 um  -31.2 um  -49.9 m       0 eV   21.8 keV  95.6 um   95.6 um         Uran        phot
    :----- List of 2ndaries - #SpawnInStep=  1(Rest= 0,Along= 0,Post= 1), #SpawnTotal=  1 ---------------
    :   -240 um  -31.2 um  -49.9 m    29.9 keV        e-
    :----------------------------------------------------------------- EndOf2ndaries Info ---------------

*********************************************************************************************************
* G4Track Information:   Particle = e-,   Track ID = 7,   Parent ID = 6
*********************************************************************************************************

Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
    0   -240 um  -31.2 um  -49.9 m    29.9 keV     0 eV      0 fm      0 fm         Uran    initStep
    1   -240 um  -31.3 um  -49.9 m       0 eV   29.9 keV  2.42 um   2.42 um         Uran       eIoni

1 None: RE: a question on special cuts per region   (Makoto Asai - 01 Nov, 2007)
1 None: RE: a question on special cuts per region   (Victor_Makarov - 01 Nov, 2007)
2 None: Re: a question on special cuts per region   (Vladimir IVANTCHENKO - 04 Nov, 2007)
None Untitled  by Ibrahim <Ibrahim>,   24 Oct, 2007

Hi;

i'd like to send gammas into my detector in 4Pi(angle solid= 4pi), how can i do it?

Best Ragards

None How to access to G4VSolid* in StackingAction()?  by <hyao@jlab.org>,   21 Oct, 2007
I am trying to figure out if the primary vertex will hit the mirror. If
not, I will kill this event in StackingAction(), and I'm going to use
G4VSolid->DistantToIn(p,v). But the problem is that I can't get the solid information. 

This is the way I am doing ( I just type all the main part )
-----------------------------------------------------------------------
First, Create a UserDefined Class corresponding geo info.

class Geo()
{
   public:
         Geo();
         ~Geo();
   public:
         G4VSolid* GetGeoSolid() {return fSolid;}
         void SetGeoSolid(G4VSolid* aSolid){ fSolid=aSolid; }
         G4String GetGeoName() { return fName; }
       

   private:
         G4VSolid* fSolid;
         G4String fName;
}
----------------------------------------------------------------------
Second, I create a UserDefined Manager corresponding to detector part

Class UserManager()
{
   public:
        UserManager();
        ~UserManager();

   public:
        vector<Geo> GetMirror() { return mirror; }
        
        static UserManager* GetUserManager();
   private:
        static UserManager* fUserManager();

   private:
        vector<Geo> mirror;
}

---------------------------------------------------------------------
Third, I set mirror solid in DetectorConstruction.cc

UserManager* Userman=UserManager::GetUserManager();
vector<Geo> MirrorObj=Userman->GetMirror();
G4VSolid* mir_solid=(blablabla)
MirrorObj.SetGeoSolid(mir_solid);
G4cout<<"solid_name="<<MirrorObj.GetGeoSolid()->GetName()<<G4endl;

--------------------------------------------------------------------


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Last, I try to read this mirror in StackingAction()

UserManager* Userman=UserManager::GetUserManager();
vector<Geo> MirrorObj=Userman->GetMirror();
G4cout<<"solid_name="<<MirrorObj.GetGeoName()<<G4endl;

//So far, everything is fine. I see the output. 
//Problem happens next line. It's exactly same with the code I written
//in DetectorConstruction.cc
G4cout<<"solid_name="<<MirrorObj.GetGeoSolid()->GetName()<<G4endl;

//Here the program gives me Segmentation fault error.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

I guess MirrorObj lost the G4VSolid* var outside the DetectorConstruction

But I have no idea how to read it and let it in the memory. Or I have
to create UserDefined G4SolidStore() since I found the source code of
this class in our database has no GetSolid() method which really 
annoied me.

I use Geant4.8.0 and don't have the root privilage to install 4.9.0.
1 None: Re: How to access to G4VSolid* in StackingAction()?   (hyao@jlab.org - 21 Oct, 2007)
(_ More: Re: How to access to G4VSolid* in StackingAction()?   (Peter Gumplinger - 22 Oct, 2007)
1 None: Re: How to access to G4VSolid* in StackingAction()?   (hyao@jlab.org - 23 Oct, 2007)
3 None: Re: How to access to G4VSolid* in StackingAction()?   (hyao@jlab.org - 23 Oct, 2007)
None information on the original primary particle  by Eva <Eva>,   19 Oct, 2007

Hello, in my simulations i need information on the original primary particles, so i have implemented the G4VUserTrackInformation as it is in http://geant4.slac.stanford.edu/Tips/event/1.html, but when i try to get the information , i get a segmentation fault. am i doing something wrong?

In my UserSteppingAction i have the following lines:

#include "T01TrackInformation.hh"
.
.
.
  T01TrackInformation* info = (T01TrackInformation*)(aStep->GetTrack()->GetUserInformation());
  G4cout << " Original Track ID " << info->GetOriginalTrackID() << G4endl;

Thank you.

1 None: RE: information on the original primary particle   (Makoto Asai - 19 Oct, 2007)
Question tracking problem?  Keywords: tracking problem
by Dennis Haggerty <Dennis Haggerty>,   18 Oct, 2007

I’m having what I think is a tracking problem. I’m running a very simple shield simulation using G4Box. When I run electrons into the material sometimes they come out of the material and then reenter the material. I have two slabs, the first is very thin with material set to Vacuum. The second slab is WCu (but I get the same thing if I use a pure Al slab). There is no energy loss in this process. I also get the same answer if I use the first slab and set the second slab to Vacuum. I cannot figure out what is turning them around. I'm running 4.9.0.p01

Note step 25 in the tracking log below.

Any suggestions?

Regards,

Dennis

*********************************************************************************************************
* G4Track Information:   Particle = e-,   Track ID = 1,   Parent ID = 0
*********************************************************************************************************

Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
    0     -5 cm   -2.2 Ang   5.3 Ang  1.47 MeV     0 eV      0 fm      0 fm        Layer    initStep
    1 -5e+03 fm   -2.2 Ang   5.3 Ang  1.47 MeV     0 eV      5 cm      5 cm        Layer  Transportation
    2  5e+03 fm   -2.2 Ang   5.3 Ang  1.47 MeV     0 eV  1e+04 fm      5 cm           D1  Transportation
    3   1.73 mm   -2.2 Ang   5.3 Ang  1.47 MeV     0 eV   1.73 mm   5.17 cm        Layer  Transportation
    4   1.75 mm  -2.54 um  -5.46 um   1.44 MeV  26.9 keV  19.2 um   5.17 cm           D2         msc
    5   1.75 mm  -1.06 um  -5.37 um   1.42 MeV  4.08 keV  3.41 um   5.18 cm           D2   LowEnBrem
    6   1.76 mm     12 um   -107 nm    1.4 MeV  20.9 keV  19.2 um   5.18 cm           D2         msc
    7   1.77 mm   17.2 um   3.79 um   1.37 MeV  10.6 keV  8.71 um   5.18 cm           D2  LowEnergyIoni
    8   1.77 mm   19.8 um   10.3 um   1.35 MeV  8.06 keV  8.08 um   5.18 cm           D2   LowEnBrem
    9   1.78 mm   33.7 um   16.7 um   1.32 MeV  26.3 keV  19.2 um   5.18 cm           D2         msc
   10    1.8 mm     39 um   24.2 um   1.31 MeV  11.3 keV  19.2 um   5.18 cm           D2         msc
   11   1.81 mm     52 um     21 um   1.29 MeV  27.5 keV  19.2 um   5.18 cm           D2         msc
   12   1.81 mm   69.1 um   27.2 um   1.26 MeV  22.4 keV  19.2 um   5.19 cm           D2         msc
   13   1.81 mm     87 um   26.9 um   1.24 MeV  23.7 keV  19.2 um   5.19 cm           D2         msc
   14   1.82 mm    103 um     34 um   1.21 MeV  33.6 keV  19.2 um   5.19 cm           D2         msc
   15   1.83 mm    110 um   40.1 um   1.19 MeV  19.3 keV  19.2 um   5.19 cm           D2         msc
   16   1.85 mm    121 um   38.9 um   1.16 MeV  21.6 keV  19.2 um   5.19 cm           D2         msc
   17   1.86 mm    137 um   37.5 um   1.14 MeV  28.2 keV  19.2 um    5.2 cm           D2         msc
   18   1.85 mm    146 um   25.4 um   1.11 MeV  24.4 keV  19.2 um    5.2 cm           D2         msc
   19   1.82 mm    142 um   26.2 um   1.07 MeV  37.1 keV  25.4 um    5.2 cm           D2         msc
   20   1.81 mm    159 um     22 um   1.05 MeV    27 keV  25.4 um    5.2 cm           D2         msc
   21   1.79 mm    168 um   18.3 um  1e+03 keV  48.4 keV  25.4 um   5.21 cm           D2         msc
   22   1.76 mm    168 um   21.8 um    973 keV  26.4 keV  25.4 um   5.21 cm           D2         msc
   23   1.74 mm    162 um   30.7 um    940 keV  33.1 keV  25.4 um   5.21 cm           D2         msc
   24   1.73 mm    160 um   41.7 um    912 keV  28.4 keV  23.5 um   5.21 cm           D2  Transportation
   25   1.73 mm    160 um   41.7 um    912 keV     0 eV      0 fm   5.21 cm        Layer  Transportation
   26   1.73 mm    162 um   48.7 um    879 keV  8.49 keV  8.01 um   5.21 cm           D2  LowEnergyIoni
   27   1.73 mm    163 um   49.9 um    878 keV  1.36 keV  1.38 um   5.21 cm           D2  Transportation
   28  5e+03 fm   2.01 mm   4.96 mm    878 keV     0 eV   5.52 mm   5.77 cm        Layer  Transportation
   29 -5e+03 fm   2.01 mm   4.96 mm    878 keV     0 eV 3.19e+04 fm   5.77 cm           D1  Transportation
   30  -17.4 cm   18.8 cm     50 cm    878 keV     0 eV   55.7 cm   61.5 cm        Layer  Transportation
   31  -17.6 cm     19 cm   50.5 cm    878 keV     0 eV   5.63 mm     62 cm   Calorimeter  Transportation
   32  -17.8 cm   19.2 cm     51 cm    878 keV     0 eV   5.63 mm   62.6 cm   OutOfWorld  Transportation

1 None: Re: tracking problem?   (Vladimir IVANTCHENKO - 18 Oct, 2007)
1 Feedback: Re: tracking problem?   (Dennis Haggerty - 18 Oct, 2007)
2 None: RE: tracking problem?   (Makoto Asai - 18 Oct, 2007)
1 Question: RE: tracking problem?   (Dennis Haggerrty - 18 Oct, 2007)
(_ None: RE: tracking problem?   (Makoto Asai - 18 Oct, 2007)
Question Tracking of secondaries after AbortEvent  by Peter Kimstrand <Peter Kimstrand>,   16 Oct, 2007

I have an application in which I kill events when they reach a certain volume. I do this by calling runManager->AbortEvent() in my UserSteppingAction() method. My question is what happens to secondaries produced prior to the call to AbortEvent? As far as I can understand from the user manuals the stack is supposed to be deleted after AbortEvent() is called, still I get hits from secondaries in the volume where I killed the primaries after AbortEvent() has been called. Can data from these secondaries be trusted or is everything junk that happens in an event after AbortEvent() has been called for that particular event? I'm running GEANT4.8.2.p01.

1 None: Re: Tracking of secondaries after AbortEvent   (Makoto Asai - 26 Feb, 2008)
None /gun/position   Keywords: /gun/position
by Reema <Reema>,   15 Oct, 2007

Hi all,

I am working to create an application with source position at (-46.5,0,15) cm and the detector at (31.5,0,0). The detector dimensions are 0.15X40X30 cm.

I am using the UI command /gun/position to set the source position. When I place the source at (-46.5,0,0), I get the desired output on the detector. However when I move the source to (-46.5,0,15), there is no output at the detector. When I move the source to (-46.5,0,-15), it works fine. I also tried to hardcode the gun position in the PrimaryGeneratorAction. I see the same effects.

Does anyone have any suggestions as to what might be happening or some mistake that I might be making when setting this geometry? Any help is much appreciated. Thanks in advance! Best regards, Reema

None Untitled  by Reema <Reema>,   15 Oct, 2007

Hi all,

I am working to create an application with source position at (-46.5,0,15) cm and the detector at (31.5,0,0). The detector dimensions are 0.15X40X30 cm.

I am using the UI command /gun/position to set the source position. When I place the source at (-46.5,0,0), I get the desired output on the detector. However when I move the source to (-46.5,0,15), there is no output at the detector. When I move the source to (-46.5,0,-15), it works fine. I also tried to hardcode the gun position in the PrimaryGeneratorAction. I see the same effects.

Does anyone have any suggestions as to what might be happening or some mistake that I might be making when setting this geometry? Any help is much appreciated. Thanks in advance! Best regards, Reema

Question once again about generating multiple particles of different types within an event  by Victor_Makarov <Victor_Makarov>,   08 Oct, 2007

Suppose, I've got an array in a file which contains lots of particles (their type, position, energy). I would like to read the file and generate those ones via PrimaryGeneratorAction within an event. I've read post 388 where Makoto Asai says that one has to invoke G4ParticleGun more than once. I guess I'll have to deal with a loop with a size of particles' number in my file, right? But I'm not quite sure where to put the loop. For example, this is a structure of PrimaryGeneratorAction.cc:

PrimaryGeneratorAction::PrimaryGeneratorAction() { ..... ..... }

PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
  delete particleGun;
}

void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
 .........
.......
  particleGun->GeneratePrimaryVertex(anEvent);
}
Where do I have to put a loop?

Thank you very much.

1 None: Re: once again about generating multiple particles of different types within an event   (Liang Zhan - 09 Oct, 2007)
(_ None: Re: once again about generating multiple particles of different types within an event   (Victor_Makarov - 09 Oct, 2007)
None How to determine the capture nucleus  Keywords: Capture Nucleus determination
by Victor Bom <V.R.Bom@tudelft.nl>,   05 Oct, 2007

Hi,

I am simulating the capture of epithermal neutrons in brass eg. a mixture of Zn and Cu. How can I determine whether the neutron has been capture by a Zn or by a Cu nucleus? I have been trying to use the secondaries, but not in all cases a secondary is produced.

regards, Victor Bom

1 None: Re: How to determine the capture nucleus   (Matthew - 05 Oct, 2007)
(_ Idea: Re: How to determine the capture nucleus   (Peter Gumplinger - 05 Oct, 2007)
Warning Uninitialized volume pointers in G4Track?  by Ben Loer <Ben Loer>,   01 Oct, 2007

Hi all,

I just came across a rather irritating bug(?) in G4Track. The following code snippet is from my UserStackingAction:

G4ClassificationOfNewTrack PUStackingAction::ClassifyNewTrack
                                            (const G4Track* aTrack)
{
  G4cout<<"Starting new stage"<<G4endl;
  if(aTrack->GetParentID()==0){/
    //This is a primary particle
    G4cout<<"Primary particle released!"<<G4endl;
    if(aTrack->GetVolume()) 
       //G4cout<<aTrack->GetVolume()->GetName()<<G4endl;
  }
  return fUrgent;
}

This causes a bus error when it encounters the if(aTrack->GetVolume()) line. I'm no C++ expert, but I thought that just checking to see if the pointer was empty should be safe, unless its not initialized.

Any suggestions on what else this could be? Or should I start a bug report?

1 None: RE: Uninitialized volume pointers in G4Track?   (Makoto Asai - 01 Oct, 2007)
2 None: RE: Uninitialized volume pointers in G4Track?   (Makoto Asai - 01 Oct, 2007)
1 None: RE: Uninitialized volume pointers in G4Track?   (Henrik - 13 Feb, 2008)
None Explicitly stopping and invoking restprocesses for e-   Keywords: Explicitly stopping and invoking restprocesses
by Yordan <yordan@phys.uni-sofia.bg>,   28 Sep, 2007

In my simulation I am shouting with electrons the radiator of the cherenkov detektor and I am receiving this message:

Explicitly stopping and invoking restprocesses for e- inside Acc1
  steps: 52000, kinetic energy: 0.68809091 MeV
x: (-43.227662,18.388808,-14385.831)  p: (-0.96930875,-0.1758614,0.45410354) t: 2.2979547

What this mean and which class prints this? "Acc1" is the radiator.

1 None: RE: Explicitly stopping and invoking restprocesses for e-   (Makoto Asai - 28 Sep, 2007)
(_ None: RE: Explicitly stopping and invoking restprocesses for e-   (Yordan - 29 Sep, 2007)
Question How to get the PDGID of a parent track?  Keywords: pdg id, parent track
by F. Juget <frederic.juget@unine.ch>,   27 Sep, 2007
I want to obtain the pdgid of the parent of a track in usersteppingaction.
It is easy to get the parentid (track->GetParentID()), but is there a way to get the pdg number of this parent track?
1 Feedback: Re: How to get the PDGID of a parent track?   (Peter Gumplinger - 27 Sep, 2007)
None Accessing SingleParticleSource from UserPrimaryGeneratorAction  Keywords: GPS, vertex
by Ben Loer <Ben Loer>,   20 Sep, 2007

Hi all,

I am trying to simulate the background environment for my detector. To do this, I use the G4GeneralParticleSource to define the isotopes (via /gps/ion ..) and confine them to the volumes of my different components. For my analysis, I would like to be able to generate the different spectra due to these different sources. It's easy enough to get the particle type from the gps, but this isn't always sufficient, for say, Radon, which is in all components. I thought an easy way to to it was to have in the GeneratePrimaries method the line

gps->GetCurrentSourceIndex()

after generating the primary vertex to find which SingleParticleSource was used to generate the vertex. Unfortunately, this just points to the last source added, or the last source set active.

Is there any method to find which of the defined sources was used to generate the vertex? If not, is there any way to index my different backgrounds in an accessible way? Is there a way to get which volume the primary was generated in from within the UserPrimaryGeneratorAction?

Thanks!

None set Step with G4UserLimits..how? not working  Keywords: G4UserLimits, SetMaxAllowedStep, Step Size
by Jasmine Ma <Jasmine Ma>,   13 Sep, 2007

Hi- I'm relatively new to geant4 and I've asked this question to my
 local expert (other grad student) and he has no idea what's wrong.

I'm trying to limit the stepsize of these particles I'm shooting. To do this I used G4UserLimits in my "DetectorConstruction.cc" something like...

  G4LogicalVolumeStore* lvStore=G4LogicalVolumeStore::GetInstance();
  lvStore=G4LogicalVolumeStore::GetInstance();
  G4UserLimits *MyLimits = new G4UserLimits();  //lvTGAR->GetUserLimits();
  MyLimits->SetMaxAllowedStep(1*cm);
  for (size_t ii=0;ii<(*lvStore).size();ii++){   
    if ((*lvStore)[ii]->GetVisAttributes()==0) {
      G4String matName=(*lvStore)[ii]->GetMaterial()->GetName();
      (*lvStore)[ii]->SetVisAttributes(GetMaterialVisAttrib(matName));
      (*lvStore)[ii]->SetUserLimits(MyLimits);
    }
  }

Additionally, I have the same g4userlimit max set point set in the volume I would *really* like to limit the step size.

None of this is working. THe stepsize isnt changing. If I look at the output. I can see that the first step had a length of 8 cm, even though I set the max to 1

Step#    X(mm)    Y(mm)    Z(mm) KinE(MeV)  dE(MeV) StepLeng TrackLeng  NextVolume ProcName
    0        0        0   -4e+03  1.19e+05        0        0         0        TGAR initStep
    1        0        0 -3.92e+03  1.19e+05   0.0162     80.6      80.6        TGAR hIoni

Is there some other step I must perform?

Thank you for any help

Jasmine Ma

1 None: RE: set Step with G4UserLimits..how? not working   (Makoto Asai - 14 Sep, 2007)
Sad Energy deposition errors ?  Keywords: Energy deposition error?
by Yuxin Feng <fengyx@ufl.edu>,   05 Sep, 2007

Dear All,

When I calculated the deposited energy of electron in a detector, I found the deposited energy could be greater than the kinetic energy of initial electron. To test it you may run an example of N03 with

/control/verbose 2

/control/saveHistory

/run/verbose 2

/event/verbose 0

/tracking/verbose 1

/gun/particle e-

/gun/energy 0.300 MeV

/run/beamOn 10

you will find

---> Begin of event: 0

*********************************************************************************************************
* G4Track Information:   Particle = e-,   Track ID = 1,   Parent ID = 0
*********************************************************************************************************

Step#      X         Y         Z        KineE    dEStep   StepLeng  TrakLeng    Volume     Process
    0     -9 cm      0 fm      0 fm    300 keV     0 eV      0 fm      0 fm        World    initStep
    1   -7.5 cm      0 fm      0 fm    300 keV     0 eV    1.5 cm    1.5 cm        World  Transportation
    2   -7.4 cm      0 fm      0 fm    300 keV     0 eV      1 mm    1.6 cm        Layer  Transportation
    3   -7.4 cm    630 nm   -807 nm    294 keV  5.67 keV  2.91 um    1.6 cm         Lead         msc
    4   -7.4 cm   2.94 um  -1.59 um    283 keV  11.6 keV  2.91 um    1.6 cm         Lead         msc
    5   -7.4 cm   5.41 um   -467 nm    271 keV  11.6 keV  2.91 um    1.6 cm         Lead         msc
    6   -7.4 cm   7.67 um  -1.62 um    261 keV   9.8 keV  2.91 um    1.6 cm         Lead         msc
    7   -7.4 cm   9.95 um  -3.05 um    255 keV     6 keV  2.91 um    1.6 cm         Lead         msc
    8   -7.4 cm   11.4 um  -4.95 um    247 keV  8.47 keV  2.91 um    1.6 cm         Lead         msc
    9   -7.4 cm   9.75 um  -6.45 um    238 keV  8.81 keV  2.91 um    1.6 cm         Lead         msc
   10   -7.4 cm   9.62 um  -8.93 um    223 keV  14.8 keV  2.91 um    1.6 cm         Lead         msc
   11   -7.4 cm   12.2 um  -9.56 um    213 keV  9.85 keV  2.91 um    1.6 cm         Lead         msc
   12   -7.4 cm   13.2 um  -11.5 um    201 keV  12.4 keV  2.91 um    1.6 cm         Lead         msc
   13   -7.4 cm   12.8 um  -14.1 um    191 keV  9.85 keV  2.91 um    1.6 cm         Lead         msc
   14   -7.4 cm   11.6 um    -16 um    183 keV  8.42 keV  2.91 um    1.6 cm         Lead         msc
   15   -7.4 cm   9.19 um  -15.2 um    179 keV  3.53 keV  2.91 um    1.6 cm         Lead         msc
   16   -7.4 cm   9.12 um  -13.3 um    166 keV  13.3 keV  2.91 um    1.6 cm         Lead         msc
   17   -7.4 cm   9.05 um  -10.9 um    151 keV    15 keV  2.91 um    1.6 cm         Lead         msc
   18   -7.4 cm   9.87 um  -8.65 um    139 keV  11.4 keV  2.91 um    1.6 cm         Lead         msc
   19   -7.4 cm   11.8 um  -7.48 um    122 keV  17.5 keV  2.91 um    1.6 cm         Lead         msc
   20   -7.4 cm   11.8 um  -5.74 um    113 keV  8.55 keV  2.91 um   1.61 cm         Lead         msc
   21   -7.4 cm   11.5 um  -3.53 um    108 keV  5.49 keV  2.91 um   1.61 cm         Lead         msc
   22   -7.4 cm   12.2 um  -1.79 um   96.2 keV  11.7 keV  2.91 um   1.61 cm         Lead         msc
   23   -7.4 cm     12 um   1.37 nm   81.9 keV  14.3 keV  2.91 um   1.61 cm         Lead         msc
   24   -7.4 cm     12 um   1.67 um   53.5 keV  28.3 keV  2.91 um   1.61 cm         Lead         msc
   25   -7.4 cm   11.1 um    743 nm   15.8 keV  37.7 keV  2.91 um   1.61 cm         Lead         msc
   26   -7.4 cm   11.1 um    692 nm      0 eV   31.6 keV  1.34 um   1.61 cm         Lead   LowEnBrem
---> End of event: 0
   Absorber: total energy: 315.802 keV       total track length: 68.3867 um 
        Gap: total energy:       0 eV        total track length:       0 fm 
=======================================================================

Something must be wrong in Geant4, I think.

Could you let me know ow this happens?

Thanks,

--Yuxin

1 Feedback: Re: Energy deposition errors ?   (Peter Gumplinger - 05 Sep, 2007)
3 None: Re: Energy deposition errors ?   (michel maire - 06 Sep, 2007)
None secondary particle tracks are generated with wrong times in G4NeutronHPFissionFS  by Victor_Makarov <Victor_Makarov>,   05 Sep, 2007

I'm investigating delayed neutrons from fission reactions. These are the lines in file G4NeutronHPFissionFS.cc responsible for setting time of delayed neutrons' tracks as secondaries:

G4double time = -std::log(G4UniformRand())/theDecayConstants[i0-Prompt];

time += theTrack.GetGlobalTime();

G4HadSecondary * track = new G4HadSecondary( theNeutrons->operator[]( i0 ) );

track->SetTime(time);

theResult.AddSecondary(track);

As I understand it, at first some time delay constants are read, then they are added to GlobalTime - time point of fission proccess. At last a secondary is created at the result time, so track of delayed neutron must begin with time = -std::log(G4UniformRand())/theDecayConstants[i0-Prompt] + theTrack.GetGlobalTime().

When I do /tracking/verbose 2, I see that the delayed neutron track begins with Global time - time point of fission proccess so that delay is ignored. That confuses me greatly. I guess Geant 4 at some further step ignores the set time of a track and addresses to time point of Fission proccess - the proccess that has created the particle. But I'm too weak in tracking algoritms of Geant...

Any help will be highly appreciated.

1 Feedback: Re: secondary particle tracks are generated with wrong times in G4NeutronHPFissionFS   (Peter Gumplinger - 05 Sep, 2007)
(_ None: Re: secondary particle tracks are generated with wrong times in G4NeutronHPFissionFS   (Victor_Makarov - 05 Sep, 2007)
(_ None: Re: secondary particle tracks are generated with wrong times in G4NeutronHPFissionFS   (Koi, Tatsumi - 07 Sep, 2007)
Question How to get the process name in the GetFieldValue() method of G4MagneticField  Keywords: process name
by Kamil Sedlak <kamil.sedlak@cern.ch>,   24 Aug, 2007

Dear All,
  Is there a way how to get the process name in my private 
class derived from the "G4MagneticField" class ?  I would like the
function GetFieldValue() returns a different (more precise) field 
value if (and only if) the actual process that is being calculated
is called "DecayWithSpin".
  Cheers,
  Kamil

1 Feedback: Re: How to get the process name in the GetFieldValue() method of G4MagneticField   (Peter Gumplinger - 24 Aug, 2007)
None How to track recoil atom in EM process?  Keywords: recoil atom
by Xinxin Tang <Xinxin Tang>,   18 Aug, 2007

when primary particle is electon and target is Silicon and physics 
process is "standard" electronmagnetic processes, I cann't get 
recoil atom (i.e. Silicon). However,when primary particle change 
into neutron and hardon processes is added, recoil atom can be tracked.
I want to know, dose EM processes has the abilitiy like hardon processes?thanks!
 

None How to track recoil atom in EM process?  Keywords: track recoil atom in EM processes
by Xinxin Tang <Xinxin Tang>,   18 Aug, 2007

when primary particle is electon and target is Silicon and physics 
process is "standard" electronmagnetic processes, I cann't get 
recoil atom (i.e. Silicon). However,when primary particle change 
into neutron and hardon processes is added, recoil atom can be tracked.
I want to know, dose EM processes has the abilitiy like hardon processes?thanks!
 

None poststep -> GetPhysicalVolume() returns "NULL point GetPhysicalVolume() returns "NULL pointer"  by Kin Yip <kinyip@bnl.gov>,   17 Aug, 2007

I've been running 4.8. In a G4step of a photon, when I try to GetPhysicalVolume() on the post-step, I get a null pointer ! GetPhysicalVolume() for the pre-step is OK.

I can see that pre-step is in the "World" (and in Air). Though one can't GetPhysicalVolume() for the post-step, one can get GetPosition() for the post-step. I've seen that the post step is at the boundary of the "World" (at least for 1 coordinate).

Is this normal or a bug ?

Kin

1 None: RE: poststep -> GetPhysicalVolume() returns "NULL point GetPhysicalVolume() returns "NULL pointer"   (Makoto Asai - 19 Aug, 2007)
Question dead loop problem!  Keywords: dead loop
by Jian WU <wujian@ustc.edu.cn>,   13 Aug, 2007
Hi expert,
    When running a job, I encountered the following information
and the jod went into a dead loop. Any idea about it:

WARNING - G4Navigator::ComputeStep()
          Track stuck, not moving for 10 steps
          in volume -world- at point (3.176821685,6.558946445,-48.75)
          direction: (-0.3019686021,-0.9533178484,0.0002078964686).
          Potential geometry or navigation problem !
          Trying pushing it of 9e-10 mm ...
WARNING - G4Navigator::ComputeStep()
          Track stuck, not moving for 10 steps
          in volume -world- at point (3.176821685,6.558946443,-48.75)
          direction: (-0.3019686021,-0.9533178484,0.0002078961509).
          Potential geometry or navigation problem !
          Trying pushing it of 9e-10 mm ...
    ............ 
    and so on and on

How to solve the problem? Thanks in advance!
Jian
None Step size  by Adam <ax_blais@laurentian.ca>,   30 Jul, 2007

Is there a default step size in G4 and is it always the same? I can't find where step size is set anywhere in my program. I've been searching for this all morning.

1 None: Re: Step size   (Vladimir IVANTCHENKO - 30 Jul, 2007)
None Inconsistent number of tracks?  by Adam <ax_blais@laurentian.ca>,   26 Jul, 2007

In the SteppingAction class that is part of example N02, there is the following code that prints the number of trajectories in the event:

 G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
  G4int n_trajectories = 0;
  if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();

 if (event_id < 100 || event_id%100 == 0) {
    G4cout << ">>> Event " << evt->GetEventID() << G4endl;
    G4cout << "    " << n_trajectories 
           << " trajectories stored in this event." << G4endl;
  }

I made my own TrackingAction class, with the simple code of :

void ExN02TrackingAction::PostUserTrackingAction(const G4Track* track)
{
  number_of_tracks++;
}

For the first event, the first method returns 29396 trajectories, and the second method returns 29485 tracks. Why is this different? They should be the same.

In fact, for every event, the second method seems to count more tracks.

Question User Limits on World volume giving problems  Keywords: G4UserLimits, worldvolume
by Aaron <rasputin465@hotmail.com>,   25 Jul, 2007

Has anyone ever seen problems arise when applying User Limits to the world logical volume? I am using a neutron gun in air. If I set ANY user limits, my neutron gun shoots low-energy electrons instead. Even setting the defaults,

logicWorld->SetUserLimits(new G4UserLimits());

gives this problem. Anyone know what might be going on?

Thanks! Aaron

Question Removing TrackBanner when printing output  Keywords: printing output, trackbanner, removal
by Matthew Middione <middionematt@csufresno.edu>,   20 Jul, 2007
Hello,

I was wondering if there was a way to eliminate the Track Banner when
printing output in Geant4.

Below is an example of my output:

*********************************************************************************************************
* G4Track Information:   Particle = F18[0.0],   Track ID = 1,   Parent ID = 0
*********************************************************************************************************


*********************************************************************************************************
* G4Track Information:   Particle = e+,   Track ID = 4,   Parent ID = 1
*********************************************************************************************************

-0.821   1.191

*********************************************************************************************************
* G4Track Information:   Particle = F18[0.0],   Track ID = 1,   Parent ID = 0
*********************************************************************************************************


*********************************************************************************************************
* G4Track Information:   Particle = e+,   Track ID = 4,   Parent ID = 1
*********************************************************************************************************

-0.736  -0.205

*********************************************************************************************************
* G4Track Information:   Particle = F18[0.0],   Track ID = 1,   Parent ID = 0
*********************************************************************************************************


*********************************************************************************************************
* G4Track Information:   Particle = e+,   Track ID = 4,   Parent ID = 1
*********************************************************************************************************

-0.126  -0.069


...And so on...

The reason why I ask is because I plan on running the simulation 50000
times and only wish to display the set of numbers that you see above for
the e+ particles.  If there was a way to eliminate the asterisks and the
G4Track Information, which I believe is called the TrackBanner then I
believe my goal would be achieved.  Let me know what your thoughts are
on this matter and if you know how I can eliminate this TrackBanner.

Thanks in anticipation,
Matthew Middione


None GetStepStatus() == fGeomBoundary - Problem  by Asim <herr.aghdiri@gmx.de>,   20 Jul, 2007

Hi there,

I'm still simulating a proton-beam and I want to count all particles which pass z=100.

Th