source: trunk/source/processes/electromagnetic/utils/include/G4VMscModel.hh@ 1005

Last change on this file since 1005 was 1005, checked in by garnier, 17 years ago

fichier oublies

File size: 5.8 KB
Line 
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// $Id: G4VMscModel.hh,v 1.8 2009/02/24 09:56:03 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-02-ref-02 $
28//
29// -------------------------------------------------------------------
30//
31// GEANT4 Class header file
32//
33//
34// File name: G4VMscModel
35//
36// Author: Vladimir Ivanchenko
37//
38// Creation date: 07.03.2008
39//
40// Modifications:
41//
42//
43// Class Description:
44//
45// General interface to msc models
46
47// -------------------------------------------------------------------
48//
49
50#ifndef G4VMscModel_h
51#define G4VMscModel_h 1
52
53#include "G4VEmModel.hh"
54#include "G4MscStepLimitType.hh"
55#include "globals.hh"
56#include "G4ThreeVector.hh"
57#include "G4Track.hh"
58#include "G4SafetyHelper.hh"
59
60class G4ParticleChangeForMSC;
61
62class G4VMscModel : public G4VEmModel
63{
64
65public:
66
67 G4VMscModel(const G4String& nam);
68
69 virtual ~G4VMscModel();
70
71 // empty
72 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
73 const G4MaterialCutsCouple*,
74 const G4DynamicParticle*,
75 G4double tmin,
76 G4double tmax);
77
78 //================================================================
79 // Set parameters of multiple scattering models
80 //================================================================
81
82 inline void SetStepLimitType(G4MscStepLimitType);
83
84 inline void SetLateralDisplasmentFlag(G4bool val);
85
86 inline void SetRangeFactor(G4double);
87
88 inline void SetGeomFactor(G4double);
89
90 inline void SetSkin(G4double);
91
92 inline void SetSampleZ(G4bool);
93
94protected:
95
96 // initialisation of interface with geometry
97 void InitialiseSafetyHelper();
98
99 // shift point of the track PostStep
100 void ComputeDisplacement(G4ParticleChangeForMSC*,
101 const G4ThreeVector& displDir,
102 G4double displacement,
103 G4double postsafety);
104
105 // compute safety
106 inline G4double ComputeSafety(const G4ThreeVector& position, G4double limit);
107
108 // compute linear distance to a geometry boundary
109 inline G4double ComputeGeomLimit(const G4Track& position, G4double& presafety,
110 G4double limit);
111
112private:
113
114 // hide assignment operator
115 G4VMscModel & operator=(const G4VMscModel &right);
116 G4VMscModel(const G4VMscModel&);
117
118 G4SafetyHelper* safetyHelper;
119
120protected:
121
122 G4double facrange;
123 G4double facgeom;
124 G4double facsafety;
125 G4double skin;
126 G4double dtrl;
127 G4double lambdalimit;
128 G4double geommax;
129
130 G4MscStepLimitType steppingAlgorithm;
131
132 G4bool samplez;
133 G4bool latDisplasment;
134
135};
136
137//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139
140inline void G4VMscModel::SetLateralDisplasmentFlag(G4bool val)
141{
142 latDisplasment = val;
143}
144
145//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146
147inline void G4VMscModel::SetSkin(G4double val)
148{
149 skin = val;
150}
151
152//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
153
154inline void G4VMscModel::SetRangeFactor(G4double val)
155{
156 facrange = val;
157}
158
159//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
160
161inline void G4VMscModel::SetGeomFactor(G4double val)
162{
163 facgeom = val;
164}
165
166//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
167
168inline void G4VMscModel::SetStepLimitType(G4MscStepLimitType val)
169{
170 steppingAlgorithm = val;
171}
172
173//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
174
175inline void G4VMscModel::SetSampleZ(G4bool val)
176{
177 samplez = val;
178}
179
180//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
181
182inline G4double G4VMscModel::ComputeSafety(const G4ThreeVector& position,
183 G4double)
184{
185 return safetyHelper->ComputeSafety(position);
186}
187
188//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
189
190inline G4double G4VMscModel::ComputeGeomLimit(const G4Track& track,
191 G4double& presafety,
192 G4double limit)
193{
194 G4double res = geommax;
195 if(track.GetVolume() != safetyHelper->GetWorldVolume()) {
196 res = safetyHelper->CheckNextStep(
197 track.GetStep()->GetPreStepPoint()->GetPosition(),
198 track.GetMomentumDirection(),
199 limit, presafety);
200 }
201 return res;
202}
203
204//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
205
206#endif
207
Note: See TracBrowser for help on using the repository browser.