Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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{
41 public:
43 std::map<G4double, int64_t, G4::MoleculeCounter::TimePrecision>;
45 using MaterialMap = std::map<MolType, int64_t>;
46 using ReactantList = std::vector<MolType>;
47 using CounterMapType = std::map<MolType, NbMoleculeInTime>;
50 ~G4DNAScavengerMaterial() override = default;
53 void Initialize();
54
58
60 const G4ThreeVector* position = nullptr,
61 G4int number = 1);
63 const G4ThreeVector* position = nullptr,
64 G4int number = 1);
65
66 void Reset() override;
67
68 void PrintInfo();
69
70 MaterialMap::iterator end() { return fScavengerTable.end(); }
71 MaterialMap::iterator begin() { return fScavengerTable.begin(); }
72 size_t size() { return fScavengerTable.size(); }
73
75 {
76 auto it = fScavengerTable.find(type);
77 if(it != fScavengerTable.end())
78 {
79 return it->second > 0;
80 }
81 else
82 {
83 return false;
84 }
85 }
86
87 void SetCounterAgainstTime() { fCounterAgainstTime = true; }
88
89 std::vector<MolType> GetScavengerList() const
90 {
91 std::vector<MolType> output;
92 for(const auto& it : fScavengerTable)
93 {
94 output.push_back(it.first);
95 }
96 return output;
97 }
98
99 void Dump();
100 int64_t GetNMoleculesAtTime(MolType molecule, G4double time);
101 G4bool SearchTimeMap(MolType molecule);
102 int64_t SearchUpperBoundTime(G4double time, G4bool sameTypeOfMolecule);
103
104 private:
105 G4VChemistryWorld* fpChemistryInfo;
106 G4bool fIsInitialized;
107 MaterialMap fScavengerTable;
108 CounterMapType fCounterMap;
109 G4bool fCounterAgainstTime;
110 G4int fVerbose;
111 struct Search
112 {
113 Search() { fLowerBoundSet = false; }
114 CounterMapType::iterator fLastMoleculeSearched;
115 NbMoleculeInTime::iterator fLowerBoundTime;
116 G4bool fLowerBoundSet;
117 };
118
119 std::unique_ptr<Search> fpLastSearch;
120};
121#endif // G4DNASCAVENGERMATERIAL_HH
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
std::map< G4double, int64_t, G4::MoleculeCounter::TimePrecision > NbMoleculeInTime
G4double GetNumberMoleculePerVolumeUnitForMaterialConf(MolType) const
MaterialMap::iterator end()
int64_t SearchUpperBoundTime(G4double time, G4bool sameTypeOfMolecule)
G4DNAScavengerMaterial & operator=(const G4DNAScavengerMaterial &)=delete
std::vector< MolType > GetScavengerList() const
std::map< MolType, NbMoleculeInTime > CounterMapType
void ReduceNumberMoleculePerVolumeUnitForMaterialConf(MolType, G4double)
~G4DNAScavengerMaterial() override=default
void AddAMoleculeAtTime(MolType, G4double time, const G4ThreeVector *position=nullptr, G4int number=1)
MaterialMap::iterator begin()
std::map< MolType, int64_t > MaterialMap
int64_t GetNMoleculesAtTime(MolType molecule, G4double time)
std::vector< MolType > ReactantList
void AddNumberMoleculePerVolumeUnitForMaterialConf(MolType, G4double)
G4DNAScavengerMaterial()=default
G4bool SearchTimeMap(MolType molecule)
void RemoveAMoleculeAtTime(MolType, G4double time, const G4ThreeVector *position=nullptr, G4int number=1)
G4DNAScavengerMaterial(const G4DNAScavengerMaterial &right)=delete
const G4MolecularConfiguration * MolType