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

#include <G4KL3DecayChannel.hh>

+ Inheritance diagram for G4KL3DecayChannel:

Public Member Functions

 G4KL3DecayChannel (const G4String &theParentName, G4double theBR, const G4String &thePionName, const G4String &theLeptonName, const G4String &theNutrinoName)
 
 ~G4KL3DecayChannel () override=default
 
G4DecayProductsDecayIt (G4double) override
 
void SetDalitzParameter (G4double aLambda, G4double aXi)
 
G4double GetDalitzParameterLambda () const
 
G4double GetDalitzParameterXi () const
 
- 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 Types

enum  { idPi = 0 , idLepton = 1 , idNutrino = 2 }
 

Protected Member Functions

 G4KL3DecayChannel (const G4KL3DecayChannel &)=default
 
G4KL3DecayChanneloperator= (const G4KL3DecayChannel &)
 
void PhaseSpace (G4double Mparent, const G4double *Mdaughter, G4double *Edaughter, G4double *Pdaughter)
 
G4double DalitzDensity (G4double parentmass, G4double Epi, G4double El, G4double Enu, G4double massPi, G4double massL, G4double massNu)
 
- 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 37 of file G4KL3DecayChannel.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
idPi 
idLepton 
idNutrino 

Definition at line 57 of file G4KL3DecayChannel.hh.

Constructor & Destructor Documentation

◆ G4KL3DecayChannel() [1/2]

G4KL3DecayChannel::G4KL3DecayChannel ( const G4String & theParentName,
G4double theBR,
const G4String & thePionName,
const G4String & theLeptonName,
const G4String & theNutrinoName )

Definition at line 42 of file G4KL3DecayChannel.cc.

45 : G4VDecayChannel("KL3 Decay", theParentName, theBR, 3, thePionName, theLeptonName,
46 theNutrinoName)
47{
48 static const G4String K_plus("kaon+");
49 static const G4String K_minus("kaon-");
50 static const G4String K_L("kaon0L");
51 static const G4String Mu_plus("mu+");
52 static const G4String Mu_minus("mu-");
53 static const G4String E_plus("e+");
54 static const G4String E_minus("e-");
55
56 // check modes
57 if (((theParentName == K_plus) && (theLeptonName == E_plus))
58 || ((theParentName == K_minus) && (theLeptonName == E_minus)))
59 {
60 // K+- (Ke3)
61 pLambda = 0.0286;
62 pXi0 = -0.35;
63 }
64 else if (((theParentName == K_plus) && (theLeptonName == Mu_plus))
65 || ((theParentName == K_minus) && (theLeptonName == Mu_minus)))
66 {
67 // K+- (Kmu3)
68 pLambda = 0.033;
69 pXi0 = -0.35;
70 }
71 else if ((theParentName == K_L) && ((theLeptonName == E_plus) || (theLeptonName == E_minus))) {
72 // K0L (Ke3)
73 pLambda = 0.0300;
74 pXi0 = -0.11;
75 }
76 else if ((theParentName == K_L) && ((theLeptonName == Mu_plus) || (theLeptonName == Mu_minus))) {
77 // K0L (Kmu3)
78 pLambda = 0.034;
79 pXi0 = -0.11;
80 }
81 else {
82#ifdef G4VERBOSE
83 if (GetVerboseLevel() > 2) {
84 G4cout << "G4KL3DecayChannel:: constructor :";
85 G4cout << "illegal arguments " << G4endl;
86 ;
87 DumpInfo();
88 }
89#endif
90 // set values for K0L (Ke3) temporarily
91 pLambda = 0.0300;
92 pXi0 = -0.11;
93 }
94}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4int GetVerboseLevel() const

Referenced by G4KL3DecayChannel().

◆ ~G4KL3DecayChannel()

G4KL3DecayChannel::~G4KL3DecayChannel ( )
overridedefault

◆ G4KL3DecayChannel() [2/2]

G4KL3DecayChannel::G4KL3DecayChannel ( const G4KL3DecayChannel & )
protecteddefault

Member Function Documentation

◆ DalitzDensity()

G4double G4KL3DecayChannel::DalitzDensity ( G4double parentmass,
G4double Epi,
G4double El,
G4double Enu,
G4double massPi,
G4double massL,
G4double massNu )
protected

