Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
DMXMinEkineCuts.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: DMXMinEkineCuts.cc 69148 2013-04-19 10:35:21Z gcosmo $
28 //
29 //
30 // --------------------------------------------------------------
31 // GEANT 4 class implementation file
32 //
33 // History: first implementation, based on object model of
34 // 2nd December 1995, G.Cosmo
35 // --------------------------------------------------------------
36 // 15 April 1998 M.Maire
37 // --------------------------------------------------------------
38 
39 #include "DMXMinEkineCuts.hh"
40 
41 #include "G4Step.hh"
42 #include "G4UserLimits.hh"
43 #include "G4VParticleChange.hh"
44 #include "G4LossTableManager.hh"
45 
47  : DMXSpecialCuts(aName)
48 {
49  if (verboseLevel>1) {
50  G4cout << GetProcessName() << " is created "<< G4endl;
51  }
53 }
54 
56 {}
57 
59  : DMXSpecialCuts()
60 {}
61 
62 
64  const G4Track& aTrack,
65  G4double ,
67 {
68  // condition is set to "Not Forced"
69  *condition = NotForced;
70 
71  G4double proposedStep = DBL_MAX;
72  // get the pointer to UserLimits
73  G4UserLimits* pUserLimits = aTrack.GetVolume()->GetLogicalVolume()->GetUserLimits();
74  const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
75  G4ParticleDefinition* aParticleDef = aTrack.GetDefinition();
76 
77  if (pUserLimits && aParticleDef->GetPDGCharge() != 0.0) {
78  //min kinetic energy
79  G4double temp = DBL_MAX;
80  G4double eKine = aParticle->GetKineticEnergy();
81  const G4MaterialCutsCouple* couple = aTrack.GetMaterialCutsCouple();
82  G4double eMin = pUserLimits->GetUserMinEkine(aTrack);
83 
84  if (eKine < eMin)
85  return 0.;
86 
87  G4double rangeNow = DBL_MAX;
88 
90  rangeNow = lossManager->GetRange(aParticleDef,eKine,couple);
91 
92  // charged particles only
93  G4double rangeMin = lossManager->GetRange(aParticleDef,eMin,couple);
94  temp = rangeNow - rangeMin;
95  if (proposedStep > temp) proposedStep = temp;
96  }
97  return proposedStep;
98 }
G4LogicalVolume * GetLogicalVolume() const
DMXMinEkineCuts(const G4String &processName="DMXMinEkineCuts")
virtual G4double GetUserMinEkine(const G4Track &)
#define G4endl
Definition: G4ios.hh:61
G4double GetPDGCharge() const
G4double condition(const G4ErrorSymMatrix &m)
G4ParticleDefinition * GetDefinition() const
virtual ~DMXMinEkineCuts()
double G4double
Definition: G4Types.hh:76
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:411
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
void SetProcessType(G4ProcessType)
Definition: G4VProcess.hh:423
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
G4int verboseLevel
Definition: G4VProcess.hh:371
G4ForceCondition
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
static G4LossTableManager * Instance()
G4UserLimits * GetUserLimits() const
#define DBL_MAX
Definition: templates.hh:83
const G4DynamicParticle * GetDynamicParticle() const
G4VPhysicalVolume * GetVolume() const