Back to home page

EIC code displayed by LXR

 
 

    


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

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     void Init(G4Element* anElement, const G4String& dirName,
0059               G4ParticleDefinition* projectile);
0060 
0061     void Register(G4ParticleHPFinalState* theFS, const G4String& aName);
0062 
0063     G4double GetXsec(G4double anEnergy)
0064     {
0065       G4double result = 0.0;
0066       for (G4int i = 0; i < nChannels; ++i) {
0067         result += std::max(0., theChannels[i]->GetXsec(anEnergy));
0068       }
0069       return result;
0070     }
0071 
0072     G4int GetNumberOfChannels() { return nChannels; }
0073 
0074     G4bool HasDataInAnyFinalState()
0075     {
0076       G4bool result = false;
0077       for (G4int i = 0; i < nChannels; ++i) {
0078         if (theChannels[i]->HasDataInAnyFinalState())
0079     {
0080           result = true;
0081       break;
0082     }
0083       }
0084       return result;
0085     }
0086 
0087     void DumpInfo();
0088 
0089     G4ParticleHPChannelList(G4ParticleHPChannelList &) = delete;
0090     G4ParticleHPChannelList & operator=
0091     (const G4ParticleHPChannelList &right) = delete;
0092 
0093   private:
0094     G4ParticleHPChannel** theChannels;
0095     G4ParticleDefinition* theProjectile;
0096     G4Element* theElement{nullptr};
0097     G4int nChannels;
0098     G4int idx{0};
0099     G4String theDir{""};
0100 
0101     G4HadFinalState unChanged;
0102 };
0103 
0104 #endif