Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes
G4NeutronBetaDecayChannel Class Reference

#include <G4NeutronBetaDecayChannel.hh>

Inheritance diagram for G4NeutronBetaDecayChannel:
G4VDecayChannel

Public Member Functions

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

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

Protected Attributes

const G4double aENuCorr
 
- Protected Attributes inherited from G4VDecayChannel
G4String kinematics_name
 
G4double rbranch
 
G4int numberOfDaughters
 
G4Stringparent_name
 
G4String ** daughters_name
 
G4ParticleTableparticletable
 
G4int verboseLevel
 
G4ParticleDefinitionG4MT_parent
 
G4ParticleDefinition ** G4MT_daughters
 
G4double G4MT_parent_mass
 
G4doubleG4MT_daughters_mass
 

Additional Inherited Members

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

Detailed Description

Definition at line 43 of file G4NeutronBetaDecayChannel.hh.

Constructor & Destructor Documentation

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

Definition at line 58 of file G4NeutronBetaDecayChannel.cc.

References G4cout, G4endl, G4VDecayChannel::GetVerboseLevel(), G4VDecayChannel::SetBR(), G4VDecayChannel::SetDaughter(), G4VDecayChannel::SetNumberOfDaughters(), and G4VDecayChannel::SetParent().

61  :G4VDecayChannel("Neutron Decay"),
62  aENuCorr(-0.102)
63 {
64  // set names for daughter particles
65  if (theParentName == "neutron") {
66  SetBR(theBR);
67  SetParent("neutron");
69  SetDaughter(0, "e-");
70  SetDaughter(1, "anti_nu_e");
71  SetDaughter(2, "proton");
72  } else if (theParentName == "anti_neutron") {
73  SetBR(theBR);
74  SetParent("anti_neutron");
76  SetDaughter(0, "e+");
77  SetDaughter(1, "nu_e");
78  SetDaughter(2, "anti_proton");
79  } else {
80 #ifdef G4VERBOSE
81  if (GetVerboseLevel()>0) {
82  G4cout << "G4NeutronBetaDecayChannel:: constructor :";
83  G4cout << " parent particle is not neutron but ";
84  G4cout << theParentName << G4endl;
85  }
86 #endif
87  }
88 }
void SetBR(G4double value)
G4GLOB_DLL std::ostream G4cout
void SetNumberOfDaughters(G4int value)
G4int GetVerboseLevel() const
void SetParent(const G4ParticleDefinition *particle_type)
void SetDaughter(G4int anIndex, const G4ParticleDefinition *particle_type)
#define G4endl
Definition: G4ios.hh:61
G4NeutronBetaDecayChannel::~G4NeutronBetaDecayChannel ( )
virtual

Definition at line 90 of file G4NeutronBetaDecayChannel.cc.

91 {
92 }
G4NeutronBetaDecayChannel::G4NeutronBetaDecayChannel ( const G4NeutronBetaDecayChannel right)
protected

Definition at line 94 of file G4NeutronBetaDecayChannel.cc.

95  : G4VDecayChannel(right),
96  aENuCorr(-0.102)
97 {
98 }
G4NeutronBetaDecayChannel::G4NeutronBetaDecayChannel ( )
protected

Definition at line 52 of file G4NeutronBetaDecayChannel.cc.

53  :G4VDecayChannel(),
54  aENuCorr(-0.102)
55 {
56 }

Member Function Documentation

G4DecayProducts * G4NeutronBetaDecayChannel::DecayIt ( G4double  )
virtual

Implements G4VDecayChannel.

Definition at line 128 of file G4NeutronBetaDecayChannel.cc.

References aENuCorr, G4DecayProducts::DumpInfo(), G4VDecayChannel::FillDaughters(), G4VDecayChannel::FillParent(), G4cout, G4endl, G4VDecayChannel::G4MT_daughters, G4VDecayChannel::G4MT_parent, G4UniformRand, G4ParticleDefinition::GetPDGMass(), G4VDecayChannel::GetVerboseLevel(), G4DecayProducts::PushProducts(), python.hepunit::rad, CLHEP::HepRotation::rotateY(), CLHEP::HepRotation::rotateZ(), python.hepunit::twopi, and test::x.

