Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4MolecularDecayTable Class Reference

#include <G4MolecularDissociationTable.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 G4MolecularDissociationTable.hh.

Constructor & Destructor Documentation

G4MolecularDecayTable::G4MolecularDecayTable ( )

Definition at line 43 of file G4MolecularDissociationTable.cc.

44 {;}
G4MolecularDecayTable::~G4MolecularDecayTable ( )

Definition at line 46 of file G4MolecularDissociationTable.cc.

References int().

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 }
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
G4MolecularDecayTable::G4MolecularDecayTable ( const G4MolecularDecayTable right)

Definition at line 69 of file G4MolecularDissociationTable.cc.

References right.

70 {
71  *this = right;
72 }

Member Function Documentation

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

Definition at line 158 of file G4MolecularDissociationTable.cc.

Referenced by G4MoleculeDefinition::AddDecayChannel().

159 {
160  fDecayChannelsMap[label].push_back(channel);
161 }
void G4MolecularDecayTable::AddeConfToExcitedState ( const G4String label,
const G4ElectronOccupancy conf 
)

Definition at line 143 of file G4MolecularDissociationTable.cc.

References FatalErrorInArgument, and G4Exception().

Referenced by G4MoleculeDefinition::AddeConfToExcitedState().

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 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void G4MolecularDecayTable::AddExcitedState ( const G4String label)

Definition at line 130 of file G4MolecularDissociationTable.cc.

References FatalErrorInArgument, and G4Exception().

Referenced by G4MoleculeDefinition::AddExcitedState().

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 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void G4MolecularDecayTable::CheckDataConsistency ( )

Definition at line 163 of file G4MolecularDissociationTable.cc.

References G4INCL::ClusterDecay::decay(), FatalErrorInArgument, G4String::first(), G4Exception(), G4MolecularDecayChannel::GetProbability(), and G4INCL::Math::max().

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 }
G4int first(char) const
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
T max(const T t1, const T t2)
brief Return the largest of the two arguments
double G4double
Definition: G4Types.hh:76
const vector< const G4MolecularDecayChannel * > * G4MolecularDecayTable::GetDecayChannels ( const G4ElectronOccupancy conf) const

Definition at line 81 of file G4MolecularDissociationTable.cc.

Referenced by G4MoleculeDefinition::GetDecayChannels().

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 }
const vector< const G4MolecularDecayChannel * > * G4MolecularDecayTable::GetDecayChannels ( const G4String exState) const

Definition at line 90 of file G4MolecularDissociationTable.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 }
const channelsMap & G4MolecularDecayTable::GetDecayChannelsMap ( ) const
inline

Definition at line 134 of file G4MolecularDissociationTable.hh.

Referenced by operator=().

135 {
136  return fDecayChannelsMap;
137 }
const G4ElectronOccupancy & G4MolecularDecayTable::GetElectronOccupancy ( const G4String exState) const

Definition at line 112 of file G4MolecularDissociationTable.cc.

References FatalErrorInArgument, and G4Exception().

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 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
const G4String & G4MolecularDecayTable::GetExcitedState ( const G4ElectronOccupancy conf) const

Definition at line 97 of file G4MolecularDissociationTable.cc.

References FatalErrorInArgument, and G4Exception().

Referenced by G4MoleculeDefinition::GetExcitedState().

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 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
const statesMap & G4MolecularDecayTable::GetExcitedStateMaps ( ) const
inline

Definition at line 129 of file G4MolecularDissociationTable.hh.

130 {
131  return fExcitedStatesMap;
132 }
G4MolecularDecayTable & G4MolecularDecayTable::operator= ( const G4MolecularDecayTable right)

Definition at line 74 of file G4MolecularDissociationTable.cc.

References GetDecayChannelsMap().

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: