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3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/dna/molecules/management/src/G4MoleculeTable.cc (Version 11.3.0) and /processes/electromagnetic/dna/molecules/management/src/G4MoleculeTable.cc (Version 9.6.p2)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 /*                                                
 27  * G4MoleculeTable.cc                             
 28  *                                                
 29  *  Created on: 23 oct. 2013                      
 30  *      Author: kara                              
 31  */                                               
 32                                                   
 33 #include "G4MoleculeTable.hh"                     
 34 #include "G4MolecularConfiguration.hh"            
 35 #include "G4MoleculeDefinition.hh"                
 36 #include "G4MoleculeTableMessenger.hh"            
 37                                                   
 38 G4MoleculeTable* G4MoleculeTable::fpgMoleculeT    
 39                                                   
 40 //--------------------------------------------    
 41                                                   
 42 G4MoleculeTable::G4MoleculeTable()                
 43   : fMoleculeDefTableMessenger(new G4MoleculeT    
 44 {                                                 
 45 }                                                 
 46                                                   
 47 //--------------------------------------------    
 48                                                   
 49 G4MoleculeTable::~G4MoleculeTable()               
 50 = default;                                        
 51                                                   
 52 //--------------------------------------------    
 53                                                   
 54 G4MoleculeTable* G4MoleculeTable::Instance()      
 55 {                                                 
 56   if (fpgMoleculeTable == nullptr) fpgMolecule    
 57   return fpgMoleculeTable;                        
 58 }                                                 
 59                                                   
 60 //--------------------------------------------    
 61                                                   
 62 G4MoleculeTable* G4MoleculeTable::GetMoleculeT    
 63 {                                                 
 64   return Instance();                              
 65 }                                                 
 66                                                   
 67 //--------------------------------------------    
 68                                                   
 69 G4MoleculeDefinition*                             
 70 G4MoleculeTable::CreateMoleculeDefinition(cons    
 71                                           doub    
 72 {                                                 
 73   return new G4MoleculeDefinition(name, -1 /*     
 74                                   diffusion_co    
 75 }                                                 
 76                                                   
 77 //--------------------------------------------    
 78                                                   
 79 G4MoleculeDefinition*                             
 80 G4MoleculeTable::GetMoleculeDefinition(const G    
 81                                        bool mu    
 82 {                                                 
 83   auto it = fMoleculeDefTable.find(name);         
 84   G4MoleculeDefinition* definition(nullptr);      
 85   if (it != fMoleculeDefTable.end())              
 86   {                                               
 87     definition = it->second;                      
 88   }                                               
 89   else if(mustExist)                              
 90   {                                               
 91     // exception                                  
 92     G4ExceptionDescription description;           
 93     description << "The molecule definition "     
 94                 << " was NOT recorded in the t    
 95     G4Exception("G4MoleculeTable::CreateMolecu    
 96                 "MOLECULE_DEFINITION_NOT_CREAT    
 97                 FatalException,                   
 98                 description);                     
 99   }                                               
100   return definition;                              
101 }                                                 
102                                                   
103 //--------------------------------------------    
104                                                   
105 G4MolecularConfiguration*                         
106 G4MoleculeTable::GetConfiguration(const G4Stri    
107 {                                                 
108   G4MolecularConfiguration* species =             
109       G4MolecularConfiguration::GetMolecularCo    
110                                                   
111   if(species == nullptr && mustExist)             
112   {                                               
113     // exception                                  
114     G4ExceptionDescription description;           
115     description << "The configuration " << nam    
116                 << " was not recorded in the t    
117     G4Exception("G4MoleculeTable::GetConfigura    
118                 "CONF_NOT_CREATED",               
119                 FatalException,                   
120                 description);                     
121   }                                               
122                                                   
123   return species;                                 
124 }                                                 
125                                                   
126 //--------------------------------------------    
127                                                   
128 G4MolecularConfiguration*                         
129 G4MoleculeTable::GetConfiguration(G4int id)       
130 {                                                 
131   G4MolecularConfiguration* species =             
132         G4MolecularConfiguration::GetMolecular    
133                                                   
134   return species;                                 
135 }                                                 
136                                                   
137 //--------------------------------------------    
138                                                   
139 void G4MoleculeTable::Insert(G4MoleculeDefinit    
140 {                                                 
141                                                   
142   const G4String& name = moleculeDefinition->G    
143   auto it = fMoleculeDefTable.find(name);         
144   if (it == fMoleculeDefTable.end())              
145   {                                               
146     fMoleculeDefTable[name] = moleculeDefiniti    
147   }                                               
148   else                                            
149   {                                               
150     // exception                                  
151     G4ExceptionDescription description;           
152     description << "The molecule definition "     
153                 << " was already recorded in t    
154     G4Exception("G4MoleculeTable::CreateMolecu    
155                 "DEFINITION_ALREADY_CREATED",     
156   }                                               
157 }                                                 
158                                                   
159 //--------------------------------------------    
160                                                   
161 void G4MoleculeTable::PrepareMolecularConfigur    
162 {                                                 
163   auto it = fMoleculeDefTable.begin();            
164                                                   
165   for(; it != fMoleculeDefTable.end() ; ++it)     
166   {                                               
167     G4MolecularConfiguration::GetOrCreateMolec    
168   }                                               
169 }                                                 
170                                                   
171 //--------------------------------------------    
172                                                   
173 G4MolecularConfiguration*                         
174 G4MoleculeTable::CreateConfiguration(const G4S    
175                                      G4Molecul    
176 {                                                 
177   bool alreadyCreated(false);                     
178                                                   
179   G4MolecularConfiguration* molConf =             
180       G4MolecularConfiguration::CreateMolecula    
181                                                   
182                                                   
183                                                   
184   return molConf;                                 
185 }                                                 
186                                                   
187 //--------------------------------------------    
188                                                   
189 G4MolecularConfiguration*                         
190 G4MoleculeTable::CreateConfiguration(const G4S    
191                                      G4Molecul    
192                                      const G4S    
193                                      int charg    
194 {                                                 
195   bool alreadyCreated(false);                     
196                                                   
197   G4MolecularConfiguration* molConf =             
198       G4MolecularConfiguration::CreateMolecula    
199                                                   
200                                                   
201                                                   
202                                                   
203                                                   
204   return molConf;                                 
205 }                                                 
206                                                   
207 //--------------------------------------------    
208                                                   
209 G4MolecularConfiguration*                         
210 G4MoleculeTable::CreateConfiguration(const G4S    
211                                      G4Molecul    
212                                      int charg    
213                                      double di    
214 {                                                 
215   bool alreadyCreated(false);                     
216                                                   
217   G4MolecularConfiguration* molConf =             
218         G4MolecularConfiguration::CreateMolecu    
219                                                   
220                                                   
221                                                   
222                                                   
223                                                   
224   if(diffusion_coefficient!=-1) // TODO           
225   {                                               
226     molConf->SetDiffusionCoefficient(diffusion    
227   }                                               
228   return molConf;                                 
229 }                                                 
230                                                   
231 //--------------------------------------------    
232                                                   
233 G4MolecularConfiguration*                         
234 G4MoleculeTable::CreateConfiguration(const G4S    
235                                      const G4M    
236                                      const G4S    
237                                      const G4E    
238 {                                                 
239   bool alreadyCreated(false);                     
240                                                   
241   G4MolecularConfiguration* molConf =             
242       G4MolecularConfiguration::CreateMolecula    
243                                                   
244                                                   
245                                                   
246                                                   
247                                                   
248   return molConf;                                 
249 }                                                 
250                                                   
251 //--------------------------------------------    
252                                                   
253 void G4MoleculeTable::Finalize()                  
254 {                                                 
255   G4MolecularConfiguration::FinalizeAll();        
256 }                                                 
257                                                   
258 //--------------------------------------------    
259                                                   
260 G4ConfigurationIterator G4MoleculeTable::GetCo    
261 {                                                 
262   return G4ConfigurationIterator(G4MolecularCo    
263 }                                                 
264                                                   
265 //--------------------------------------------    
266                                                   
267 int G4MoleculeTable::GetNumberOfDefinedSpecies    
268 {                                                 
269   return G4MolecularConfiguration::GetNumberOf    
270 }                                                 
271