Geant4
11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PrimaryTransformer.hh
Go to the documentation of this file.
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
25
//
26
// G4PrimaryTransformer
27
//
28
// Class description:
29
//
30
// This class is exclusively used by G4EventManager for the conversion
31
// from G4PrimaryVertex/G4PrimaryParticle to G4DynamicParticle/G4Track.
32
33
// Author: Makoto Asai, 1999
34
// --------------------------------------------------------------------
35
#ifndef G4PrimaryTransformer_hh
36
#define G4PrimaryTransformer_hh 1
37
38
#include "
globals.hh
"
39
#include "
G4TrackVector.hh
"
40
#include "
G4ParticleTable.hh
"
41
#include "
G4PrimaryParticle.hh
"
42
#include "
G4DynamicParticle.hh
"
43
44
class
G4Event
;
45
class
G4PrimaryVertex
;
46
47
class
G4PrimaryTransformer
48
{
49
public
:
50
51
G4PrimaryTransformer
();
52
virtual
~G4PrimaryTransformer
() =
default
;
53
54
G4TrackVector
*
GimmePrimaries
(
G4Event
* anEvent,
G4int
trackIDCounter=0);
55
void
CheckUnknown
();
56
57
inline
void
SetVerboseLevel
(
G4int
vl)
58
{
verboseLevel
= vl; }
59
60
void
SetUnknnownParticleDefined
(
G4bool
vl);
61
// By invoking this method, the user can alter the treatment of unknown
62
// particles. The ideal place to invoke this method is in the
63
// BeginOfRunAction().
64
65
inline
G4bool
GetUnknownParticleDefined
()
const
66
{
return
unknownParticleDefined
; }
67
68
protected
:
69
70
void
GenerateTracks
(
G4PrimaryVertex
* primaryVertex);
71
void
GenerateSingleTrack
(
G4PrimaryParticle
* primaryParticle,
72
G4double
x0,
G4double
y0,
G4double
z0,
73
G4double
t0,
G4double
wv);
74
void
SetDecayProducts
(
G4PrimaryParticle
* mother,
75
G4DynamicParticle
* motherDP);
76
G4bool
CheckDynamicParticle
(
G4DynamicParticle
*DP);
77
78
// Following two virtual methods are provided to customize the use
79
// of G4PrimaryTransformer for particle types exotic to Geant4.
80
81
virtual
G4ParticleDefinition
*
GetDefinition
(
G4PrimaryParticle
* pp);
82
// Return appropriate G4ParticleDefinition w.r.t. the primary particle.
83
// If nullptr is returned, the particle will not be treated as a track,
84
// but its daughters will be examined in case it has "pre-assigned
85
// decay products".
86
87
virtual
G4bool
IsGoodForTrack
(
G4ParticleDefinition
* pd);
88
// Return true if a primary particle should be converted into a track.
89
// By default, all particles of non-shortlived and shortlived with
90
// valid decay tables are converted.
91
92
protected
:
93
94
G4TrackVector
TV
;
95
G4ParticleTable
*
particleTable
=
nullptr
;
96
97
G4ParticleDefinition
*
unknown
=
nullptr
;
98
G4ParticleDefinition
*
opticalphoton
=
nullptr
;
99
G4int
verboseLevel
= 0;
100
G4int
trackID
= 0;
101
G4int
nWarn
= 0;
102
G4bool
unknownParticleDefined
=
false
;
103
G4bool
opticalphotonDefined
=
false
;
104
};
105
106
#endif
G4DynamicParticle.hh
G4ParticleTable.hh
G4PrimaryParticle.hh
G4TrackVector.hh
G4TrackVector
std::vector< G4Track * > G4TrackVector
Definition:
G4TrackVector.hh:43
G4double
double G4double
Definition:
G4Types.hh:83
G4bool
bool G4bool
Definition:
G4Types.hh:86
G4int
int G4int
Definition:
G4Types.hh:85
G4DynamicParticle
Definition:
G4DynamicParticle.hh:65
G4Event
Definition:
G4Event.hh:55
G4ParticleDefinition
Definition:
G4ParticleDefinition.hh:61
G4ParticleTable
Definition:
G4ParticleTable.hh:60
G4PrimaryParticle
Definition:
G4PrimaryParticle.hh:67
G4PrimaryTransformer
Definition:
G4PrimaryTransformer.hh:48
G4PrimaryTransformer::unknownParticleDefined
G4bool unknownParticleDefined
Definition:
G4PrimaryTransformer.hh:102
G4PrimaryTransformer::CheckDynamicParticle
G4bool CheckDynamicParticle(G4DynamicParticle *DP)
Definition:
G4PrimaryTransformer.cc:343
G4PrimaryTransformer::SetUnknnownParticleDefined
void SetUnknnownParticleDefined(G4bool vl)
Definition:
G4PrimaryTransformer.cc:331
G4PrimaryTransformer::~G4PrimaryTransformer
virtual ~G4PrimaryTransformer()=default
G4PrimaryTransformer::opticalphotonDefined
G4bool opticalphotonDefined
Definition:
G4PrimaryTransformer.hh:103
G4PrimaryTransformer::SetVerboseLevel
void SetVerboseLevel(G4int vl)
Definition:
G4PrimaryTransformer.hh:57
G4PrimaryTransformer::TV
G4TrackVector TV
Definition:
G4PrimaryTransformer.hh:94
G4PrimaryTransformer::G4PrimaryTransformer
G4PrimaryTransformer()
Definition:
G4PrimaryTransformer.cc:44
G4PrimaryTransformer::GetDefinition
virtual G4ParticleDefinition * GetDefinition(G4PrimaryParticle *pp)
Definition:
G4PrimaryTransformer.cc:360
G4PrimaryTransformer::nWarn
G4int nWarn
Definition:
G4PrimaryTransformer.hh:101
G4PrimaryTransformer::particleTable
G4ParticleTable * particleTable
Definition:
G4PrimaryTransformer.hh:95
G4PrimaryTransformer::unknown
G4ParticleDefinition * unknown
Definition:
G4PrimaryTransformer.hh:97
G4PrimaryTransformer::opticalphoton
G4ParticleDefinition * opticalphoton
Definition:
G4PrimaryTransformer.hh:98
G4PrimaryTransformer::GetUnknownParticleDefined
G4bool GetUnknownParticleDefined() const
Definition:
G4PrimaryTransformer.hh:65
G4PrimaryTransformer::IsGoodForTrack
virtual G4bool IsGoodForTrack(G4ParticleDefinition *pd)
Definition:
G4PrimaryTransformer.cc:374
G4PrimaryTransformer::CheckUnknown
void CheckUnknown()
Definition:
G4PrimaryTransformer.cc:50
G4PrimaryTransformer::SetDecayProducts
void SetDecayProducts(G4PrimaryParticle *mother, G4DynamicParticle *motherDP)
Definition:
G4PrimaryTransformer.cc:253
G4PrimaryTransformer::verboseLevel
G4int verboseLevel
Definition:
G4PrimaryTransformer.hh:99
G4PrimaryTransformer::GimmePrimaries
G4TrackVector * GimmePrimaries(G4Event *anEvent, G4int trackIDCounter=0)
Definition:
G4PrimaryTransformer.cc:59
G4PrimaryTransformer::GenerateSingleTrack
void GenerateSingleTrack(G4PrimaryParticle *primaryParticle, G4double x0, G4double y0, G4double z0, G4double t0, G4double wv)
Definition:
G4PrimaryTransformer.cc:109
G4PrimaryTransformer::trackID
G4int trackID
Definition:
G4PrimaryTransformer.hh:100
G4PrimaryTransformer::GenerateTracks
void GenerateTracks(G4PrimaryVertex *primaryVertex)
Definition:
G4PrimaryTransformer.cc:77
G4PrimaryVertex
Definition:
G4PrimaryVertex.hh:50
globals.hh
geant4-v11.1.1
source
event
include
G4PrimaryTransformer.hh
Generated by
1.9.6