G4Molecule.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // Contact: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
00027 //
00028 // WARNING : This class is released as a prototype.
00029 // It might strongly evolve or even disapear in the next releases.
00030 //
00031 // ---------------------------------------------------------------------
00032 //      GEANT 4 class header file
00033 //
00034 //      History: first implementation, based on G4DynamicParticle
00035 //           New dependency : G4VUserTrackInformation
00036 //
00037 //      ---------------- G4Molecule  ----------------
00038 //      first design&implementation by Alfonso Mantero, 7 Apr 2009
00039 //      New developments Alfonso Mantero & Mathieu Karamitros
00040 //      Oct/Nov 2009 Class Name changed to G4Molecule
00041 //                   Removed dependency from G4DynamicParticle
00042 //                   New constructors :
00043 //                    copy constructor
00044 //                    direct ionized/excited molecule
00045 //                   New methods :
00046 //                    Get : name,atoms' number,nb electrons,decayChannel
00047 //                    PrintState //To get the electronic level and the
00048 //                                 corresponding name of the excitation
00049 //                    Kinematic :
00050 //                    BuildTrack,GetKineticEnergy,GetDiffusionVelocity
00051 //                    Change the way dynCharge and eNb is calculated
00052 // ---------------------------------------------------------------------
00053 
00054 #ifndef G4Molecule_h
00055 #define G4Molecule_h 1
00056 
00057 #include "G4IT.hh"
00058 #include "G4Allocator.hh"
00059 #include "G4MoleculeDefinition.hh"
00060 
00061 class G4Molecule;
00062 class G4MolecularConfiguration;
00063 class G4MoleculeDefinition;
00064 class G4MolecularDecayChannel;
00065 class G4DynamicParticle;
00066 
00067 G4Molecule* GetMolecule(const G4Track& track) ;
00068 G4Molecule* GetMolecule(const G4Track* track) ;
00069 
00076 class G4Molecule : public G4IT
00077 {
00078 
00079 public: // With Description
00080 
00081     ITDef(G4Molecule)
00082 
00083     //From G4VUserTrackInformation
00084     void Print() const;
00085 
00086     //  new/delete operators are overloded to use G4Allocator
00087     inline void *operator new(size_t);
00088 #ifdef __IBMCPP__
00089     inline void *operator new(size_t sz, void* p) { return p; }
00090 #endif
00091     inline void operator delete(void *aVUserTrackInformation);
00092 
00093     G4Molecule(const G4Molecule&);
00094     G4Molecule & operator=(const G4Molecule &right);
00095     G4bool operator==(const G4Molecule &right) const;
00096     G4bool operator!=(const G4Molecule &right) const;
00097     G4bool operator<(const G4Molecule &right) const;
00098 
00099 private :
00100     bool CompareElectronOccupancy (const G4ElectronOccupancy* /*elecOccupancy2*/,
00101                                    const G4int& /*totalOcc1*/, const G4int& /*totalOcc2*/) const;
00102 
00103 public:
00104     //------ Constructors --------------------------
00108     G4Molecule(G4MoleculeDefinition * molecule);
00109 
00113     G4Molecule(G4MoleculeDefinition * molecule, G4int, G4int);
00114 
00119     G4Molecule(G4MoleculeDefinition * molecule, G4int, G4bool);
00120 
00121     virtual ~G4Molecule();
00122 
00123     //-------- Methods -------------------------------
00124     //Get from static definition
00127     const G4String& GetName() const;
00128 
00131     G4int GetAtomsNumber() const;
00132 
00136     void SetElectronOccupancy(const G4ElectronOccupancy*);
00137 
00140     void ExciteMolecule(G4int);
00141 
00144     void IonizeMolecule(G4int);
00145 
00150     void AddElectron(G4int orbit, G4int n =1);
00151 
00154     void RemoveElectron(G4int,G4int number=1);
00155 
00158     void MoveOneElectron(G4int /*orbit*/,G4int /*orbit*/);
00159 
00162     G4double GetNbElectrons() const; //This method can be used to check if the electron s number is physical
00163 
00166     void PrintState() const;
00167 
00168     G4Track * BuildTrack(G4double globalTime, const G4ThreeVector& Position);
00169 
00170     G4double GetKineticEnergy() const;
00171 
00172     G4double GetDiffusionVelocity() const;
00173 
00174     const std::vector <const G4MolecularDecayChannel*>* GetDecayChannel() const;
00175 
00176     G4int GetMoleculeID() const;
00177 
00178     //-------------Inline functions ---------------------
00182     const G4MoleculeDefinition* GetDefinition() const;
00183 
00184     //methods to set/get changing parameters
00185 
00187 
00192     void SetDiffusionCoefficient(G4double);
00193 
00196     G4double GetDiffusionCoefficient() const;
00197 
00200     void SetDecayTime(G4double);
00201 
00204     G4double GetDecayTime() const;
00205 
00208     void SetVanDerVaalsRadius(G4double);
00209     G4double GetVanDerVaalsRadius() const ;
00210 
00214     const G4ElectronOccupancy* GetElectronOccupancy() const;
00215 
00218     G4int GetCharge() const;
00219 
00222     void SetMass(G4double);
00223 
00226     G4double GetMass() const;
00228 
00229     inline G4MolecularConfiguration* GetMolecularConfiguration() ;
00230 
00231     inline static void SetGlobalTemperature(double);
00232     inline static double GetGlobalTemperature();
00233 
00234 private:
00237     G4Molecule();
00238 
00239     void Init();
00240     G4DynamicParticle* fDynamicParticle;
00241 
00242     G4MolecularConfiguration* fMolecularConfiguration;
00243 
00244     static double fgTemperature;
00245 };
00246 
00247 
00248 #if defined G4EM_ALLOC_EXPORT
00249 extern G4DLLEXPORT G4Allocator<G4Molecule> aMoleculeAllocator;
00250 #else
00251 extern G4DLLIMPORT G4Allocator<G4Molecule> aMoleculeAllocator;
00252 #endif
00253 
00254 
00256 inline void * G4Molecule::operator new(size_t)
00258 {
00259     void * aMolecule;
00260     aMolecule = (void *) aMoleculeAllocator.MallocSingle();
00261     return aMolecule;
00262 }
00263 
00265 inline void G4Molecule::operator delete(void * aMolecule)
00267 {
00268     // DEBUG
00269     // G4cout<<"G4Molecule::operator delete(void * aMolecule) called"<<G4endl;
00270     aMoleculeAllocator.FreeSingle((G4Molecule *) aMolecule);
00271 }
00272 
00273 inline G4MolecularConfiguration* G4Molecule::GetMolecularConfiguration()
00274 {
00275     return fMolecularConfiguration ;
00276 }
00277 
00278 inline void G4Molecule::SetGlobalTemperature(double temperature)
00279 {
00280     fgTemperature = temperature;
00281 }
00282 
00283 inline double G4Molecule::GetGlobalTemperature()
00284 {
00285     return fgTemperature;
00286 }
00287 
00288 #endif

Generated on Mon May 27 17:48:53 2013 for Geant4 by  doxygen 1.4.7