Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4VUserFastSimulation.cxx
Go to the documentation of this file.
1//------------------------------------------------
2// The Geant4 Virtual Monte Carlo package
3// Copyright (C) 2007 - 2015 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
14
16#include "TG4GeometryManager.h"
17#include "TG4Globals.h"
20
21#include <G4VFastSimulationModel.hh>
22
23//_____________________________________________________________________________
32
33//_____________________________________________________________________________
38
39//
40// protected methods
41//
42
43//_____________________________________________________________________________
44void TG4VUserFastSimulation::SetModel(const G4String& modelName)
45{
46 fFastModelsManager->SetModel(modelName);
47}
48
49//_____________________________________________________________________________
51 const G4String& modelName, const G4String& particles)
52{
53 fFastModelsManager->SetModelParticles(modelName, particles);
54}
55
56//_____________________________________________________________________________
58 const G4String& modelName, const G4String& regions)
59{
60 fFastModelsManager->SetModelRegions(modelName, regions);
61}
62
63//_____________________________________________________________________________
65 G4VFastSimulationModel* fastSimulationModel)
66{
68
69 // check that model configuration exists
70 TG4ModelConfiguration* modelConfiguration =
71 fFastModelsManager->GetModelConfiguration(fastSimulationModel->GetName());
72 if (!modelConfiguration) {
73 TString text = "The fast simulation model ";
74 text += fastSimulationModel->GetName().data();
75 text += " configuration was not found.";
76 TG4Globals::Warning("TG4VUserFastSimulation", "Register",
77 text + TG4Globals::Endl() +
78 TString("The model configuration has to set firts.") +
80 TString("/mcPhysics/fastSimulation/setModel command or SetModel() "
81 "function."));
82 return;
83 }
84
85 modelConfiguration->SetFastSimulationModel(fastSimulationModel);
86}
Definition of the TG4GeometryManager class.
Definition of the TG4Globals class and basic container types.
Definition of the TG4ModelConfigurationManager class.
Definition of the TG4ModelConfiguration class.
Definition of the TG4VUserFastSimulation class.
TG4ModelConfigurationManager * GetFastModelsManager() const
static TG4GeometryManager * Instance()
static void Warning(const TString &className, const TString &methodName, const TString &text)
static TString Endl()
Definition TG4Globals.h:100
void SetModelRegions(const G4String &modelName, const G4String &regionsMedia)
void SetModel(const G4String &modelName)
TG4ModelConfiguration * GetModelConfiguration(const G4String &modelName, G4bool warn=true) const
void SetModelParticles(const G4String &modelName, const G4String &particles)
A helper class to hold a configuration of a special physics model.
void SetFastSimulationModel(G4VFastSimulationModel *fastSimulationModel)
void SetModelParticles(const G4String &modelName, const G4String &particles)
Method to be utilized to apply fast simulation model to selected particles.
void SetModel(const G4String &modelName)
Method to be utilized to register each fast simulation model by name.
void SetModelRegions(const G4String &modelName, const G4String &regions)
Method to be utilized to apply fast simulation model to selected regions.
TG4ModelConfigurationManager * fFastModelsManager
the fast simulation models manager
void Register(G4VFastSimulationModel *fastSimulationModel)
Method to be utilized to register each fast simulation model.