Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4PionRadiativeDecayChannel Class Reference

#include <G4PionRadiativeDecayChannel.hh>

Inheritance diagram for G4PionRadiativeDecayChannel:
Collaboration diagram for G4PionRadiativeDecayChannel:

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 ()
 
G4double GetRangeMass () const
 
void SetRangeMass (G4double val)
 
virtual G4bool IsOKWithParentMass (G4double parentMass)
 
void SetPolarization (const G4ThreeVector &)
 
const G4ThreeVector & GetPolarization () const
 

Protected Member Functions

 G4PionRadiativeDecayChannel (const G4PionRadiativeDecayChannel &)
 
G4PionRadiativeDecayChannel & operator= (const G4PionRadiativeDecayChannel &)
 
 G4PionRadiativeDecayChannel ()
 
- Protected Member Functions inherited from G4VDecayChannel
void ClearDaughtersName ()
 
void CheckAndFillDaughters ()
 
void CheckAndFillParent ()
 
 G4VDecayChannel ()
 
 G4VDecayChannel (const G4VDecayChannel &)
 
G4VDecayChannel & operator= (const G4VDecayChannel &)
 
G4double DynamicalMass (G4double massPDG, G4double width, G4double maxDev=+1.) const
 

Additional Inherited Members

- Protected Attributes inherited from G4VDecayChannel
G4String kinematics_name
 
G4double rbranch
 
G4int numberOfDaughters
 
G4String * parent_name
 
G4String ** daughters_name
 
G4double rangeMass
 
G4ThreeVector parent_polarization
 
G4ParticleTable * particletable
 
G4int verboseLevel
 
G4ParticleDefinition * G4MT_parent
 
G4ParticleDefinition ** G4MT_daughters
 
G4double G4MT_parent_mass
 
G4double * G4MT_daughters_mass
 
G4double * G4MT_daughters_width
 
G4Mutex daughtersMutex
 
G4Mutex parentMutex
 
- 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 79 of file G4PionRadiativeDecayChannel.cc.

81  : G4VDecayChannel("Radiative Pion Decay",1)
82 {
83  // set names for daughter particles
84  if (theParentName == "pi+") {
85  SetBR(theBR);
86  SetParent("pi+");
88  SetDaughter(0, "e+");
89  SetDaughter(1, "gamma");
90  SetDaughter(2, "nu_e");
91  } else if (theParentName == "pi-") {
92  SetBR(theBR);
93  SetParent("pi-");
95  SetDaughter(0, "e-");
96  SetDaughter(1, "gamma");
97  SetDaughter(2, "anti_nu_e");
98  } else {
99 #ifdef G4VERBOSE
100  if (GetVerboseLevel()>0) {
101  G4cout << "G4RadiativePionDecayChannel:: constructor :";
102  G4cout << " parent particle is not charged pion but ";
103  G4cout << theParentName << G4endl;
104  }
105 #endif
106  }
107 }
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

Here is the call graph for this function:

G4PionRadiativeDecayChannel::~G4PionRadiativeDecayChannel ( )
virtual

Definition at line 109 of file G4PionRadiativeDecayChannel.cc.

110 {
111 }
G4PionRadiativeDecayChannel::G4PionRadiativeDecayChannel ( const G4PionRadiativeDecayChannel &  right)
protected

Definition at line 112 of file G4PionRadiativeDecayChannel.cc.

113  :G4VDecayChannel(right)
114 {
115 }
G4PionRadiativeDecayChannel::G4PionRadiativeDecayChannel ( )
protected

Definition at line 73 of file G4PionRadiativeDecayChannel.cc.

74  : G4VDecayChannel()
75 {
76 }

Member Function Documentation

G4DecayProducts * G4PionRadiativeDecayChannel::DecayIt ( G4double  )
virtual

Implements G4VDecayChannel.

Definition at line 144 of file G4PionRadiativeDecayChannel.cc.

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

Here is the call graph for this function:

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

Definition at line 117 of file G4PionRadiativeDecayChannel.cc.

118 {
119  if (this != &right) {
121  verboseLevel = right.verboseLevel;
122  rbranch = right.rbranch;
123 
124  // copy parent name
125  parent_name = new G4String(*right.parent_name);
126 
127  // clear daughters_name array
129 
130  // recreate array
132  if ( numberOfDaughters >0 ) {
135  //copy daughters name
136  for (G4int index=0; index < numberOfDaughters; index++) {
137  daughters_name[index] = new G4String(*right.daughters_name[index]);
138  }
139  }
140  }
141  return *this;
142 }
int G4int
Definition: G4Types.hh:78
G4String kinematics_name
G4String * parent_name
G4String ** daughters_name

Here is the call graph for this function:


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