File indexing completed on 2025-01-18 09:58:05
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
0035 #ifndef G4DecayTable_hh
0036 #define G4DecayTable_hh 1
0037
0038 #include "G4ParticleDefinition.hh"
0039 #include "G4VDecayChannel.hh"
0040 #include "G4ios.hh"
0041 #include "globals.hh"
0042
0043 #include <vector>
0044
0045 class G4DecayTable
0046 {
0047 public:
0048 using G4VDecayChannelVector = std::vector<G4VDecayChannel*>;
0049
0050 G4DecayTable();
0051 ~G4DecayTable();
0052
0053 G4DecayTable(const G4DecayTable&) = delete;
0054 G4DecayTable& operator=(const G4DecayTable&) = delete;
0055
0056
0057 inline G4bool operator==(const G4DecayTable& right) const;
0058 inline G4bool operator!=(const G4DecayTable& right) const;
0059
0060
0061
0062 void Insert(G4VDecayChannel* aChannel);
0063
0064
0065 inline G4int entries() const;
0066
0067
0068 G4VDecayChannel* SelectADecayChannel(G4double parentMass = -1.);
0069
0070
0071 inline G4VDecayChannel* GetDecayChannel(G4int index) const;
0072 inline G4VDecayChannel* operator[](G4int index);
0073
0074 void DumpInfo() const;
0075
0076 private:
0077 G4ParticleDefinition* parent = nullptr;
0078 G4VDecayChannelVector* channels = nullptr;
0079 };
0080
0081
0082
0083
0084
0085 inline G4bool G4DecayTable::operator==(const G4DecayTable& right) const
0086 {
0087 return (this == &right);
0088 }
0089
0090 inline G4bool G4DecayTable::operator!=(const G4DecayTable& right) const
0091 {
0092 return (this != &right);
0093 }
0094
0095 inline G4int G4DecayTable::entries() const
0096 {
0097 return G4int(channels->size());
0098 }
0099
0100 inline G4VDecayChannel* G4DecayTable::operator[](G4int index)
0101 {
0102 return (*channels)[index];
0103 }
0104
0105 inline G4VDecayChannel* G4DecayTable::GetDecayChannel(G4int index) const
0106 {
0107 G4VDecayChannel* selectedChannel = nullptr;
0108 if ((index >= 0) && (index < G4int(channels->size()))) {
0109 selectedChannel = (*channels)[index];
0110 }
0111 return selectedChannel;
0112 }
0113
0114 #endif