source: trunk/source/processes/management/include/G4VRestProcess.hh @ 1007

Last change on this file since 1007 was 1007, checked in by garnier, 15 years ago

update to geant4.9.2

File size: 5.9 KB
Line 
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: G4VRestProcess.hh,v 1.6 2006/06/29 21:07:58 gunter Exp $
28// GEANT4 tag $Name: geant4-09-02 $
29//
30//
31// ------------------------------------------------------------
32//      GEANT 4 class header file
33//
34//      History: first implementation, based on object model of
35//      2nd December 1995, G.Cosmo
36//
37// Class Description
38//  Abstract class which defines the public behavior of
39//  physics interactions at rest.
40//
41// ------------------------------------------------------------
42//   New Physics scheme           18 Dec. 1996  H.Kurahige
43// ------------------------------------------------------------
44//   modified                     25 Feb. 1997  H.Kurahige
45//   modified                      8 Mar. 1997  H.Kurahige
46//   modified                     26 Mar. 1997  H.Kurahige
47//   modified                     16 Apr. 1997  L.Urban   
48//   modified                     17 Dec. 1997  L.Urban   
49//   modified for new ParticleChange 12 Mar. 1998  H.Kurashige
50
51
52#ifndef G4VRestProcess_h
53#define G4VRestProcess_h 1
54
55#include "globals.hh"
56#include "G4ios.hh"
57
58#include "G4VProcess.hh"
59
60
61class G4VRestProcess : public G4VProcess
62{
63  //  Abstract class which defines the public behavior of
64  //  physics interactions at rest.
65
66  public:
67      G4VRestProcess(const G4String&  ,
68                     G4ProcessType   aType = fNotDefined );
69      G4VRestProcess(G4VRestProcess& );
70
71      virtual ~G4VRestProcess();
72
73  public:   //  with description
74      virtual G4double AtRestGetPhysicalInteractionLength(
75                             const G4Track& track,
76                             G4ForceCondition* condition
77                            );
78
79      virtual G4VParticleChange* AtRestDoIt(
80                             const G4Track& ,
81                             const G4Step&
82                            );
83
84     //  no operation in  PostStepDoIt and  AlongStepDoIt
85      virtual G4double AlongStepGetPhysicalInteractionLength(
86                             const G4Track&,
87                             G4double  ,
88                             G4double  ,
89                             G4double& ,
90                             G4GPILSelection*
91                           ){ return -1.0; };
92
93      virtual G4double PostStepGetPhysicalInteractionLength(
94                             const G4Track& ,
95                             G4double   ,
96                             G4ForceCondition* 
97                            ) { return -1.0; };
98
99     //  no operation in  PostStepDoIt and  AlongStepDoIt
100      virtual G4VParticleChange* PostStepDoIt(
101                             const G4Track& ,
102                             const G4Step&
103                            ) {return 0;};
104
105      virtual G4VParticleChange* AlongStepDoIt(
106                             const G4Track& ,
107                             const G4Step& 
108                            ) {return 0;};
109 
110  protected: //  with description
111
112      virtual G4double GetMeanLifeTime(const G4Track& aTrack,G4ForceCondition* condition)=0;
113      //  Calculates the mean life-time (i.e. for decays) of the
114      //  particle at rest due to the occurence of the given process,
115      //  or converts the probability of interaction (i.e. for
116      //  annihilation) into the life-time of the particle for the
117      //  occurence of the given process.
118
119 private:
120  // hide default constructor and assignment operator as private
121      G4VRestProcess();
122      G4VRestProcess & operator=(const G4VRestProcess &right);
123};
124
125// -----------------------------------------
126//  inlined function members implementation
127// -----------------------------------------
128#include "G4Step.hh"
129#include "G4Track.hh"
130#include "G4MaterialTable.hh"
131#include "G4VParticleChange.hh"
132
133inline G4double G4VRestProcess::AtRestGetPhysicalInteractionLength(
134                             const G4Track& track,
135                             G4ForceCondition* condition
136                            )
137{
138  // beggining of tracking
139  ResetNumberOfInteractionLengthLeft();
140
141  // condition is set to "Not Forced"
142  *condition = NotForced;
143
144  // get mean life time
145  currentInteractionLength = GetMeanLifeTime(track, condition);
146
147#ifdef G4VERBOSE
148 if ((currentInteractionLength <0.0) || (verboseLevel>2)){
149    G4cout << "G4VRestProcess::AtRestGetPhysicalInteractionLength ";
150    G4cout << "[ " << GetProcessName() << "]" <<G4endl;
151    track.GetDynamicParticle()->DumpInfo();
152    G4cout << " in Material  " << track.GetMaterial()->GetName() <<G4endl;
153    G4cout << "MeanLifeTime = " << currentInteractionLength/ns << "[ns]" <<G4endl;
154  }
155#endif
156
157  return theNumberOfInteractionLengthLeft * currentInteractionLength;
158}
159
160
161inline G4VParticleChange* G4VRestProcess::AtRestDoIt( 
162                             const G4Track&,
163                             const G4Step& 
164                            )
165{
166//  clear NumberOfInteractionLengthLeft
167    ClearNumberOfInteractionLengthLeft();
168
169    return pParticleChange;
170}
171
172
173#endif
174
175
176
Note: See TracBrowser for help on using the repository browser.