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

#include <G4PolarizationManager.hh>

Public Member Functions

virtual ~G4PolarizationManager ()
 
void ListVolumes ()
 
void Clean ()
 
void SetVolumePolarization (G4LogicalVolume *lVol, const G4ThreeVector &pol)
 
void SetVolumePolarization (const G4String &lVolName, const G4ThreeVector &pol)
 
const G4ThreeVectorGetVolumePolarization (G4LogicalVolume *lVol) const
 
bool IsPolarized (G4LogicalVolume *lVol) const
 
void SetVerbose (G4int val)
 
G4int GetVerbose () const
 
void SetActivated (G4bool val)
 
bool IsActivated () const
 

Static Public Member Functions

static G4PolarizationManagerGetInstance ()
 
static void Dispose ()
 

Detailed Description

Definition at line 58 of file G4PolarizationManager.hh.

Constructor & Destructor Documentation

◆ ~G4PolarizationManager()

G4PolarizationManager::~G4PolarizationManager ( )
virtual

Definition at line 72 of file G4PolarizationManager.cc.

73{
74}

Member Function Documentation

◆ Clean()

void G4PolarizationManager::Clean ( )
inline

Definition at line 125 of file G4PolarizationManager.hh.

125{ volumePolarizations.clear(); }

◆ Dispose()

void G4PolarizationManager::Dispose ( )
static

Definition at line 57 of file G4PolarizationManager.cc.

58{
59 if (instance != nullptr)
60 {
61 delete instance;
62 instance = nullptr;
63 }
64}

◆ GetInstance()

G4PolarizationManager * G4PolarizationManager::GetInstance ( )
static

◆ GetVerbose()

G4int G4PolarizationManager::GetVerbose ( ) const
inline

Definition at line 116 of file G4PolarizationManager.hh.

116{ return verboseLevel; }

Referenced by G4PolarizationMessenger::GetCurrentValue().

◆ GetVolumePolarization()

const G4ThreeVector & G4PolarizationManager::GetVolumePolarization ( G4LogicalVolume lVol) const
inline

Definition at line 96 of file G4PolarizationManager.hh.

97{
98 if (!activated) return zeroPolarization;
99 PolarizationMap::const_iterator cit=volumePolarizations.find(lVol);
100 if (cit!=volumePolarizations.end()) return cit->second;
101 return zeroPolarization;
102}

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

◆ IsActivated()

bool G4PolarizationManager::IsActivated ( ) const
inline

Definition at line 121 of file G4PolarizationManager.hh.

121{ return activated; }

◆ IsPolarized()

bool G4PolarizationManager::IsPolarized ( G4LogicalVolume lVol) const
inline

Definition at line 106 of file G4PolarizationManager.hh.

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

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

◆ ListVolumes()

void G4PolarizationManager::ListVolumes ( )

Definition at line 76 of file G4PolarizationManager.cc.

77{
78 if (volumePolarizations.size()==0) return;
79 G4cout<<" Polarization for "<<volumePolarizations.size()
80 <<" registered volume(s) : "<<G4endl;
81 if (!activated)
82 G4cout<<" but polarization deactivated "<<G4endl;
83 for (auto vp : volumePolarizations) {
84 G4cout << vp.first->GetName() << " : " << vp.second << G4endl;
85 }
86}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

Referenced by G4PolarizationMessenger::SetNewValue().

◆ SetActivated()

void G4PolarizationManager::SetActivated ( G4bool  val)
inline

Definition at line 120 of file G4PolarizationManager.hh.

120{ activated = val; }

Referenced by G4PolarizationMessenger::SetNewValue().

◆ SetVerbose()

void G4PolarizationManager::SetVerbose ( G4int  val)
inline

Definition at line 115 of file G4PolarizationManager.hh.

115{ verboseLevel = val; }

Referenced by G4PolarizationMessenger::SetNewValue().

◆ SetVolumePolarization() [1/2]

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

Definition at line 96 of file G4PolarizationManager.cc.

97{
98 for (auto& vp : volumePolarizations) {
99 if (vp.first->GetName()==lVolName) {
100 vp.second=pol;
101 if (verboseLevel>=1) G4cout<<" SetVolumePolarization "
102 <<lVolName<<" "
103 <<pol<<G4endl;
104 return;
105 }
106 }
107 G4cout<<" logical volume '"<<lVolName<<"'not registered yet \n"
108 <<" please register before using '/polarization/volume/set' "<<G4endl;
109}

◆ SetVolumePolarization() [2/2]

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

Definition at line 88 of file G4PolarizationManager.cc.

89{
90 volumePolarizations[lVol]=pol;
91 if (verboseLevel>=1) G4cout<<" SetVolumePolarization "
92 <<lVol->GetName()<<" "
93 <<pol<<G4endl;
94}
const G4String & GetName() const

Referenced by G4PolarizationMessenger::SetNewValue().


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