Geant4-11
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
G4PolarizationManager Class Reference

#include <G4PolarizationManager.hh>

Public Member Functions

void Clean ()
 
 G4PolarizationManager (const G4PolarizationManager &)=delete
 
G4int GetVerbose () const
 
const G4StokesVector GetVolumePolarization (G4LogicalVolume *lVol) const
 
bool IsActivated () const
 
bool IsPolarized (G4LogicalVolume *lVol) const
 
void ListVolumes ()
 
G4PolarizationManageroperator= (const G4PolarizationManager &right)=delete
 
void SetActivated (G4bool val)
 
void SetVerbose (G4int val)
 
void SetVolumePolarization (const G4String &lVolName, const G4ThreeVector &pol)
 
void SetVolumePolarization (G4LogicalVolume *lVol, const G4ThreeVector &pol)
 
 ~G4PolarizationManager ()
 

Static Public Member Functions

static void Dispose ()
 
static G4PolarizationManagerGetInstance ()
 

Private Member Functions

 G4PolarizationManager ()
 

Private Attributes

G4bool fActivated
 
G4PolarizationMessengerfMessenger
 
G4int fVerboseLevel
 
PolarizationMap fVolumePolarizations
 

Static Private Attributes

static G4ThreadLocal G4PolarizationManagerfInstance = nullptr
 

Detailed Description

Definition at line 50 of file G4PolarizationManager.hh.

Constructor & Destructor Documentation

◆ ~G4PolarizationManager()

G4PolarizationManager::~G4PolarizationManager ( )

Definition at line 68 of file G4PolarizationManager.cc.

68{}

◆ G4PolarizationManager() [1/2]

G4PolarizationManager::G4PolarizationManager ( const G4PolarizationManager )
delete

◆ G4PolarizationManager() [2/2]

G4PolarizationManager::G4PolarizationManager ( )
private

Definition at line 60 of file G4PolarizationManager.cc.

References fMessenger.

Referenced by GetInstance().

Member Function Documentation

◆ Clean()

void G4PolarizationManager::Clean ( )
inline

Definition at line 129 of file G4PolarizationManager.hh.

129{ fVolumePolarizations.clear(); }
PolarizationMap fVolumePolarizations

References fVolumePolarizations.

◆ Dispose()

void G4PolarizationManager::Dispose ( )
static

Definition at line 51 of file G4PolarizationManager.cc.

52{
53 if(fInstance != nullptr)
54 {
55 delete fInstance;
56 fInstance = nullptr;
57 }
58}
static G4ThreadLocal G4PolarizationManager * fInstance

References fInstance.

◆ GetInstance()

G4PolarizationManager * G4PolarizationManager::GetInstance ( )
static

◆ GetVerbose()

G4int G4PolarizationManager::GetVerbose ( ) const
inline

Definition at line 119 of file G4PolarizationManager.hh.

119{ return fVerboseLevel; }

References fVerboseLevel.

Referenced by G4PolarizationMessenger::GetCurrentValue().

◆ GetVolumePolarization()

const G4StokesVector G4PolarizationManager::GetVolumePolarization ( G4LogicalVolume lVol) const
inline

◆ IsActivated()

bool G4PolarizationManager::IsActivated ( ) const
inline

Definition at line 126 of file G4PolarizationManager.hh.

126{ return fActivated; }

References fActivated.

◆ IsPolarized()

bool G4PolarizationManager::IsPolarized ( G4LogicalVolume lVol) const
inline

◆ ListVolumes()

void G4PolarizationManager::ListVolumes ( )

Definition at line 70 of file G4PolarizationManager.cc.

71{
72 if(fVolumePolarizations.empty())
73 return;
74 G4cout << " Polarization for " << fVolumePolarizations.size()
75 << " registered volume(s) : " << G4endl;
76 if(!fActivated)
77 G4cout << " but polarization deactivated " << G4endl;
78 for(auto vp : fVolumePolarizations)
79 {
80 G4cout << vp.first->GetName() << " : " << vp.second << G4endl;
81 }
82}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

References fActivated, fVolumePolarizations, G4cout, and G4endl.

Referenced by G4PolarizationMessenger::SetNewValue().

◆ operator=()

G4PolarizationManager & G4PolarizationManager::operator= ( const G4PolarizationManager right)
delete

◆ SetActivated()

void G4PolarizationManager::SetActivated ( G4bool  val)
inline

Definition at line 122 of file G4PolarizationManager.hh.

123{
124 fActivated = val;
125}

References fActivated.

Referenced by G4PolarizationMessenger::SetNewValue().

◆ SetVerbose()

void G4PolarizationManager::SetVerbose ( G4int  val)
inline

Definition at line 115 of file G4PolarizationManager.hh.

116{
117 fVerboseLevel = val;
118}

References fVerboseLevel.

Referenced by G4PolarizationMessenger::SetNewValue().

◆ SetVolumePolarization() [1/2]

void G4PolarizationManager::SetVolumePolarization ( const G4String lVolName,
const G4ThreeVector pol 
)

Definition at line 93 of file G4PolarizationManager.cc.

95{
96 for(auto& vp : fVolumePolarizations)
97 {
98 if(vp.first->GetName() == lVolName)
99 {
100 vp.second = pol;
101 if(fVerboseLevel >= 1)
102 G4cout << " SetVolumePolarization " << lVolName << " " << pol << G4endl;
103 return;
104 }
105 }
107 ed << " Logical volume '" << lVolName << "'not registered yet.\n"
108 << " Please register before using '/polarization/volume/set'\n";
109 G4Exception("G4PolarizationManager::SetVolumePolarization", "pol040",
110 FatalException, ed);
111}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40

References FatalException, fVerboseLevel, fVolumePolarizations, G4cout, G4endl, and G4Exception().

◆ SetVolumePolarization() [2/2]

void G4PolarizationManager::SetVolumePolarization ( G4LogicalVolume lVol,
const G4ThreeVector pol 
)

Definition at line 84 of file G4PolarizationManager.cc.

86{
87 fVolumePolarizations[lVol] = pol;
88 if(fVerboseLevel >= 1)
89 G4cout << " SetVolumePolarization " << lVol->GetName() << " " << pol
90 << G4endl;
91}
const G4String & GetName() const

References fVerboseLevel, fVolumePolarizations, G4cout, G4endl, and G4LogicalVolume::GetName().

Referenced by G4PolarizationMessenger::SetNewValue().

Field Documentation

◆ fActivated

G4bool G4PolarizationManager::fActivated
private

◆ fInstance

G4ThreadLocal G4PolarizationManager * G4PolarizationManager::fInstance = nullptr
staticprivate

Definition at line 79 of file G4PolarizationManager.hh.

Referenced by Dispose(), and GetInstance().

◆ fMessenger

G4PolarizationMessenger* G4PolarizationManager::fMessenger
private

Definition at line 81 of file G4PolarizationManager.hh.

Referenced by G4PolarizationManager().

◆ fVerboseLevel

G4int G4PolarizationManager::fVerboseLevel
private

Definition at line 85 of file G4PolarizationManager.hh.

Referenced by GetVerbose(), SetVerbose(), and SetVolumePolarization().

◆ fVolumePolarizations

PolarizationMap G4PolarizationManager::fVolumePolarizations
private

The documentation for this class was generated from the following files: