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
44class G4Event;
45class G4PrimaryVertex;
46
48{
49 public:
50
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
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
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);
75 G4DynamicParticle* motherDP);
77
78 // Following two virtual methods are provided to customize the use
79 // of G4PrimaryTransformer for particle types exotic to Geant4.
80
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
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
96
104};
105
106#endif
std::vector< G4Track * > G4TrackVector
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4bool CheckDynamicParticle(G4DynamicParticle *DP)
void SetUnknnownParticleDefined(G4bool vl)
virtual ~G4PrimaryTransformer()=default
void SetVerboseLevel(G4int vl)
virtual G4ParticleDefinition * GetDefinition(G4PrimaryParticle *pp)
G4ParticleTable * particleTable
G4ParticleDefinition * unknown
G4ParticleDefinition * opticalphoton
G4bool GetUnknownParticleDefined() const
virtual G4bool IsGoodForTrack(G4ParticleDefinition *pd)
void SetDecayProducts(G4PrimaryParticle *mother, G4DynamicParticle *motherDP)
G4TrackVector * GimmePrimaries(G4Event *anEvent, G4int trackIDCounter=0)
void GenerateSingleTrack(G4PrimaryParticle *primaryParticle, G4double x0, G4double y0, G4double z0, G4double t0, G4double wv)
void GenerateTracks(G4PrimaryVertex *primaryVertex)