129 {
130  // This class describes free neutron beta decay kinemtics.
131  // This version neglects neutron/electron polarization
132  // without Coulomb effect
133 
134 #ifdef G4VERBOSE
135  if (GetVerboseLevel()>1) G4cout << "G4NeutronBetaDecayChannel::DecayIt ";
136 #endif
137 
138  if (G4MT_parent == 0) FillParent();
139  if (G4MT_daughters == 0) FillDaughters();
140 
141  // parent mass
142  G4double parentmass = G4MT_parent->GetPDGMass();
143 
144  //daughters'mass
145  G4double daughtermass[3];
146  G4double sumofdaughtermass = 0.0;
147  for (G4int index=0; index<3; index++){
148  daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
149  sumofdaughtermass += daughtermass[index];
150  }
151  G4double xmax = parentmass-sumofdaughtermass;
152 
153  //create parent G4DynamicParticle at rest
154  G4ThreeVector dummy;
155  G4DynamicParticle * parentparticle = new G4DynamicParticle( G4MT_parent, dummy, 0.0);
156 
157  //create G4Decayproducts
158  G4DecayProducts *products = new G4DecayProducts(*parentparticle);
159  delete parentparticle;
160 
161  // calculate daughter momentum
162  G4double daughtermomentum[3];
163 
164  // calcurate electron energy
165  G4double x; // Ee
166  G4double p; // Pe
167  G4double dm = daughtermass[0]; //Me
168  G4double w; // cosine of e-nu angle
169  G4double r;
170  G4double r0;
171  do {
172  x = xmax*G4UniformRand();
173  p = std::sqrt(x*(x+2.0*dm));
174  w = 1.0-2.0*G4UniformRand();
175  r = p*(x+dm)*(xmax-x)*(xmax-x)*(1.0+aENuCorr*p/(x+dm)*w);
176  r0 = G4UniformRand()*(xmax+dm)*(xmax+dm)*xmax*xmax*(1.0+aENuCorr);
177  } while (r < r0);
178 
179 
180  //create daughter G4DynamicParticle
181  // rotation materix to lab frame
182  G4double costheta = 2.*G4UniformRand()-1.0;
183  G4double theta = std::acos(costheta)*rad;
185  G4RotationMatrix rm;
186  rm.rotateY(theta);
187  rm.rotateZ(phi);
188 
189  // daughter 0 (electron) in Z direction
190  daughtermomentum[0] = p;
191  G4ThreeVector direction0(0.0, 0.0, 1.0);
192  direction0 = rm * direction0;
193  G4DynamicParticle * daughterparticle0
194  = new G4DynamicParticle( G4MT_daughters[0], direction0*daughtermomentum[0]);
195  products->PushProducts(daughterparticle0);
196 
197  // daughter 1 (nutrino) in XZ plane
198  G4double eNu; // Enu
199  eNu = (parentmass-daughtermass[2])*(parentmass+daughtermass[2])+(dm*dm)-2.*parentmass*(x+dm);
200  eNu /= 2.*(parentmass+p*w-(x+dm));
201  G4double cosn = w;
202  G4double phin = twopi*G4UniformRand()*rad;
203  G4double sinn = std::sqrt((1.0-cosn)*(1.0+cosn));
204 
205  G4ThreeVector direction1(sinn*std::cos(phin), sinn*std::sin(phin), cosn);
206  direction1 = rm * direction1;
207  G4DynamicParticle * daughterparticle1
208  = new G4DynamicParticle( G4MT_daughters[1], direction1*eNu);
209  products->PushProducts(daughterparticle1);
210 
211  // daughter 2 (proton) at REST
212  G4double eP; // Eproton
213  eP = parentmass-eNu-(x+dm)-daughtermass[2];
214  G4double pPx = -eNu*sinn;
215  G4double pPz = -p-eNu*cosn;
216  G4double pP = std::sqrt(eP*(eP+2.*daughtermass[2]));
217  G4ThreeVector direction2(pPx/pP*std::cos(phin), pPx/pP*std::sin(phin), pPz/pP);
218  G4DynamicParticle * daughterparticle2
219  = new G4DynamicParticle( G4MT_daughters[2], direction2);
220  products->PushProducts(daughterparticle2);
221 
222 
223  // output message
224 #ifdef G4VERBOSE
225  if (GetVerboseLevel()>1) {
226  G4cout << "G4NeutronBetaDecayChannel::DecayIt ";
227  G4cout << " create decay products in rest frame " <<G4endl;
228  products->DumpInfo();
229  }
230 #endif
231  return products;
232 }
G4int PushProducts(G4DynamicParticle *aParticle)
G4ParticleDefinition * G4MT_parent
const char * p
Definition: xmltok.h:285
G4ParticleDefinition ** G4MT_daughters
HepRotation & rotateY(double delta)
Definition: Rotation.cc:79
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
void DumpInfo() const
G4int GetVerboseLevel() const
G4double GetPDGMass() const
HepRotation & rotateZ(double delta)
Definition: Rotation.cc:92
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4NeutronBetaDecayChannel & G4NeutronBetaDecayChannel::operator= ( const G4NeutronBetaDecayChannel right)
protected

Definition at line 101 of file G4NeutronBetaDecayChannel.cc.

References G4VDecayChannel::ClearDaughtersName(), G4VDecayChannel::daughters_name, G4VDecayChannel::kinematics_name, G4VDecayChannel::numberOfDaughters, G4VDecayChannel::parent_name, G4VDecayChannel::rbranch, and G4VDecayChannel::verboseLevel.

102 {
103  if (this != &right) {
105  verboseLevel = right.verboseLevel;
106  rbranch = right.rbranch;
107 
108  // copy parent name
109  parent_name = new G4String(*right.parent_name);
110 
111  // clear daughters_name array
113 
114  // recreate array
116  if ( numberOfDaughters >0 ) {
119  //copy daughters name
120  for (G4int index=0; index < numberOfDaughters; index++) {
121  daughters_name[index] = new G4String(*right.daughters_name[index]);
122  }
123  }
124  }
125  return *this;
126 }
int G4int
Definition: G4Types.hh:78
G4String kinematics_name
G4String * parent_name
G4String ** daughters_name

Field Documentation

const G4double G4NeutronBetaDecayChannel::aENuCorr
protected

Definition at line 70 of file G4NeutronBetaDecayChannel.hh.

Referenced by DecayIt().


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