Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:17

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 //
0033 #ifndef G4UnknownDecay_h
0034 #define G4UnknownDecay_h 1
0035 
0036 #include <CLHEP/Units/PhysicalConstants.h>
0037 
0038 #include "G4ios.hh"
0039 #include "globals.hh"
0040 #include "G4VDiscreteProcess.hh"
0041 #include "G4ParticleChangeForDecay.hh"
0042 
0043 class G4UnknownDecay : public G4VDiscreteProcess 
0044 {
0045  // Class Description
0046   //  This class is a decay process for "unknown" particle.
0047 
0048   public:
0049     //  Constructors 
0050     G4UnknownDecay(const G4String& processName ="UnknownDecay");
0051 
0052     //  Destructor
0053     virtual ~G4UnknownDecay();
0054 
0055   private:
0056     //  copy constructor
0057       G4UnknownDecay(const G4UnknownDecay &right);
0058 
0059     //  Assignment Operation (generated)
0060       G4UnknownDecay & operator=(const G4UnknownDecay &right);
0061 
0062   public: //With Description
0063   
0064      virtual G4VParticleChange *PostStepDoIt(
0065                  const G4Track& aTrack,
0066                              const G4Step& aStep
0067                             ) override;
0068 
0069      virtual void BuildPhysicsTable(const G4ParticleDefinition&) override; 
0070      // In G4UnknownDecay, thePhysicsTable stores values of
0071     //    beta * std::sqrt( 1 - beta*beta) 
0072     //  as a function of normalized kinetic enregy (=Ekin/mass),
0073     //  becasuse this table is universal for all particle types,
0074 
0075 
0076     virtual G4bool IsApplicable(const G4ParticleDefinition&) override;
0077     // returns "true" if the decay process can be applied to
0078     // the particle type. 
0079  
0080     virtual void ProcessDescription(std::ostream& outFile) const override;
0081     //
0082 
0083   protected: // With Description
0084     virtual G4VParticleChange* DecayIt(
0085                  const G4Track& aTrack,
0086                  const G4Step&  aStep
0087                 ) ;
0088     // The DecayIt() method returns by pointer a particle-change object,
0089     // which has information of daughter particles.
0090 
0091   public:
0092 
0093     virtual G4double PostStepGetPhysicalInteractionLength(
0094                              const G4Track& track,
0095                              G4double   previousStepSize,
0096                              G4ForceCondition* condition
0097                             ) override;
0098 
0099 
0100   protected: // With Description
0101     // GetMeanFreePath returns ctau*beta*gamma for decay in flight 
0102     virtual G4double GetMeanFreePath(const G4Track& aTrack,
0103                               G4double   previousStepSize,
0104                               G4ForceCondition* condition
0105                              ) override;
0106 
0107   private:
0108      G4int verboseLevel;
0109      // controle flag for output message
0110      //  0: Silent
0111      //  1: Warning message
0112      //  2: More
0113 
0114   private:
0115     // HighestValue.
0116     const G4double HighestValue;
0117  
0118     // ParticleChange for decay process
0119     G4ParticleChangeForDecay fParticleChangeForDecay;
0120     
0121 };
0122 
0123 inline 
0124  G4double G4UnknownDecay::PostStepGetPhysicalInteractionLength(
0125                              const G4Track& track,
0126                              G4double   /*previousStepSize*/,
0127                              G4ForceCondition* condition
0128                             )
0129 {
0130   // pre-assigned UnknownDecay time
0131   G4double pTime = track.GetDynamicParticle()->GetPreAssignedDecayProperTime();
0132 
0133   if (pTime < 0.) pTime = DBL_MIN;
0134 
0135   // condition is set to "Not Forced"
0136   *condition = NotForced;
0137   
0138   // reminder proper time
0139   G4double remainder = pTime - track.GetProperTime();
0140   if (remainder <= 0.0) remainder = DBL_MIN;
0141   
0142   // use pre-assigned Decay time to determine PIL
0143   //return GetMeanFreePath(track, previousStepSize, condition);
0144   return remainder*CLHEP::c_light;
0145 
0146 }
0147 
0148 inline  
0149   G4VParticleChange* G4UnknownDecay::PostStepDoIt(
0150                  const G4Track& aTrack,
0151                  const G4Step&  aStep
0152                 )
0153 {
0154   return DecayIt(aTrack, aStep);
0155 }
0156 
0157 #endif
0158 
0159 
0160 
0161 
0162 
0163 
0164 
0165 
0166 
0167