Geant4 9.6.0
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)
 
virtual ~G4PionRadiativeDecayChannel ()
 
virtual G4DecayProductsDecayIt (G4double)
 
- 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="")
 
virtual ~G4VDecayChannel ()
 
G4int operator== (const G4VDecayChannel &right) const
 
G4int operator!= (const G4VDecayChannel &right) const
 
G4int operator< (const G4VDecayChannel &right) const
 
virtual G4DecayProductsDecayIt (G4double parentMass=-1.0)=0
 
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 ()
 

Protected Member Functions

 G4PionRadiativeDecayChannel (const G4PionRadiativeDecayChannel &)
 
G4PionRadiativeDecayChanneloperator= (const G4PionRadiativeDecayChannel &)
 
 G4PionRadiativeDecayChannel ()
 
- Protected Member Functions inherited from G4VDecayChannel
 G4VDecayChannel ()
 
 G4VDecayChannel (const G4VDecayChannel &)
 
G4VDecayChanneloperator= (const G4VDecayChannel &)
 
void ClearDaughtersName ()
 
void FillDaughters ()
 
void FillParent ()
 

Additional Inherited Members

- Protected Attributes inherited from G4VDecayChannel
G4String kinematics_name
 
G4double rbranch
 
G4int numberOfDaughters
 
G4Stringparent_name
 
G4String ** daughters_name
 
G4ParticleTableparticletable
 
G4ParticleDefinitionparent
 
G4ParticleDefinition ** daughters
 
G4double parent_mass
 
G4doubledaughters_mass
 
G4int verboseLevel
 
- Static Protected Attributes inherited from G4VDecayChannel
static const G4String noName = " "
 

Detailed Description

Definition at line 54 of file G4PionRadiativeDecayChannel.hh.

Constructor & Destructor Documentation

◆ G4PionRadiativeDecayChannel() [1/3]

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

Definition at line 55 of file G4PionRadiativeDecayChannel.cc.

58 : G4VDecayChannel("Radiative Pion Decay",1)
59{
60 // set names for daughter particles
61 if (theParentName == "pi+") {
62 SetBR(theBR);
63 SetParent("pi+");
65 SetDaughter(0, "e+");
66 SetDaughter(1, "gamma");
67 SetDaughter(2, "nu_e");
68 } else if (theParentName == "pi-") {
69 SetBR(theBR);
70 SetParent("pi-");
72 SetDaughter(0, "e-");
73 SetDaughter(1, "gamma");
74 SetDaughter(2, "anti_nu_e");
75 } else {
76#ifdef G4VERBOSE
77 if (GetVerboseLevel()>0) {
78 G4cout << "G4RadiativePionDecayChannel:: constructor :";
79 G4cout << " parent particle is not charged pion but ";
80 G4cout << theParentName << G4endl;
81 }
82#endif
83 }
84
85 beta = 3.6612e-03;
86
87 cib = 1.16141e-03;
88 csdp = 3.45055e-02;
89 csdm = 5.14122e-03;
90 cif = 4.63543e-05;
91 cig = 1.78928e-05;
92
93 xl = 2.*0.1*MeV/139.57*MeV;
94 yl = ((1.-xl) + std::sqrt((1-xl)*(1-xl)+4*beta*beta))/2.;
95
96 xu = 1. - (yl - std::sqrt(yl*yl-4.*beta*beta))/2.;
97 yu = 1. + beta*beta;
98
99 d2wmax = D2W(xl,yl);
100
101}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT 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 ( )
virtual

Definition at line 103 of file G4PionRadiativeDecayChannel.cc.

104{
105}

◆ G4PionRadiativeDecayChannel() [2/3]

G4PionRadiativeDecayChannel::G4PionRadiativeDecayChannel ( const G4PionRadiativeDecayChannel right)
protected

Definition at line 106 of file G4PionRadiativeDecayChannel.cc.

107 :G4VDecayChannel(right),
108 beta(right.beta),cib(right.cib),csdp(right.csdp),
109 csdm(right.csdm),cif(right.cif),cig(right.cig),
110 xl(right.xl), yl(right.yl), xu(right.xu), yu(right.yu),
111 d2wmax(right.d2wmax)
112{
113}

◆ G4PionRadiativeDecayChannel() [3/3]

G4PionRadiativeDecayChannel::G4PionRadiativeDecayChannel ( )
protected

Definition at line 48 of file G4PionRadiativeDecayChannel.cc.

50 beta(0.),cib(0.),csdp(0.),csdm(0.),cif(0.),cig(0.),
51 xl(0.), yl(0.), xu(0.), yu(0.), d2wmax(0.)
52{
53}

Member Function Documentation

◆ DecayIt()

G4DecayProducts * G4PionRadiativeDecayChannel::DecayIt ( G4double  )
virtual

Implements G4VDecayChannel.

Definition at line 153 of file G4PionRadiativeDecayChannel.cc.

