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

#include <G4NuclearPolarization.hh>

Public Member Functions

 G4NuclearPolarization (G4int Z, G4int A, G4double exc)
 
 ~G4NuclearPolarization ()
 
void Unpolarize ()
 
void SetPolarization (std::vector< std::vector< G4complex > > &p)
 
std::vector< std::vector< G4complex > > & GetPolarization ()
 
G4int GetZ () const
 
G4int GetA () const
 
G4double GetExcitationEnergy () const
 
void SetExcitationEnergy (G4double val)
 
G4NuclearPolarizationoperator= (const G4NuclearPolarization &right)
 
 G4NuclearPolarization (const G4NuclearPolarization &right)
 
G4bool operator== (const G4NuclearPolarization &right) const
 
G4bool operator!= (const G4NuclearPolarization &right) const
 

Friends

std::ostream & operator<< (std::ostream &, const G4NuclearPolarization &)
 

Detailed Description

Definition at line 54 of file G4NuclearPolarization.hh.

Constructor & Destructor Documentation

◆ G4NuclearPolarization() [1/2]

G4NuclearPolarization::G4NuclearPolarization ( G4int  Z,
G4int  A,
G4double  exc 
)
explicit

Definition at line 42 of file G4NuclearPolarization.cc.

43 : fZ(Z), fA(A), fExcEnergy(exc)
44{
45 Unpolarize();
46 //G4cout << "NP: new " << this << G4endl;
47}

◆ ~G4NuclearPolarization()

G4NuclearPolarization::~G4NuclearPolarization ( )

Definition at line 49 of file G4NuclearPolarization.cc.

50{
51 //G4cout << "NP: delete " << this << G4endl;
52}

◆ G4NuclearPolarization() [2/2]

G4NuclearPolarization::G4NuclearPolarization ( const G4NuclearPolarization right)
inline

Definition at line 115 of file G4NuclearPolarization.hh.

116 {
117 *this = right;
118 }

Member Function Documentation

◆ GetA()

G4int G4NuclearPolarization::GetA ( ) const
inline

Definition at line 87 of file G4NuclearPolarization.hh.

88 {
89 return fA;
90 }

◆ GetExcitationEnergy()

G4double G4NuclearPolarization::GetExcitationEnergy ( ) const
inline

Definition at line 92 of file G4NuclearPolarization.hh.

93 {
94 return fExcEnergy;
95 }

◆ GetPolarization()

std::vector< std::vector< G4complex > > & G4NuclearPolarization::GetPolarization ( )
inline

Definition at line 77 of file G4NuclearPolarization.hh.

78 {
79 return fPolarization;
80 }

Referenced by G4PolarizationTransition::SampleGammaTransition().

◆ GetZ()

G4int G4NuclearPolarization::GetZ ( ) const
inline

Definition at line 82 of file G4NuclearPolarization.hh.

83 {
84 return fZ;
85 }

◆ operator!=()

G4bool G4NuclearPolarization::operator!= ( const G4NuclearPolarization right) const

Definition at line 70 of file G4NuclearPolarization.cc.

71{
72 return (fZ != right.fZ || fA != right.fA || fExcEnergy != right.fExcEnergy
73 || fPolarization != right.fPolarization);
74}

◆ operator=()

G4NuclearPolarization & G4NuclearPolarization::operator= ( const G4NuclearPolarization right)
inline

Definition at line 104 of file G4NuclearPolarization.hh.

105 {
106 if (this != &right) {
107 fZ = right.fZ;
108 fA = right.fA;
109 fExcEnergy = right.fExcEnergy;
110 fPolarization = right.fPolarization;
111 }
112 return *this;
113 }

◆ operator==()

G4bool G4NuclearPolarization::operator== ( const G4NuclearPolarization right) const

Definition at line 64 of file G4NuclearPolarization.cc.

65{
66 return (fZ == right.fZ && fA == right.fA && fExcEnergy == right.fExcEnergy
67 && fPolarization == right.fPolarization);
68}

◆ SetExcitationEnergy()

void G4NuclearPolarization::SetExcitationEnergy ( G4double  val)
inline

Definition at line 97 of file G4NuclearPolarization.hh.

98 {
99 fExcEnergy = val;
100 }

◆ SetPolarization()

void G4NuclearPolarization::SetPolarization ( std::vector< std::vector< G4complex > > &  p)
inline

Definition at line 69 of file G4NuclearPolarization.hh.

70 {
71 Clean();
72 for(auto & pol : p) {
73 fPolarization.push_back(pol);
74 }
75 }

Referenced by G4PolarizationTransition::SampleGammaTransition().

◆ Unpolarize()

void G4NuclearPolarization::Unpolarize ( )
inline

Definition at line 62 of file G4NuclearPolarization.hh.

63 {
64 Clean();
65 fPolarization.resize(1);
66 fPolarization[0].push_back(1.0);
67 }

Referenced by G4NuclearPolarization(), and G4PolarizationTransition::SampleGammaTransition().

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const G4NuclearPolarization p 
)
friend

Definition at line 76 of file G4NuclearPolarization.cc.

77{
78 out << "G4NuclearPolarization: Z= " << p.fZ << " A= " << p.fA << " Exc(MeV)= "
79 << p.fExcEnergy << G4endl;
80 out << " P = [ {";
81 size_t kk = p.fPolarization.size();
82 for(size_t k=0; k<kk; ++k) {
83 if(k>0) { out << " {"; }
84 size_t kpmax = (p.fPolarization[k]).size();
85 for(size_t kappa=0; kappa<kpmax; ++kappa) {
86 if(kappa > 0) { out << "} {"; }
87 out << p.fPolarization[k][kappa].real() << " + "
88 << p.fPolarization[k][kappa].imag() << "*i";
89 }
90 if(k+1 < kk) { out << "}" << G4endl; }
91 }
92 out << "} ]" << G4endl;
93 return out;
94}
#define G4endl
Definition: G4ios.hh:57

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