Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4ParticleChangeForDecay.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4ParticleChangeForDecay
0027 //
0028 // Class description:
0029 //
0030 // Concrete class for ParticleChange which has functionality for G4Decay.
0031 //
0032 // This class contains the results after invocation of the decay process.
0033 // This includes secondary particles generated by the interaction.
0034 
0035 // Author: Hisaya Kurashige, 23 March 1998  
0036 // --------------------------------------------------------------------
0037 #ifndef G4ParticleChangeForDecay_hh
0038 #define G4ParticleChangeForDecay_hh 1
0039 
0040 #include "globals.hh"
0041 #include "G4ios.hh"
0042 #include "G4ThreeVector.hh"
0043 #include "G4VParticleChange.hh"
0044 
0045 class G4DynamicParticle;
0046 
0047 class G4ParticleChangeForDecay final : public G4VParticleChange
0048 {
0049   public:
0050 
0051     G4ParticleChangeForDecay();
0052 
0053     ~G4ParticleChangeForDecay() override = default;
0054 
0055     G4ParticleChangeForDecay(const G4ParticleChangeForDecay& right) = delete;
0056     G4ParticleChangeForDecay& operator=(const G4ParticleChangeForDecay& right) = delete;
0057 
0058   // --- the following methods are for updating G4Step -----
0059   // Return the pointer to the G4Step after updating the step information
0060   // by using final state information of the track given by a physics process
0061   // !!! No effect for  AlongSteyp
0062 
0063     G4Step* UpdateStepForAtRest(G4Step* Step) final;
0064     G4Step* UpdateStepForPostStep(G4Step* Step) final;
0065 
0066     void Initialize(const G4Track&) final;
0067       // Initialize all properties by using G4Track information
0068 
0069     void ProposeGlobalTime(G4double t);
0070     void ProposeLocalTime(G4double t);
0071       // Get/Propose the final global/local time
0072       // NOTE: DO NOT INVOKE both methods in a step
0073       //       Each method affects both local and global time
0074 
0075     G4double GetGlobalTime(G4double timeDelay = 0.0) const;
0076     G4double GetLocalTime(G4double timeDelay = 0.0) const;
0077       // Convert the time delay to the glocbal/local time.
0078       // Can get  the final global/local time without argument
0079 
0080     const G4ThreeVector* GetPolarization() const;
0081     void ProposePolarization(G4double Px, G4double Py, G4double Pz);
0082     void ProposePolarization(const G4ThreeVector& finalPoralization);
0083       // Get/Propose the final Polarization vector
0084 
0085   // --- Dump and debug methods ---
0086 
0087     void DumpInfo() const final;
0088 
0089     G4bool CheckIt(const G4Track&) final;
0090 
0091   private:
0092 
0093     G4double theGlobalTime0 = 0.0;
0094       // The global time at Initial
0095     G4double theLocalTime0 = 0.0;
0096       // The local time at Initial
0097 
0098     G4double theTimeChange = 0.0;
0099       // The change of local time of a given particle
0100 
0101     G4ThreeVector thePolarizationChange;
0102       // The changed (final) polarization of a given track
0103 };
0104 
0105 // ----------------------
0106 // Inline methods
0107 // ----------------------
0108 
0109 inline
0110 void G4ParticleChangeForDecay::ProposeGlobalTime(G4double t)
0111 {
0112   theTimeChange = (t - theGlobalTime0) + theLocalTime0;
0113 }
0114 
0115 inline
0116 G4double G4ParticleChangeForDecay::GetGlobalTime(G4double timeDelay) const
0117 {
0118   //  Convert the time delay to the global time.
0119   return theGlobalTime0 + (theTimeChange - theLocalTime0) + timeDelay;
0120 }
0121 
0122 inline
0123 void G4ParticleChangeForDecay::ProposeLocalTime(G4double t)
0124 {
0125   theTimeChange = t;
0126 }
0127 
0128 inline
0129 G4double G4ParticleChangeForDecay::GetLocalTime(G4double timeDelay) const
0130 {
0131   //  Convert the time delay to the local time.
0132   return theTimeChange + timeDelay;
0133 }
0134 
0135 inline
0136 const G4ThreeVector* G4ParticleChangeForDecay::GetPolarization() const
0137 {
0138   return &thePolarizationChange;
0139 }
0140 
0141 inline
0142 void G4ParticleChangeForDecay::ProposePolarization(
0143   const G4ThreeVector& finalPoralization)
0144 {
0145   thePolarizationChange = finalPoralization;
0146 }
0147 
0148 inline
0149 void G4ParticleChangeForDecay::ProposePolarization(G4double Px,
0150                                                    G4double Py,
0151                                                    G4double Pz)
0152 {
0153   thePolarizationChange.setX(Px);
0154   thePolarizationChange.setY(Py);
0155   thePolarizationChange.setZ(Pz);
0156 }
0157 
0158 #endif