Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4AdjointAlongStepWeightCorrection.cc
이 파일의 문서화 페이지로 가기
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: G4AdjointAlongStepWeightCorrection.cc 66892 2013-01-17 10:57:59Z gunter $
27 //
29 #include "G4Step.hh"
30 #include "G4ParticleDefinition.hh"
31 #include "G4VParticleChange.hh"
32 #include "G4AdjointCSManager.hh"
33 
35 //
36 
38  G4ProcessType type): G4VContinuousProcess(name, type)
42  currentCouple=0;
43 }
44 
46 //
47 
49 {delete fParticleChange;
50 }
52 //
54  const G4ParticleDefinition& )
55 {
56 ;
57 }
59 //
60 
62 {;
63 }
65 //
67  const G4Step& step)
68 {
69 
71 
72  // Get the actual (true) Step length
73  //----------------------------------
74  G4double length = step.GetStepLength();
75 
76 
78  G4ParticleDefinition* thePartDef= const_cast<G4ParticleDefinition*> (track.GetDynamicParticle()->GetDefinition());
80  preStepKinEnergy,Tkin, currentCouple,length);
81 
82 
83 
84 
85  //Caution!!!
86  // It is important to select the weight of the post_step_point
87  // as the current weight and not the weight of the track, as t
88  // the weight of the track is changed after having applied all
89  // the along_step_do_it.
90 
91  // G4double new_weight=weight_correction*track.GetWeight(); //old
92  G4double new_weight=weight_correction*step.GetPostStepPoint()->GetWeight();
93 
94 
95 
96  //if (weight_correction >2.) new_weight=1.e-300;
97 
98 
99  //The following test check for zero weight.
100  //This happens after weight correction of gamma for photo electric effect.
101  //When the new weight is 0 it will be later on consider as nan by G4.
102  //Therefore we do put a lower limit of 1.e-300. for new_weight
103  //Correction by L.Desorgher on 15 July 2009
104  if (new_weight==0 || (new_weight<=0 && new_weight>0)){
105  //G4cout<<new_weight<<'\t'<<weight_correction<<'\t'<<track.GetWeight()<<G4endl;
106  new_weight=1.e-300;
107  }
108 
109  //G4cout<<new_weight<<'\t'<<weight_correction<<'\t'<<track.GetWeight()<<G4endl;
113 
114 
115  return fParticleChange;
116 
117 }
119 //
121  G4double , G4double , G4double& )
122 {
123  G4double x = DBL_MAX;
126  return x;
127 }
Float_t x
Definition: compare.C:6
G4double GetKineticEnergy() const
const XML_Char * name
Definition: expat.h:151
void SetSecondaryWeightByProcess(G4bool)
virtual G4double GetContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety)
double G4double
Definition: G4Types.hh:76
G4ParticleDefinition * GetDefinition() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
virtual void Initialize(const G4Track &)
G4ProcessType
G4double GetStepLength() const
G4VParticleChange * AlongStepDoIt(const G4Track &, const G4Step &)
Definition: G4Step.hh:76
G4StepPoint * GetPostStepPoint() const
G4double GetKineticEnergy() const
void DefineMaterial(const G4MaterialCutsCouple *couple)
static G4AdjointCSManager * GetAdjointCSManager()
void PreparePhysicsTable(const G4ParticleDefinition &)
void SetParentWeightByProcess(G4bool)
void ProposeParentWeight(G4double finalWeight)
G4AdjointAlongStepWeightCorrection(const G4String &name="ContinuousWeightCorrection", G4ProcessType type=fElectromagnetic)
G4double GetWeight() const
#define DBL_MAX
Definition: templates.hh:83
G4double GetContinuousWeightCorrection(G4ParticleDefinition *aPartDef, G4double PreStepEkin, G4double AfterStepEkin, const G4MaterialCutsCouple *aCouple, G4double step_length)
void BuildPhysicsTable(const G4ParticleDefinition &)
const G4DynamicParticle * GetDynamicParticle() const