Definition at line 287 of file G4KL3DecayChannel.cc.

289{
290 // KL3 decay - Dalitz Plot Density, see Chounet et al Phys. Rep. 4, 201
291 // Arguments
292 // Epi: kinetic enregy of pion
293 // El: kinetic enregy of lepton (e or mu)
294 // Enu: kinetic energy of nutrino
295 // Constants
296 // pLambda : linear energy dependence of f+
297 // pXi0 : = f+(0)/f-
298 // pNorm : normalization factor
299 // Variables
300 // Epi: total energy of pion
301 // El: total energy of lepton (e or mu)
302 // Enu: total energy of nutrino
303
304 // calculate total energy
305 Epi = Epi + massPi;
306 El = El + massL;
307 Enu = Enu + massNu;
308
309 G4double Epi_max = (massK * massK + massPi * massPi - massL * massL) / 2.0 / massK;
310 G4double E = Epi_max - Epi;
311 G4double q2 = massK * massK + massPi * massPi - 2.0 * massK * Epi;
312
313 G4double F = 1.0 + pLambda * q2 / massPi / massPi;
314 G4double Fmax = 1.0;
315 if (pLambda > 0.0) Fmax = (1.0 + pLambda * (massK * massK / massPi / massPi + 1.0));
316
317 G4double Xi = pXi0 * (1.0 + pLambda * q2 / massPi / massPi);
318
319 G4double coeffA = massK * (2.0 * El * Enu - massK * E) + massL * massL * (E / 4.0 - Enu);
320 G4double coeffB = massL * massL * (Enu - E / 2.0);
321 G4double coeffC = massL * massL * E / 4.0;
322
323 G4double RhoMax = (Fmax * Fmax) * (massK * massK * massK / 8.0);
324
325 G4double Rho = (F * F) * (coeffA + coeffB * Xi + coeffC * Xi * Xi);
326
327#ifdef G4VERBOSE
328 if (GetVerboseLevel() > 2) {
329 G4cout << "G4KL3DecayChannel::DalitzDensity " << G4endl;
330 G4cout << " Pi[" << massPi / GeV << "GeV/c/c] :" << Epi / GeV << "GeV" << G4endl;
331 G4cout << " L[" << massL / GeV << "GeV/c/c] :" << El / GeV << "GeV" << G4endl;
332 G4cout << " Nu[" << massNu / GeV << "GeV/c/c] :" << Enu / GeV << "GeV" << G4endl;
333 G4cout << " F :" << F << " Fmax :" << Fmax << " Xi :" << Xi << G4endl;
334 G4cout << " A :" << coeffA << " B :" << coeffB << " C :" << coeffC << G4endl;
335 G4cout << " Rho :" << Rho << " RhoMax :" << RhoMax << G4endl;
336 }
337#endif
338 return (Rho / RhoMax);
339}
double G4double
Definition G4Types.hh:83

Referenced by DecayIt().

◆ DecayIt()

G4DecayProducts * G4KL3DecayChannel::DecayIt ( G4double )
overridevirtual

Implements G4VDecayChannel.

Definition at line 125 of file G4KL3DecayChannel.cc.

