Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
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 G4ThreeVector & GetVolumePolarization (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 G4PolarizationManager * GetInstance ()
 
static void Dispose ()
 

Detailed Description

Definition at line 60 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 127 of file G4PolarizationManager.hh.

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

Definition at line 58 of file G4PolarizationManager.cc.

59 {
60  if (instance != 0)
61  {
62  delete instance;
63  instance = 0;
64  }
65 }
G4PolarizationManager * G4PolarizationManager::GetInstance ( void  )
static
G4int G4PolarizationManager::GetVerbose ( ) const
inline

Definition at line 118 of file G4PolarizationManager.hh.

Referenced by G4PolarizationMessenger::GetCurrentValue().

118 { return verboseLevel; }
const G4ThreeVector & G4PolarizationManager::GetVolumePolarization ( G4LogicalVolume *  lVol) const
inline
bool G4PolarizationManager::IsActivated ( ) const
inline

Definition at line 123 of file G4PolarizationManager.hh.

123 { return activated; }
bool G4PolarizationManager::IsPolarized ( G4LogicalVolume *  lVol) const
inline
void G4PolarizationManager::ListVolumes ( )

Definition at line 77 of file G4PolarizationManager.cc.

References G4cout, and G4endl.

Referenced by G4PolarizationMessenger::SetNewValue().

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 (PolarizationMap::const_iterator cit=volumePolarizations.begin();
85  cit!=volumePolarizations.end();cit++) {
86  G4cout<<cit->first->GetName()<<" : "<<cit->second<<G4endl;
87  }
88 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4PolarizationManager::SetActivated ( G4bool  val)
inline

Definition at line 122 of file G4PolarizationManager.hh.

Referenced by G4PolarizationMessenger::SetNewValue().

122 { activated = val; }
void G4PolarizationManager::SetVerbose ( G4int  val)
inline

Definition at line 117 of file G4PolarizationManager.hh.

Referenced by G4PolarizationMessenger::SetNewValue().

117 { verboseLevel = val; }
void G4PolarizationManager::SetVolumePolarization ( G4LogicalVolume *  lVol,
const G4ThreeVector &  pol 
)

Definition at line 90 of file G4PolarizationManager.cc.

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

Referenced by G4PolarizationMessenger::SetNewValue().

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

Definition at line 98 of file G4PolarizationManager.cc.

References G4cout, and G4endl.

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

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