|
Geant4 VMC Version 6.8
|
Manager class for converting VMC cuts in energy in G4 regions. More...
#include <TG4RegionsManager.h>

Public Member Functions | |
| TG4RegionsManager () | |
| ~TG4RegionsManager () override=default | |
| void | DefineRegions () override |
| void | UpdateProductionCutsTable () override |
| void | CheckRegions () const override |
| void | PrintRegions (std::ostream &output) const override |
| void | LoadRegions () |
| void | DumpRegion (const G4String &volName) const |
| void | SetRangePrecision (G4int precision) |
| Set the precision for calculating ranges. | |
| void | SetEnergyTolerance (G4double tolerance) |
| Set the tolerance (relative) for comparing energy cut values. | |
| void | SetLoad (G4bool isLoad) |
| void | SetFromG4Table (G4bool isG4Table) |
| Set the option to print/save cuts from G4 table. | |
| G4int | GetRangePrecision () const |
| Return the precision for calculating ranges. | |
| G4double | GetEnergyTolerance () const |
| Return the tolerance (relative) for comparing energy cut values. | |
| G4String | GetFileName () const |
| G4bool | IsG4Table () const |
| Return the option to print or save regions from production cuts table. | |
| G4bool | IsLoad () const |
| Return the option to load regions ranges from a file. | |
| Public Member Functions inherited from TG4VRegionsManager | |
| TG4VRegionsManager () | |
| virtual | ~TG4VRegionsManager () |
| virtual void | SaveRegions () |
| virtual void | DumpRegionStore () const |
| void | SetFileName (const G4String &fileName) |
| Set the file name for regions output. | |
| void | SetApplyForGamma (G4bool applyForGamma) |
| Set the option to apply range cuts for gamma (default is true). | |
| void | SetApplyForElectron (G4bool applyForElectron) |
| Set the option to apply range cuts for e- (default is true). | |
| void | SetApplyForPositron (G4bool applyForPositron) |
| Set the option to apply range cuts for e+ (default is true). | |
| void | SetApplyForProton (G4bool applyForProton) |
| Set the option to apply range cuts for proton (default is true). | |
| void | SetCheck (G4bool isCheck) |
| Set the option to perform consistency check (by default false). | |
| void | SetPrint (G4bool isPrint) |
| Set the option to print all regions. | |
| void | SetSave (G4bool isSave) |
| Set the option to save all regions in a file. | |
| G4String | GetFileName () const |
| Return the file name for regions output. | |
| G4bool | GetApplyForGamma () const |
| Return the option to apply range cuts for gamma. | |
| G4bool | GetApplyForElectron () const |
| Return the option to apply range cuts for e+. | |
| G4bool | GetApplyForPositron () const |
| Return the option to apply range cuts for positron. | |
| G4bool | GetApplyForProton () const |
| Return the option to apply range cuts for proton. | |
| G4bool | IsCheck () const |
| Return the option to perform consistency check. | |
| G4bool | IsPrint () const |
| Return the option to print all regions. | |
| G4bool | IsSave () const |
| Return option to save all regions in a file. | |
| Public Member Functions inherited from TG4Verbose | |
| TG4Verbose (const G4String &cmdName) | |
| TG4Verbose (const G4String &cmdName, G4int verboseLevel) | |
| virtual | ~TG4Verbose () |
| virtual void | VerboseLevel (G4int level) |
| virtual G4int | VerboseLevel () const |
Private Types | |
| using | TG4RegionData = std::array<G4double, fgkValuesSize> |
Private Member Functions | |
| TG4RegionsManager (const TG4RegionsManager &right)=delete | |
| TG4RegionsManager & | operator= (const TG4RegionsManager &right)=delete |
| G4bool | Iterate (G4double energyCut, G4double &lowerCut, G4double &higherCut, G4double defaultRangeCut, G4double lowEdgeEnergy, G4double highEdgeEnergy, G4int nbin, std::map< G4double, G4double > &map, std::map< G4double, G4double >::const_iterator &it, G4Material *material, G4VRangeToEnergyConverter &converter) const |
| std::pair< G4double, G4double > | ConvertEnergyToRange (G4double energyCut, G4Material *material, G4VRangeToEnergyConverter &converter, G4double defaultRangeValue) const |
| std::pair< G4double, G4double > | GetRangeCut (G4double energyCut, G4Material *material, G4VRangeToEnergyConverter &converter, G4double defaultRangeValue) const |
| void | CheckRegionsRanges () const |
| void | PrintFromMap (std::ostream &output) const |
Private Attributes | |
| TG4RegionsMessenger | fMessenger |
| messenger | |
| G4int | fRangePrecision = fgkDefaultRangePrecision |
| the precision for calculating ranges | |
| G4double | fEnergyTolerance = fgkDefaultEnergyTolerance |
| the tolerance (relative) for comparing energy cut values | |
| G4bool | fIsG4Table = false |
| option to print or save regions from G4 production cuts table | |
| G4bool | fIsLoad = false |
| option to load regions ranges from a file | |
| std::map< G4String, TG4RegionData > | fRegionData |
| map for computed or loaded regions data | |
Static Private Attributes | |
| static constexpr G4int | fgkDefaultRangePrecision = 5 |
| the default precision for calculating ranges | |
| static constexpr G4double | fgkDefaultEnergyTolerance = 0.01 |
| the default tolerance (relative) for comparing energy cut values | |
| static constexpr G4int | fgkNofBins = 10 |
| the number of bins for search range iteration | |
| static constexpr G4int | fgkMinRangeOrder = -3 |
| the minimum range order | |
| static constexpr G4int | fgkMaxRangeOrder = 6 |
| the maximum range order | |
Additional Inherited Members | |
| Static Public Member Functions inherited from TG4VRegionsManager | |
| static TG4VRegionsManager * | Instance () |
| Return the singleton instance. | |
| Protected Types inherited from TG4VRegionsManager | |
| using | TG4RegionData = std::array<G4double, fgkValuesSize> |
| Protected Member Functions inherited from TG4VRegionsManager | |
| TG4VRegionsManager (const TG4VRegionsManager &right)=delete | |
| TG4VRegionsManager & | operator= (const TG4VRegionsManager &right)=delete |
| G4double | GetGlobalEnergyCut (TG4G3Cut cutType) const |
| G4double | GetEnergyCut (TG4Limits *limits, TG4G3Cut cutType, G4double globalCutValue) const |
| G4bool | IsCoupleUsedInTheRegion (const G4MaterialCutsCouple *couple, const G4Region *region) const |
| void | CheckRegionsInGeometry () const |
| void | PrintLegend (std::ostream &output) const |
| void | PrintRegionData (std::ostream &output, const G4String &matName, const TG4RegionData &values) const |
| void | PrintFromG4Table (std::ostream &output) const |
| Protected Attributes inherited from TG4VRegionsManager | |
| G4String | fFileName |
| file name for regions output | |
| G4bool | fApplyForGamma = true |
| option to apply cuts for gamma (default is true) | |
| G4bool | fApplyForElectron = true |
| option to apply cuts for e- (default is true) | |
| G4bool | fApplyForPositron = true |
| option to apply cuts for e+ (default is true) | |
| G4bool | fApplyForProton = true |
| option to apply cuts for proton (default is true) | |
| G4bool | fIsCheck = false |
| option to perform consistency check (by default false) | |
| G4bool | fIsPrint = false |
| option to print all regions | |
| G4bool | fIsSave = false |
| option to save all regions in a file | |
| Static Protected Attributes inherited from TG4VRegionsManager | |
| static constexpr size_t | fgkRangeGamIdx = 0 |
| static constexpr size_t | fgkRangeEleIdx = 1 |
| static constexpr size_t | fgkCutGamIdx = 2 |
| static constexpr size_t | fgkCutEleIdx = 3 |
| static constexpr size_t | fgkVmcCutGamIdx = 4 |
| static constexpr size_t | fgkVmcCutEleIdx = 5 |
| static constexpr size_t | fgkValuesSize = 6 |
| static TG4VRegionsManager * | fgInstance = nullptr |
| the singleton instance | |
| static const G4String | fgkDefaultRegionName |
| the name of the region with default cuts | |
| static const G4String | fgkDefaultFileName = "regions.dat" |
| the name of the region with default cuts | |
Manager class for converting VMC cuts in energy in G4 regions.
The VMC cuts in energy can be defined via the following TVirtulaMC functions:
The TG4RegionsManager class defined regions with cuts in range corresponding to the VMC energy cuts set by user following these rules:
By default, the computed range cut for e- is applied also to e+ and proton. This feature can be switched off by the UI commands:
User can select several levels of verbosity; the following information is then printed:
Definition at line 77 of file TG4RegionsManager.h.
|
private |
Definition at line 106 of file TG4RegionsManager.h.
| TG4RegionsManager::TG4RegionsManager | ( | ) |
Definition at line 44 of file TG4RegionsManager.cxx.
Referenced by TG4RunManager::ConfigureRunManager(), operator=(), and TG4RegionsManager().
|
overridedefault |
|
privatedelete |
|
overridevirtual |
Apply cuts defined in tracking media
Implements TG4VRegionsManager.
Definition at line 336 of file TG4RegionsManager.cxx.
Referenced by ~TG4RegionsManager().
|
inlineoverridevirtual |
Implements TG4VRegionsManager.
Definition at line 85 of file TG4RegionsManager.h.
|
overridevirtual |
Perform two checks:
Reimplemented from TG4VRegionsManager.
Definition at line 580 of file TG4RegionsManager.cxx.
|
overridevirtual |
Print regions from data map or the production cuts table.
Reimplemented from TG4VRegionsManager.
Definition at line 566 of file TG4RegionsManager.cxx.
| void TG4RegionsManager::LoadRegions | ( | ) |
Load all regions ranges from the input file.
Definition at line 591 of file TG4RegionsManager.cxx.
Referenced by DefineRegions().
| void TG4RegionsManager::DumpRegion | ( | const G4String & | volName | ) | const |
Dump region properties for volume with given name
Definition at line 679 of file TG4RegionsManager.cxx.
|
inline |
Set the precision for calculating ranges.
Definition at line 161 of file TG4RegionsManager.h.
Referenced by TG4RegionsMessenger::SetNewValue().
|
inline |
Set the tolerance (relative) for comparing energy cut values.
Definition at line 168 of file TG4RegionsManager.h.
Referenced by TG4RegionsMessenger::SetNewValue().
| void TG4RegionsManager::SetLoad | ( | G4bool | isLoad | ) |
Set the option to load regions ranges from a file.
Definition at line 757 of file TG4RegionsManager.cxx.
Referenced by TG4RegionsMessenger::SetNewValue().
|
inline |
Set the option to print/save cuts from G4 table.
Definition at line 175 of file TG4RegionsManager.h.
Referenced by TG4RegionsMessenger::SetNewValue().
|
inline |
Return the precision for calculating ranges.
Definition at line 181 of file TG4RegionsManager.h.
|
inline |
Return the tolerance (relative) for comparing energy cut values.
Definition at line 187 of file TG4RegionsManager.h.
| G4String TG4RegionsManager::GetFileName | ( | ) | const |
|
inline |
Return the option to print or save regions from production cuts table.
Definition at line 193 of file TG4RegionsManager.h.
Referenced by GetFileName().
|
inline |
Return the option to load regions ranges from a file.
Definition at line 197 of file TG4RegionsManager.h.
Referenced by GetFileName().
|
privatedelete |
|
private |
Helper function called from ConvertEnergyToRange() in each iteration
Definition at line 53 of file TG4RegionsManager.cxx.
Referenced by ConvertEnergyToRange(), and operator=().
|
private |
Estimate cut in range for given cut in energy. Return negative value if range cut is not fount.
Definition at line 101 of file TG4RegionsManager.cxx.
Referenced by GetRangeCut(), and operator=().
|
private |
Convert energy cuts in range cuts; return defaultRangeCut, if found value is smaller than default
Definition at line 204 of file TG4RegionsManager.cxx.
Referenced by DefineRegions(), and operator=().
|
private |
Loop over region data map and check if the calculated cuts are consistent with the energy cuts defined in limits
Definition at line 272 of file TG4RegionsManager.cxx.
Referenced by CheckRegions(), and operator=().
|
private |
Loop over regions data map and print all regions ranges, calculated energy cuts and the VMC energy cuts.
Definition at line 314 of file TG4RegionsManager.cxx.
Referenced by operator=(), and PrintRegions().
|
staticconstexprprivate |
the default precision for calculating ranges
Definition at line 133 of file TG4RegionsManager.h.
|
staticconstexprprivate |
the default tolerance (relative) for comparing energy cut values
Definition at line 135 of file TG4RegionsManager.h.
|
staticconstexprprivate |
the number of bins for search range iteration
Definition at line 137 of file TG4RegionsManager.h.
Referenced by ConvertEnergyToRange().
|
staticconstexprprivate |
the minimum range order
Definition at line 139 of file TG4RegionsManager.h.
Referenced by ConvertEnergyToRange().
|
staticconstexprprivate |
the maximum range order
Definition at line 141 of file TG4RegionsManager.h.
Referenced by ConvertEnergyToRange().
|
private |
|
private |
the precision for calculating ranges
Definition at line 149 of file TG4RegionsManager.h.
Referenced by ConvertEnergyToRange(), GetRangePrecision(), and SetRangePrecision().
|
private |
the tolerance (relative) for comparing energy cut values
Definition at line 151 of file TG4RegionsManager.h.
Referenced by CheckRegionsRanges(), GetEnergyTolerance(), and SetEnergyTolerance().
|
private |
option to print or save regions from G4 production cuts table
Definition at line 153 of file TG4RegionsManager.h.
Referenced by IsG4Table(), PrintRegions(), and SetFromG4Table().
|
private |
option to load regions ranges from a file
Definition at line 155 of file TG4RegionsManager.h.
Referenced by DefineRegions(), GetRangeCut(), IsLoad(), LoadRegions(), and SetLoad().
|
private |
map for computed or loaded regions data
Definition at line 157 of file TG4RegionsManager.h.
Referenced by CheckRegionsRanges(), DefineRegions(), GetRangeCut(), LoadRegions(), and PrintFromMap().