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