126{
127 // this version neglects muon polarization
128 // assumes the pure V-A coupling
129 // gives incorrect energy spectrum for Neutrinos
130#ifdef G4VERBOSE
131 if (GetVerboseLevel() > 1) G4cout << "G4KL3DecayChannel::DecayIt " << G4endl;
132#endif
133
134 // fill parent particle and its mass
137
138 // fill daughter particles and their mass
140 G4double daughterM[3];
141 daughterM[idPi] = G4MT_daughters[idPi]->GetPDGMass();
144
145 // determine momentum/energy of daughters according to DalitzDensity
146 G4double daughterP[3], daughterE[3];
147 G4double w;
148 G4double r;
149 const size_t MAX_LOOP = 10000;
150 for (std::size_t loop_counter = 0; loop_counter < MAX_LOOP; ++loop_counter) {
151 r = G4UniformRand();
152 PhaseSpace(massK, &daughterM[0], &daughterE[0], &daughterP[0]);
153 w = DalitzDensity(massK, daughterE[idPi], daughterE[idLepton], daughterE[idNutrino],
154 daughterM[idPi], daughterM[idLepton], daughterM[idNutrino]);
155 if (r <= w) break;
156 }
157
158 // output message
159#ifdef G4VERBOSE
160 if (GetVerboseLevel() > 1) {
161 G4cout << *daughters_name[0] << ":" << daughterP[0] / GeV << "[GeV/c]" << G4endl;
162 G4cout << *daughters_name[1] << ":" << daughterP[1] / GeV << "[GeV/c]" << G4endl;
163 G4cout << *daughters_name[2] << ":" << daughterP[2] / GeV << "[GeV/c]" << G4endl;
164 }
165#endif
166
167 // create parent G4DynamicParticle at rest
168 auto direction = new G4ThreeVector(1.0, 0.0, 0.0);
169 auto parentparticle = new G4DynamicParticle(G4MT_parent, *direction, 0.0);
170 delete direction;
171
172 // create G4Decayproducts
173 auto products = new G4DecayProducts(*parentparticle);
174 delete parentparticle;
175
176 // create daughter G4DynamicParticle
177 G4double costheta, sintheta, phi, sinphi, cosphi;
178 G4double costhetan, sinthetan, phin, sinphin, cosphin;
179
180 // pion
181 costheta = 2. * G4UniformRand() - 1.0;
182 sintheta = std::sqrt((1.0 - costheta) * (1.0 + costheta));
183 phi = twopi * G4UniformRand() * rad;
184 sinphi = std::sin(phi);
185 cosphi = std::cos(phi);
186 direction = new G4ThreeVector(sintheta * cosphi, sintheta * sinphi, costheta);
187 G4ThreeVector momentum0 = (*direction) * daughterP[0];
188 auto daughterparticle = new G4DynamicParticle(G4MT_daughters[0], momentum0);
189 products->PushProducts(daughterparticle);
190
191 // neutrino
192 costhetan =
193 (daughterP[1] * daughterP[1] - daughterP[2] * daughterP[2] - daughterP[0] * daughterP[0])
194 / (2.0 * daughterP[2] * daughterP[0]);
195 sinthetan = std::sqrt((1.0 - costhetan) * (1.0 + costhetan));
196 phin = twopi * G4UniformRand() * rad;
197 sinphin = std::sin(phin);
198 cosphin = std::cos(phin);
199 direction->setX(sinthetan * cosphin * costheta * cosphi - sinthetan * sinphin * sinphi
200 + costhetan * sintheta * cosphi);
201 direction->setY(sinthetan * cosphin * costheta * sinphi + sinthetan * sinphin * cosphi
202 + costhetan * sintheta * sinphi);
203 direction->setZ(-sinthetan * cosphin * sintheta + costhetan * costheta);
204
205 G4ThreeVector momentum2 = (*direction) * daughterP[2];
206 daughterparticle = new G4DynamicParticle(G4MT_daughters[2], momentum2);
207 products->PushProducts(daughterparticle);
208
209 // lepton
210 G4ThreeVector momentum1 = (momentum0 + momentum2) * (-1.0);
211 daughterparticle = new G4DynamicParticle(G4MT_daughters[1], momentum1);
212 products->PushProducts(daughterparticle);
213
214#ifdef G4VERBOSE
215 if (GetVerboseLevel() > 1) {
216 G4cout << "G4KL3DecayChannel::DecayIt ";
217 G4cout << " create decay products in rest frame " << G4endl;
218 G4cout << " decay products address=" << products << G4endl;
219 products->DumpInfo();
220 }
221#endif
222 delete direction;
223 return products;
224}
CLHEP::Hep3Vector G4ThreeVector
#define G4UniformRand()
Definition Randomize.hh:52
void PhaseSpace(G4double Mparent, const G4double *Mdaughter, G4double *Edaughter, G4double *Pdaughter)
G4double DalitzDensity(G4double parentmass, G4double Epi, G4double El, G4double Enu, G4double massPi, G4double massL, G4double massNu)
G4ParticleDefinition ** G4MT_daughters
G4String ** daughters_name
G4ParticleDefinition * G4MT_parent

◆ GetDalitzParameterLambda()

G4double G4KL3DecayChannel::GetDalitzParameterLambda ( ) const
inline

Definition at line 100 of file G4KL3DecayChannel.hh.

