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

#include <G4MolecularDecayTable.hh>

Public Member Functions

 G4MolecularDecayTable ()
 
 ~G4MolecularDecayTable ()
 
 G4MolecularDecayTable (const G4MolecularDecayTable &)
 
G4MolecularDecayTableoperator= (const G4MolecularDecayTable &right)
 
void AddExcitedState (const G4String &)
 
void AddeConfToExcitedState (const G4String &, const G4ElectronOccupancy &)
 
void AddDecayChannel (const G4String &, const G4MolecularDecayChannel *)
 
void CheckDataConsistency ()
 
const std::vector< const G4MolecularDecayChannel * > * GetDecayChannels (const G4ElectronOccupancy *) const
 
const std::vector< const G4MolecularDecayChannel * > * GetDecayChannels (const G4String &) const
 
const G4StringGetExcitedState (const G4ElectronOccupancy *) const
 
const G4ElectronOccupancyGetElectronOccupancy (const G4String &) const
 
const statesMapGetExcitedStateMaps () const
 
const channelsMapGetDecayChannelsMap () const
 

Detailed Description

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

Definition at line 88 of file G4MolecularDecayTable.hh.

Constructor & Destructor Documentation

◆ G4MolecularDecayTable() [1/2]

G4MolecularDecayTable::G4MolecularDecayTable ( )

Definition at line 43 of file G4MolecularDecayTable.cc.

44{;}

◆ ~G4MolecularDecayTable()

G4MolecularDecayTable::~G4MolecularDecayTable ( )

Definition at line 46 of file G4MolecularDecayTable.cc.

47{
48 channelsMap::iterator it_map = fDecayChannelsMap.begin();
49
50 for(;it_map != fDecayChannelsMap.end() ; it_map++)
51 {
52 vector<const G4MolecularDecayChannel*>& decayChannels = it_map->second;
53 if(!decayChannels.empty())
54 {
55 for(int i = 0 ; i < (int) decayChannels.size() ; i++)
56 {
57 if(decayChannels [i])
58 {
59 delete decayChannels[i];
60 decayChannels[i] = 0;
61 }
62 }
63 decayChannels.clear();
64 }
65 }
66 fDecayChannelsMap.clear();
67}

◆ G4MolecularDecayTable() [2/2]

G4MolecularDecayTable::G4MolecularDecayTable ( const G4MolecularDecayTable right)

Definition at line 69 of file G4MolecularDecayTable.cc.

70{
71 *this = right;
72}

Member Function Documentation

◆ AddDecayChannel()

void G4MolecularDecayTable::AddDecayChannel ( const G4String label,
const G4MolecularDecayChannel channel 
)

Definition at line 158 of file G4MolecularDecayTable.cc.

159{
160 fDecayChannelsMap[label].push_back(channel);
161}

Referenced by G4MoleculeDefinition::AddDecayChannel().

◆ AddeConfToExcitedState()

void G4MolecularDecayTable::AddeConfToExcitedState ( const G4String label,
const G4ElectronOccupancy conf 
)

Definition at line 143 of file G4MolecularDecayTable.cc.

144{
145 statesMap::iterator statesIter = fExcitedStatesMap.find(conf);
146
147 if (statesIter == fExcitedStatesMap.end())
148 {
149 fExcitedStatesMap[conf] = label;
150 }
151 else
152 {
153 G4Exception("G4MolecularDecayTable::AddExcitedState","G4MolecularDecayTable004",
154 FatalErrorInArgument,"Electronic configuration already registered in the decay table");
155 }
156}
@ FatalErrorInArgument
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by G4MoleculeDefinition::AddeConfToExcitedState().

◆ AddExcitedState()

void G4MolecularDecayTable::AddExcitedState ( const G4String label)

Definition at line 130 of file G4MolecularDecayTable.cc.

131{
132 channelsMap::iterator channelsIter = fDecayChannelsMap.find(label);
133 if(channelsIter != fDecayChannelsMap.end())
134 {
135 G4String errMsg = "Excited state" + label + " already registered in the decay table.";
136 G4Exception("G4MolecularDecayTable::AddExcitedState",
137 "G4MolecularDecayTable003",FatalErrorInArgument, errMsg);
138 return;
139 }
140 fDecayChannelsMap[label] ;
141}

Referenced by G4MoleculeDefinition::AddExcitedState().

◆ CheckDataConsistency()

void G4MolecularDecayTable::CheckDataConsistency ( )

Definition at line 163 of file G4MolecularDecayTable.cc.

