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 | // $Id: G4ImportanceProcess.hh,v 1.4 2008/04/21 09:10:28 ahoward Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-02 $ |
---|
29 | // |
---|
30 | // ---------------------------------------------------------------------- |
---|
31 | // Class G4ImportanceProcess |
---|
32 | // |
---|
33 | // Class description: |
---|
34 | // |
---|
35 | // Used internally by importance sampling in the "mass" geometry. |
---|
36 | // This process is a forced post step process. I will apply |
---|
37 | // importance sampling if the particle crosses a boundary in the |
---|
38 | // "mass" geometry. |
---|
39 | |
---|
40 | // Author: Michael Dressel (Michael.Dressel@cern.ch) |
---|
41 | // ---------------------------------------------------------------------- |
---|
42 | #ifndef G4ImportanceProcess_hh |
---|
43 | #define G4ImportanceProcess_hh G4ImportanceProcess_hh |
---|
44 | |
---|
45 | #include "G4VProcess.hh" |
---|
46 | #include "G4VTrackTerminator.hh" |
---|
47 | |
---|
48 | class G4SamplingPostStepAction; |
---|
49 | class G4VImportanceAlgorithm; |
---|
50 | class G4VIStore; |
---|
51 | |
---|
52 | class G4Step; |
---|
53 | class G4Navigator; |
---|
54 | class G4TransportationManager; |
---|
55 | class G4PathFinder; |
---|
56 | class G4VTouchable; |
---|
57 | |
---|
58 | #include "G4FieldTrack.hh" |
---|
59 | #include "G4TouchableHandle.hh" |
---|
60 | |
---|
61 | |
---|
62 | class G4ImportanceProcess : public G4VProcess, public G4VTrackTerminator |
---|
63 | { |
---|
64 | |
---|
65 | public: // with description |
---|
66 | |
---|
67 | G4ImportanceProcess(const G4VImportanceAlgorithm &aImportanceAlgorithm, |
---|
68 | const G4VIStore &aIstore, |
---|
69 | const G4VTrackTerminator *TrackTerminator, |
---|
70 | const G4String &aName = "ImportanceProcess", G4bool para = false); |
---|
71 | // creates a G4ParticleChange |
---|
72 | |
---|
73 | virtual ~G4ImportanceProcess(); |
---|
74 | // delete the G4ParticleChange |
---|
75 | |
---|
76 | |
---|
77 | //-------------------------------------------------------------- |
---|
78 | // Set Paralle World |
---|
79 | //-------------------------------------------------------------- |
---|
80 | |
---|
81 | void SetParallelWorld(G4String parallelWorldName); |
---|
82 | void SetParallelWorld(G4VPhysicalVolume* parallelWorld); |
---|
83 | |
---|
84 | //-------------------------------------------------------------- |
---|
85 | // Process interface |
---|
86 | //-------------------------------------------------------------- |
---|
87 | |
---|
88 | void StartTracking(G4Track*); |
---|
89 | |
---|
90 | |
---|
91 | virtual G4double |
---|
92 | PostStepGetPhysicalInteractionLength(const G4Track& aTrack, |
---|
93 | G4double previousStepSize, |
---|
94 | G4ForceCondition* condition); |
---|
95 | // make process beeing forced |
---|
96 | virtual G4VParticleChange *PostStepDoIt(const G4Track&, const G4Step&); |
---|
97 | // manage the importance sampling in the "mass" geometry |
---|
98 | |
---|
99 | virtual void KillTrack() const; |
---|
100 | // used in case no scoring process follows that does the killing |
---|
101 | |
---|
102 | virtual const G4String &GetName() const; |
---|
103 | |
---|
104 | |
---|
105 | public: // without description |
---|
106 | |
---|
107 | // no operation in AtRestDoIt and AlongStepDoIt |
---|
108 | |
---|
109 | virtual G4double |
---|
110 | AlongStepGetPhysicalInteractionLength(const G4Track&, |
---|
111 | G4double , |
---|
112 | G4double , |
---|
113 | G4double& , |
---|
114 | G4GPILSelection*); |
---|
115 | virtual G4double |
---|
116 | AtRestGetPhysicalInteractionLength(const G4Track& , |
---|
117 | G4ForceCondition*); |
---|
118 | |
---|
119 | virtual G4VParticleChange* |
---|
120 | AtRestDoIt(const G4Track&, const G4Step&); |
---|
121 | |
---|
122 | |
---|
123 | virtual G4VParticleChange* |
---|
124 | AlongStepDoIt(const G4Track&, const G4Step&); |
---|
125 | |
---|
126 | private: |
---|
127 | |
---|
128 | G4ImportanceProcess(const G4ImportanceProcess &); |
---|
129 | G4ImportanceProcess &operator=(const G4ImportanceProcess &); |
---|
130 | |
---|
131 | private: |
---|
132 | |
---|
133 | void CopyStep(const G4Step & step); |
---|
134 | |
---|
135 | G4Step * fGhostStep; |
---|
136 | G4StepPoint * fGhostPreStepPoint; |
---|
137 | G4StepPoint * fGhostPostStepPoint; |
---|
138 | |
---|
139 | G4ParticleChange *fParticleChange; |
---|
140 | const G4VImportanceAlgorithm &fImportanceAlgorithm; |
---|
141 | const G4VIStore &fIStore; |
---|
142 | G4SamplingPostStepAction *fPostStepAction; |
---|
143 | |
---|
144 | G4TransportationManager* fTransportationManager; |
---|
145 | G4PathFinder* fPathFinder; |
---|
146 | |
---|
147 | // ------------------------------- |
---|
148 | // Navigation in the Ghost World: |
---|
149 | // ------------------------------- |
---|
150 | G4String fGhostWorldName; |
---|
151 | G4VPhysicalVolume* fGhostWorld; |
---|
152 | G4Navigator* fGhostNavigator; |
---|
153 | G4int fNavigatorID; |
---|
154 | G4TouchableHandle fOldGhostTouchable; |
---|
155 | G4TouchableHandle fNewGhostTouchable; |
---|
156 | G4FieldTrack fFieldTrack; |
---|
157 | G4double fGhostSafety; |
---|
158 | G4bool fOnBoundary; |
---|
159 | |
---|
160 | G4bool paraflag; |
---|
161 | |
---|
162 | }; |
---|
163 | |
---|
164 | #endif |
---|