154{
155
156#ifdef G4VERBOSE
157 if (GetVerboseLevel()>1)
158 G4cout << "G4PionRadiativeDecayChannel::DecayIt ";
159#endif
160
161 if (parent == 0) FillParent();
162 if (daughters == 0) FillDaughters();
163
164 // parent mass
165 G4double parentmass = parent->GetPDGMass();
166
167 G4double EMPI = parentmass;
168
169 //daughters'mass
170 G4double daughtermass[3];
171 G4double sumofdaughtermass = 0.0;
172 for (G4int index=0; index<3; index++){
173 daughtermass[index] = daughters[index]->GetPDGMass();
174 sumofdaughtermass += daughtermass[index];
175 }
176
177 G4double EMASS = daughtermass[0];
178
179 //create parent G4DynamicParticle at rest
180 G4ThreeVector dummy;
181 G4DynamicParticle * parentparticle =
182 new G4DynamicParticle( parent, dummy, 0.0);
183 //create G4Decayproducts
184 G4DecayProducts *products = new G4DecayProducts(*parentparticle);
185 delete parentparticle;
186
187 G4double x, y, d2w;
188
189 do {
190
191 do {
192
193 x = xl + G4UniformRand()*(xu-xl);
194 y = yl + G4UniformRand()*(yu-yl);
195
196 } while (x+y <= 1.);
197
198 d2w = D2W(x,y);
199
200 } while (d2w <= G4UniformRand()*d2wmax);
201
202//-----------------------------------------------------------------------
203//
204// Calculate the angle between positron and photon (cosine)
205//
206 G4double cthetaGE = (y*(x-2.)+2.*(1.-x+beta*beta)) /
207 (x*std::sqrt(y*y-4.*beta*beta));
208
209//
210//-----------------------------------------------------------------------
211//
212 G4double G = x * EMPI/2.;
213 G4double E = y * EMPI/2.;
214//
215//-----------------------------------------------------------------------
216//
217
218 if (E < EMASS) E = EMASS;
219
220 // calculate daughter momentum
221 G4double daughtermomentum[2];
222
223 daughtermomentum[0] = std::sqrt(E*E - EMASS*EMASS);
224
225 G4double cthetaE = 2.*G4UniformRand()-1.;
226 G4double sthetaE = std::sqrt(1.-cthetaE*cthetaE);
227
228 G4double phiE = twopi*G4UniformRand()*rad;
229 G4double cphiE = std::cos(phiE);
230 G4double sphiE = std::sin(phiE);
231
232 //Coordinates of the decay positron
233
234 G4double px = sthetaE*cphiE;
235 G4double py = sthetaE*sphiE;
236 G4double pz = cthetaE;
237
238 G4ThreeVector direction0(px,py,pz);
239
240 G4DynamicParticle * daughterparticle0
241 = new G4DynamicParticle( daughters[0], daughtermomentum[0]*direction0);
242
243 products->PushProducts(daughterparticle0);
244
245 daughtermomentum[1] = G;
246
247 G4double sthetaGE = std::sqrt(1.-cthetaGE*cthetaGE);
248
249 G4double phiGE = twopi*G4UniformRand()*rad;
250 G4double cphiGE = std::cos(phiGE);
251 G4double sphiGE = std::sin(phiGE);
252
253 //Coordinates of the decay gamma with respect to the decay positron
254
255 px = sthetaGE*cphiGE;
256 py = sthetaGE*sphiGE;
257 pz = cthetaGE;
258
259 G4ThreeVector direction1(px,py,pz);
260
261 direction1.rotateUz(direction0);
262
263 G4DynamicParticle * daughterparticle1
264 = new G4DynamicParticle( daughters[1], daughtermomentum[1]*direction1);
265
266 products->PushProducts(daughterparticle1);
267
268// output message
269#ifdef G4VERBOSE
270 if (GetVerboseLevel()>1) {
271 G4cout << "G4PionRadiativeDecayChannel::DecayIt ";
272 G4cout << " create decay products in rest frame " <<G4endl;
273 products->DumpInfo();
274 }
275#endif
276
277 return products;
278
279}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4UniformRand()
Definition: Randomize.hh:53
void DumpInfo() const
G4int PushProducts(G4DynamicParticle *aParticle)
G4ParticleDefinition * parent
G4ParticleDefinition ** daughters

◆ operator=()

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

Definition at line 115 of file G4PionRadiativeDecayChannel.cc.

116{
117 if (this != &right) {
120 rbranch = right.rbranch;
121
122 // copy parent name
123 parent_name = new G4String(*right.parent_name);
124
125 // clear daughters_name array
127
128 // recreate array
130 if ( numberOfDaughters >0 ) {
133 //copy daughters name
134 for (G4int index=0; index < numberOfDaughters; index++) {
135 daughters_name[index] = new G4String(*right.daughters_name[index]);
136 }
137 }
138 beta = right.beta;
139 cib = right.cib;
140 csdp = right.csdp;
141 csdm = right.csdm;
142 cif = right.cif;
143 cig = right.cig;
144 xl = right.xl;
145 yl = right.yl;
146 xu = right.xu;
147 yu = right.yu;
148 d2wmax = right.d2wmax;
149 }
150 return *this;
151}
G4String * parent_name
G4String ** daughters_name
G4String kinematics_name

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