Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-16 08:56:37

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 // Hadronic Process: Very Low Energy Neutron X-Sections
0027 // original by H.P. Wellisch, TRIUMF, 14-Feb-97
0028 // Builds and has the Cross-section data for one material.
0029 
0030 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
0031 // V. Ivanchenko, July-2023 Basic revision of particle HP classes
0032 //
0033 
0034 #ifndef G4ParticleHPChannelList_h
0035 #define G4ParticleHPChannelList_h 1
0036 
0037 #include "G4ParticleHPChannel.hh"
0038 #include "globals.hh"
0039 
0040 class G4Element;
0041 class G4HadFinalState;
0042 class G4HadProjectile;
0043 class G4ParticleHPFinalState;
0044 class G4ParticleDefinition;
0045 
0046 class G4ParticleHPChannelList
0047 {
0048   public:
0049     G4ParticleHPChannelList(G4int n = 0, G4ParticleDefinition* p = nullptr);
0050 
0051     void Init(G4int n);
0052 
0053     ~G4ParticleHPChannelList();
0054 
0055     G4HadFinalState* ApplyYourself(const G4Element* theElement,
0056                                    const G4HadProjectile& aTrack);
0057 
0058     // method added by M.Zmeskal 02/2024 - to be used in G4ParticleHPInelasticURR
0059     G4HadFinalState * ApplyYourself(G4int, G4int, G4int, const G4HadProjectile & aTrack);
0060 
0061     void Init(G4Element* anElement, const G4String& dirName,
0062               G4ParticleDefinition* projectile);
0063 
0064     void Register(G4ParticleHPFinalState* theFS, const G4String& aName);
0065 
0066     G4double GetXsec(G4double anEnergy)
0067     {
0068       G4double result = 0.0;
0069       for (G4int i = 0; i < nChannels; ++i) {
0070         result += std::max(0., theChannels[i]->GetXsec(anEnergy));
0071       }
0072       return result;
0073     }
0074 
0075     // method added by M.Zmeskal 02/2024 - to be used in G4ParticleHPIsoProbabilityTable
0076     inline G4double GetWeightedXsec( G4double anEnergy, G4int isotopeJ ) {
0077       G4double result = 0.0;
0078       G4int i;
0079       for ( i = 0; i < nChannels; i++ ) {
0080         if ( theChannels[i]->HasAnyData( isotopeJ ) ) {
0081           result += std::max( 0.0, theChannels[i]->GetWeightedXsec( anEnergy, isotopeJ ) );
0082         }
0083       }
0084       return result;
0085     }
0086 
0087     G4int GetNumberOfChannels() { return nChannels; }
0088 
0089     G4bool HasDataInAnyFinalState()
0090     {
0091       G4bool result = false;
0092       for (G4int i = 0; i < nChannels; ++i) {
0093         if (theChannels[i]->HasDataInAnyFinalState())
0094     {
0095           result = true;
0096       break;
0097     }
0098       }
0099       return result;
0100     }
0101 
0102     void DumpInfo();
0103 
0104     G4ParticleHPChannelList(G4ParticleHPChannelList &) = delete;
0105     G4ParticleHPChannelList & operator=
0106     (const G4ParticleHPChannelList &right) = delete;
0107 
0108   private:
0109     G4ParticleHPChannel** theChannels;
0110     G4ParticleDefinition* theProjectile;
0111     G4Element* theElement{nullptr};
0112     G4int nChannels;
0113     G4int idx{0};
0114     G4String theDir{""};
0115 
0116     G4HadFinalState unChanged;
0117 };
0118 
0119 #endif