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 60 of file G4PolarizationManager.hh.


Constructor & Destructor Documentation

G4PolarizationManager::~G4PolarizationManager (  )  [virtual]

Definition at line 73 of file G4PolarizationManager.cc.

00074 {  
00075 }


Member Function Documentation

void G4PolarizationManager::Clean (  )  [inline]

Definition at line 127 of file G4PolarizationManager.hh.

00127 { volumePolarizations.clear(); }

void G4PolarizationManager::Dispose (  )  [static]

Definition at line 58 of file G4PolarizationManager.cc.

00059 {
00060   if (instance != 0)
00061   {
00062     delete instance;
00063     instance = 0;
00064   }
00065 }

G4PolarizationManager * G4PolarizationManager::GetInstance (  )  [static]

Definition at line 52 of file G4PolarizationManager.cc.

Referenced by G4PolarizedCompton::GetMeanFreePath(), G4ePolarizedIonisation::GetMeanFreePath(), G4eplusPolarizedAnnihilation::GetMeanFreePath(), G4PolarizedCompton::PostStepGetPhysicalInteractionLength(), G4ePolarizedIonisation::PostStepGetPhysicalInteractionLength(), G4eplusPolarizedAnnihilation::PostStepGetPhysicalInteractionLength(), G4PolarizedMollerBhabhaModel::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), and G4PolarizedAnnihilationModel::SampleSecondaries().

00053 {
00054   if (instance == 0) instance = new G4PolarizationManager();
00055   return instance;
00056 }

G4int G4PolarizationManager::GetVerbose (  )  const [inline]

Definition at line 118 of file G4PolarizationManager.hh.

Referenced by G4PolarizationMessenger::GetCurrentValue().

00118 { return verboseLevel; }

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

Definition at line 98 of file G4PolarizationManager.hh.

Referenced by G4PolarizedCompton::GetMeanFreePath(), G4ePolarizedIonisation::GetMeanFreePath(), G4eplusPolarizedAnnihilation::GetMeanFreePath(), G4PolarizedCompton::PostStepGetPhysicalInteractionLength(), G4ePolarizedIonisation::PostStepGetPhysicalInteractionLength(), G4eplusPolarizedAnnihilation::PostStepGetPhysicalInteractionLength(), G4PolarizedMollerBhabhaModel::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), and G4PolarizedAnnihilationModel::SampleSecondaries().

00099 {
00100   if (!activated) return zeroPolarization;
00101   PolarizationMap::const_iterator cit=volumePolarizations.find(lVol);
00102   if (cit!=volumePolarizations.end()) return cit->second;
00103   return zeroPolarization;
00104 }

bool G4PolarizationManager::IsActivated (  )  const [inline]

Definition at line 123 of file G4PolarizationManager.hh.

00123 { return activated; }

bool G4PolarizationManager::IsPolarized ( G4LogicalVolume lVol  )  const [inline]

Definition at line 108 of file G4PolarizationManager.hh.

Referenced by G4PolarizedCompton::GetMeanFreePath(), G4ePolarizedIonisation::GetMeanFreePath(), G4eplusPolarizedAnnihilation::GetMeanFreePath(), G4PolarizedCompton::PostStepGetPhysicalInteractionLength(), G4ePolarizedIonisation::PostStepGetPhysicalInteractionLength(), G4eplusPolarizedAnnihilation::PostStepGetPhysicalInteractionLength(), G4PolarizedMollerBhabhaModel::SampleSecondaries(), G4PolarizedComptonModel::SampleSecondaries(), and G4PolarizedAnnihilationModel::SampleSecondaries().

00109 {
00110   if (!activated) return false;
00111   PolarizationMap::const_iterator cit=volumePolarizations.find(lVol);
00112   return (cit!=volumePolarizations.end());
00113 }

void G4PolarizationManager::ListVolumes (  ) 

Definition at line 77 of file G4PolarizationManager.cc.

References G4cout, and G4endl.

Referenced by G4PolarizationMessenger::SetNewValue().

00078 {
00079   if (volumePolarizations.size()==0) return;
00080   G4cout<<" Polarization for "<<volumePolarizations.size()
00081         <<" registered volume(s) : "<<G4endl;
00082   if (!activated) 
00083     G4cout<<" but polarization deactivated "<<G4endl;
00084   for (PolarizationMap::const_iterator cit=volumePolarizations.begin();
00085        cit!=volumePolarizations.end();cit++) {
00086     G4cout<<cit->first->GetName()<<" : "<<cit->second<<G4endl;
00087   }
00088 }

void G4PolarizationManager::SetActivated ( G4bool  val  )  [inline]

Definition at line 122 of file G4PolarizationManager.hh.

Referenced by G4PolarizationMessenger::SetNewValue().

00122 { activated = val; }

void G4PolarizationManager::SetVerbose ( G4int  val  )  [inline]

Definition at line 117 of file G4PolarizationManager.hh.

Referenced by G4PolarizationMessenger::SetNewValue().

00117 { verboseLevel = val; }

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

Definition at line 98 of file G4PolarizationManager.cc.

References G4cout, and G4endl.

00099 {
00100   for (PolarizationMap::iterator it=volumePolarizations.begin();
00101        it!=volumePolarizations.end();it++) {
00102     if (it->first->GetName()==lVolName) {
00103       it->second=pol;
00104       if (verboseLevel>=1) G4cout<<" SetVolumePolarization "
00105                                  <<lVolName<<" "
00106                                  <<pol<<G4endl;
00107       return;
00108     }
00109   }
00110   G4cout<<" logical volume '"<<lVolName<<"'not registerd yet \n"
00111         <<" please register before using '/polarization/volume/set' "<<G4endl;
00112 }

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

00091 {
00092   volumePolarizations[lVol]=pol;
00093   if (verboseLevel>=1) G4cout<<" SetVolumePolarization "
00094                              <<lVol->GetName()<<" "
00095                              <<pol<<G4endl;
00096 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:56 2013 for Geant4 by  doxygen 1.4.7