Geant4-11
G4DNAScavengerMaterial.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
27#ifndef G4DNASCAVENGERMATERIAL_HH
28#define G4DNASCAVENGERMATERIAL_HH
29#include "globals.hh"
30#include "G4ios.hh"
31#include <map>
32#include <vector>
33#include "G4MoleculeCounter.hh"
35class G4Material;
38
40 std::map<G4double, G4int, G4::MoleculeCounter::TimePrecision>;
41
43{
44 public:
46 using MaterialMap = std::map<MolType, G4double>;
47 using ReactantList = std::vector<MolType>;
48 using CounterMapType = std::map<MolType, NbMoleculeAgainstTime>;
51 ~G4DNAScavengerMaterial() override = default;
54 void Initialize();
55
59
61 const G4ThreeVector* position = nullptr,
62 G4int number = 1);
64 const G4ThreeVector* position = nullptr,
65 G4int number = 1);
66
67 void Reset() override;
68
69 void PrintInfo();
70
71 MaterialMap::iterator end() { return fScavengerTable.end(); }
72 MaterialMap::iterator begin() { return fScavengerTable.begin(); }
73 size_t size() { return fScavengerTable.size(); }
74
76 {
77 auto it = fScavengerTable.find(type);
78 if(it != fScavengerTable.end())
79 {
80 return it->second > 0;
81 }
82 else
83 {
84 return false;
85 }
86 }
87
89
90 std::vector<MolType> GetScavengerList() const
91 {
92 std::vector<MolType> output;
93 for(const auto& it : fScavengerTable)
94 {
95 output.push_back(it.first);
96 }
97 return output;
98 }
99
100 void Dump();
102 G4bool SearchTimeMap(MolType molecule);
103 G4int SearchUpperBoundTime(G4double time, G4bool sameTypeOfMolecule);
104
105 private:
108 std::map<MolType, G4double> fScavengerTable;
112 struct Search
113 {
114 Search() { fLowerBoundSet = false; }
115 CounterMapType::iterator fLastMoleculeSearched;
116 NbMoleculeAgainstTime::iterator fLowerBoundTime;
118 };
119
120 std::unique_ptr<Search> fpLastSearch;
121};
122#endif // G4DNASCAVENGERMATERIAL_HH
std::map< G4double, G4int, G4::MoleculeCounter::TimePrecision > NbMoleculeAgainstTime
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4double GetNumberMoleculePerVolumeUnitForMaterialConf(MolType) const
MaterialMap::iterator end()
G4DNAScavengerMaterial & operator=(const G4DNAScavengerMaterial &)=delete
G4int SearchUpperBoundTime(G4double time, G4bool sameTypeOfMolecule)
std::vector< MolType > GetScavengerList() const
void ReduceNumberMoleculePerVolumeUnitForMaterialConf(MolType, G4double)
~G4DNAScavengerMaterial() override=default
void AddAMoleculeAtTime(MolType, G4double time, const G4ThreeVector *position=nullptr, G4int number=1)
std::map< MolType, G4double > fScavengerTable
MaterialMap::iterator begin()
std::vector< MolType > ReactantList
void AddNumberMoleculePerVolumeUnitForMaterialConf(MolType, G4double)
G4DNAScavengerMaterial()=default
std::map< MolType, G4double > MaterialMap
G4bool SearchTimeMap(MolType molecule)
G4VChemistryWorld * fpChemistryInfo
std::unique_ptr< Search > fpLastSearch
G4int GetNMoleculesAtTime(MolType molecule, G4double time)
void RemoveAMoleculeAtTime(MolType, G4double time, const G4ThreeVector *position=nullptr, G4int number=1)
std::map< MolType, NbMoleculeAgainstTime > CounterMapType
G4DNAScavengerMaterial(const G4DNAScavengerMaterial &right)=delete
const G4MolecularConfiguration * MolType
CounterMapType::iterator fLastMoleculeSearched
NbMoleculeAgainstTime::iterator fLowerBoundTime