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

#include <G4NeutronBetaDecayChannel.hh>

+ Inheritance diagram for G4NeutronBetaDecayChannel:

Public Member Functions

 G4NeutronBetaDecayChannel (const G4String &theParentName, G4double theBR)
 
 ~G4NeutronBetaDecayChannel () override=default
 
G4DecayProductsDecayIt (G4double) override
 
- Public Member Functions inherited from G4VDecayChannel
 G4VDecayChannel (const G4String &aName, G4int Verbose=1)
 
 G4VDecayChannel (const G4String &aName, const G4String &theParentName, G4double theBR, G4int theNumberOfDaughters, const G4String &theDaughterName1, const G4String &theDaughterName2="", const G4String &theDaughterName3="", const G4String &theDaughterName4="", const G4String &theDaughterName5="")
 
virtual ~G4VDecayChannel ()
 
G4bool operator== (const G4VDecayChannel &r) const
 
G4bool operator!= (const G4VDecayChannel &r) const
 
G4bool operator< (const G4VDecayChannel &right) const
 
const G4StringGetKinematicsName () const
 
G4double GetBR () const
 
G4int GetNumberOfDaughters () const
 
G4ParticleDefinitionGetParent ()
 
G4ParticleDefinitionGetDaughter (G4int anIndex)
 
G4int GetAngularMomentum ()
 
const G4StringGetParentName () const
 
const G4StringGetDaughterName (G4int anIndex) const
 
G4double GetParentMass () const
 
G4double GetDaughterMass (G4int anIndex) const
 
void SetParent (const G4ParticleDefinition *particle_type)
 
void SetParent (const G4String &particle_name)
 
void SetBR (G4double value)
 
void SetNumberOfDaughters (G4int value)
 
void SetDaughter (G4int anIndex, const G4ParticleDefinition *particle_type)
 
void SetDaughter (G4int anIndex, const G4String &particle_name)
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
void DumpInfo ()
 
G4double GetRangeMass () const
 
void SetRangeMass (G4double val)
 
virtual G4bool IsOKWithParentMass (G4double parentMass)
 
void SetPolarization (const G4ThreeVector &)
 
const G4ThreeVectorGetPolarization () const
 

Protected Member Functions

 G4NeutronBetaDecayChannel ()=default
 
 G4NeutronBetaDecayChannel (const G4NeutronBetaDecayChannel &)
 
G4NeutronBetaDecayChanneloperator= (const G4NeutronBetaDecayChannel &)
 
- Protected Member Functions inherited from G4VDecayChannel
 G4VDecayChannel ()
 
 G4VDecayChannel (const G4VDecayChannel &)
 
G4VDecayChanneloperator= (const G4VDecayChannel &)
 
void ClearDaughtersName ()
 
void CheckAndFillDaughters ()
 
void CheckAndFillParent ()
 
G4double DynamicalMass (G4double massPDG, G4double width, G4double maxDev=1.0) const
 

Protected Attributes

const G4double aENuCorr = -0.102
 
- Protected Attributes inherited from G4VDecayChannel
G4String kinematics_name = ""
 
G4double rbranch = 0.0
 
G4Stringparent_name = nullptr
 
G4String ** daughters_name = nullptr
 
G4double rangeMass = 2.5
 
G4ThreeVector parent_polarization
 
G4ParticleTableparticletable = nullptr
 
G4ParticleDefinitionG4MT_parent = nullptr
 
G4ParticleDefinition ** G4MT_daughters = nullptr
 
G4double G4MT_parent_mass = 0.0
 
G4doubleG4MT_daughters_mass = nullptr
 
G4doubleG4MT_daughters_width = nullptr
 
G4Mutex daughtersMutex
 
G4Mutex parentMutex
 
G4int numberOfDaughters = 0
 
G4int verboseLevel = 1
 

Additional Inherited Members

- Static Protected Attributes inherited from G4VDecayChannel
static const G4String noName = " "
 

Detailed Description

Definition at line 42 of file G4NeutronBetaDecayChannel.hh.

Constructor & Destructor Documentation

◆ G4NeutronBetaDecayChannel() [1/3]

