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

#include <G4PionRadiativeDecayChannel.hh>

+ Inheritance diagram for G4PionRadiativeDecayChannel:

Public Member Functions

 G4PionRadiativeDecayChannel (const G4String &theParentName, G4double theBR)
 
 ~G4PionRadiativeDecayChannel () 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

 G4PionRadiativeDecayChannel ()=default
 
 G4PionRadiativeDecayChannel (const G4PionRadiativeDecayChannel &)=default
 
G4PionRadiativeDecayChanneloperator= (const G4PionRadiativeDecayChannel &)
 
- 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
 

Additional Inherited Members

- 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
 
- Static Protected Attributes inherited from G4VDecayChannel
static const G4String noName = " "
 

Detailed Description

Definition at line 46 of file G4PionRadiativeDecayChannel.hh.

Constructor & Destructor Documentation

◆ G4PionRadiativeDecayChannel() [1/3]

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

Definition at line 66 of file G4PionRadiativeDecayChannel.cc.

68 : G4VDecayChannel("Radiative Pion Decay", 1)
69{
70 // set names for daughter particles
71 if (theParentName == "pi+") {
72 SetBR(theBR);
73 SetParent("pi+");
75 SetDaughter(0, "e+");
76 SetDaughter(1, "gamma");
77 SetDaughter(2, "nu_e");
78 }
79 else if (theParentName == "pi-") {
80 SetBR(theBR);
81 SetParent("pi-");
83 SetDaughter(0, "e-");
84 SetDaughter(1, "gamma");
85 SetDaughter(2, "anti_nu_e");
86 }
87 else {
88#ifdef G4VERBOSE
89 if (GetVerboseLevel() > 0) {
90 G4cout << "G4RadiativePionDecayChannel::G4PionRadiativeDecayChannel()" << G4endl;
91 G4cout << "Parent particle is not charged pion: ";
92 G4cout << theParentName << G4endl;
93 }
94#endif
95 }
96}
#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)

◆ ~G4PionRadiativeDecayChannel()

G4PionRadiativeDecayChannel::~G4PionRadiativeDecayChannel ( )
overridedefault

◆ G4PionRadiativeDecayChannel() [2/3]

G4PionRadiativeDecayChannel::G4PionRadiativeDecayChannel ( )
protecteddefault

◆ G4PionRadiativeDecayChannel() [3/3]

G4PionRadiativeDecayChannel::G4PionRadiativeDecayChannel ( const G4PionRadiativeDecayChannel & )
protecteddefault

Member Function Documentation

◆ DecayIt()

G4DecayProducts * G4PionRadiativeDecayChannel::DecayIt ( G4double )
overridevirtual

Implements G4VDecayChannel.

Definition at line 126 of file G4PionRadiativeDecayChannel.cc.

