19#include <G4AnalysisUtilities.hh>
20#include <G4LogicalVolume.hh>
21#include <G4LogicalVolumeStore.hh>
22#include <G4Material.hh>
28G4Mutex createBiasingOperatorMutex = G4MUTEX_INITIALIZER;
34 const G4String& name,
const G4String& availableModels)
40 G4cout <<
"TG4BiasingManager::TG4BiasingManager" << G4endl;
60 G4cout <<
"TG4BiasingManager::CreateBiasingOperator" << G4endl;
76 G4AutoLock lm(&createBiasingOperatorMutex);
84 std::vector<G4String> particlesVector;
87 G4Analysis::Tokenize(modelConfiguration->
GetParticles(), particlesVector);
94 for (
auto it = particlesVector.begin(); it != particlesVector.end(); it++) {
99 G4LogicalVolumeStore* lvStore = G4LogicalVolumeStore::GetInstance();
100 for (G4int i = 0; i < G4int(lvStore->size()); i++) {
101 G4LogicalVolume* lv = (*lvStore)[i];
102 G4String materialName = lv->GetMaterial()->GetName();
105 G4cout <<
"Biasing manager: processing volume " << lv->GetName()
106 <<
", material " << materialName << G4endl;
110 if (!modelConfiguration->
HasRegion(materialName)) {
112 G4cout <<
" Material " << materialName <<
" is not in selection"
119 biasingOperator->AttachTo(lv);
122 G4cout <<
"Biasing operator attached to lv " << lv->GetName() << G4endl;
125#ifdef G4MULTITHREADED
Definition of the TG4BiasingManager class.
Definition of the TG4BiasingOperator class.
Definition of the TG4ModelConfiguration class.
TG4BiasingManager(const G4String &name, const G4String &availableModels="")
void CreateBiasingOperator()
virtual ~TG4BiasingManager()
void AddParticle(G4String particleName)
The model configuration vector with suitable setters and a messenger.
const ModelConfigurationVector & GetVector() const
A helper class to hold a configuration of a special physics model.
const G4String & GetParticles() const
G4bool HasRegion(const G4String ®ionName)
virtual G4int VerboseLevel() const