G4NeutronBetaDecayChannel::G4NeutronBetaDecayChannel ( const G4String & theParentName,
G4double theBR )

Definition at line 43 of file G4NeutronBetaDecayChannel.cc.

44 : G4VDecayChannel("Neutron Decay")
45{
46 // set names for daughter particles
47 if (theParentName == "neutron") {
48 SetBR(theBR);
49 SetParent("neutron");
51 SetDaughter(0, "e-");
52 SetDaughter(1, "anti_nu_e");
53 SetDaughter(2, "proton");
54 }
55 else if (theParentName == "anti_neutron") {
56 SetBR(theBR);
57 SetParent("anti_neutron");
59 SetDaughter(0, "e+");
60 SetDaughter(1, "nu_e");
61 SetDaughter(2, "anti_proton");
62 }
63 else {
64#ifdef G4VERBOSE
65 if (GetVerboseLevel() > 0) {
66 G4cout << "G4NeutronBetaDecayChannel:: constructor :";
67 G4cout << " parent particle is not neutron but ";
68 G4cout << theParentName << G4endl;
69 }
70#endif
71 }
72}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void SetBR(G4double value)
G4int GetVerboseLevel() const
void SetNumberOfDaughters(G4int value)
void SetDaughter(G4int anIndex, const G4ParticleDefinition *particle_type)
void SetParent(const G4ParticleDefinition *particle_type)

◆ ~G4NeutronBetaDecayChannel()

G4NeutronBetaDecayChannel::~G4NeutronBetaDecayChannel ( )
overridedefault

◆ G4NeutronBetaDecayChannel() [2/3]

G4NeutronBetaDecayChannel::G4NeutronBetaDecayChannel ( )
protecteddefault

◆ G4NeutronBetaDecayChannel() [3/3]

G4NeutronBetaDecayChannel::G4NeutronBetaDecayChannel ( const G4NeutronBetaDecayChannel & right)
protected

Definition at line 74 of file G4NeutronBetaDecayChannel.cc.

75 : G4VDecayChannel(right)
76{}

Member Function Documentation

◆ DecayIt()

G4DecayProducts * G4NeutronBetaDecayChannel::DecayIt ( G4double )
overridevirtual

Implements G4VDecayChannel.

Definition at line 106 of file G4NeutronBetaDecayChannel.cc.

