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