Geant4 11.2.2
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 &out, const G4NuclearPolarization &p)
 

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}
const G4double A[17]

◆ ~G4NuclearPolarization()

G4NuclearPolarization::~G4NuclearPolarization ( )

Definition at line 49 of file G4NuclearPolarization.cc.

50{
51 //G4cout << "NP: delete " << this << G4endl;
52 Clean();
53}

◆ 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 71 of file G4NuclearPolarization.cc.

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

◆ 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 65 of file G4NuclearPolarization.cc.

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

◆ 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 Symbol Documentation

◆ operator<<

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

Definition at line 77 of file G4NuclearPolarization.cc.

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

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