Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:41

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // Contact: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
0027 //
0028 // WARNING : This class is released as a prototype.
0029 // It might strongly evolve or even disapear in the next releases.
0030 //
0031 // ----------------------------------------------------------------------
0032 //      GEANT 4 class implementation file
0033 //
0034 //      21 Oct 2009 first implementation by A. Mantero and M.Karamitros
0035 //                  Based on prototype of A.Mantero
0036 // **********************************************************************
0037 //
0038 // Author: Mathieu Karamitros
0039 
0040 // The code is developed in the framework of the ESA AO7146
0041 //
0042 // We would be very happy hearing from you, send us your feedback! :)
0043 //
0044 // In order for Geant4-DNA to be maintained and still open-source,
0045 // article citations are crucial. 
0046 // If you use Geant4-DNA chemistry and you publish papers about your software, 
0047 // in addition to the general paper on Geant4-DNA:
0048 //
0049 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
0050 //
0051 // we would be very happy if you could please also cite the following
0052 // reference papers on chemistry:
0053 //
0054 // J. Comput. Phys. 274 (2014) 841-882
0055 // Prog. Nucl. Sci. Tec. 2 (2011) 503-508 
0056 
0057 #ifndef G4MoleculeDefinition_h
0058 #define G4MoleculeDefinition_h 1
0059 
0060 #include "globals.hh"
0061 #include "G4ParticleDefinition.hh"
0062 #include "G4ios.hh"
0063 #include "G4ElectronOccupancy.hh"
0064 #include "G4MolecularDissociationTable.hh"
0065 #include "G4MolecularDissociationChannel.hh"
0066 #include "G4FakeParticleID.hh"
0067 
0068 class G4MolecularDissociationChannel;
0069 class G4MolecularDissociationTable;
0070 class G4MolecularConfiguration;
0071 
0072 // -----------------------------------------------------------------------------
0073 // ###                          MoleculeDefinition                           ###
0074 // -----------------------------------------------------------------------------
0075 
0076 class G4MoleculeDefinition: public G4ParticleDefinition
0077 {
0078 public:
0079   G4MoleculeDefinition(const G4String& name,
0080                        G4double mass,
0081                        G4double diffCoeff,
0082                        G4int charge = 0,
0083                        G4int electronicLevels = 0,
0084                        G4double radius = -1,
0085                        G4int atomsNumber = -1,
0086                        G4double lifetime = -1,
0087                        G4String aType = "",
0088                        G4FakeParticleID ID = G4FakeParticleID::Create());
0089 
0090   ~G4MoleculeDefinition() override;
0091 
0092   G4MoleculeDefinition(const G4MoleculeDefinition&) = delete;
0093   G4MoleculeDefinition& operator=(const G4MoleculeDefinition&) = delete;
0094 
0095   // Set the electronic configuration at ground level
0096   void SetLevelOccupation(G4int,
0097                           G4int eNb = 2);
0098   // set the occupation(0(def), 1 or 2) of the level specified
0099   //(levels numbering starts from 0)
0100 
0101   //methods to set/get diffusion properties
0102   inline void SetDiffusionCoefficient(G4double);
0103   inline G4double GetDiffusionCoefficient() const;
0104 
0105   inline void SetAtomsNumber(G4int);
0106   inline G4int GetAtomsNumber() const;
0107 
0108   inline void SetVanDerVaalsRadius(G4double);
0109   inline G4double GetVanDerVaalsRadius() const;
0110 
0111   //____________________________________________________________________________
0112   // Create more molecular configurations for this molecule definition
0113   // Other ways : through G4MolecularTable
0114 
0115   // Note: the userID of the created molecule configuration will be:
0116   //       MoleculeDefinationName_excitedStateLabel
0117   G4MolecularConfiguration*
0118   NewConfiguration(const G4String& excitedStateLabel);
0119 
0120   G4MolecularConfiguration*
0121   NewConfigurationWithElectronOccupancy(const G4String& excitedStateLabel,
0122                                         const G4ElectronOccupancy&,
0123                                         double decayTime = 0.);
0124 
0125   G4MolecularConfiguration*
0126   GetConfigurationWithLabel(const G4String& molecularConfLabel);
0127 
0128   //____________________________________________________________________________
0129   // Build the decay table
0130   // Version 1
0131 
0132   void AddDecayChannel(const G4MolecularConfiguration* molConf,
0133                        const G4MolecularDissociationChannel* channel);
0134 
0135   // Version 2
0136 
0137   void AddDecayChannel(const G4String& molecularConfLabel,
0138                        const G4MolecularDissociationChannel* channel);
0139 
0140   //____________________________________________________________________________
0141   // "Get" methods related to decay
0142 
0143   const std::vector<const G4MolecularDissociationChannel*>*
0144     GetDecayChannels(const G4MolecularConfiguration*) const;
0145   const std::vector<const G4MolecularDissociationChannel*>*
0146     GetDecayChannels(const G4String&) const;
0147 
0148   inline const G4MolecularDissociationTable* GetDecayTable() const;
0149   inline G4MolecularDissociationTable* GetDecayTable();
0150   inline G4double GetDecayTime() const;
0151 
0152   //____________________________________________________________________________
0153   // General "Get" methods
0154   inline const G4ElectronOccupancy* GetGroundStateElectronOccupancy() const;
0155   inline G4int GetCharge() const;
0156   inline const G4String& GetName() const;
0157   inline G4double GetMass() const;
0158   inline const G4String& GetType() const;
0159   inline G4int GetNbElectrons() const;
0160   inline G4int GetNbMolecularShells() const;
0161 
0162   inline const G4String& GetFormatedName() const
0163   {
0164     return fFormatedName;
0165   }
0166 
0167   //____________________________________________________________________________
0168   inline void SetFormatedName(const G4String& name)
0169   {
0170     fFormatedName = name;
0171   }
0172 
0173   void Finalize();
0174 
0175   static G4MoleculeDefinition* Load(std::istream&);
0176   void Serialize(std::ostream&);
0177 
0178 protected:
0179   G4MoleculeDefinition();
0180 
0181 private:
0182   G4int fCharge;
0183 
0184   // Diffusion Coefficient in one medium only
0185   // Note : For the time being, we will consider only one diffusion
0186   // coefficient for the all simulation => diffusion in one medium only
0187   // If the user needs to use the diffusion in different materials,
0188   // she/he should contact the developers/maintainers of this package
0189   G4double fDiffusionCoefficient;
0190 
0191   G4int fAtomsNb;
0192   G4double fVanDerVaalsRadius;
0193 
0194   G4String fFormatedName;
0195 
0196   G4ElectronOccupancy* fElectronOccupancy;
0197   G4MolecularDissociationTable* fDecayTable;
0198 };
0199 
0200 inline void G4MoleculeDefinition::SetDiffusionCoefficient(G4double value)
0201 {
0202   fDiffusionCoefficient = value;
0203 }
0204 
0205 inline G4double G4MoleculeDefinition::GetDiffusionCoefficient() const
0206 {
0207   return fDiffusionCoefficient;
0208 }
0209 
0210 inline G4int G4MoleculeDefinition::GetCharge() const
0211 {
0212   return fCharge;
0213 }
0214 
0215 inline G4double G4MoleculeDefinition::GetDecayTime() const
0216 {
0217   return GetPDGLifeTime();
0218 }
0219 
0220 inline void G4MoleculeDefinition::SetAtomsNumber(G4int val)
0221 {
0222   fAtomsNb = val;
0223 }
0224 
0225 inline G4int G4MoleculeDefinition::GetAtomsNumber() const
0226 {
0227   return fAtomsNb;
0228 }
0229 
0230 inline void G4MoleculeDefinition::SetVanDerVaalsRadius(G4double val)
0231 {
0232   fVanDerVaalsRadius = val;
0233 }
0234 
0235 inline G4double G4MoleculeDefinition::GetVanDerVaalsRadius() const
0236 {
0237   return fVanDerVaalsRadius;
0238 }
0239 
0240 inline const G4ElectronOccupancy* G4MoleculeDefinition::GetGroundStateElectronOccupancy() const
0241 {
0242   return fElectronOccupancy;
0243 }
0244 
0245 inline const G4String& G4MoleculeDefinition::GetName() const
0246 {
0247 
0248   return GetParticleName();
0249 }
0250 
0251 inline G4double G4MoleculeDefinition::GetMass() const
0252 {
0253   return GetPDGMass();
0254 }
0255 
0256 inline const G4String& G4MoleculeDefinition::GetType() const
0257 {
0258   return GetParticleSubType();
0259 }
0260 
0261 inline G4int G4MoleculeDefinition::GetNbElectrons() const
0262 {
0263   if (fElectronOccupancy != nullptr)
0264   {
0265     return fElectronOccupancy->GetTotalOccupancy();
0266   }
0267 
0268   return 0;
0269   //    return fNbOfElectrons;
0270 }
0271 
0272 inline G4int G4MoleculeDefinition::GetNbMolecularShells() const
0273 {
0274   if (fElectronOccupancy != nullptr)
0275   {
0276     return fElectronOccupancy->GetSizeOfOrbit();
0277   }
0278 
0279   return 0;
0280 }
0281 
0282 inline const G4MolecularDissociationTable* G4MoleculeDefinition::GetDecayTable() const
0283 {
0284   return fDecayTable;
0285 }
0286 
0287 inline G4MolecularDissociationTable* G4MoleculeDefinition::GetDecayTable()
0288 {
0289   return fDecayTable;
0290 }
0291 #endif
0292