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 // G4ParticleChangeForDecay << 27 // 26 // 28 // Class description: << 27 // $Id: G4ParticleChangeForDecay.hh 68795 2013-04-05 13:24:46Z gcosmo $ >> 28 29 // 29 // 30 // Concrete class for ParticleChange which has << 30 // >> 31 // ------------------------------------------------------------ >> 32 // GEANT 4 class header file 31 // 33 // 32 // This class contains the results after invoc << 34 // 33 // This includes secondary particles generated << 35 // ------------------------------------------------------------ 34 << 36 // Implemented for the new scheme 23 Mar. 1998 H.Kurahige 35 // Author: Hisaya Kurashige, 23 March 1998 << 37 // 36 // ------------------------------------------- << 38 // Class Description 37 #ifndef G4ParticleChangeForDecay_hh << 39 // This class is a concrete class for ParticleChange which 38 #define G4ParticleChangeForDecay_hh 1 << 40 // has functionality for G4Decay. >> 41 // >> 42 // This class contains the results after invocation of the decay process. >> 43 // This includes secondary particles generated by the interaction. >> 44 // ------------------------------------------------------------ >> 45 #ifndef G4ParticleChangeForDecay_h >> 46 #define G4ParticleChangeForDecay_h 1 39 47 40 #include "globals.hh" 48 #include "globals.hh" 41 #include "G4ios.hh" 49 #include "G4ios.hh" 42 #include "G4ThreeVector.hh" 50 #include "G4ThreeVector.hh" 43 #include "G4VParticleChange.hh" << 44 << 45 class G4DynamicParticle; 51 class G4DynamicParticle; >> 52 #include "G4VParticleChange.hh" 46 53 47 class G4ParticleChangeForDecay final : public << 54 class G4ParticleChangeForDecay: public G4VParticleChange 48 { 55 { 49 public: << 56 public: 50 << 57 // default constructor 51 G4ParticleChangeForDecay(); 58 G4ParticleChangeForDecay(); 52 59 53 ~G4ParticleChangeForDecay() override = def << 60 // destructor >> 61 virtual ~G4ParticleChangeForDecay(); 54 62 55 G4ParticleChangeForDecay(const G4ParticleC << 63 protected: 56 G4ParticleChangeForDecay& operator=(const << 64 // hide copy constructor and assignment operaor as protected >> 65 G4ParticleChangeForDecay(const G4ParticleChangeForDecay &right); >> 66 G4ParticleChangeForDecay & operator=(const G4ParticleChangeForDecay &right); 57 67 58 // --- the following methods are for updatin << 68 public: 59 // Return the pointer to the G4Step after up << 69 // equal/unequal operator 60 // by using final state information of the t << 70 G4bool operator==(const G4ParticleChangeForDecay &right) const; 61 // !!! No effect for AlongSteyp << 71 G4bool operator!=(const G4ParticleChangeForDecay &right) const; 62 << 72 63 G4Step* UpdateStepForAtRest(G4Step* Step) << 73 public: // with description 64 G4Step* UpdateStepForPostStep(G4Step* Step << 74 // ---------------------------------------------------- 65 << 75 // --- the following methods are for updating G4Step ----- 66 void Initialize(const G4Track&) final; << 76 // Return the pointer to the G4Step after updating the Step information 67 // Initialize all properties by using G4 << 77 // by using final state information of the track given by a physics 68 << 78 // process 69 void ProposeGlobalTime(G4double t); << 79 70 void ProposeLocalTime(G4double t); << 80 // !!! No effect for AlongSteyp 71 // Get/Propose the final global/local ti << 81 // virtual G4Step* UpdateStepForAlongStep(G4Step* Step); 72 // NOTE: DO NOT INVOKE both methods in a << 82 73 // Each method affects both local << 83 virtual G4Step* UpdateStepForAtRest(G4Step* Step); 74 << 84 virtual G4Step* UpdateStepForPostStep(G4Step* Step); 75 G4double GetGlobalTime(G4double timeDelay << 85 76 G4double GetLocalTime(G4double timeDelay = << 86 virtual void Initialize(const G4Track&); 77 // Convert the time delay to the glocbal << 87 // Initialize all propoerties by using G4Track information 78 // Can get the final global/local time << 88 >> 89 void ProposeGlobalTime(G4double t); >> 90 void ProposeLocalTime(G4double t); >> 91 // Get/Propose the final global/local Time >> 92 // NOTE: DO NOT INVOKE both methods in a step >> 93 // Each method affects both local and global time >> 94 >> 95 G4double GetGlobalTime(G4double timeDelay=0.0) const; >> 96 G4double GetLocalTime(G4double timeDelay=0.0) const; >> 97 // Convert the time delay to the glocbal/local time. >> 98 // Can get the final global/local Time without argument 79 99 80 const G4ThreeVector* GetPolarization() con 100 const G4ThreeVector* GetPolarization() const; 81 void ProposePolarization(G4double Px, G4do << 101 void ProposePolarization(G4double Px, G4double Py, G4double Pz); 82 void ProposePolarization(const G4ThreeVect << 102 void ProposePolarization(const G4ThreeVector& finalPoralization); 83 // Get/Propose the final Polarization ve << 103 // Get/Propose the final Polarization vector. 84 104 85 // --- Dump and debug methods --- << 105 public: 86 << 106 virtual void DumpInfo() const; 87 void DumpInfo() const final; << 88 << 89 G4bool CheckIt(const G4Track&) final; << 90 << 91 private: << 92 107 93 G4double theGlobalTime0 = 0.0; << 108 protected: 94 // The global time at Initial << 109 G4double theGlobalTime0; 95 G4double theLocalTime0 = 0.0; << 110 // The global time at Initial. 96 // The local time at Initial << 111 G4double theLocalTime0; >> 112 // The local time at Initial. 97 113 98 G4double theTimeChange = 0.0; << 114 G4double theTimeChange; 99 // The change of local time of a given p << 115 // The change of local time of a given particle. 100 116 101 G4ThreeVector thePolarizationChange; 117 G4ThreeVector thePolarizationChange; 102 // The changed (final) polarization of a << 118 // The changed (final) polarization of a given track >> 119 >> 120 public: >> 121 // for Debug >> 122 virtual G4bool CheckIt(const G4Track&); 103 }; 123 }; 104 124 105 // ---------------------- << 125 inline 106 // Inline methods << 126 void G4ParticleChangeForDecay::ProposeGlobalTime(G4double t) 107 // ---------------------- << 108 << 109 inline << 110 void G4ParticleChangeForDecay::ProposeGlobalTi << 111 { 127 { 112 theTimeChange = (t - theGlobalTime0) + theLo << 128 theTimeChange = (t-theGlobalTime0) + theLocalTime0; 113 } 129 } 114 << 130 115 inline 131 inline 116 G4double G4ParticleChangeForDecay::GetGlobalTi << 132 G4double G4ParticleChangeForDecay::GetGlobalTime(G4double timeDelay) const 117 { 133 { 118 // Convert the time delay to the global tim 134 // Convert the time delay to the global time. 119 return theGlobalTime0 + (theTimeChange - the << 135 return theGlobalTime0 + (theTimeChange-theLocalTime0) + timeDelay; 120 } 136 } 121 137 122 inline << 138 inline 123 void G4ParticleChangeForDecay::ProposeLocalTim << 139 void G4ParticleChangeForDecay::ProposeLocalTime(G4double t) 124 { 140 { 125 theTimeChange = t; 141 theTimeChange = t; 126 } 142 } 127 << 143 128 inline 144 inline 129 G4double G4ParticleChangeForDecay::GetLocalTim << 145 G4double G4ParticleChangeForDecay::GetLocalTime(G4double timeDelay) const 130 { 146 { 131 // Convert the time delay to the local time 147 // Convert the time delay to the local time. 132 return theTimeChange + timeDelay; 148 return theTimeChange + timeDelay; 133 } 149 } 134 150 135 inline 151 inline 136 const G4ThreeVector* G4ParticleChangeForDecay: << 152 const G4ThreeVector* G4ParticleChangeForDecay::GetPolarization() const 137 { 153 { 138 return &thePolarizationChange; 154 return &thePolarizationChange; 139 } 155 } 140 156 141 inline 157 inline 142 void G4ParticleChangeForDecay::ProposePolariza << 158 void G4ParticleChangeForDecay::ProposePolarization(const G4ThreeVector& finalPoralization) 143 const G4ThreeVector& finalPoralization) << 144 { 159 { 145 thePolarizationChange = finalPoralization; 160 thePolarizationChange = finalPoralization; 146 } 161 } 147 162 148 inline 163 inline 149 void G4ParticleChangeForDecay::ProposePolariza << 164 void G4ParticleChangeForDecay::ProposePolarization( 150 << 165 G4double Px, 151 << 166 G4double Py, >> 167 G4double Pz ) 152 { 168 { 153 thePolarizationChange.setX(Px); 169 thePolarizationChange.setX(Px); 154 thePolarizationChange.setY(Py); 170 thePolarizationChange.setY(Py); 155 thePolarizationChange.setZ(Pz); 171 thePolarizationChange.setZ(Pz); 156 } 172 } 157 173 158 #endif 174 #endif 159 175