Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4VRestProcess << 26 // >> 27 // $Id: G4VRestProcess.hh,v 1.6 2006/06/29 21:07:58 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-08-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 27 // 36 // 28 // Class description: << 37 // Class Description >> 38 // Abstract class which defines the public behavior of >> 39 // physics interactions at rest. 29 // 40 // 30 // Abstract class which defines the public beh << 41 // ------------------------------------------------------------ 31 // physics interactions at rest. << 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 32 51 33 // Authors: << 52 #ifndef G4VRestProcess_h 34 // - 2 December 1995, G.Cosmo - First implemen << 53 #define G4VRestProcess_h 1 35 // - 18 December 1996, H.Kurashige - New Physi << 36 // ------------------------------------------- << 37 #ifndef G4VRestProcess_hh << 38 #define G4VRestProcess_hh 1 << 39 54 40 #include "globals.hh" 55 #include "globals.hh" 41 #include "G4ios.hh" 56 #include "G4ios.hh" 42 57 43 #include "G4VProcess.hh" 58 #include "G4VProcess.hh" 44 59 >> 60 45 class G4VRestProcess : public G4VProcess 61 class G4VRestProcess : public G4VProcess 46 { 62 { 47 public: << 63 // Abstract class which defines the public behavior of 48 << 64 // physics interactions at rest. 49 G4VRestProcess(const G4String& aName, << 50 G4ProcessType aType = fNotD << 51 G4VRestProcess(G4VRestProcess&); << 52 65 53 virtual ~G4VRestProcess(); << 66 public: >> 67 G4VRestProcess(const G4String& , >> 68 G4ProcessType aType = fNotDefined ); >> 69 G4VRestProcess(G4VRestProcess& ); 54 70 55 G4VRestProcess& operator=(const G4VRestPro << 71 virtual ~G4VRestProcess(); 56 72 57 virtual G4double AtRestGetPhysicalInteract << 73 public: // with description >> 74 virtual G4double AtRestGetPhysicalInteractionLength( 58 const G4Track& tr 75 const G4Track& track, 59 G4ForceCondition* << 76 G4ForceCondition* condition 60 ); << 77 ); 61 78 62 virtual G4VParticleChange* AtRestDoIt( << 79 virtual G4VParticleChange* AtRestDoIt( 63 const G4Track& , << 80 const G4Track& , 64 const G4Step& << 81 const G4Step& 65 ); << 82 ); 66 83 67 virtual G4double AlongStepGetPhysicalInter << 84 // no operation in PostStepDoIt and AlongStepDoIt >> 85 virtual G4double AlongStepGetPhysicalInteractionLength( 68 const G4Track&, 86 const G4Track&, 69 G4double , << 87 G4double , 70 G4double , << 88 G4double , 71 G4double& , << 89 G4double& , 72 G4GPILSelection* << 90 G4GPILSelection* 73 ) { return -1.0; } << 91 ){ return -1.0; }; 74 // No operation in AlongStepGPIL << 75 92 76 virtual G4double PostStepGetPhysicalIntera << 93 virtual G4double PostStepGetPhysicalInteractionLength( 77 const G4Track& , 94 const G4Track& , 78 G4double , << 95 G4double , 79 G4ForceCondition* << 96 G4ForceCondition* 80 ) { return -1.0; } << 97 ) { return -1.0; }; 81 // No operation in PostStepGPIL << 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 }; 82 124 83 virtual G4VParticleChange* PostStepDoIt( << 125 // ----------------------------------------- 84 const G4Track& , << 126 // inlined function members implementation 85 const G4Step& << 127 // ----------------------------------------- 86 ) { return 0; } << 128 #include "G4Step.hh" 87 // No operation in PostStepDoIt << 129 #include "G4Track.hh" >> 130 #include "G4MaterialTable.hh" >> 131 #include "G4VParticleChange.hh" 88 132 89 virtual G4VParticleChange* AlongStepDoIt( << 133 inline G4double G4VRestProcess::AtRestGetPhysicalInteractionLength( 90 const G4Track& , << 134 const G4Track& track, 91 const G4Step& << 135 G4ForceCondition* condition 92 ) { return 0; } << 136 ) 93 // No operation in AlongStepDoIt << 137 { 94 << 138 // beggining of tracking 95 protected: << 139 ResetNumberOfInteractionLengthLeft(); 96 << 97 virtual G4double GetMeanLifeTime(const G4T << 98 G4ForceCo << 99 // Calculates the mean life-time (i.e. f << 100 // particle at rest due to the occurrenc << 101 // or converts the probability of intera << 102 // annihilation) into the life-time of t << 103 // occurrence of the given process << 104 140 105 private: << 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 >> 161 inline G4VParticleChange* G4VRestProcess::AtRestDoIt( >> 162 const G4Track&, >> 163 const G4Step& >> 164 ) >> 165 { >> 166 // clear NumberOfInteractionLengthLeft >> 167 ClearNumberOfInteractionLengthLeft(); >> 168 >> 169 return pParticleChange; >> 170 } 106 171 107 G4VRestProcess(); << 108 // Hidden default constructor << 109 }; << 110 172 111 #endif 173 #endif >> 174 >> 175 >> 176 112 177