164{
165 channelsMap::iterator channelsIter;
166
167 //Let's check probabilities
168
169 for (channelsIter=fDecayChannelsMap.begin(); channelsIter!=fDecayChannelsMap.end(); channelsIter++ )
170 {
171
172 vector<const G4MolecularDecayChannel*>& decayVect = channelsIter->second;
173 G4double sum=0;
174
175 G4double max = decayVect.size();
176
177 for (size_t i=0; i<max; i++)
178 {
179 const G4MolecularDecayChannel* decay = decayVect[i];
180 const G4double prob = decay->GetProbability();
181 sum += prob;
182 }
183
184 if (sum != 1)
185 {
186 G4String errMsg = "Deexcitation Channels probabilities in " + channelsIter->first
187 + "excited state don't sum up to 1";
188 G4Exception("G4MolecularDecayTable::CheckDataConsistency",
189 "G4MolecularDecayTable005",FatalErrorInArgument, errMsg);
190 }
191 }
192
193}
double G4double
Definition: G4Types.hh:64
G4int first(char) const

◆ GetDecayChannels() [1/2]

const vector< const G4MolecularDecayChannel * > * G4MolecularDecayTable::GetDecayChannels ( const G4ElectronOccupancy conf) const

Definition at line 81 of file G4MolecularDecayTable.cc.

82{
83 statesMap::const_iterator it_exstates = fExcitedStatesMap.find(*conf);
84 if(it_exstates == fExcitedStatesMap.end()) return 0;
85 channelsMap::const_iterator it_decchannel = fDecayChannelsMap.find(it_exstates->second) ;
86 if(it_decchannel == fDecayChannelsMap.end()) return 0;
87 return &(it_decchannel->second);
88}

Referenced by G4MoleculeDefinition::GetDecayChannels().

◆ GetDecayChannels() [2/2]

const vector< const G4MolecularDecayChannel * > * G4MolecularDecayTable::GetDecayChannels ( const G4String exState) const

Definition at line 90 of file G4MolecularDecayTable.cc.

91{
92 channelsMap::const_iterator it_decchannel = fDecayChannelsMap.find(exState);
93 if(it_decchannel == fDecayChannelsMap.end()) return 0;
94 return &(it_decchannel->second);
95}

◆ GetDecayChannelsMap()

const channelsMap & G4MolecularDecayTable::GetDecayChannelsMap ( ) const
inline

Definition at line 134 of file G4MolecularDecayTable.hh.

135{
136 return fDecayChannelsMap;
137}

Referenced by operator=().

◆ GetElectronOccupancy()

const G4ElectronOccupancy & G4MolecularDecayTable::GetElectronOccupancy ( const G4String exState) const

Definition at line 112 of file G4MolecularDecayTable.cc.

113{
114 statesMap::const_iterator statesIter;
115 const G4ElectronOccupancy* conf(0);
116 for (statesIter=fExcitedStatesMap.begin(); statesIter!=fExcitedStatesMap.end(); statesIter++ )
117 {
118 if(exState == statesIter->second) conf = &(statesIter->first);
119 }
120
121 if(statesIter == fExcitedStatesMap.end())
122 {
123 G4String errMsg = "Excited state" + exState + " not found";
124 G4Exception("G4MolecularDecayTable::GetElectronOccupancy(const G4String&)",
125 "G4MolecularDecayTable002",FatalErrorInArgument, errMsg);
126 }
127 return *conf;
128}

◆ GetExcitedState()

const G4String & G4MolecularDecayTable::GetExcitedState ( const G4ElectronOccupancy conf) const

Definition at line 97 of file G4MolecularDecayTable.cc.

98{
99 statesMap::const_iterator it_exstates = fExcitedStatesMap.find(*conf);
100
101 if(it_exstates == fExcitedStatesMap.end())
102 {
103 G4String errMsg = "Excited state not found";
104 G4Exception("G4MolecularDecayTable::GetExcitedState(const G4ElectronOccupancy*)",
105 "G4MolecularDecayTable001",FatalErrorInArgument, errMsg);
106// return *(new G4String("IM FAKE")); // fake return statement
107 }
108
109 return it_exstates->second;
110}

Referenced by G4MoleculeDefinition::GetExcitedState().

◆ GetExcitedStateMaps()

const statesMap & G4MolecularDecayTable::GetExcitedStateMaps ( ) const
inline

Definition at line 129 of file G4MolecularDecayTable.hh.

130{
131 return fExcitedStatesMap;
132}

◆ operator=()

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

Definition at line 74 of file G4MolecularDecayTable.cc.

75{
76 fExcitedStatesMap = aMolecularDecayTable.fExcitedStatesMap;
77 fDecayChannelsMap = channelsMap(aMolecularDecayTable.GetDecayChannelsMap());
78 return *this;
79}
std::map< G4String, std::vector< const G4MolecularDecayChannel * >, std::less< G4String > > channelsMap

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