107{
108 // This class describes free neutron beta decay kinematics.
109 // This version neglects neutron/electron polarization
110 // without Coulomb effect
111
112#ifdef G4VERBOSE
113 if (GetVerboseLevel() > 1) G4cout << "G4NeutronBetaDecayChannel::DecayIt ";
114#endif
115
118
119 // parent mass
120 G4double parentmass = G4MT_parent->GetPDGMass();
121
122 // daughters'mass
123 G4double daughtermass[3];
124 G4double sumofdaughtermass = 0.0;
125 for (G4int index = 0; index < 3; ++index) {
126 daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
127 sumofdaughtermass += daughtermass[index];
128 }
129 G4double xmax = parentmass - sumofdaughtermass;
130
131 // create parent G4DynamicParticle at rest
132 G4ThreeVector dummy;
133 auto parentparticle = new G4DynamicParticle(G4MT_parent, dummy, 0.0);
134
135 // create G4Decayproducts
136 auto products = new G4DecayProducts(*parentparticle);
137 delete parentparticle;
138
139 // calculate daughter momentum
140 G4double daughtermomentum[3];
141
142 // calcurate electron energy
143 G4double x; // Ee
144 G4double p; // Pe
145 G4double dm = daughtermass[0]; // Me
146 G4double w; // cosine of e-nu angle
147 G4double r;
148 G4double r0;
149 const std::size_t MAX_LOOP = 10000;
150 for (std::size_t loop_counter = 0; loop_counter < MAX_LOOP; ++loop_counter) {
151 x = xmax * G4UniformRand();
152 p = std::sqrt(x * (x + 2.0 * dm));
153 w = 1.0 - 2.0 * G4UniformRand();
154 r = p * (x + dm) * (xmax - x) * (xmax - x) * (1.0 + aENuCorr * p / (x + dm) * w);
155 r0 = G4UniformRand() * (xmax + dm) * (xmax + dm) * xmax * xmax * (1.0 + aENuCorr);
156 if (r > r0) break;
157 }
158
159 // create daughter G4DynamicParticle
160 // rotation materix to lab frame
161 //
162 G4double costheta = 2. * G4UniformRand() - 1.0;
163 G4double theta = std::acos(costheta) * rad;
164 G4double phi = twopi * G4UniformRand() * rad;
166 rm.rotateY(theta);
167 rm.rotateZ(phi);
168
169 // daughter 0 (electron) in Z direction
170 daughtermomentum[0] = p;
171 G4ThreeVector direction0(0.0, 0.0, 1.0);
172 direction0 = rm * direction0;
173 auto daughterparticle0 =
174 new G4DynamicParticle(G4MT_daughters[0], direction0 * daughtermomentum[0]);
175 products->PushProducts(daughterparticle0);
176
177 // daughter 1 (nutrino) in XZ plane
178 G4double eNu; // Enu
179 eNu = (parentmass - daughtermass[2]) * (parentmass + daughtermass[2]) + (dm * dm)
180 - 2. * parentmass * (x + dm);
181 eNu /= 2. * (parentmass + p * w - (x + dm));
182 G4double cosn = w;
183 G4double phin = twopi * G4UniformRand() * rad;
184 G4double sinn = std::sqrt((1.0 - cosn) * (1.0 + cosn));
185
186 G4ThreeVector direction1(sinn * std::cos(phin), sinn * std::sin(phin), cosn);
187 direction1 = rm * direction1;
188 auto daughterparticle1 = new G4DynamicParticle(G4MT_daughters[1], direction1 * eNu);
189 products->PushProducts(daughterparticle1);
190
191 // daughter 2 (proton) at REST
192 G4double eP; // Eproton
193 eP = parentmass - eNu - (x + dm) - daughtermass[2];
194 G4double pPx = -eNu * sinn;
195 G4double pPz = -p - eNu * cosn;
196 G4double pP = std::sqrt(eP * (eP + 2. * daughtermass[2]));
197 G4ThreeVector direction2(pPx / pP * std::cos(phin), pPx / pP * std::sin(phin), pPz / pP);
198 direction2 = rm * direction2;
199 auto daughterparticle2 = new G4DynamicParticle(G4MT_daughters[2], direction2 * pP);
200 products->PushProducts(daughterparticle2);
201
202 // output message
203#ifdef G4VERBOSE
204 if (GetVerboseLevel() > 1) {
205 G4cout << "G4NeutronBetaDecayChannel::DecayIt ";
206 G4cout << " create decay products in rest frame " << G4endl;
207 products->DumpInfo();
208 }
209#endif
210 return products;
211}
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
#define G4UniformRand()
Definition Randomize.hh:52
HepRotation & rotateZ(double delta)
Definition Rotation.cc:87
HepRotation & rotateY(double delta)
Definition Rotation.cc:74
G4ParticleDefinition ** G4MT_daughters
G4ParticleDefinition * G4MT_parent

◆ operator=()

G4NeutronBetaDecayChannel & G4NeutronBetaDecayChannel::operator= ( const G4NeutronBetaDecayChannel & right)
protected

Definition at line 79 of file G4NeutronBetaDecayChannel.cc.

80{
81 if (this != &right) {
84 rbranch = right.rbranch;
85
86 // copy parent name
87 delete parent_name;
88 parent_name = new G4String(*right.parent_name);
89
90 // clear daughters_name array
92
93 // recreate array
95 if (numberOfDaughters > 0) {
97 // copy daughters name
98 for (G4int index = 0; index < numberOfDaughters; ++index) {
99 daughters_name[index] = new G4String(*right.daughters_name[index]);
100 }
101 }
102 }
103 return *this;
104}
G4String ** daughters_name

Member Data Documentation

◆ aENuCorr

const G4double G4NeutronBetaDecayChannel::aENuCorr = -0.102
protected

Definition at line 58 of file G4NeutronBetaDecayChannel.hh.

Referenced by DecayIt().


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