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 // G4VContinuousProcess << 27 // 26 // 28 // Class description: << 27 // $Id: G4VContinuousProcess.hh,v 1.6 2006/06/29 21:07:46 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-08-03-patch-02 $ 29 // 29 // 30 // Abstract class which defines the public beh << 30 // 31 // Continuous physics interactions. << 31 // ------------------------------------------------------------ >> 32 // GEANT 4 class header file >> 33 // >> 34 // History: first implementation, based on object model of >> 35 // 2nd December 1995, G.Cosmo >> 36 // add G4VContinuousProcess(const G4String&) 24 Jul 1996, Hisaya kurashige >> 37 // >> 38 // Class Description >> 39 // Abstract class which defines the public behavior of >> 40 // Continuous physics interactions. >> 41 // >> 42 // ------------------------------------------------------------ >> 43 // New Physics scheme 18 Dec. 1996 H.Kurahige >> 44 // ------------------------------------------------------------ >> 45 // modified 25 Feb. 1997 H.Kurahige >> 46 // modified 8 Mar. 1997 H.Kurashige >> 47 // modified 22 Mar. 1997 H.Kurashige >> 48 // modified 26 Mar. 1997 H.Kurashige >> 49 // modified AlongStepGPIL etc. 17 Dec. 1997 H.Kurashige >> 50 // fix bugs in GetGPILSelection() 24 Jan. 1998 H.Kurashige >> 51 // modified for new ParticleChange 12 Mar. 1998 H.Kurashige 32 52 33 // Authors: << 53 #ifndef G4VContinuousProcess_h 34 // - 2 December 1995, G.Cosmo - First implemen << 54 #define G4VContinuousProcess_h 1 35 // - 18 December 1996, H.Kurashige - New Physi << 36 // ------------------------------------------- << 37 #ifndef G4VContinuousProcess_hh << 38 #define G4VContinuousProcess_hh 1 << 39 55 40 #include "globals.hh" 56 #include "globals.hh" 41 #include "G4ios.hh" 57 #include "G4ios.hh" 42 58 43 #include "G4VProcess.hh" 59 #include "G4VProcess.hh" 44 60 45 class G4VContinuousProcess : public G4VProcess 61 class G4VContinuousProcess : public G4VProcess 46 { 62 { >> 63 // Abstract class which defines the public behavior of >> 64 // Continuous physics interactions. 47 public: 65 public: 48 66 49 G4VContinuousProcess(const G4String& aName << 67 G4VContinuousProcess(const G4String& , 50 G4ProcessType aType = << 68 G4ProcessType aType = fNotDefined ); 51 G4VContinuousProcess(G4VContinuousProcess << 69 G4VContinuousProcess(G4VContinuousProcess &); 52 << 53 virtual ~G4VContinuousProcess(); << 54 70 55 G4VContinuousProcess& operator=(const G4VC << 71 virtual ~G4VContinuousProcess(); 56 72 57 virtual G4double AlongStepGetPhysicalInter << 73 public: // with description >> 74 virtual G4double AlongStepGetPhysicalInteractionLength( 58 const G4Track& tr 75 const G4Track& track, 59 G4double previou << 76 G4double previousStepSize, 60 G4double current << 77 G4double currentMinimumStep, 61 G4double& propose << 78 G4double& proposedSafety, 62 G4GPILSelection* 79 G4GPILSelection* selection 63 ); << 80 ); 64 81 65 virtual G4VParticleChange* AlongStepDoIt( << 82 virtual G4VParticleChange* AlongStepDoIt( 66 const G4Track& , << 83 const G4Track& , 67 const G4Step& << 84 const G4Step& 68 ); << 85 ); 69 86 70 // no operation in AtRestDoIt and PostStep << 87 // no operation in AtRestDoIt and PostStepDoIt 71 // << 88 virtual G4double PostStepGetPhysicalInteractionLength( 72 virtual G4double PostStepGetPhysicalIntera << 73 const G4Track&, 89 const G4Track&, 74 G4double, << 90 G4double, 75 G4ForceCondition* << 91 G4ForceCondition* 76 ) { return -1.0; } << 92 ){ return -1.0; }; 77 93 78 virtual G4double AtRestGetPhysicalInteract << 94 virtual G4double AtRestGetPhysicalInteractionLength( 79 const G4Track& , 95 const G4Track& , 80 G4ForceCondition* << 96 G4ForceCondition* 81 ) { return -1.0; } << 97 ) { return -1.0; }; 82 98 83 // no operation in AtRestDoIt and PostStep << 99 // no operation in AtRestDoIt and PostStepDoIt 84 // << 100 virtual G4VParticleChange* AtRestDoIt( 85 virtual G4VParticleChange* AtRestDoIt( << 101 const G4Track& , 86 const G4Track& , << 102 const G4Step& 87 const G4Step& << 103 ) {return 0;}; 88 ) { return 0; } << 104 89 << 105 virtual G4VParticleChange* PostStepDoIt( 90 virtual G4VParticleChange* PostStepDoIt( << 106 const G4Track& , 91 const G4Track& , << 107 const G4Step& 92 const G4Step& << 108 ) {return 0;}; 93 ) { return 0; } << 94 109 95 protected: << 110 protected: // with description >> 111 virtual G4double GetContinuousStepLimit(const G4Track& aTrack, >> 112 G4double previousStepSize, >> 113 G4double currentMinimumStep, >> 114 G4double& currentSafety >> 115 )=0; >> 116 // This pure virtual function is used to calculate step limit >> 117 // for AlongStep in the derived processes 96 118 97 virtual G4double GetContinuousStepLimit( c << 119 private: 98 G << 120 // this is the returnd value of G4GPILSelection in 99 G << 121 // the arguments of AlongStepGPIL() 100 G << 122 G4GPILSelection valueGPILSelection; 101 // This pure virtual function is used to << 123 102 // for AlongStep in the derived processe << 124 protected: // with description >> 125 // these two methods are set/get methods for valueGPILSelection >> 126 void SetGPILSelection(G4GPILSelection selection) >> 127 { valueGPILSelection = selection;}; 103 128 104 inline void SetGPILSelection(G4GPILSelecti << 129 G4GPILSelection GetGPILSelection() const{return valueGPILSelection;}; 105 { valueGPILSelection = selection; } << 106 130 107 inline G4GPILSelection GetGPILSelection() << 108 { return valueGPILSelection; } << 109 131 110 private: 132 private: >> 133 // hide default constructor and assignment operator as private >> 134 G4VContinuousProcess(); >> 135 G4VContinuousProcess & operator=(const G4VContinuousProcess &right); 111 136 112 G4VContinuousProcess(); << 113 // Hidden default constructor << 114 << 115 G4GPILSelection valueGPILSelection = Candi << 116 // The returned value of G4GPILSelection << 117 // the arguments of AlongStepGPIL() << 118 }; 137 }; >> 138 // ----------------------------------------- >> 139 // inlined function members implementation >> 140 // ----------------------------------------- >> 141 #include "G4Step.hh" >> 142 #include "G4Track.hh" >> 143 #include "G4MaterialTable.hh" >> 144 #include "G4VParticleChange.hh" >> 145 >> 146 inline G4double G4VContinuousProcess::AlongStepGetPhysicalInteractionLength( >> 147 const G4Track& track, >> 148 G4double previousStepSize, >> 149 G4double currentMinimumStep, >> 150 G4double& currentSafety, >> 151 G4GPILSelection* selection >> 152 ) >> 153 { >> 154 // GPILSelection is set to defaule value of CandidateForSelection >> 155 valueGPILSelection = CandidateForSelection; >> 156 >> 157 // get Step limit proposed by the process >> 158 G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety); >> 159 >> 160 // set return value for G4GPILSelection >> 161 *selection = valueGPILSelection; >> 162 >> 163 #ifdef G4VERBOSE >> 164 if (verboseLevel>1){ >> 165 G4cout << "G4VContinuousProcess::AlongStepGetPhysicalInteractionLength "; >> 166 G4cout << "[ " << GetProcessName() << "]" <<G4endl; >> 167 track.GetDynamicParticle()->DumpInfo(); >> 168 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl; >> 169 G4cout << "IntractionLength= " << steplength/cm <<"[cm] " <<G4endl; >> 170 } >> 171 #endif >> 172 >> 173 return steplength ; >> 174 } >> 175 >> 176 inline G4VParticleChange* G4VContinuousProcess::AlongStepDoIt( >> 177 const G4Track& , >> 178 const G4Step& >> 179 ) >> 180 { >> 181 return pParticleChange; >> 182 } 119 183 120 #endif 184 #endif >> 185 >> 186 >> 187 >> 188 121 189