Back to home page

EIC code displayed by LXR

 
 

    


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

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 //
0027 #ifndef G4DNAGillespieDirectMethod_hh
0028 #define G4DNAGillespieDirectMethod_hh 1
0029 #include "globals.hh"
0030 #include "G4DNAMesh.hh"
0031 #include "G4Track.hh"
0032 #include "G4Molecule.hh"
0033 #include "G4MolecularConfiguration.hh"
0034 #include "G4MoleculeTable.hh"
0035 #include "G4ITTrackHolder.hh"
0036 #include "G4DNAEventSet.hh"
0037 class G4DNAMolecularReactionData;
0038 class G4DNAScavengerMaterial;
0039 class G4MolecularConfiguration;
0040 class G4ChemEquilibrium;
0041 class G4DNAGillespieDirectMethod
0042 {
0043  public:
0044   G4DNAGillespieDirectMethod();
0045   ~G4DNAGillespieDirectMethod();
0046   using MolType      = const G4MolecularConfiguration*;
0047   using Index        = G4VDNAMesh::Index;
0048   using Voxel        = G4DNAMesh::Voxel;
0049   using JumpingData  = std::pair<MolType, Index>;
0050   using ReactionData = const G4DNAMolecularReactionData;
0051   using EventIt      = G4DNAEventSet::EventSet::iterator;
0052 
0053   G4double PropensityFunction(const Voxel& voxel, ReactionData* data);
0054   G4double PropensityFunction(const Voxel& voxel, MolType moleType);
0055   inline void SetVoxelMesh(G4DNAMesh& mesh) { fpMesh = &mesh; }
0056   void SetTimeStep(const G4double& stepTime);
0057   void Initialize();
0058   void CreateEvent(const Index& index);
0059   void CreateEvents();
0060   void SetEventSet(G4DNAEventSet*);
0061   inline void SetVerbose(const G4int& verbose)
0062   {
0063       fVerbose = verbose;
0064   }
0065   G4bool SetEquilibrium(const G4DNAMolecularReactionData* pReaction);
0066   void ResetEquilibrium();
0067 
0068 
0069  private:
0070   G4double Reaction(const Voxel& voxel);
0071   G4double DiffusiveJumping(const Voxel& voxel);
0072   G4double ComputeNumberInNode(const Voxel& voxel, MolType type);
0073   G4double VolumeOfNode(const Voxel& voxel);
0074   G4DNAMolecularReactionTable* fMolecularReactions;
0075   G4DNAMesh* fpMesh = nullptr;
0076   G4double fTimeStep = DBL_MAX;
0077   G4DNAEventSet* fpEventSet = nullptr;
0078   G4double fVerbose         = 0;
0079   std::map<G4double /*Propensity*/, ReactionData*> fReactionDataMap;
0080   std::map<G4double /*Propensity*/, JumpingData> fJumpingDataMap;
0081   G4bool FindScavenging(const Voxel& voxel, MolType, G4double&);
0082   G4DNAScavengerMaterial* fpScavengerMaterial = nullptr;
0083   std::map<G4int,std::unique_ptr<G4ChemEquilibrium>> fEquilibriumProcesses;
0084   G4bool IsEquilibrium(const G4int& reactionType) const;
0085 
0086 };
0087 #endif