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

#include <G4PionRadiativeDecayChannel.hh>

Inheritance diagram for G4PionRadiativeDecayChannel:
G4VDecayChannel

Public Member Functions

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

 G4PionRadiativeDecayChannel (const G4PionRadiativeDecayChannel &)
 
G4PionRadiativeDecayChannel & operator= (const G4PionRadiativeDecayChannel &)
 
 G4PionRadiativeDecayChannel ()
 
- 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 54 of file G4PionRadiativeDecayChannel.hh.

Constructor & Destructor Documentation

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

Definition at line 56 of file G4PionRadiativeDecayChannel.cc.

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

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 }
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
G4PionRadiativeDecayChannel::~G4PionRadiativeDecayChannel ( )
virtual

Definition at line 103 of file G4PionRadiativeDecayChannel.cc.

104 {
105 }
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::G4PionRadiativeDecayChannel ( )
protected

Definition at line 48 of file G4PionRadiativeDecayChannel.cc.

49  : G4VDecayChannel(),
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

G4DecayProducts * G4PionRadiativeDecayChannel::DecayIt ( G4double  )
virtual

Implements G4VDecayChannel.

Definition at line 153 of file G4PionRadiativeDecayChannel.cc.

References 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::Hep3Vector::rotateUz(), python.hepunit::twopi, and test::x.

154 {
155 
156 #ifdef G4VERBOSE
157  if (GetVerboseLevel()>1)
158  G4cout << "G4PionRadiativeDecayChannel::DecayIt ";
159 #endif
160 
161  if (G4MT_parent == 0) FillParent();
162  if (G4MT_daughters == 0) FillDaughters();
163 
164  // parent mass
165  G4double parentmass = G4MT_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] = G4MT_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( G4MT_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( G4MT_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( G4MT_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 }
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
G4int GetVerboseLevel() const
G4double GetPDGMass() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4PionRadiativeDecayChannel & G4PionRadiativeDecayChannel::operator= ( const G4PionRadiativeDecayChannel &  right)
protected

Definition at line 115 of file G4PionRadiativeDecayChannel.cc.

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

116 {
117  if (this != &right) {
119  verboseLevel = right.verboseLevel;
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 }
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: