Back to home page

EIC code displayed by LXR

 
 

    


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

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 // INCL++ intra-nuclear cascade model
0027 // Alain Boudard, CEA-Saclay, France
0028 // Joseph Cugnon, University of Liege, Belgium
0029 // Jean-Christophe David, CEA-Saclay, France
0030 // Pekka Kaitaniemi, CEA-Saclay, France, and Helsinki Institute of Physics, Finland
0031 // Sylvie Leray, CEA-Saclay, France
0032 // Davide Mancusi, CEA-Saclay, France
0033 //
0034 #define INCLXX_IN_GEANT4_MODE 1
0035 
0036 #include "globals.hh"
0037 
0038 #ifndef G4INCLXXInterface_hh
0039 #define G4INCLXXInterface_hh 1
0040 
0041 #include "G4Nucleon.hh"
0042 #include "G4Nucleus.hh"
0043 #include "G4HadronicInteraction.hh"
0044 #include "G4VIntraNuclearTransportModel.hh"
0045 #include "G4KineticTrackVector.hh"
0046 #include "G4FragmentVector.hh"
0047 #include "G4ParticleChange.hh"
0048 #include "G4ReactionProductVector.hh"
0049 #include "G4ReactionProduct.hh"
0050 #include "globals.hh"
0051 
0052 // INCL++
0053 #include "G4INCLCascade.hh"
0054 
0055 // Geant4 de-excitation
0056 #include "G4ExcitationHandler.hh"
0057 
0058 // Binary cascade
0059 #include "G4BinaryCascade.hh"
0060 #include "G4BinaryLightIonReaction.hh"
0061 
0062 // PreCompound
0063 #include "G4VPreCompoundModel.hh"
0064 #include "G4PreCompoundModel.hh"
0065 
0066 // G4IonTable
0067 #include "G4IonTable.hh"
0068 
0069 // fission
0070 #include "G4VLevelDensityParameter.hh"
0071 #include "G4FissionProbability.hh"
0072 
0073 #include <fstream>
0074 #include <iostream>
0075 
0076 class G4INCLXXInterfaceStore;
0077 class G4INCLXXVInterfaceTally;
0078 
0079 /** \brief INCL++ intra-nuclear cascade
0080  *
0081  * Interface for INCL++. This interface handles basic hadron bullet particles
0082  * (protons, neutrons, pions), as well as light ions.
0083  *
0084  * Example usage in case of protons:
0085  * @code
0086  * G4INCLXXInterface* inclModel = new G4INCLXXInterface;
0087  * inclModel -> SetMinEnergy(0.0 * MeV); // Set the energy limits
0088  * inclModel -> SetMaxEnergy(3.0 * GeV);
0089  *
0090  * G4HadronInelasticProcess* protonInelasticProcess = new G4HadronInelasticProcess( "protonInelastic", G4Proton::Definition() );
0091  * G4VCrossSectionDataSet* protonInelasticCrossSection = new G4BGGNucleonInelasticXS( G4Proton::Proton() );
0092  *
0093  * protonInelasticProcess -> RegisterMe(inclModel);
0094  * protonInelasticProcess -> AddDataSet(protonInelasticCrossSection);
0095  *
0096  * particle = G4Proton::Proton();
0097  * processManager = particle -> GetProcessManager();
0098  * processManager -> AddDiscreteProcess(protonInelasticProcess);
0099  * @endcode
0100  * The same setup procedure is needed for neutron, pion and generic-ion
0101  * inelastic processes as well.
0102  */
0103 class G4INCLXXInterface : public G4VIntraNuclearTransportModel {
0104 public:
0105   G4INCLXXInterface(G4VPreCompoundModel * const aPreCompound = 0);
0106   ~G4INCLXXInterface(); // Destructor
0107 
0108   G4bool operator==(G4INCLXXInterface& right) {
0109     return (this == &right);
0110   }
0111 
0112   G4bool operator!=(G4INCLXXInterface& right) {
0113     return (this != &right);
0114   }
0115 
0116   G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus); // Idle
0117 
0118   /**
0119    * Main method to apply the INCL physics model.
0120    * @param aTrack the projectile particle
0121    * @param theNucleus target nucleus
0122    * @return the output of the INCL physics model
0123    */
0124   G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,  G4Nucleus& theNucleus);
0125 
0126   using G4VIntraNuclearTransportModel::SetDeExcitation;
0127 
0128   void DeleteModel() {
0129     delete theINCLModel;
0130     theINCLModel = NULL;
0131   }
0132 
0133   virtual void ModelDescription(std::ostream& outFile) const;
0134 
0135   G4String const &GetDeExcitationModelName() const;
0136 
0137 private:
0138   G4bool AccurateProjectile(const G4HadProjectile &aTrack, const G4Nucleus &theTargetNucleus) const;
0139 
0140   /// \brief Dummy copy constructor to shut up Coverity warnings
0141   G4INCLXXInterface(const G4INCLXXInterface &rhs);
0142 
0143   /// \brief Dummy assignment operator to shut up Coverity warnings
0144   G4INCLXXInterface &operator=(G4INCLXXInterface const &rhs);
0145 
0146   /// \brief Convert G4ParticleDefinition to corresponding INCL particle type
0147   G4INCL::ParticleType toINCLParticleType(G4ParticleDefinition const * const) const;
0148 
0149   /// \brief Convert G4HadProjectile to corresponding INCL particle species
0150   G4INCL::ParticleSpecies toINCLParticleSpecies(G4HadProjectile const &) const;
0151 
0152   /// \brief Convert G4HadProjectile to corresponding INCL particle kinetic energy
0153   G4double toINCLKineticEnergy(G4HadProjectile const &) const;
0154 
0155   /// \brief Convert an INCL particle to a G4DynamicParticle
0156   G4DynamicParticle *toG4Particle(G4int A, G4int Z, G4int S, G4int PDGCode , G4double kinE, G4double px, G4double py, G4double pz) const;
0157 
0158   /// \brief Convert A, Z and S to a G4ParticleDefinition
0159   G4ParticleDefinition *toG4ParticleDefinition (G4int A, G4int Z, G4int S, G4int PDGCode) const;
0160 
0161   /// \brief Rescale remnant momentum if necessary
0162   G4double remnant4MomentumScaling(G4double mass,
0163       G4double kineticE,
0164       G4double px, G4double py, G4double pz) const;
0165 
0166   G4INCL::INCL *theINCLModel;
0167 
0168   G4VPreCompoundModel *thePreCompoundModel;
0169 
0170   G4HadFinalState theResult;
0171 
0172   G4HadronicInteraction *theBackupModel;
0173   G4HadronicInteraction *theBackupModelNucleon;
0174   G4HadronicInteraction *theBackupModelAntiIonExceptAntiProton;
0175 
0176   G4INCLXXInterfaceStore * const theInterfaceStore;
0177   G4INCLXXVInterfaceTally * theTally;
0178 
0179   G4bool complainedAboutBackupModel;
0180   G4bool complainedAboutPreCompound;
0181 
0182   G4IonTable * const theIonTable;
0183 
0184   G4bool dumpRemnantInfo;
0185 
0186   G4VLevelDensityParameter *theINCLXXLevelDensity;
0187   G4FissionProbability *theINCLXXFissionProbability;
0188 
0189   G4int secID;  // Creator model ID for the secondaries
0190 };
0191 
0192 #endif