127{
128#ifdef G4VERBOSE
129 if (GetVerboseLevel() > 1) G4cout << "G4PionRadiativeDecayChannel::DecayIt ";
130#endif
131
134
135 // parent mass
136 G4double parentmass = G4MT_parent->GetPDGMass();
137
138 G4double EMPI = parentmass;
139
140 // daughters'mass
141 const G4int N_DAUGHTER = 3;
142 G4double daughtermass[N_DAUGHTER];
143 // G4double sumofdaughtermass = 0.0;
144 for (G4int index = 0; index < N_DAUGHTER; ++index) {
145 daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
146 // sumofdaughtermass += daughtermass[index];
147 }
148
149 G4double EMASS = daughtermass[0];
150
151 // create parent G4DynamicParticle at rest
152 G4ThreeVector dummy;
153 auto parentparticle = new G4DynamicParticle(G4MT_parent, dummy, 0.0);
154 // create G4Decayproducts
155 auto products = new G4DecayProducts(*parentparticle);
156 delete parentparticle;
157
158 G4double x, y;
159
160 const std::size_t MAX_LOOP = 1000;
161
162 for (std::size_t loop_counter1 = 0; loop_counter1 < MAX_LOOP; ++loop_counter1) {
163 for (std::size_t loop_counter2 = 0; loop_counter2 < MAX_LOOP; ++loop_counter2) {
164 x = xl + G4UniformRand() * (xu - xl);
165 y = yl + G4UniformRand() * (yu - yl);
166 if (x + y > 1.) break;
167 }
168 G4double d2w = D2W(x, y);
169 if (d2w > G4UniformRand() * d2wmax) break;
170 }
171
172 // Calculate the angle between positron and photon (cosine)
173 //
174 G4double cthetaGE =
175 (y * (x - 2.) + 2. * (1. - x + beta * beta)) / (x * std::sqrt(y * y - 4. * beta * beta));
176
177 G4double G = x * EMPI / 2.;
178 G4double E = y * EMPI / 2.;
179
180 if (E < EMASS) E = EMASS;
181
182 // calculate daughter momentum
183 G4double daughtermomentum[2];
184
185 daughtermomentum[0] = std::sqrt(E * E - EMASS * EMASS);
186
187 G4double cthetaE = 2. * G4UniformRand() - 1.;
188 G4double sthetaE = std::sqrt(1. - cthetaE * cthetaE);
189
190 G4double phiE = twopi * G4UniformRand() * rad;
191 G4double cphiE = std::cos(phiE);
192 G4double sphiE = std::sin(phiE);
193
194 // Coordinates of the decay positron
195 //
196 G4double px = sthetaE * cphiE;
197 G4double py = sthetaE * sphiE;
198 G4double pz = cthetaE;
199
200 G4ThreeVector direction0(px, py, pz);
201
202 auto daughterparticle0 =
203 new G4DynamicParticle(G4MT_daughters[0], daughtermomentum[0] * direction0);
204
205 products->PushProducts(daughterparticle0);
206
207 daughtermomentum[1] = G;
208
209 G4double sthetaGE = std::sqrt(1. - cthetaGE * cthetaGE);
210
211 G4double phiGE = twopi * G4UniformRand() * rad;
212 G4double cphiGE = std::cos(phiGE);
213 G4double sphiGE = std::sin(phiGE);
214
215 // Coordinates of the decay gamma with respect to the decay positron
216 //
217 px = sthetaGE * cphiGE;
218 py = sthetaGE * sphiGE;
219 pz = cthetaGE;
220
221 G4ThreeVector direction1(px, py, pz);
222
223 direction1.rotateUz(direction0);
224
225 auto daughterparticle1 =
226 new G4DynamicParticle(G4MT_daughters[1], daughtermomentum[1] * direction1);
227
228 products->PushProducts(daughterparticle1);
229
230 // output message
231#ifdef G4VERBOSE
232 if (GetVerboseLevel() > 1) {
233 G4cout << "G4PionRadiativeDecayChannel::DecayIt() -";
234 G4cout << " create decay products in rest frame " << G4endl;
235 products->DumpInfo();
236 }
237#endif
238
239 return products;
240}
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
#define G4UniformRand()
Definition Randomize.hh:52
G4ParticleDefinition ** G4MT_daughters
G4ParticleDefinition * G4MT_parent

◆ operator=()

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

Definition at line 99 of file G4PionRadiativeDecayChannel.cc.

100{
101 if (this != &right) {
104 rbranch = right.rbranch;
105
106 // copy parent name
107 parent_name = new G4String(*right.parent_name);
108
109 // clear daughters_name array
111
112 // recreate array
114 if (numberOfDaughters > 0) {
115 if (daughters_name != nullptr) ClearDaughtersName();
117 // copy daughters name
118 for (G4int index = 0; index < numberOfDaughters; ++index) {
119 daughters_name[index] = new G4String(*right.daughters_name[index]);
120 }
121 }
122 }
123 return *this;
124}
G4String ** daughters_name

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