G4DNAMolecularReactionTable.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 // $Id: G4DNAMolecularReactionTable.hh 64057 2012-10-30 15:04:49Z gcosmo $
00027 //
00028 // Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr) 
00029 //
00030 // WARNING : This class is released as a prototype.
00031 // It might strongly evolve or even disapear in the next releases.
00032 //
00033 // History:
00034 // -----------
00035 // 10 Oct 2011 M.Karamitros created
00036 //
00037 // -------------------------------------------------------------------
00038 
00039 #ifndef G4MolecularReactionTable_h
00040 #define G4MolecularReactionTable_h 1
00041 
00042 #include "G4ITReactionTable.hh"
00043 #include "G4Molecule.hh"
00044 #include <vector>
00045 #include <map>
00046 #include "G4ReferenceCast.hh"
00047 
00048 class G4VDNAReactionModel ;
00049 class G4DNAMolecularReactionTable;
00050 
00056 class G4DNAMolecularReactionData
00057 {
00058 public :
00059     G4DNAMolecularReactionData(G4double reactionRate,
00060                             const G4Molecule* reactive1,
00061                             const G4Molecule* reactive2);
00062     ~G4DNAMolecularReactionData();
00063 
00064     const G4Molecule* GetReactive1() const { return fReactive1.get(); }
00065     const G4Molecule* GetReactive2() const { return fReactive2.get(); }
00066 
00067     G4double GetReactionRate() const {return fReactionRate;}
00068     G4double GetReducedReactionRadius() const {return fReducedReactionRadius;}
00069 
00070     //_____________________________________________________
00071     void SetReactive1(const G4Molecule* reactive) ;
00072     void SetReactive2(const G4Molecule* reactive) ;
00073     void SetReactive(const G4Molecule* reactive1, const G4Molecule* reactive2);
00074     void AddProduct(const G4Molecule* molecule);
00075 
00076     G4int GetNbProducts() const
00077     {
00078         if(fProducts) return fProducts->size();
00079         return 0;
00080     }
00081 
00082     const G4Molecule* GetProduct(G4int i) const
00083     {
00084         if(fProducts) return (*fProducts)[i].get();
00085         return 0;
00086     }
00087 
00088 protected :
00089     G4DNAMolecularReactionData();
00090     G4MoleculeHandle fReactive1;
00091     G4MoleculeHandle fReactive2;
00092     G4double fReactionRate;
00093     G4double fReducedReactionRadius;
00094 
00095     std::vector<G4MoleculeHandle>* fProducts;
00096 };
00097 
00098 struct compMoleculeP
00099 {
00100     bool operator () (const G4Molecule* molecule1, const G4Molecule* molecule2) const
00101     {
00102         return *molecule1<*molecule2;
00103     }
00104 };
00105 
00111 class G4DNAMolecularReactionTable : public G4ITReactionTable
00112 {
00113 protected:
00114     G4DNAMolecularReactionTable();
00115     static G4DNAMolecularReactionTable* fInstance;
00116 
00117 public :
00118     static G4DNAMolecularReactionTable* GetReactionTable();
00119     static void DeleteInstance();
00120     virtual ~G4DNAMolecularReactionTable();
00121 
00131     void SetReaction(G4double observedReactionRate,
00132                      const G4Molecule* reactive1, const G4Molecule* reactive2);
00133 
00134     void SetReaction(G4DNAMolecularReactionData*);
00135 
00136     const G4DNAMolecularReactionData* GetReactionData(const G4Molecule*, const G4Molecule*) const;
00137 
00138     //_________________________________________________________________
00142     const std::vector<const G4Molecule*>* CanReactWith(const G4Molecule* aMolecule) const ;
00143     const std::map<const G4Molecule*, const G4DNAMolecularReactionData*, compMoleculeP>* GetReativesNData(const G4Molecule* aMolecule) const ;
00144     const std::vector<const G4DNAMolecularReactionData*>* GetReactionData(const G4Molecule*) const ;
00145 
00146     //_________________________________________________________________
00147     void PrintTable(G4VDNAReactionModel* = 0);
00148 
00149 protected :
00150     const G4MoleculeHandleManager* fMoleculeHandleManager;
00151     G4bool fVerbose;
00152 
00153     //_________________________________________________
00154     typedef std::map<const G4Molecule*,
00155                         std::map<const G4Molecule*,
00156                                  const G4DNAMolecularReactionData*,
00157                                  compMoleculeP>,
00158                     compMoleculeP > ReactionDataMap;
00159     typedef std::map<const G4Molecule*,std::vector<const G4Molecule*>,compMoleculeP> ReactivesMV ;
00160     typedef std::map<const G4Molecule*,std::vector<const G4DNAMolecularReactionData*>,compMoleculeP> ReactionDataMV ;
00161 
00162     ReactionDataMap fReactionData;
00163     ReactivesMV     fReactivesMV;
00164     ReactionDataMV  fReactionDataMV;
00165 };
00166 #endif /*G4MolecularReactionTable_HH*/
00167 

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