Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VEmAdjointModel.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// Module: G4VEMAdjointModel
29// Author: L. Desorgher
30// Organisation: SpaceIT GmbH
31// Contract: ESA contract 21435/08/NL/AT
32// Customer: ESA/ESTEC
33/////////////////////////////////////////////////////////////////////////////////
34//
35// CHANGE HISTORY
36// --------------
37// ChangeHistory:
38// 10 September 2009 Move to a virtual class. L. Desorgher
39// 1st April 2007 creation by L. Desorgher
40//
41//-------------------------------------------------------------
42// Documentation:
43// Base class for Adjoint EM model. It is based on the use of direct G4VEmModel.
44//
45
46
47#ifndef G4VEmAdjointModel_h
48#define G4VEmAdjointModel_h 1
49
50#include "globals.hh"
51#include "G4DynamicParticle.hh"
54#include "G4Material.hh"
55#include "G4Element.hh"
56#include "G4ElementVector.hh"
57#include "Randomize.hh"
59#include "G4VEmModel.hh"
60#include "G4Electron.hh"
61#include "G4Gamma.hh"
63
64class G4PhysicsTable;
65class G4Region;
68class G4Track;
70
72{
73
74public: // public methods
75
76 G4VEmAdjointModel(const G4String& nam);
77
78 virtual ~G4VEmAdjointModel();
79
80 //------------------------------------------------------------------------
81 // Virtual methods to be implemented for the sample secondaries concrete model
82 //------------------------------------------------------------------------
83
84 //virtual void Initialise()=0;
85
86 virtual void SampleSecondaries(const G4Track& aTrack,
87 G4bool IsScatProjToProjCase,
88 G4ParticleChange* fParticleChange)=0;
89
90
91 //------------------------------------------------------------------------
92 // Methods for adjoint processes; may be overwritten if needed;
93 //------------------------------------------------------------------------
94
95
97 G4double primEnergy,
98 G4bool IsScatProjToProjCase);
99
101 G4double primEnergy,
102 G4bool IsScatProjToProjCase);
103
105 G4double kinEnergyProj, // kinetic energy of the primary particle before the interaction
106 G4double kinEnergyProd, // kinetic energy of the secondary particle
107 G4double Z,
108 G4double A = 0.);
109
111 G4double kinEnergyProj, // kinetic energy of the primary particle before the interaction
112 G4double kinEnergyScatProj, // kinetic energy of the primary particle after the interaction
113 G4double Z,
114 G4double A = 0.);
115
116
117
119 const G4Material* aMaterial,
120 G4double kinEnergyProj, // kinetic energy of the primary particle before the interaction
121 G4double kinEnergyProd // kinetic energy of the secondary particle
122 );
123
125 const G4Material* aMaterial,
126 G4double kinEnergyProj, // kinetic energy of the primary particle before the interaction
127 G4double kinEnergyScatProj // kinetic energy of the primary particle after the interaction
128 );
129
130
131 //Energy limits of adjoint secondary
132 //------------------
133
138
139
140
141 //Other Methods
142 //---------------
143
145
146
147 std::vector< std::vector< double>* > ComputeAdjointCrossSectionVectorPerAtomForSecond(
148 G4double kinEnergyProd,
149 G4double Z,
150 G4double A = 0.,
151 G4int nbin_pro_decade=10
152 );
153 std::vector< std::vector< double>* > ComputeAdjointCrossSectionVectorPerAtomForScatProj(
154 G4double kinEnergyProd,
155 G4double Z,
156 G4double A = 0.,
157 G4int nbin_pro_decade=10
158 );
159
160 std::vector< std::vector< double>* > ComputeAdjointCrossSectionVectorPerVolumeForSecond(
161 G4Material* aMaterial,
162 G4double kinEnergyProd,
163 G4int nbin_pro_decade=10
164 );
165 std::vector< std::vector< double>* > ComputeAdjointCrossSectionVectorPerVolumeForScatProj(
166 G4Material* aMaterial,
167 G4double kinEnergyProd,
168 G4int nbin_pro_decade=10
169 );
170
171
172
173 inline void SetCSMatrices(std::vector< G4AdjointCSMatrix* >* Vec1CSMatrix, std::vector< G4AdjointCSMatrix* >* Vec2CSMatrix){
176
177
178 };
179
181
183
185
187
188 void SetHighEnergyLimit(G4double aVal);
189
190 void SetLowEnergyLimit(G4double aVal);
191
192 inline void DefineDirectEMModel(G4VEmModel* aModel){theDirectEMModel = aModel;}
193
195
198 }
199
201
203
204 inline void SetUseMatrix(G4bool aBool) { UseMatrix = aBool;}
205
208
209 inline void SetApplyCutInRange(G4bool aBool){ ApplyCutInRange = aBool;}
210 inline G4bool GetUseMatrix() {return UseMatrix;}
214
215 inline G4String GetName(){ return name;}
216 inline virtual void SetCSBiasingFactor(G4double aVal) {CS_biasing_factor = aVal;}
217
220
221protected:
222
223 //Some of them can be overriden by daughter classes
224
225
229
230
231
232 //General methods to sample secondary energy
233 //--------------------------------------
234 G4double SampleAdjSecEnergyFromCSMatrix(size_t MatrixIndex,G4double prim_energy,G4bool IsScatProjToProjCase);
235 G4double SampleAdjSecEnergyFromCSMatrix(G4double prim_energy,G4bool IsScatProjToProjCase);
236 void SelectCSMatrix(G4bool IsScatProjToProjCase);
237
238 virtual G4double SampleAdjSecEnergyFromDiffCrossSectionPerAtom(G4double prim_energy,G4bool IsScatProjToProjCase);
239
240
241
242 //Post Step weight correction
243 //----------------------------
244 virtual void CorrectPostStepWeight(G4ParticleChange* fParticleChange,
245 G4double old_weight,
246 G4double adjointPrimKinEnergy,
247 G4double projectileKinEnergy,
248 G4bool IsScatProjToProjCase);
249
250
251
252
253
254
255protected: //attributes
256
259
260
261
262
263 //Name
264 //-----
265
267
268 //Needed for CS integration at the initialisation phase
269 //-----------------------------------------------------
270
277
278 //for the adjoint simulation we need for each element or material:
279 //an adjoint CS Matrix
280 //-----------------------------
281
282 std::vector< G4AdjointCSMatrix* >* pOnCSMatrixForProdToProjBackwardScattering;
283 std::vector< G4AdjointCSMatrix* >* pOnCSMatrixForScatProjToProjBackwardScattering;
285 std::vector<G4double> CS_Vs_ElementForProdToProjCase;
286
290
291 //particle definition
292 //------------------
293
298
299 //Prestep energy
300 //-------------
302
303 //Current couple material
304 //----------------------
312
313 //For ions
314 //---------
317
318 //Energy limits
319 //-------------
320
323
324 //Cross Section biasing factor
325 //---------------------------
327
328 //Type of Model with Matrix or not
329 //--------------------------------
331 G4bool UseMatrixPerElement; //other possibility is per Material
333
334 //Index of Cross section matrices to be used
335 //------------
337
339
340 //This is needed for the forced interaction where part of the weight correction
341 // is given outside the model while the secondary are created in the model
342 //The weight should be fixed before adding the secondary
345
346};
347
348
349#endif
350
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
void SetUseMatrixPerElement(G4bool aBool)
virtual G4double DiffCrossSectionPerVolumePrimToScatPrim(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyScatProj)
void SetAdjointEquivalentOfDirectSecondaryParticleDefinition(G4ParticleDefinition *aPart)
G4bool GetSecondPartOfSameType()
void SetCSMatrices(std::vector< G4AdjointCSMatrix * > *Vec1CSMatrix, std::vector< G4AdjointCSMatrix * > *Vec2CSMatrix)
virtual ~G4VEmAdjointModel()
G4double lastAdjointCSForProdToProjCase
virtual void SampleSecondaries(const G4Track &aTrack, G4bool IsScatProjToProjCase, G4ParticleChange *fParticleChange)=0
G4double DiffCrossSectionFunction1(G4double kinEnergyProj)
G4VEmModel * theDirectEMModel
void SetUseMatrix(G4bool aBool)
G4bool GetUseOnlyOneMatrixForAllElements()
G4double lastAdjointCSForScatProjToProjCase
virtual G4double GetSecondAdjEnergyMaxForProdToProjCase(G4double PrimAdjEnergy)
G4double kinEnergyProjForIntegration
size_t indexOfUsedCrossSectionMatrix
void SelectCSMatrix(G4bool IsScatProjToProjCase)
std::vector< std::vector< double > * > ComputeAdjointCrossSectionVectorPerAtomForSecond(G4double kinEnergyProd, G4double Z, G4double A=0., G4int nbin_pro_decade=10)
virtual void CorrectPostStepWeight(G4ParticleChange *fParticleChange, G4double old_weight, G4double adjointPrimKinEnergy, G4double projectileKinEnergy, G4bool IsScatProjToProjCase)
virtual void SetCSBiasingFactor(G4double aVal)
virtual G4double DiffCrossSectionPerVolumePrimToSecond(const G4Material *aMaterial, G4double kinEnergyProj, G4double kinEnergyProd)
G4ParticleDefinition * GetAdjointEquivalentOfDirectPrimaryParticleDefinition()
G4double GetLowEnergyLimit()
virtual G4double DiffCrossSectionPerAtomPrimToScatPrim(G4double kinEnergyProj, G4double kinEnergyScatProj, G4double Z, G4double A=0.)
G4double additional_weight_correction_factor_for_post_step_outside_model
void SetLowEnergyLimit(G4double aVal)
G4double DiffCrossSectionPerVolumeFunctionForIntegrationOverEkinProj(G4double EkinProd)
void SetAdditionalWeightCorrectionFactorForPostStepOutsideModel(G4double factor)
std::vector< G4double > CS_Vs_ElementForScatProjToProjCase
void DefineCurrentMaterial(const G4MaterialCutsCouple *couple)
G4ParticleDefinition * GetAdjointEquivalentOfDirectSecondaryParticleDefinition()
G4ParticleDefinition * theDirectPrimaryPartDef
G4double SampleAdjSecEnergyFromCSMatrix(size_t MatrixIndex, G4double prim_energy, G4bool IsScatProjToProjCase)
virtual G4double GetSecondAdjEnergyMaxForScatProjToProjCase(G4double PrimAdjEnergy)
G4double kinEnergyProdForIntegration
G4double kinEnergyScatProjForIntegration
void SetSecondPartOfSameType(G4bool aBool)
G4double currentTcutForDirectPrim
std::vector< G4AdjointCSMatrix * > * pOnCSMatrixForScatProjToProjBackwardScattering
G4Material * currentMaterial
virtual G4double GetAdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
std::vector< std::vector< double > * > ComputeAdjointCrossSectionVectorPerVolumeForSecond(G4Material *aMaterial, G4double kinEnergyProd, G4int nbin_pro_decade=10)
G4bool UseOnlyOneMatrixForAllElements
virtual G4double GetSecondAdjEnergyMinForProdToProjCase(G4double PrimAdjEnergy)
G4Material * SelectedMaterial
void SetCorrectWeightForPostStepInModel(G4bool aBool)
std::vector< G4AdjointCSMatrix * > * pOnCSMatrixForProdToProjBackwardScattering
G4VParticleChange * pParticleChange
void SetUseOnlyOneMatrixForAllElements(G4bool aBool)
G4bool correct_weight_for_post_step_in_model
G4double DiffCrossSectionFunction2(G4double kinEnergyProj)
std::vector< G4double > CS_Vs_ElementForProdToProjCase
void SetAdjointEquivalentOfDirectPrimaryParticleDefinition(G4ParticleDefinition *aPart)
void DefineDirectEMModel(G4VEmModel *aModel)
std::vector< std::vector< double > * > ComputeAdjointCrossSectionVectorPerVolumeForScatProj(G4Material *aMaterial, G4double kinEnergyProd, G4int nbin_pro_decade=10)
virtual G4double DiffCrossSectionPerAtomPrimToSecond(G4double kinEnergyProj, G4double kinEnergyProd, G4double Z, G4double A=0.)
G4double currentTcutForDirectSecond
G4MaterialCutsCouple * currentCouple
virtual G4double AdjointCrossSection(const G4MaterialCutsCouple *aCouple, G4double primEnergy, G4bool IsScatProjToProjCase)
virtual G4double SampleAdjSecEnergyFromDiffCrossSectionPerAtom(G4double prim_energy, G4bool IsScatProjToProjCase)
void SetHighEnergyLimit(G4double aVal)
std::vector< std::vector< double > * > ComputeAdjointCrossSectionVectorPerAtomForScatProj(G4double kinEnergyProd, G4double Z, G4double A=0., G4int nbin_pro_decade=10)
G4ParticleDefinition * theAdjEquivOfDirectSecondPartDef
G4double GetHighEnergyLimit()
void SetApplyCutInRange(G4bool aBool)
virtual G4double GetSecondAdjEnergyMinForScatProjToProjCase(G4double PrimAdjEnergy, G4double Tcut=0)
G4ParticleDefinition * theAdjEquivOfDirectPrimPartDef