Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 59 of file G4PolarizationManager.hh.

Constructor & Destructor Documentation

G4PolarizationManager::~G4PolarizationManager ( )
virtual

Definition at line 73 of file G4PolarizationManager.cc.

74 {
75 }

Member Function Documentation

void G4PolarizationManager::Clean ( )
inline

Definition at line 126 of file G4PolarizationManager.hh.

126 { volumePolarizations.clear(); }
void G4PolarizationManager::Dispose ( )
static

Definition at line 58 of file G4PolarizationManager.cc.

59 {
60  if (instance != nullptr)
61  {
62  delete instance;
63  instance = nullptr;
64  }
65 }
G4PolarizationManager * G4PolarizationManager::GetInstance ( void  )
static

Definition at line 52 of file G4PolarizationManager.cc.

53 {
54  if (instance == nullptr) instance = new G4PolarizationManager();
55  return instance;
56 }

Here is the caller graph for this function:

G4int G4PolarizationManager::GetVerbose ( ) const
inline

Definition at line 117 of file G4PolarizationManager.hh.

117 { return verboseLevel; }

Here is the caller graph for this function:

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

Definition at line 97 of file G4PolarizationManager.hh.

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

Here is the caller graph for this function:

bool G4PolarizationManager::IsActivated ( ) const
inline

Definition at line 122 of file G4PolarizationManager.hh.

122 { return activated; }
bool G4PolarizationManager::IsPolarized ( G4LogicalVolume lVol) const
inline

Definition at line 107 of file G4PolarizationManager.hh.

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

Here is the caller graph for this function:

void G4PolarizationManager::ListVolumes ( )

Definition at line 77 of file G4PolarizationManager.cc.

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

Here is the caller graph for this function:

void G4PolarizationManager::SetActivated ( G4bool  val)
inline

Definition at line 121 of file G4PolarizationManager.hh.

121 { activated = val; }

Here is the caller graph for this function:

void G4PolarizationManager::SetVerbose ( G4int  val)
inline

Definition at line 116 of file G4PolarizationManager.hh.

116 { verboseLevel = val; }

Here is the caller graph for this function:

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

Definition at line 89 of file G4PolarizationManager.cc.

90 {
91  volumePolarizations[lVol]=pol;
92  if (verboseLevel>=1) G4cout<<" SetVolumePolarization "
93  <<lVol->GetName()<<" "
94  <<pol<<G4endl;
95 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
const G4String & GetName() const

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 97 of file G4PolarizationManager.cc.

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

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