Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DNAMaterialManager.cc
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// 1/2/2023: Hoang: this file is used to check available DNA materials,
27// and keeps DNA cross sections.
28
30#include "G4StateManager.hh"
31#include "G4Threading.hh"
32#include "G4AutoLock.hh"
33#include "G4NistManager.hh"
34
35G4DNAMaterialManager *G4DNAMaterialManager::theInstance = nullptr;
36
37namespace {
38 G4Mutex MaterialMutex = G4MUTEX_INITIALIZER;
39}
40
42 if (nullptr == theInstance) {
43 G4AutoLock l(&MaterialMutex);
44 if (nullptr == theInstance) {
45 static G4DNAMaterialManager manager;
46 theInstance = &manager;
47 }
48 l.unlock();
49 }
50 return theInstance;
51}
52
53G4DNAMaterialManager::G4DNAMaterialManager() {
55 fStateManager = G4StateManager::GetStateManager();
56}
57
59 return fData[t];
60}
61
63 fData[t] = m;
64}
65
#define G4MUTEX_INITIALIZER
std::mutex G4Mutex
bool G4bool
Definition G4Types.hh:86
static G4DNAMaterialManager * Instance()
void SetMasterDataModel(const DNAModelType &t, G4VEmModel *m)
G4VEmModel * GetModel(const DNAModelType &t)
static G4NistManager * Instance()
static G4StateManager * GetStateManager()
G4bool IsMasterThread()