Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
electromagnetic/TestEm8/src/StepMax.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: StepMax.cc 106960 2017-10-31 08:35:19Z gcosmo $
27 //
28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 
31 #include "StepMax.hh"
32 #include "DetectorConstruction.hh"
33 #include "G4VPhysicalVolume.hh"
35 
36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
37 
39  : G4VEmProcess(processName, fGeneral),fMaxChargedStep(DBL_MAX),
40  fDetector(ptr),fWorld(nullptr),isInitialised(false)
41 {
42  SetProcessSubType(static_cast<G4int>(STEP_LIMITER));
43 }
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48 {}
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51 
53 {
54  return (part.GetPDGCharge() != 0. && !part.IsShortLived());
55 }
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
60 {
61  if(isInitialised) {
62  isInitialised = false;
63  }
64 }
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
69 {
70  if(!isInitialised) {
73  isInitialised = true;
74  if(fMaxChargedStep < DBL_MAX) {
75  G4cout << GetProcessName() << ": SubType= " << GetProcessSubType()
76  << " Step limit(mm)= " << fMaxChargedStep << G4endl;
77  }
78  }
79 }
80 
81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82 
84 {}
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87 
88 G4double
90  G4double,
92 {
93  // condition is set to "Not Forced"
94  *condition = NotForced;
95  return (aTrack.GetVolume() != fWorld) ? fMaxChargedStep : DBL_MAX;
96 }
97 
98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99 
101 {
102  // do nothing
103  aParticleChange.Initialize(aTrack);
104  return &aParticleChange;
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108 
#define G4endl
Definition: G4ios.hh:61
DetectorConstruction * fDetector
G4double GetPDGCharge() const
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
G4double condition(const G4ErrorSymMatrix &m)
virtual void PreparePhysicsTable(const G4ParticleDefinition &)
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:289
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
TString part[npart]
Definition: Style.C:32
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
virtual void Initialize(const G4Track &)
const G4String & GetProcessName() const
Definition: G4VProcess.hh:411
Definition: G4Step.hh:76
virtual void InitialiseProcess(const G4ParticleDefinition *)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
virtual G4bool IsApplicable(const G4ParticleDefinition &)
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:435
G4ForceCondition
G4GLOB_DLL std::ostream G4cout
StepMax(const G4String &processName="UserMaxStep")
#define DBL_MAX
Definition: templates.hh:83
Simple detector construction with a box volume placed in a world.
G4VPhysicalVolume * GetVolume() const
G4int GetProcessSubType() const
Definition: G4VProcess.hh:429