Back to home page

EIC code displayed by LXR

 
 

    


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

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 // GEANT4 Class header file
0030 //
0031 // File name:     G4HadronStoppingProcess
0032 //
0033 // Author V.Ivanchenko 21 April 2012 on base of G4MuonMinusCaptureAtRest
0034 //
0035 //
0036 // Class Description:
0037 //
0038 // Base process class for nuclear capture of negatively charged particles
0039 //
0040 // Modifications: 
0041 //  20120928  M. Kelsey -- Add GetMeanLifeTime() here, instead of in base.
0042 //  20121004  K. Genser -- defined two argument constructor with defaults
0043 //  20121016  K. Genser -- Reverting to use one argument c'tor
0044 //  20140818  K. Genser -- Labeled tracks using G4PhysicsModelCatalog
0045 //
0046 //------------------------------------------------------------------------
0047 
0048 #ifndef G4HadronStoppingProcess_h
0049 #define G4HadronStoppingProcess_h 1
0050  
0051 #include "globals.hh"
0052 #include "G4HadronicProcess.hh"
0053 #include "G4ParticleDefinition.hh"
0054 #include "G4ElementSelector.hh"
0055 #include "G4HadronicInteraction.hh"
0056 #include "G4Track.hh"
0057 #include "G4Step.hh"
0058 #include "G4ForceCondition.hh"
0059 #include "G4HadronicProcessType.hh"
0060 #include "G4HadFinalState.hh"
0061 
0062 class G4HadronStoppingProcess : public G4HadronicProcess
0063 { 
0064 public:
0065  
0066   explicit G4HadronStoppingProcess(const G4String& name = "hadronCaptureAtRest");
0067 
0068   virtual ~G4HadronStoppingProcess();
0069 
0070   virtual G4bool IsApplicable(const G4ParticleDefinition&);
0071 
0072   virtual void PreparePhysicsTable(const G4ParticleDefinition&);
0073 
0074   virtual void BuildPhysicsTable(const G4ParticleDefinition&);
0075 
0076   virtual G4double 
0077   AtRestGetPhysicalInteractionLength(const G4Track& track,
0078                      G4ForceCondition* condition);
0079 
0080   virtual G4double 
0081   PostStepGetPhysicalInteractionLength(const G4Track& track,
0082                        G4double   previousStepSize,
0083                        G4ForceCondition* condition);
0084 
0085   virtual G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&);
0086 
0087   virtual void ProcessDescription(std::ostream& outFile) const;
0088 
0089   inline void SetElementSelector(G4ElementSelector* ptr);
0090 
0091   inline void SetEmCascade(G4HadronicInteraction* ptr);
0092 
0093   inline void SetBoundDecay(G4HadronicInteraction* ptr);
0094 
0095 protected:
0096   // set effective lifetime for at-rest process (default is forced action)
0097   // FIXME: This should be computed by subprocesses via cross-section analogue
0098   G4double GetMeanLifeTime(const G4Track& /*aTrack*/,
0099                            G4ForceCondition* /*condition*/) { return -1.0; }
0100 
0101 private:
0102 
0103   // hide assignment operator as private 
0104   G4HadronStoppingProcess& operator=(const G4HadronStoppingProcess &right);
0105   G4HadronStoppingProcess(const G4HadronStoppingProcess& );
0106 
0107   G4ElementSelector* fElementSelector;
0108 
0109   G4HadronicInteraction* fEmCascade;
0110   G4HadronicInteraction* fBoundDecay;
0111 
0112   G4int emcID;
0113   G4int ncID;
0114   G4int dioID;
0115 
0116   // This is shadowing "result" in the cc file and
0117   // looks to be unnecessary.  Removed by DHW, 12 June 2012   
0118   // G4HadFinalState result;   
0119 };
0120 
0121 inline void 
0122 G4HadronStoppingProcess::SetElementSelector(G4ElementSelector* ptr)
0123 {
0124   if(fElementSelector != ptr) {
0125     delete fElementSelector;
0126     fElementSelector = ptr;
0127   }
0128 }
0129 
0130 inline void 
0131 G4HadronStoppingProcess::SetEmCascade(G4HadronicInteraction* ptr)
0132 {
0133   fEmCascade = ptr;
0134 }
0135 
0136 inline void 
0137 G4HadronStoppingProcess::SetBoundDecay(G4HadronicInteraction* ptr)
0138 {
0139   fBoundDecay = ptr;
0140 }
0141 
0142 #endif