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

#include <G4MuonDecayChannel.hh>

Inheritance diagram for G4MuonDecayChannel:
G4VDecayChannel G4MuonDecayChannelWithSpin

Public Member Functions

 G4MuonDecayChannel (const G4String &theParentName, G4double theBR)
 
virtual ~G4MuonDecayChannel ()
 
virtual G4DecayProducts * DecayIt (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 G4String & GetKinematicsName () const
 
G4double GetBR () const
 
G4int GetNumberOfDaughters () const
 
G4ParticleDefinition * GetParent ()
 
G4ParticleDefinition * GetDaughter (G4int anIndex)
 
G4int GetAngularMomentum ()
 
const G4String & GetParentName () const
 
const G4String & GetDaughterName (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

 G4MuonDecayChannel (const G4MuonDecayChannel &)
 
G4MuonDecayChannel & operator= (const G4MuonDecayChannel &)
 
 G4MuonDecayChannel ()
 
- Protected Member Functions inherited from G4VDecayChannel
void ClearDaughtersName ()
 
void FillDaughters ()
 
void FillParent ()
 
 G4VDecayChannel ()
 
 G4VDecayChannel (const G4VDecayChannel &)
 
G4VDecayChannel & operator= (const G4VDecayChannel &)
 

Additional Inherited Members

- Protected Attributes inherited from G4VDecayChannel
G4String kinematics_name
 
G4double rbranch
 
G4int numberOfDaughters
 
G4String * parent_name
 
G4String ** daughters_name
 
G4ParticleTable * particletable
 
G4int verboseLevel
 
G4ParticleDefinition * G4MT_parent
 
G4ParticleDefinition ** G4MT_daughters
 
G4double G4MT_parent_mass
 
G4double * G4MT_daughters_mass
 
- Static Protected Attributes inherited from G4VDecayChannel
static const G4String noName = " "
 

Detailed Description

Definition at line 43 of file G4MuonDecayChannel.hh.

Constructor & Destructor Documentation

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

Definition at line 59 of file G4MuonDecayChannel.cc.

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

61  :G4VDecayChannel("Muon Decay",1)
62 {
63  // set names for daughter particles
64  if (theParentName == "mu+") {
65  SetBR(theBR);
66  SetParent("mu+");
68  SetDaughter(0, "e+");
69  SetDaughter(1, "nu_e");
70  SetDaughter(2, "anti_nu_mu");
71  } else if (theParentName == "mu-") {
72  SetBR(theBR);
73  SetParent("mu-");
75  SetDaughter(0, "e-");
76  SetDaughter(1, "anti_nu_e");
77  SetDaughter(2, "nu_mu");
78  } else {
79 #ifdef G4VERBOSE
80  if (GetVerboseLevel()>0) {
81  G4cout << "G4MuonDecayChannel:: constructor :";
82  G4cout << " parent particle is not muon but ";
83  G4cout << theParentName << G4endl;
84  }
85 #endif
86  }
87 }
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
G4MuonDecayChannel::~G4MuonDecayChannel ( )
virtual

Definition at line 94 of file G4MuonDecayChannel.cc.

95 {
96 }
G4MuonDecayChannel::G4MuonDecayChannel ( const G4MuonDecayChannel &  right)
protected

Definition at line 89 of file G4MuonDecayChannel.cc.

89  :
90  G4VDecayChannel(right)
91 {
92 }
G4MuonDecayChannel::G4MuonDecayChannel ( )
protected

Definition at line 54 of file G4MuonDecayChannel.cc.

56 {
57 }

Member Function Documentation

G4DecayProducts * G4MuonDecayChannel::DecayIt ( G4double  )
virtual

Implements G4VDecayChannel.

Reimplemented in G4MuonDecayChannelWithSpin.

Definition at line 125 of file G4MuonDecayChannel.cc.

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

126 {
127  // this version neglects muon polarization,and electron mass
128  // assumes the pure V-A coupling
129  // the Neutrinos are correctly V-A.
130 #ifdef G4VERBOSE
131  if (GetVerboseLevel()>1) G4cout << "G4MuonDecayChannel::DecayIt ";
132 #endif
133 
134  if (G4MT_parent == 0) FillParent();
135  if (G4MT_daughters == 0) FillDaughters();
136 
137  // parent mass
138  G4double parentmass = G4MT_parent->GetPDGMass();
139 
140  //daughters'mass
141  G4double daughtermass[3];
142  G4double sumofdaughtermass = 0.0;
143  for (G4int index=0; index<3; index++){
144  daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
145  sumofdaughtermass += daughtermass[index];
146  }
147 
148  //create parent G4DynamicParticle at rest
149  G4ThreeVector dummy;
150  G4DynamicParticle * parentparticle = new G4DynamicParticle( G4MT_parent, dummy, 0.0);
151  //create G4Decayproducts
152  G4DecayProducts *products = new G4DecayProducts(*parentparticle);
153  delete parentparticle;
154 
155  // calculate daughter momentum
156  G4double daughtermomentum[3];
157  // calcurate electron energy
158  G4double xmax = (1.0+daughtermass[0]*daughtermass[0]/parentmass/parentmass);
159  G4double x;
160 
161  G4double Ee,Ene;
162 
163  G4double gam;
164  G4double EMax=parentmass/2-daughtermass[0];
165 
166 
167  //Generating Random Energy
168 do {
169  Ee=G4UniformRand();
170  do{
171  x=xmax*G4UniformRand();
172  gam=G4UniformRand();
173  }while (gam >x*(1.-x));
174  Ene=x;
175  } while ( Ene < (1.-Ee));
176  G4double Enm=(2.-Ee-Ene);
177 
178 
179  //initialisation of rotation parameters
180 
181  G4double costheta,sintheta,rphi,rtheta,rpsi;
182  costheta= 1.-2./Ee-2./Ene+2./Ene/Ee;
183  sintheta=std::sqrt(1.-costheta*costheta);
184 
185 
186  rphi=twopi*G4UniformRand()*rad;
187  rtheta=(std::acos(2.*G4UniformRand()-1.));
188  rpsi=twopi*G4UniformRand()*rad;
189 
190  G4RotationMatrix rot;
191  rot.set(rphi,rtheta,rpsi);
192 
193  //electron 0
194  daughtermomentum[0]=std::sqrt(Ee*Ee*EMax*EMax+2.0*Ee*EMax * daughtermass[0]);
195  G4ThreeVector direction0(0.0,0.0,1.0);
196 
197  direction0 *= rot;
198 
199  G4DynamicParticle * daughterparticle = new G4DynamicParticle ( G4MT_daughters[0], direction0 * daughtermomentum[0]);
200 
201  products->PushProducts(daughterparticle);
202 
203  //electronic neutrino 1
204 
205  daughtermomentum[1]=std::sqrt(Ene*Ene*EMax*EMax+2.0*Ene*EMax * daughtermass[1]);
206  G4ThreeVector direction1(sintheta,0.0,costheta);
207 
208  direction1 *= rot;
209 
210  G4DynamicParticle * daughterparticle1 = new G4DynamicParticle ( G4MT_daughters[1], direction1 * daughtermomentum[1]);
211  products->PushProducts(daughterparticle1);
212 
213  //muonnic neutrino 2
214 
215  daughtermomentum[2]=std::sqrt(Enm*Enm*EMax*EMax +2.0*Enm*EMax*daughtermass[2]);
216  G4ThreeVector direction2(-Ene/Enm*sintheta,0,-Ee/Enm-Ene/Enm*costheta);
217 
218  direction2 *= rot;
219 
220  G4DynamicParticle * daughterparticle2 = new G4DynamicParticle ( G4MT_daughters[2],
221  direction2 * daughtermomentum[2]);
222  products->PushProducts(daughterparticle2);
223 
224 
225 
226 
227  // output message
228 #ifdef G4VERBOSE
229  if (GetVerboseLevel()>1) {
230  G4cout << "G4MuonDecayChannel::DecayIt ";
231  G4cout << " create decay products in rest frame " <<G4endl;
232  products->DumpInfo();
233  }
234 #endif
235  return products;
236 }
G4int PushProducts(G4DynamicParticle *aParticle)
G4ParticleDefinition * G4MT_parent
G4ParticleDefinition ** G4MT_daughters
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
void DumpInfo() const
HepRotation & set(const Hep3Vector &axis, double delta)
Definition: RotationA.cc:27
G4int GetVerboseLevel() const
G4double GetPDGMass() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4MuonDecayChannel & G4MuonDecayChannel::operator= ( const G4MuonDecayChannel &  right)
protected

Definition at line 98 of file G4MuonDecayChannel.cc.

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

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

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