Geant4-11
G4VFastSimulationModel.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//
27//
28//
29//---------------------------------------------------------------
30//
31// G4VFastSimulationModel.hh
32//
33// Description:
34// Base class for fast simulation models.
35//
36// History:
37// Oct 97: Verderi && MoraDeFreitas - First Implementation.
38//
39//---------------------------------------------------------------
40
41
42#ifndef G4VFastSimulationModel_h
43#define G4VFastSimulationModel_h
44
45#include "G4FastTrack.hh"
46#include "G4FastStep.hh"
47
48//-------------------------------------------
49//
50// G4VFastSimulationModel class
51//
52//-------------------------------------------
53
54// Class Description:
55// This is the abstract class for the implementation of parameterisations.
56// You have to inherit from it to implement your concrete parameterisation
57// model.
58//
59
61{
62 public: // With description
63
64 G4VFastSimulationModel(const G4String& aName);
65 // aName identifies the parameterisation model.
66
68 G4bool IsUnique=FALSE);
69 // This constructor allows you to get a quick "getting started".
70 // In addition to the model name, this constructor accepts a G4LogicalVolume
71 // pointer. This volume will automatically becomes the envelope, and the
72 // needed G4FastSimulationManager object is constructed if necessary giving
73 // it the G4LogicalVolume pointer and the boolean value. If it already
74 // exists, the model is simply added to this manager. However the
75 // G4VFastSimulationModel object will not keep track of the envelope given
76 // in the constructor.
77 // The boolean argument is there for optimization purpose: if you know that
78 // the G4LogicalVolume envelope is placed only once you can turn this
79 // boolean value to "true" (an automated mechanism is foreseen here.)
80
81public: // Without description
83
84public: // With description
85
87 // In your implementation, you have to return "true" when your model is
88 // applicable to the G4ParticleDefinition passed to this method. The
89 // G4ParticleDefinition provides all intrisic particle informations (mass,
90 // charge, spin, name ...).
91
92 virtual G4bool ModelTrigger(const G4FastTrack &) = 0;
93 // You have to return "true" when the dynamics conditions to trigger your
94 // parameterisation are fulfiled. The G4FastTrack provides you access to
95 // the current G4Track, gives simple access to envelope related features
96 // (G4LogicalVolume, G4VSolid, G4AffineTransform references between the
97 // global and the envelope local coordinates systems) and simple access to
98 // the position, momentum expressed in the envelope coordinate system.
99 // Using those quantities and the G4VSolid methods, you can for example
100 // easily check how far you are from the envelope boundary.
101
102 virtual void DoIt(const G4FastTrack&, G4FastStep&) = 0;
103 // Your parameterisation properly said. The G4FastTrack reference provides
104 // input informations. The final state of the particles after parameterisation
105 // has to be returned through the G4FastStep reference. This final state is
106 // described has "requests" the tracking will apply after your
107 // parameterisation has been invoked.
108
109 // ---------------------------
110 // -- Idem for AtRest methods:
111 // ---------------------------
112 // -- A default dummy implementation is provided.
113
114 virtual
115 G4bool AtRestModelTrigger(const G4FastTrack&) {return false;}
116 // You have to return "true" when the dynamics conditions to trigger your
117 // parameterisation are fulfiled. The G4FastTrack provides you access to
118 // the current G4Track, gives simple access to envelope related features
119 // (G4LogicalVolume, G4VSolid, G4AffineTransform references between the
120 // global and the envelope local coordinates systems) and simple access to
121 // the position, momentum expressed in the envelope coordinate system.
122 // Using those quantities and the G4VSolid methods, you can for example
123 // easily check how far you are from the envelope boundary.
124
125 virtual
127 // Your parameterisation properly said. The G4FastTrack reference provides
128 // input informations. The final state of the particles after parameterisation
129 // has to be returned through the G4FastStep reference. This final state is
130 // described has "requests" the tracking will apply after your
131 // parameterisation has been invoked.
132
133public: // Without description
134
135 // Useful public methods :
136 const G4String GetName() const;
138
139private:
140 //-------------
141 // Model Name:
142 //-------------
144};
145
147{
148 return theModelName;
149}
150
151inline G4bool
153{
154 return (this==&fsm) ? true : false;
155}
156#endif
bool G4bool
Definition: G4Types.hh:86
#define FALSE
Definition: Globals.hh:23
virtual void DoIt(const G4FastTrack &, G4FastStep &)=0
virtual G4bool ModelTrigger(const G4FastTrack &)=0
virtual void AtRestDoIt(const G4FastTrack &, G4FastStep &)
virtual G4bool IsApplicable(const G4ParticleDefinition &)=0
const G4String GetName() const
G4VFastSimulationModel(const G4String &aName)
G4bool operator==(const G4VFastSimulationModel &) const
virtual G4bool AtRestModelTrigger(const G4FastTrack &)