Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MolecularDissociationTable Class Reference

#include <G4MolecularDissociationTable.hh>

Public Member Functions

 G4MolecularDissociationTable ()
 
 ~G4MolecularDissociationTable ()
 
 G4MolecularDissociationTable (const G4MolecularDissociationTable &)
 
G4MolecularDissociationTableoperator= (const G4MolecularDissociationTable &right)
 
void AddChannel (const G4MolecularConfiguration *molConf, const G4MolecularDissociationChannel *channel)
 
void CheckDataConsistency () const
 
const std::vector< const G4MolecularDissociationChannel * > * GetDecayChannels (const G4MolecularConfiguration *) const
 
const std::vector< const G4MolecularDissociationChannel * > * GetDecayChannels (const G4String &excitedStateLabel) const
 
void Serialize (std::ostream &)
 

Detailed Description

Class Description G4MolecularDecayTable operates as a container of deexcitation modes for excited or ionized molecules

Definition at line 77 of file G4MolecularDissociationTable.hh.

Constructor & Destructor Documentation

◆ G4MolecularDissociationTable() [1/2]

G4MolecularDissociationTable::G4MolecularDissociationTable ( )
default

◆ ~G4MolecularDissociationTable()

G4MolecularDissociationTable::~G4MolecularDissociationTable ( )

Definition at line 51 of file G4MolecularDissociationTable.cc.

52{
53 auto it_map = fDissociationChannels.begin();
54
55 for (; it_map != fDissociationChannels.end(); it_map++)
56 {
57 vector<const G4MolecularDissociationChannel*>& decayChannels = it_map
58 ->second;
59 if (!decayChannels.empty())
60 {
61 for (auto & decayChannel : decayChannels)
62 {
63 if (decayChannel != nullptr)
64 {
65 delete decayChannel;
66 decayChannel = nullptr;
67 }
68 }
69 decayChannels.clear();
70 }
71 }
72 fDissociationChannels.clear();
73}

◆ G4MolecularDissociationTable() [2/2]

G4MolecularDissociationTable::G4MolecularDissociationTable ( const G4MolecularDissociationTable & right)

Definition at line 77 of file G4MolecularDissociationTable.cc.

79{
80 *this = right;
81}

Member Function Documentation

◆ AddChannel()

void G4MolecularDissociationTable::AddChannel ( const G4MolecularConfiguration * molConf,
const G4MolecularDissociationChannel * channel )

Definition at line 127 of file G4MolecularDissociationTable.cc.

130{
131 fDissociationChannels[molConf].push_back(channel);
132}

Referenced by G4MoleculeDefinition::AddDecayChannel(), and G4MoleculeDefinition::AddDecayChannel().

◆ CheckDataConsistency()

void G4MolecularDissociationTable::CheckDataConsistency ( ) const

Definition at line 136 of file G4MolecularDissociationTable.cc.

137{
138 ChannelMap::const_iterator channelsIter;
139
140 for(channelsIter = fDissociationChannels.begin();
141 channelsIter != fDissociationChannels.end(); ++channelsIter)
142 {
143
144 const vector<const G4MolecularDissociationChannel*>& decayVect =
145 channelsIter->second;
146 G4double sum = 0;
147
148 G4double max = decayVect.size();
149
150 for(size_t i = 0; i < max; i++)
151 {
152 const G4MolecularDissociationChannel* decay = decayVect[i];
153 const G4double prob = decay->GetProbability();
154 sum += prob;
155 }
156
157 if(sum != 1)
158 {
160 errMsg << "The probabilities for deecitation of molecular configuration "
161 << channelsIter->first->GetName()
162 << " with label :" << channelsIter->first->GetLabel()
163 << " don't sum up to 1";
164 G4Exception("G4MolecularDissociationTable::CheckDataConsistency",
165 "BRANCHING_RATIOS_CONSISTENCY",
167 errMsg);
168 }
169 }
170}
@ FatalErrorInArgument
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
double G4double
Definition G4Types.hh:83
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
T max(const T t1, const T t2)
brief Return the largest of the two arguments

◆ GetDecayChannels() [1/2]

const vector< const G4MolecularDissociationChannel * > * G4MolecularDissociationTable::GetDecayChannels ( const G4MolecularConfiguration * conf) const

Definition at line 96 of file G4MolecularDissociationTable.cc.

98{
99 auto it_exstates = fDissociationChannels.find(conf);
100 if (it_exstates == fDissociationChannels.end()) return nullptr;
101 return &(it_exstates->second);
102}

Referenced by G4MoleculeDefinition::GetDecayChannels(), and G4MoleculeDefinition::GetDecayChannels().

◆ GetDecayChannels() [2/2]

const vector< const G4MolecularDissociationChannel * > * G4MolecularDissociationTable::GetDecayChannels ( const G4String & excitedStateLabel) const

Definition at line 107 of file G4MolecularDissociationTable.cc.

108{
109 for(const auto & fDissociationChannel : fDissociationChannels)
110 {
111 if(fDissociationChannel.first->GetLabel() == exState) return &(fDissociationChannel.second);
112 }
113 return nullptr;
114}

◆ operator=()

G4MolecularDissociationTable & G4MolecularDissociationTable::operator= ( const G4MolecularDissociationTable & right)

Definition at line 86 of file G4MolecularDissociationTable.cc.

87{
88 if(this == &right) return *this;
89 fDissociationChannels = right.fDissociationChannels;
90 return *this;
91}

◆ Serialize()

void G4MolecularDissociationTable::Serialize ( std::ostream & )

Definition at line 172 of file G4MolecularDissociationTable.cc.

173{
174 // TODO
175}

The documentation for this class was generated from the following files: