Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PolarizationManager Class Reference

#include <G4PolarizationManager.hh>

Public Member Functions

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

Static Public Member Functions

static G4PolarizationManagerGetInstance ()
 
static void Dispose ()
 

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()

G4PolarizationManager::G4PolarizationManager ( const G4PolarizationManager & )
delete

Member Function Documentation

◆ Clean()

void G4PolarizationManager::Clean ( )
inline

Definition at line 129 of file G4PolarizationManager.hh.

129{ fVolumePolarizations.clear(); }

◆ 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}

◆ GetInstance()

G4PolarizationManager * G4PolarizationManager::GetInstance ( )
static

◆ GetVerbose()

G4int G4PolarizationManager::GetVerbose ( ) const
inline

Definition at line 119 of file G4PolarizationManager.hh.

119{ return fVerboseLevel; }

Referenced by G4PolarizationMessenger::GetCurrentValue().

◆ GetVolumePolarization()

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

Definition at line 91 of file G4PolarizationManager.hh.

93{
94 if(!fActivated)
96 PolarizationMap::const_iterator cit = fVolumePolarizations.find(lVol);
97 if(cit != fVolumePolarizations.end())
98 {
99 const G4StokesVector vec = G4StokesVector(cit->second);
100 return vec;
101 }
103}
static const G4StokesVector ZERO

Referenced by G4PolarizedAnnihilationModel::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), and G4PolarizedIonisationModel::SampleSecondaries().

◆ IsActivated()

bool G4PolarizationManager::IsActivated ( ) const
inline

Definition at line 126 of file G4PolarizationManager.hh.

126{ return fActivated; }

◆ IsPolarized()

bool G4PolarizationManager::IsPolarized ( G4LogicalVolume * lVol) const
inline

Definition at line 106 of file G4PolarizationManager.hh.

107{
108 if(!fActivated)
109 return false;
110 PolarizationMap::const_iterator cit = fVolumePolarizations.find(lVol);
111 return (cit != fVolumePolarizations.end());
112}

Referenced by G4PolarizedAnnihilationModel::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), and G4PolarizedIonisationModel::SampleSecondaries().

◆ 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:67
G4GLOB_DLL std::ostream G4cout

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}

Referenced by G4PolarizationMessenger::SetNewValue().

◆ SetVerbose()

void G4PolarizationManager::SetVerbose ( G4int val)
inline

Definition at line 115 of file G4PolarizationManager.hh.

116{
117 fVerboseLevel = val;
118}

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)
std::ostringstream G4ExceptionDescription

◆ 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

Referenced by G4PolarizationMessenger::SetNewValue().


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