Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // G4VDiscreteProcess << 23 >> 24 // >> 25 // $Id: G4VDiscreteProcess.hh,v 1.5 2001/07/11 10:08:18 gunter Exp $ >> 26 // GEANT4 tag $Name: geant4-04-00 $ >> 27 // >> 28 // >> 29 // ------------------------------------------------------------ >> 30 // GEANT 4 class header file >> 31 // >> 32 // History: first implementation, based on object model of >> 33 // 2nd December 1995, G.Cosmo >> 34 // add G4VDiscreteProcess(const G4String&) 24 Jul 1996, Hisaya kurashige 27 // 35 // 28 // Class description: << 36 // Class Description >> 37 // Abstract class which defines the public behavior of >> 38 // discrete physics interactions. 29 // 39 // 30 // Abstract class which defines the public beh << 40 // ------------------------------------------------------------ 31 // discrete physics interactions. << 41 // New Physics scheme 18 Dec. 1996 H.Kurahige >> 42 // ------------------------------------------------------------ >> 43 // modified 25 Feb. 1997 H.Kurahige >> 44 // modified 8 Mar. 1997 H.Kurahige >> 45 // modified 26 Mar. 1997 H.Kurahige >> 46 // modified 16 Apr. 1997 L.Urban >> 47 // modified 17 Dec. 1997 L.Urban >> 48 // modified for new ParticleChange 12 Mar. 1998 H.Kurashige 32 49 33 // Authors: << 50 #ifndef G4VDiscreteProcess_h 34 // - 2 December 1995, G.Cosmo - First implemen << 51 #define G4VDiscreteProcess_h 1 35 // - 18 December 1996, H.Kurashige - New Physi << 36 // ------------------------------------------- << 37 #ifndef G4VDiscreteProcess_hh << 38 #define G4VDiscreteProcess_hh 1 << 39 52 40 #include "globals.hh" 53 #include "globals.hh" 41 #include "G4ios.hh" 54 #include "G4ios.hh" 42 55 43 #include "G4VProcess.hh" 56 #include "G4VProcess.hh" 44 57 45 class G4VDiscreteProcess : public G4VProcess 58 class G4VDiscreteProcess : public G4VProcess 46 { 59 { >> 60 // Abstract class which defines the public behavior of >> 61 // discrete physics interactions. 47 public: 62 public: 48 63 49 G4VDiscreteProcess(const G4String& aName, << 64 G4VDiscreteProcess(const G4String& , 50 G4ProcessType aType = f << 65 G4ProcessType aType = fNotDefined ); 51 G4VDiscreteProcess(G4VDiscreteProcess&); << 66 G4VDiscreteProcess(G4VDiscreteProcess &); 52 67 53 virtual ~G4VDiscreteProcess(); << 68 virtual ~G4VDiscreteProcess(); 54 69 55 G4VDiscreteProcess& operator=(const G4VDis << 70 public :// with description 56 << 71 virtual G4double PostStepGetPhysicalInteractionLength( 57 virtual G4double PostStepGetPhysicalIntera << 58 const G4Track& tr 72 const G4Track& track, 59 G4double previous << 73 G4double previousStepSize, 60 G4ForceCondition* << 74 G4ForceCondition* condition 61 ); << 75 ); 62 << 76 63 virtual G4VParticleChange* PostStepDoIt( << 77 virtual G4VParticleChange* PostStepDoIt( 64 const G4Track& , << 78 const G4Track& , 65 const G4Step& << 79 const G4Step& 66 ); << 80 ); 67 81 68 // No operation in AtRestDoIt and AlongSte << 82 // no operation in AtRestDoIt and AlongStepDoIt 69 // << 83 virtual G4double AlongStepGetPhysicalInteractionLength( 70 virtual G4double AlongStepGetPhysicalInter << 71 const G4Track&, 84 const G4Track&, 72 G4double , << 85 G4double , 73 G4double , << 86 G4double , 74 G4double& , << 87 G4double& , 75 G4GPILSelection* 88 G4GPILSelection* 76 ) { return -1.0; } << 89 ){ return -1.0; }; 77 << 78 virtual G4double AtRestGetPhysicalInteract << 79 const G4Track& , << 80 G4ForceCondition* << 81 ) { return -1.0; } << 82 90 83 // No operation in AtRestDoIt and AlongSte << 91 virtual G4double AtRestGetPhysicalInteractionLength( 84 // << 85 virtual G4VParticleChange* AtRestDoIt( << 86 const G4Track& , 92 const G4Track& , 87 const G4Step& << 93 G4ForceCondition* 88 ) { return nullptr << 94 ) { return -1.0; }; 89 95 90 virtual G4VParticleChange* AlongStepDoIt( << 96 // no operation in AtRestDoIt and AlongStepDoIt 91 const G4Track& , << 97 virtual G4VParticleChange* AtRestDoIt( 92 const G4Step& << 98 const G4Track& , 93 ) { return nullptr << 99 const G4Step& 94 << 100 ) {return 0;}; 95 // cross section in the unit of inverse le << 101 96 // function of kinetic energy << 102 virtual G4VParticleChange* AlongStepDoIt( 97 virtual G4double GetCrossSection( << 103 const G4Track& , 98 const G4double, << 104 const G4Step& 99 const G4MaterialC << 105 ) {return 0;}; 100 ) { return 0.0; } << 101 << 102 // minimal energy for non-zero cross secti << 103 virtual G4double MinPrimaryEnergy( << 104 const G4ParticleD << 105 const G4Material* << 106 ) { return 0.0; } << 107 106 108 protected: << 107 protected:// with description 109 << 108 virtual G4double GetMeanFreePath(const G4Track& aTrack, 110 virtual G4double GetMeanFreePath( const G4 << 109 G4double previousStepSize, 111 G4double << 110 G4ForceCondition* condition 112 G4ForceC << 111 )=0; 113 // Calculates from the macroscopic cross << 112 // Calculates from the macroscopic cross section a mean 114 // free path, the value is returned in u << 113 // free path, the value is returned in units of distance. 115 114 116 private: 115 private: >> 116 // hide default constructor and assignment operator as private >> 117 G4VDiscreteProcess(); >> 118 G4VDiscreteProcess & operator=(const G4VDiscreteProcess &right); 117 119 118 G4VDiscreteProcess(); << 119 // Hidden default constructor << 120 }; 120 }; 121 121 >> 122 // ----------------------------------------- >> 123 // inlined function members implementation >> 124 // ----------------------------------------- >> 125 #include "G4Step.hh" >> 126 #include "G4Track.hh" >> 127 #include "G4MaterialTable.hh" >> 128 #include "G4VParticleChange.hh" >> 129 >> 130 inline G4double G4VDiscreteProcess::PostStepGetPhysicalInteractionLength( >> 131 const G4Track& track, >> 132 G4double previousStepSize, >> 133 G4ForceCondition* condition >> 134 ) >> 135 { >> 136 if ( (previousStepSize <=0.0) || (theNumberOfInteractionLengthLeft<=0.0)) { >> 137 // beggining of tracking (or just after DoIt of this process) >> 138 ResetNumberOfInteractionLengthLeft(); >> 139 } else { >> 140 // subtract NumberOfInteractionLengthLeft >> 141 SubtractNumberOfInteractionLengthLeft(previousStepSize); >> 142 if(theNumberOfInteractionLengthLeft<perMillion) >> 143 theNumberOfInteractionLengthLeft=0.; >> 144 } >> 145 >> 146 // condition is set to "Not Forced" >> 147 *condition = NotForced; >> 148 >> 149 // get mean free path >> 150 currentInteractionLength = GetMeanFreePath(track, previousStepSize, condition); >> 151 >> 152 #ifdef G4VERBOSE >> 153 if ((currentInteractionLength <=0.0) || (verboseLevel>2)){ >> 154 G4cout << "G4VDiscreteProcess::PostStepGetPhysicalInteractionLength "; >> 155 G4cout << "[ " << GetProcessName() << "]" <<G4endl; >> 156 track.GetDynamicParticle()->DumpInfo(); >> 157 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; >> 158 G4cout << "MeanFreePath = " << currentInteractionLength/cm << "[cm]" <<G4endl; >> 159 } >> 160 #endif >> 161 >> 162 >> 163 G4double value = theNumberOfInteractionLengthLeft * currentInteractionLength; >> 164 #ifdef G4VERBOSE >> 165 if (verboseLevel>1){ >> 166 G4cout << "G4VDiscreteProcess::PostStepGetPhysicalInteractionLength "; >> 167 G4cout << "[ " << GetProcessName() << "]" <<G4endl; >> 168 track.GetDynamicParticle()->DumpInfo(); >> 169 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; >> 170 G4cout << "InteractionLength= " << value/cm <<"[cm] " <<G4endl; >> 171 } >> 172 #endif >> 173 return value; >> 174 } >> 175 >> 176 inline G4VParticleChange* G4VDiscreteProcess::PostStepDoIt( >> 177 const G4Track& , >> 178 const G4Step& >> 179 ) >> 180 { >> 181 // clear NumberOfInteractionLengthLeft >> 182 ClearNumberOfInteractionLengthLeft(); >> 183 >> 184 return pParticleChange; >> 185 } >> 186 >> 187 122 #endif 188 #endif >> 189 >> 190 >> 191 123 192