Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:05

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 //
0027 //
0028 //
0029 // ------------------------------------------------------------
0030 //      GEANT 4 class header file
0031 //
0032 //      History: first implementation, based on object model of
0033 //      7 July 1996 H.Kurashige
0034 // ------------------------------------------------------------
0035 //  New Physics scheme           18 Jan. 1997  H.Kurahige
0036 // ------------------------------------------------------------
0037 //   modified                     4  Feb. 1997  H.Kurahige
0038 //   modified                     8  Sep. 1997  H.Kurahige
0039 //   remove BuildPhysicsTable()   27 Nov. 1997   H.Kurashige
0040 //   modified for new ParticleChange 12 Mar. 1998  H.Kurashige
0041 //   added aPhysicsTable          2  Aug. 1998 H.Kurashige
0042 //   PreAssignedDecayTime         18 Jan. 2001 H.Kurashige
0043 //   Add External Decayer         23 Feb. 2001  H.Kurashige
0044 //   Remove PhysicsTable          12 Feb. 2002 H.Kurashige
0045 //   Fixed bug in PostStepGPIL 
0046 //    in case of stopping during AlongStepDoIt 12 Mar. 2004 H.Kurashige
0047 //   Add GetRemainderLifeTime  10 Aug/2004 H.Kurashige
0048 //   Add DaughterPolarization     23 July 2008 H.Kurashige
0049 
0050 
0051 #ifndef G4Decay_h
0052 #define G4Decay_h 1
0053 
0054 #include "G4ios.hh"
0055 #include "globals.hh"
0056 #include "G4VRestDiscreteProcess.hh"
0057 #include "G4ParticleChangeForDecay.hh"
0058 #include "G4DecayProcessType.hh"
0059 
0060 class G4VExtDecayer;
0061 
0062 class G4Decay : public G4VRestDiscreteProcess 
0063 {
0064  // Class Description
0065   //  This class is a decay process
0066 
0067   public:
0068     //  Constructors 
0069     G4Decay(const G4String& processName ="Decay");
0070 
0071     //  Destructor
0072     virtual ~G4Decay();
0073 
0074   private:
0075     //  copy constructor
0076       G4Decay(const G4Decay &right);
0077 
0078     //  Assignment Operation (generated)
0079       G4Decay & operator=(const G4Decay &right);
0080 
0081   public: //With Description
0082      // G4Decay Process has both 
0083      // PostStepDoIt (for decay in flight) 
0084      //   and 
0085      // AtRestDoIt (for decay at rest)
0086   
0087      virtual G4VParticleChange *PostStepDoIt(
0088                  const G4Track& aTrack,
0089                              const G4Step& aStep
0090                             ) override;
0091 
0092      virtual G4VParticleChange* AtRestDoIt(
0093                  const G4Track& aTrack,
0094                  const G4Step&  aStep
0095                 ) override;
0096 
0097      virtual void BuildPhysicsTable(const G4ParticleDefinition&) override; 
0098      // In G4Decay, thePhysicsTable stores values of
0099     //    beta * std::sqrt( 1 - beta*beta) 
0100     //  as a function of normalized kinetic enregy (=Ekin/mass),
0101     //  becasuse this table is universal for all particle types,
0102 
0103 
0104     virtual G4bool IsApplicable(const G4ParticleDefinition&) override;
0105     // returns "true" if the decay process can be applied to
0106     // the particle type. 
0107  
0108   protected: // With Description
0109     virtual G4VParticleChange* DecayIt(
0110                  const G4Track& aTrack,
0111                  const G4Step&  aStep
0112                 );
0113     // The DecayIt() method returns by pointer a particle-change object,
0114     // which has information of daughter particles.
0115 
0116     // Set daughter polarization
0117     //  NO OPERATION in the base class of G4Decay 
0118     virtual void DaughterPolarization(const G4Track& aTrack,
0119                   G4DecayProducts* products);
0120 
0121  public:
0122     virtual G4double AtRestGetPhysicalInteractionLength(
0123                              const G4Track& track,
0124                              G4ForceCondition* condition
0125                             ) override;
0126 
0127     virtual G4double PostStepGetPhysicalInteractionLength(
0128                              const G4Track& track,
0129                              G4double   previousStepSize,
0130                              G4ForceCondition* condition
0131                             ) override;
0132 
0133   protected: // With Description
0134     // GetMeanFreePath returns ctau*beta*gamma for decay in flight 
0135     // GetMeanLifeTime returns ctau for decay at rest
0136     virtual G4double GetMeanFreePath(const G4Track& aTrack,
0137                               G4double   previousStepSize,
0138                               G4ForceCondition* condition
0139                              ) override;
0140 
0141     virtual G4double GetMeanLifeTime(const G4Track& aTrack,
0142                               G4ForceCondition* condition
0143                             ) override;
0144 
0145    public: //With Description
0146      virtual void StartTracking(G4Track*) override;
0147      virtual void EndTracking() override;
0148       // inform Start/End of tracking for each track to the physics process 
0149 
0150    public: //With Description
0151      void SetExtDecayer(G4VExtDecayer*);
0152      const G4VExtDecayer* GetExtDecayer() const;
0153      // Set/Get External Decayer
0154    
0155     G4double GetRemainderLifeTime() const;  
0156     //Get Remainder of life time at rest decay 
0157 
0158     virtual void ProcessDescription(std::ostream& outFile) const override;
0159     //
0160 
0161   protected:
0162      G4int verboseLevel;
0163      // controle flag for output message
0164      //  0: Silent
0165      //  1: Warning message
0166      //  2: More
0167 
0168   protected:
0169     // HighestValue.
0170     const G4double HighestValue;
0171  
0172     // Remainder of life time at rest
0173     G4double                 fRemainderLifeTime;
0174   
0175     // ParticleChange for decay process
0176     G4ParticleChangeForDecay fParticleChangeForDecay;
0177     
0178     // External Decayer
0179     G4VExtDecayer*    pExtDecayer;
0180 };
0181 
0182 inline  
0183   G4VParticleChange* G4Decay::AtRestDoIt(
0184                  const G4Track& aTrack,
0185                  const G4Step&  aStep
0186                 )
0187 {
0188   return DecayIt(aTrack, aStep);
0189 }
0190 
0191 
0192 inline
0193  const G4VExtDecayer* G4Decay::GetExtDecayer() const
0194 {
0195   return pExtDecayer;
0196 }
0197 
0198 inline
0199  G4double G4Decay::GetRemainderLifeTime() const 
0200 {
0201   return fRemainderLifeTime;
0202 }
0203 
0204 #endif
0205 
0206 
0207 
0208 
0209 
0210 
0211 
0212 
0213 
0214