Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMXMinEkineCuts.cc
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 // $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 }
G4double condition(const G4ErrorSymMatrix &m)
G4ParticleDefinition * GetDefinition() const
static G4LossTableManager * Instance()
G4int verboseLevel
Definition: G4VProcess.hh:368
G4double GetKineticEnergy() const
const G4DynamicParticle * GetDynamicParticle() const
virtual ~DMXMinEkineCuts()
DMXMinEkineCuts(const G4String &processName="DMXMinEkineCuts")
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
G4GLOB_DLL std::ostream G4cout
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4UserLimits * GetUserLimits() const
G4LogicalVolume * GetLogicalVolume() const
virtual G4double GetUserMinEkine(const G4Track &)
G4VPhysicalVolume * GetVolume() const
#define G4endl
Definition: G4ios.hh:61
void SetProcessType(G4ProcessType)
Definition: G4VProcess.hh:420
double G4double
Definition: G4Types.hh:76
G4ForceCondition
G4double GetPDGCharge() const
#define DBL_MAX
Definition: templates.hh:83
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)