Geant4-11
G4Molecule.hh
Go to the documentation of this file.
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// The code is developed in the framework of the ESA AO7146
32//
33// We would be very happy hearing from you, send us your feedback! :)
34//
35// In order for Geant4-DNA to be maintained and still open-source,
36// article citations are crucial.
37// If you use Geant4-DNA chemistry and you publish papers about your software,
38// in addition to the general paper on Geant4-DNA:
39//
40// Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
41//
42// we would be very happy if you could please also cite the following
43// reference papers on chemistry:
44//
45// J. Comput. Phys. 274 (2014) 841-882
46// Prog. Nucl. Sci. Tec. 2 (2011) 503-508
47//
48// ---------------------------------------------------------------------
49// GEANT 4 class header file
50//
51// History: first implementation, based on G4DynamicParticle
52// New dependency : G4VUserTrackInformation
53//
54// ---------------- G4Molecule ----------------
55// first design&implementation by Alfonso Mantero, 7 Apr 2009
56// New developments Alfonso Mantero & Mathieu Karamitros
57// Oct/Nov 2009 Class Name changed to G4Molecule
58// Removed dependency from G4DynamicParticle
59// New constructors :
60// copy constructor
61// direct ionized/excited molecule
62// New methods :
63// Get : name,atoms' number,nb electrons,decayChannel
64// PrintState //To get the electronic level and the
65// corresponding name of the excitation
66// Kinematic :
67// BuildTrack,GetKineticEnergy,GetDiffusionVelocity
68// Change the way dynCharge and eNb is calculated
69// ---------------------------------------------------------------------
70
71#ifndef G4Molecule_h
72#define G4Molecule_h 1
73
74#include "G4IT.hh"
75#include "G4Allocator.hh"
77
78class G4Molecule;
79template<>
81
82class G4Molecule;
87class G4Material;
88
89G4Molecule* GetMolecule(const G4Track& track);
90G4Molecule* GetMolecule(const G4Track* track);
91
98class G4Molecule : public G4IT
99{
100
101public:
102 // With Description
103
105
106 //From G4VUserTrackInformation
107 void Print() const;
108
109 // new/delete operators are overloded to use G4Allocator
110 inline void *operator new(size_t);
111#ifdef __IBMCPP__
112 inline void *operator new(size_t sz, void* p)
113 {
114 return p;
115 }
116#endif
117 inline void operator delete(void*);
118
119 G4Molecule(const G4Molecule&);
120 G4Molecule & operator=(const G4Molecule &right);
121 G4bool operator==(const G4Molecule &right) const;
122 G4bool operator!=(const G4Molecule &right) const;
123 G4bool operator<(const G4Molecule &right) const;
124
125 operator int() const
126 {
127 return GetMoleculeID();
128 }
129
130 virtual G4ITType GetITSubType() const
131 {
132 return GetMoleculeID();
133 }
134
135public:
136 //------ Constructors --------------------------
140 G4Molecule(G4MoleculeDefinition* pMoleculeDefinition);
141
142 G4Molecule(G4MoleculeDefinition* pMoleculeDefinition, int charge);
143
147 G4Molecule(G4MoleculeDefinition* pMoleculeDefinition, G4int, G4int);
148
153 G4Molecule(G4MoleculeDefinition* pMoleculeDefinition, G4int, G4bool);
154
156
157 virtual ~G4Molecule();
158
159 //-------- Methods -------------------------------
160 //Get from static definition
163 const G4String& GetName() const;
164
167 const G4String& GetFormatedName() const;
168
171 G4int GetAtomsNumber() const;
172
177
180 void ExciteMolecule(G4int);
181
184 void IonizeMolecule(G4int);
185
190 void AddElectron(G4int orbit, G4int n = 1);
191
194 void RemoveElectron(G4int, G4int number = 1);
195
198 void MoveOneElectron(G4int /*orbit*/, G4int /*orbit*/);
199
202 G4double GetNbElectrons() const; //This method can be used to check if the electron s number is physical
203
206 void PrintState() const;
207
208 G4Track * BuildTrack(G4double globalTime, const G4ThreeVector& Position);
209
211
213
214 const std::vector<const G4MolecularDissociationChannel*>* GetDissociationChannels() const;
215
216 G4int GetFakeParticleID() const;
217 G4int GetMoleculeID() const;
218
219 //-------------Inline functions ---------------------
223 const G4MoleculeDefinition* GetDefinition() const;
224
225 //methods to set/get changing parameters
226
228
234
238
242 double temperature) const;
243
247
250 G4double GetDecayTime() const;
251
256
261
264 G4int GetCharge() const;
265
269
272 G4double GetMass() const;
273
276 const G4String& GetLabel() const;
277
278 void SetLabel(const G4String& label);
279
280 void ChangeConfigurationToLabel(const G4String& label);
281
283
285
286 static G4Molecule* GetMolecule(const G4Track*);
287
288private:
291 G4Molecule();
293};
294
295#if defined G4EM_ALLOC_EXPORT
297#else
299#endif
300
302inline void * G4Molecule::operator new(size_t)
304{
305 if (!aMoleculeAllocator())
306 {
308 }
309 return (void *)aMoleculeAllocator()->MallocSingle();
310}
311
313inline void G4Molecule::operator delete(void * aMolecule)
315{
316 aMoleculeAllocator()->FreeSingle((G4Molecule *)aMolecule);
317}
318
319#endif
G4Molecule * GetMolecule(const G4Track &track)
Definition: G4Molecule.cc:76
G4DLLIMPORT G4Allocator< G4Molecule > *& aMoleculeAllocator()
double G4double
Definition: G4Types.hh:83
#define G4DLLIMPORT
Definition: G4Types.hh:69
#define G4DLLEXPORT
Definition: G4Types.hh:68
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
Definition: G4IT.hh:88
virtual void Print() const
Definition: G4IT.hh:97
virtual ~G4KDNode()
void IonizeMolecule(G4int)
Definition: G4Molecule.cc:308
G4int GetCharge() const
Definition: G4Molecule.cc:488
void RemoveElectron(G4int, G4int number=1)
Definition: G4Molecule.cc:322
void AddElectron(G4int orbit, G4int n=1)
Definition: G4Molecule.cc:315
virtual ~G4Molecule()
Definition: G4Molecule.cc:160
static G4Molecule * GetMolecule(const G4Track *)
Definition: G4Molecule.cc:90
G4bool operator<(const G4Molecule &right) const
Definition: G4Molecule.cc:144
G4double GetVanDerVaalsRadius() const
Definition: G4Molecule.cc:481
const G4MolecularConfiguration * GetMolecularConfiguration() const
Definition: G4Molecule.cc:532
void SetElectronOccupancy(const G4ElectronOccupancy *)
Definition: G4Molecule.cc:292
void MoveOneElectron(G4int, G4int)
Definition: G4Molecule.cc:330
G4double GetMass() const
Definition: G4Molecule.cc:495
const G4String & GetLabel() const
Definition: G4Molecule.cc:539
void ChangeConfigurationToLabel(const G4String &label)
Definition: G4Molecule.cc:546
ITDef(G4Molecule) void Print() const
G4int GetMoleculeID() const
Definition: G4Molecule.cc:467
G4double GetKineticEnergy() const
Definition: G4Molecule.cc:416
const G4String & GetFormatedName() const
Definition: G4Molecule.cc:345
virtual G4ITType GetITSubType() const
Definition: G4Molecule.hh:130
G4int GetAtomsNumber() const
Definition: G4Molecule.cc:352
G4bool operator==(const G4Molecule &right) const
Definition: G4Molecule.cc:122
G4int GetFakeParticleID() const
Definition: G4Molecule.cc:460
void SetMass(G4double)
void SetVanDerVaalsRadius(G4double)
G4double GetDiffusionVelocity() const
Definition: G4Molecule.cc:428
void PrintState() const
Definition: G4Molecule.cc:366
void SetDecayTime(G4double)
const G4String & GetName() const
Definition: G4Molecule.cc:338
const G4MolecularConfiguration * fpMolecularConfiguration
Definition: G4Molecule.hh:292
G4Track * BuildTrack(G4double globalTime, const G4ThreeVector &Position)
Definition: G4Molecule.cc:373
void ExciteMolecule(G4int)
Definition: G4Molecule.cc:301
G4bool operator!=(const G4Molecule &right) const
Definition: G4Molecule.cc:133
void SetDiffusionCoefficient(G4double)
const G4ElectronOccupancy * GetElectronOccupancy() const
Definition: G4Molecule.cc:502
G4Molecule & operator=(const G4Molecule &right)
Definition: G4Molecule.cc:113
const G4MoleculeDefinition * GetDefinition() const
Definition: G4Molecule.cc:509
G4double GetDiffusionCoefficient() const
Definition: G4Molecule.cc:516
G4double GetDecayTime() const
Definition: G4Molecule.cc:474
void SetLabel(const G4String &label)
const std::vector< const G4MolecularDissociationChannel * > * GetDissociationChannels() const
Definition: G4Molecule.cc:453
G4double GetNbElectrons() const
Definition: G4Molecule.cc:359