Geant4  10.01.p03
G4VITRestProcess.hh
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 // $Id: G4VITRestProcess.hh 85244 2014-10-27 08:24:13Z gcosmo $
27 //
29 //
30 // WARNING : This class is released as a prototype.
31 // It might strongly evolve or even disapear in the next releases.
32 //
33 // Author: Mathieu Karamitros, kara@cenbg.in2p3.fr
34 
35 // The code is developed in the framework of the ESA AO7146
36 //
37 // We would be very happy hearing from you, send us your feedback! :)
38 //
39 // In order for Geant4-DNA to be maintained and still open-source,
40 // article citations are crucial.
41 // If you use Geant4-DNA chemistry and you publish papers about your software,
42 // in addition to the general paper on Geant4-DNA:
43 //
44 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
45 //
46 // we would be very happy if you could please also cite the following
47 // reference papers on chemistry:
48 //
49 // J. Comput. Phys. 274 (2014) 841-882
50 // Prog. Nucl. Sci. Tec. 2 (2011) 503-508
51 
52 
53 
54 #ifndef G4VITRestProcess_h
55 #define G4VITRestProcess_h 1
56 
57 #include <CLHEP/Units/SystemOfUnits.h>
58 
59 #include "G4VITProcess.hh"
60 
66 {
67  // Abstract class which defines the public behavior of
68  // physics interactions at rest.
69 
70  public:
71  G4VITRestProcess(const G4String& ,
72  G4ProcessType aType = fNotDefined );
74 
75  virtual ~G4VITRestProcess();
76 
77  public: // with description
79  const G4Track& track,
81  );
82 
84  const G4Track& ,
85  const G4Step&
86  );
87 
88  // no operation in PostStepDoIt and AlongStepDoIt
90  const G4Track&,
91  G4double ,
92  G4double ,
93  G4double& ,
95  ){ return -1.0; }
96 
98  const G4Track& ,
99  G4double ,
101  ) { return -1.0; }
102 
103  // no operation in PostStepDoIt and AlongStepDoIt
105  const G4Track& ,
106  const G4Step&
107  ) {return 0;}
108 
110  const G4Track& ,
111  const G4Step&
112  ) {return 0;}
113 
114  protected: // with description
115 
116  virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
117  // Calculates the mean life-time (i.e. for decays) of the
118  // particle at rest due to the occurence of the given process,
119  // or converts the probability of interaction (i.e. for
120  // annihilation) into the life-time of the particle for the
121  // occurence of the given process.
122 
123  protected:
124  // hide default constructor and assignment operator as private
127 };
128 
129 // -----------------------------------------
130 // inlined function members implementation
131 // -----------------------------------------
133  const G4Track& track,
135  )
136 {
137  // beggining of tracking
139 
140  // condition is set to "Not Forced"
141  *condition = NotForced;
142 
143  // get mean life time
144  fpState->currentInteractionLength = GetMeanLifeTime(track, condition);
145 
146 #ifdef G4VERBOSE
147  if ((fpState->currentInteractionLength <0.0) || (verboseLevel>2)){
148  G4cout << "G4VITRestProcess::AtRestGetPhysicalInteractionLength ";
149  G4cout << "[ " << GetProcessName() << "]" <<G4endl;
150  track.GetDynamicParticle()->DumpInfo();
151  G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl;
152  G4cout << "MeanLifeTime = " << fpState->currentInteractionLength/CLHEP::ns << "[ns]" <<G4endl;
153  }
154 #endif
155 
156  return (fpState->theNumberOfInteractionLengthLeft) * (fpState->currentInteractionLength);
157 }
158 
159 
161  const G4Track&,
162  const G4Step&
163  )
164 {
165 // clear NumberOfInteractionLengthLeft
167 
168  return pParticleChange;
169 }
170 
171 
172 #endif
173 
174 
175 
176 
G4double condition(const G4ErrorSymMatrix &m)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double, G4ForceCondition *)
virtual void ClearNumberOfInteractionLengthLeft()
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4DynamicParticle * GetDynamicParticle() const
virtual G4VParticleChange * AlongStepDoIt(const G4Track &, const G4Step &)
virtual void ResetNumberOfInteractionLengthLeft()
WARNING : Redefine the method of G4VProcess reset (determine the value of)NumberOfInteractionLengthLe...
const G4String & GetName() const
Definition: G4Material.hh:178
void DumpInfo(G4int mode=0) const
virtual G4double GetMeanLifeTime(const G4Track &aTrack, G4ForceCondition *condition)=0
Identical to G4VRestProcess with dependency from G4VITProcess.
virtual G4double AtRestGetPhysicalInteractionLength(const G4Track &track, G4ForceCondition *condition)
G4GLOB_DLL std::ostream G4cout
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double, G4double, G4double &, G4GPILSelection *)
G4shared_ptr< G4ProcessState > fpState
Definition: G4Step.hh:76
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4Material * GetMaterial() const
virtual ~G4VITRestProcess()
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283
#define G4endl
Definition: G4ios.hh:61
G4VITRestProcess & operator=(const G4VITRestProcess &right)
double G4double
Definition: G4Types.hh:76
G4ForceCondition
G4VITProcess inherits from G4VProcess.
Definition: G4VITProcess.hh:99
#define ns
Definition: xmlparse.cc:597
G4GPILSelection
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
G4ProcessType
virtual G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)