Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4VTransitionRadiation.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 //
27 // $Id: G4VTransitionRadiation.cc 108423 2018-02-13 11:18:13Z gcosmo $
28 //
29 // G4VTransitionRadiation class -- implementation file
30 
31 // GEANT 4 class implementation file --- Copyright CERN 1995
32 // CERN Geneva Switzerland
33 
34 // History:
35 // 29.02.04 V.Ivanchenko create
36 // 28.07.05, P.Gumplinger add G4ProcessType to constructor
37 
39 #include "G4ParticleDefinition.hh"
40 #include "G4VTRModel.hh"
41 #include "G4Material.hh"
42 #include "G4Region.hh"
44 #include "G4EmProcessSubType.hh"
45 
47 
49  G4ProcessType type )
50  : G4VDiscreteProcess(processName, type),
51  region(nullptr),
52  model(nullptr),
53  nSteps(0),
54  gammaMin(100.),
55  cosDThetaMax(std::cos(0.1))
56 {
58  Clear();
59 }
60 
62 
64 {
65  Clear();
66 }
67 
69 
71 {
72  materials.clear();
73  steps.clear();
74  normals.clear();
75  nSteps = 0;
76 }
77 
79 
81  const G4Track& track,
82  const G4Step& step)
83 {
84 
85  // Fill temporary vectors
86 
87  const G4Material* material = track.GetMaterial();
88  G4double length = step.GetStepLength();
89  G4ThreeVector direction = track.GetMomentumDirection();
90 
91  if(nSteps == 0) {
92 
93  nSteps = 1;
94  materials.push_back(material);
95  steps.push_back(length);
96  const G4StepPoint* point = step.GetPreStepPoint();
97  startingPosition = point->GetPosition();
99  G4bool valid = true;
102  if(valid) normals.push_back(n);
103  else normals.push_back(direction);
104 
105  } else {
106 
107  if(material == materials[nSteps-1]) {
108  steps[nSteps-1] += length;
109  } else {
110  nSteps++;
111  materials.push_back(material);
112  steps.push_back(length);
113  G4bool valid = true;
116  if(valid) normals.push_back(n);
117  else normals.push_back(direction);
118  }
119  }
120 
121  // Check POstStepPoint condition
122 
123  if(track.GetTrackStatus() == fStopAndKill ||
124  track.GetVolume()->GetLogicalVolume()->GetRegion() != region ||
125  startingDirection.x()*direction.x() +
126  startingDirection.y()*direction.y() +
127  startingDirection.z()*direction.z() < cosDThetaMax)
128  {
129  if(model) {
130  model->GenerateSecondaries(*pParticleChange, materials, steps,
131  normals, startingPosition, track);
132  }
133  Clear();
134  }
135 
136  return pParticleChange;
137 }
138 
140 
142  const G4ParticleDefinition& aParticle)
143 {
144  return ( aParticle.GetPDGCharge() != 0.0 );
145 }
146 
148 
149 
151 {
152  region = reg;
153 }
154 
156 
158 {
159  model = mod;
160 }
161 
163 
165 {
166  if(model) model->PrintInfo();
167 }
168 
170 
172  const G4Track& track, G4double,
174 {
175  if(nSteps > 0) {
176  *condition = StronglyForced;
177  } else {
178  *condition = NotForced;
179  if(track.GetKineticEnergy()/track.GetDefinition()->GetPDGMass() + 1.0 > gammaMin &&
180  track.GetVolume()->GetLogicalVolume()->GetRegion() == region) {
181  *condition = StronglyForced;
182  }
183  }
184  return DBL_MAX; // so TR doesn't limit mean free path
185 }
186 
G4double GetKineticEnergy() const
virtual G4ThreeVector GetLocalExitNormal(G4bool *valid)
G4LogicalVolume * GetLogicalVolume() const
G4StepPoint * GetPreStepPoint() const
G4double GetPDGCharge() const
double z() const
G4Navigator * GetNavigatorForTracking() const
G4double condition(const G4ErrorSymMatrix &m)
G4ParticleDefinition * GetDefinition() const
G4double GetPDGMass() const
G4VTransitionRadiation(const G4String &processName="TR", G4ProcessType type=fElectromagnetic)
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &step) override
std::vector< G4double > steps
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
G4ProcessType
G4double GetStepLength() const
const G4ThreeVector & GetPosition() const
virtual G4double GetMeanFreePath(const G4Track &track, G4double, G4ForceCondition *condition) override
const G4ThreeVector & GetMomentumDirection() const
Definition: G4Step.hh:76
G4Material * GetMaterial() const
static G4TransportationManager * GetTransportationManager()
virtual G4bool IsApplicable(const G4ParticleDefinition &aParticleType) override
std::vector< G4ThreeVector > normals
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:435
G4ForceCondition
double x() const
std::vector< const G4Material * > materials
Char_t n[5]
static const G4double reg
double y() const
G4TrackStatus GetTrackStatus() const
const G4ThreeVector & GetMomentumDirection() const
#define DBL_MAX
Definition: templates.hh:83
const XML_Char XML_Content * model
Definition: expat.h:151
void SetRegion(const G4Region *reg)
G4Region * GetRegion() const
G4VPhysicalVolume * GetVolume() const