File indexing completed on 2025-01-18 09:58:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
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