101{
102 return pLambda;
103}

◆ GetDalitzParameterXi()

G4double G4KL3DecayChannel::GetDalitzParameterXi ( ) const
inline

Definition at line 105 of file G4KL3DecayChannel.hh.

106{
107 return pXi0;
108}

◆ operator=()

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

Definition at line 96 of file G4KL3DecayChannel.cc.

97{
98 if (this != &right) {
101 rbranch = right.rbranch;
102
103 // copy parent name
104 parent_name = new G4String(*right.parent_name);
105
106 // clear daughters_name array
108
109 // recreate array
111 if (numberOfDaughters > 0) {
112 if (daughters_name != nullptr) ClearDaughtersName();
114 // copy daughters name
115 for (G4int index = 0; index < numberOfDaughters; ++index) {
116 daughters_name[index] = new G4String(*right.daughters_name[index]);
117 }
118 }
119 pLambda = right.pLambda;
120 pXi0 = right.pXi0;
121 }
122 return *this;
123}
int G4int
Definition G4Types.hh:85

◆ PhaseSpace()

void G4KL3DecayChannel::PhaseSpace ( G4double Mparent,
const G4double * Mdaughter,
G4double * Edaughter,
G4double * Pdaughter )
protected

Definition at line 226 of file G4KL3DecayChannel.cc.

227{
228 // Algorithm in this code was originally written in GDECA3 in GEANT3
229
230 // sum of daughters'mass
231 G4double sumofdaughtermass = 0.0;
232 G4int index;
233 const G4int N_DAUGHTER = 3;
234
235 for (index = 0; index < N_DAUGHTER; ++index) {
236 sumofdaughtermass += M[index];
237 }
238
239 // calculate daughter momentum. Generate two
240 G4double rd1, rd2, rd;
241 G4double momentummax = 0.0, momentumsum = 0.0;
243 const size_t MAX_LOOP = 10000;
244 for (std::size_t loop_counter = 0; loop_counter < MAX_LOOP; ++loop_counter) {
245 rd1 = G4UniformRand();
246 rd2 = G4UniformRand();
247 if (rd2 > rd1) {
248 rd = rd1;
249 rd1 = rd2;
250 rd2 = rd;
251 }
252 momentummax = 0.0;
253 momentumsum = 0.0;
254 // daughter 0
255 energy = rd2 * (parentM - sumofdaughtermass);
256 P[0] = std::sqrt(energy * energy + 2.0 * energy * M[0]);
257 E[0] = energy;
258 if (P[0] > momentummax) momentummax = P[0];
259 momentumsum += P[0];
260 // daughter 1
261 energy = (1. - rd1) * (parentM - sumofdaughtermass);
262 P[1] = std::sqrt(energy * energy + 2.0 * energy * M[1]);
263 E[1] = energy;
264 if (P[1] > momentummax) momentummax = P[1];
265 momentumsum += P[1];
266 // daughter 2
267 energy = (rd1 - rd2) * (parentM - sumofdaughtermass);
268 P[2] = std::sqrt(energy * energy + 2.0 * energy * M[2]);
269 E[2] = energy;
270 if (P[2] > momentummax) momentummax = P[2];
271 momentumsum += P[2];
272 if (momentummax <= momentumsum - momentummax) break;
273 }
274#ifdef G4VERBOSE
275 if (GetVerboseLevel() > 2) {
276 G4cout << "G4KL3DecayChannel::PhaseSpace ";
277 G4cout << "Kon mass:" << parentM / GeV << "GeV/c/c" << G4endl;
278 for (index = 0; index < 3; ++index) {
279 G4cout << index << " : " << M[index] / GeV << "GeV/c/c ";
280 G4cout << " : " << E[index] / GeV << "GeV ";
281 G4cout << " : " << P[index] / GeV << "GeV/c " << G4endl;
282 }
283 }
284#endif
285}
#define M(row, col)
G4double energy(const ThreeVector &p, const G4double m)

Referenced by DecayIt().

◆ SetDalitzParameter()

void G4KL3DecayChannel::SetDalitzParameter ( G4double aLambda,
G4double aXi )
inline

Definition at line 94 of file G4KL3DecayChannel.hh.

95{
96 pLambda = aLambda;
97 pXi0 = aXi;
98}

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