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.p3 ] [ 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 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.                             *
 10 // *                                                                  *
 11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                                                  *
 18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // ********************************************************************
 25 //
 26 // Contact: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
 27 //
 28 // WARNING : This class is released as a prototype.
 29 // It might strongly evolve or even disapear in the next releases.
 30 //
 31 // ----------------------------------------------------------------------
 32 //      GEANT 4 class implementation file
 33 //
 34 //      21 Oct 2009 first implementation by A. Mantero and M.Karamitros
 35 //                  Based on prototype of A.Mantero
 36 // **********************************************************************
 37 //
 38 // Author: Mathieu Karamitros
 39 
 40 // The code is developed in the framework of the ESA AO7146
 41 //
 42 // We would be very happy hearing from you, send us your feedback! :)
 43 //
 44 // In order for Geant4-DNA to be maintained and still open-source,
 45 // article citations are crucial. 
 46 // If you use Geant4-DNA chemistry and you publish papers about your software, 
 47 // in addition to the general paper on Geant4-DNA:
 48 //
 49 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
 50 //
 51 // we would be very happy if you could please also cite the following
 52 // reference papers on chemistry:
 53 //
 54 // J. Comput. Phys. 274 (2014) 841-882
 55 // Prog. Nucl. Sci. Tec. 2 (2011) 503-508 
 56 
 57 #ifndef G4MoleculeDefinition_h
 58 #define G4MoleculeDefinition_h 1
 59 
 60 #include "globals.hh"
 61 #include "G4ParticleDefinition.hh"
 62 #include "G4ios.hh"
 63 #include "G4ElectronOccupancy.hh"
 64 #include "G4MolecularDissociationTable.hh"
 65 #include "G4MolecularDissociationChannel.hh"
 66 #include "G4FakeParticleID.hh"
 67 
 68 class G4MolecularDissociationChannel;
 69 class G4MolecularDissociationTable;
 70 class G4MolecularConfiguration;
 71 
 72 // -----------------------------------------------------------------------------
 73 // ###                          MoleculeDefinition                           ###
 74 // -----------------------------------------------------------------------------
 75 
 76 class G4MoleculeDefinition: public G4ParticleDefinition
 77 {
 78 public:
 79   G4MoleculeDefinition(const G4String& name,
 80                        G4double mass,
 81                        G4double diffCoeff,
 82                        G4int charge = 0,
 83                        G4int electronicLevels = 0,
 84                        G4double radius = -1,
 85                        G4int atomsNumber = -1,
 86                        G4double lifetime = -1,
 87                        const G4String& aType = "",
 88                        G4FakeParticleID ID = G4FakeParticleID::Create());
 89 
 90   ~G4MoleculeDefinition() override;
 91 
 92   G4MoleculeDefinition(const G4MoleculeDefinition&) = delete;
 93   G4MoleculeDefinition& operator=(const G4MoleculeDefinition&) = delete;
 94 
 95   // Set the electronic configuration at ground level
 96   void SetLevelOccupation(G4int,
 97                           G4int eNb = 2);
 98   // set the occupation(0(def), 1 or 2) of the level specified
 99   //(levels numbering starts from 0)
100 
101   //methods to set/get diffusion properties
102   inline void SetDiffusionCoefficient(G4double);
103   inline G4double GetDiffusionCoefficient() const;
104 
105   inline void SetAtomsNumber(G4int);
106   inline G4int GetAtomsNumber() const;
107 
108   inline void SetVanDerVaalsRadius(G4double);
109   inline G4double GetVanDerVaalsRadius() const;
110 
111   //____________________________________________________________________________
112   // Create more molecular configurations for this molecule definition
113   // Other ways : through G4MolecularTable
114 
115   // Note: the userID of the created molecule configuration will be:
116   //       MoleculeDefinationName_excitedStateLabel
117   G4MolecularConfiguration*
118   NewConfiguration(const G4String& excitedStateLabel);
119 
120   G4MolecularConfiguration*
121   NewConfigurationWithElectronOccupancy(const G4String& excitedStateLabel,
122                                         const G4ElectronOccupancy&,
123                                         double decayTime = 0.);
124 
125   G4MolecularConfiguration*
126   GetConfigurationWithLabel(const G4String& molecularConfLabel);
127 
128   //____________________________________________________________________________
129   // Build the decay table
130   // Version 1
131 
132   void AddDecayChannel(const G4MolecularConfiguration* molConf,
133                        const G4MolecularDissociationChannel* channel);
134 
135   // Version 2
136 
137   void AddDecayChannel(const G4String& molecularConfLabel,
138                        const G4MolecularDissociationChannel* channel);
139 
140   //____________________________________________________________________________
141   // "Get" methods related to decay
142 
143   const std::vector<const G4MolecularDissociationChannel*>*
144     GetDecayChannels(const G4MolecularConfiguration*) const;
145   const std::vector<const G4MolecularDissociationChannel*>*
146     GetDecayChannels(const G4String&) const;
147 
148   inline const G4MolecularDissociationTable* GetDecayTable() const;
149   inline G4MolecularDissociationTable* GetDecayTable();
150   inline G4double GetDecayTime() const;
151 
152   //____________________________________________________________________________
153   // General "Get" methods
154   inline const G4ElectronOccupancy* GetGroundStateElectronOccupancy() const;
155   inline G4int GetCharge() const;
156   inline const G4String& GetName() const;
157   inline G4double GetMass() const;
158   inline const G4String& GetType() const;
159   inline G4int GetNbElectrons() const;
160   inline G4int GetNbMolecularShells() const;
161 
162   inline const G4String& GetFormatedName() const
163   {
164     return fFormatedName;
165   }
166 
167   //____________________________________________________________________________
168   inline void SetFormatedName(const G4String& name)
169   {
170     fFormatedName = name;
171   }
172 
173   void Finalize();
174 
175   static G4MoleculeDefinition* Load(std::istream&);
176   void Serialize(std::ostream&);
177 
178 protected:
179   G4MoleculeDefinition();
180 
181 private:
182   G4int fCharge;
183 
184   // Diffusion Coefficient in one medium only
185   // Note : For the time being, we will consider only one diffusion
186   // coefficient for the all simulation => diffusion in one medium only
187   // If the user needs to use the diffusion in different materials,
188   // she/he should contact the developers/maintainers of this package
189   G4double fDiffusionCoefficient;
190 
191   G4int fAtomsNb;
192   G4double fVanDerVaalsRadius;
193 
194   G4String fFormatedName;
195 
196   G4ElectronOccupancy* fElectronOccupancy;
197   G4MolecularDissociationTable* fDecayTable;
198 };
199 
200 inline void G4MoleculeDefinition::SetDiffusionCoefficient(G4double value)
201 {
202   fDiffusionCoefficient = value;
203 }
204 
205 inline G4double G4MoleculeDefinition::GetDiffusionCoefficient() const
206 {
207   return fDiffusionCoefficient;
208 }
209 
210 inline G4int G4MoleculeDefinition::GetCharge() const
211 {
212   return fCharge;
213 }
214 
215 inline G4double G4MoleculeDefinition::GetDecayTime() const
216 {
217   return GetPDGLifeTime();
218 }
219 
220 inline void G4MoleculeDefinition::SetAtomsNumber(G4int val)
221 {
222   fAtomsNb = val;
223 }
224 
225 inline G4int G4MoleculeDefinition::GetAtomsNumber() const
226 {
227   return fAtomsNb;
228 }
229 
230 inline void G4MoleculeDefinition::SetVanDerVaalsRadius(G4double val)
231 {
232   fVanDerVaalsRadius = val;
233 }
234 
235 inline G4double G4MoleculeDefinition::GetVanDerVaalsRadius() const
236 {
237   return fVanDerVaalsRadius;
238 }
239 
240 inline const G4ElectronOccupancy* G4MoleculeDefinition::GetGroundStateElectronOccupancy() const
241 {
242   return fElectronOccupancy;
243 }
244 
245 inline const G4String& G4MoleculeDefinition::GetName() const
246 {
247 
248   return GetParticleName();
249 }
250 
251 inline G4double G4MoleculeDefinition::GetMass() const
252 {
253   return GetPDGMass();
254 }
255 
256 inline const G4String& G4MoleculeDefinition::GetType() const
257 {
258   return GetParticleSubType();
259 }
260 
261 inline G4int G4MoleculeDefinition::GetNbElectrons() const
262 {
263   if (fElectronOccupancy != nullptr)
264   {
265     return fElectronOccupancy->GetTotalOccupancy();
266   }
267 
268   return 0;
269   //    return fNbOfElectrons;
270 }
271 
272 inline G4int G4MoleculeDefinition::GetNbMolecularShells() const
273 {
274   if (fElectronOccupancy != nullptr)
275   {
276     return fElectronOccupancy->GetSizeOfOrbit();
277   }
278 
279   return 0;
280 }
281 
282 inline const G4MolecularDissociationTable* G4MoleculeDefinition::GetDecayTable() const
283 {
284   return fDecayTable;
285 }
286 
287 inline G4MolecularDissociationTable* G4MoleculeDefinition::GetDecayTable()
288 {
289   return fDecayTable;
290 }
291 #endif
292 
293