/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
GenDecay::BetaRadiation Class Reference

#include <Radiation.h>

Inheritance diagram for GenDecay::BetaRadiation:
Inheritance graph
[legend]
Collaboration diagram for GenDecay::BetaRadiation:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BetaRadiation (double energy, int parentZ)
virtual ~BetaRadiation ()
RadiationType type () const
std::string typeString () const
std::string asString () const
int sign () const
double kineticEnergy () const
int pid () const
double mass () const
double dnde (double kineticEnergy) const
double dnde_noff (double kineticEnergy) const
double fermi_function (double kineticEnergy) const

Protected Attributes

double m_energy

Private Member Functions

void normalize ()

Private Attributes

int m_parentZ
int m_daughterZ
int m_betaSign
double m_endpoint
double m_norm
double m_maximum
Rndm::Numbers m_rand

Detailed Description

Definition at line 71 of file Radiation.h.


Constructor & Destructor Documentation

BetaRadiation::BetaRadiation ( double  energy,
int  parentZ 
)

Definition at line 73 of file Radiation.cc.

    : Radiation(energy)
    , m_parentZ(parentZ)
    , m_daughterZ(0)
    , m_betaSign(0)
    , m_endpoint(0.0)
{
    if (parentZ < 0) {          // beta+ decay 
        m_parentZ = -parentZ;
        m_daughterZ = m_parentZ - 1;
        m_betaSign = +1;
        m_endpoint = m_energy - 2.0*CLHEP::electron_mass_c2;
    }
    else {                      // # beta- decay
        m_parentZ = parentZ;
        m_daughterZ = m_parentZ + 1;
        m_betaSign = -1;
        m_endpoint = m_energy;
    }

    ServiceHandle<IRndmGenSvc> rgsh("RndmGenSvc","BetaRadiation");
    IRndmGenSvc *rgs = rgsh.operator->();
    if (m_rand.initialize(rgs, Rndm::Flat(0,1)).isFailure()) {
        throw GaudiException("Failed to initialize uniform random numbers",
                             "GenDecay::Radiation",StatusCode::FAILURE);
    }
    if (!m_rand) {
        throw GaudiException("Got null Rndm::Numbers object",
                             "GenDecay::Radiation",StatusCode::FAILURE);
    }

    this->normalize();
}
BetaRadiation::~BetaRadiation ( ) [virtual]

Definition at line 128 of file Radiation.cc.

{
}

Member Function Documentation

void BetaRadiation::normalize ( ) [private]

Definition at line 107 of file Radiation.cc.

{
    const int steps = 1000;
    double dx = m_endpoint/steps;
    double lo = dx/2.0;

    m_norm = 1.0;
    double sum = 0.0;
    for (int ind=0; ind<steps; ++ind) {
        sum += dx * this->dnde(ind*dx+lo);
    }
    m_norm = sum;

    double max = 0;
    for (int ind=0; ind<steps; ++ind) {
        double tmp = this->dnde(ind*dx+lo);
        if (tmp > max) max = tmp;
    }
    m_maximum = max;
}
RadiationType GenDecay::BetaRadiation::type ( ) const [inline, virtual]

Implements GenDecay::Radiation.

Definition at line 88 of file Radiation.h.

{ return (m_betaSign < 0 ? BetaMinus : BetaPlus); }
std::string GenDecay::BetaRadiation::typeString ( ) const [inline, virtual]

Implements GenDecay::Radiation.

Definition at line 89 of file Radiation.h.

{ return (m_betaSign < 0 ? "BetaMinus" : "BetaPlus"); }
std::string BetaRadiation::asString ( ) const [virtual]

Implements GenDecay::Radiation.

Definition at line 132 of file Radiation.cc.

{
    stringstream ss;
    ss << "beta"<< (m_betaSign < 0 ? '-' : '+') <<": Z=" 
       << m_parentZ << ", E_endpoint=" << m_energy << ends;
    return ss.str().c_str();
}
int GenDecay::BetaRadiation::sign ( ) const [inline]

Definition at line 93 of file Radiation.h.

{ return m_betaSign; }
double BetaRadiation::kineticEnergy ( ) const [virtual]

Reimplemented from GenDecay::Radiation.

Definition at line 140 of file Radiation.cc.

{
    // MC/rejection method to sample dN/dE spectrum
    while (true) {
        double T = m_rand() * m_endpoint;
        double P = m_rand() * m_maximum;
        if (P <= this->dnde(T)) return T;
    }
    return 0.0;
}
int BetaRadiation::pid ( ) const [virtual]

Implements GenDecay::Radiation.

Definition at line 177 of file Radiation.cc.

{
    return -1*m_betaSign*11;
}
double BetaRadiation::mass ( ) const [virtual]

Implements GenDecay::Radiation.

Definition at line 181 of file Radiation.cc.

{
    return CLHEP::electron_mass_c2;
}
double BetaRadiation::dnde ( double  kineticEnergy) const

Definition at line 151 of file Radiation.cc.

{
    if (kineticEnergy > m_endpoint) return 0.0;
    if (kineticEnergy < 0.0) return 0.0;
    return this->fermi_function(kineticEnergy) * this->dnde_noff(kineticEnergy) / m_norm;
}
double BetaRadiation::dnde_noff ( double  kineticEnergy) const

Definition at line 158 of file Radiation.cc.

{
    double W = m_endpoint / CLHEP::electron_mass_c2 + 1.0;
    double E = kineticEnergy / CLHEP::electron_mass_c2 + 1.0;
    return sqrt(E*E-1.0) * (W-E)*(W-E) * E;
}
double BetaRadiation::fermi_function ( double  kineticEnergy) const

Definition at line 165 of file Radiation.cc.

{
    double E = kineticEnergy / CLHEP::electron_mass_c2 + 1.0;
    double P = sqrt(E*E-1.0);
    double U = -1*m_betaSign*m_daughterZ/137.0;
    double S = sqrt(1.0 - U*U) - 1.0;
    double Y = 2.0*M_PI*U*E/P;
    double A1 = U*U * E*E + P*P/4.0;
    double A2 = fabs(Y/(1.0-exp(-Y)));
    return pow(A1,S)*A2;
}

Member Data Documentation

Definition at line 73 of file Radiation.h.

Definition at line 74 of file Radiation.h.

Definition at line 75 of file Radiation.h.

Definition at line 76 of file Radiation.h.

Definition at line 78 of file Radiation.h.

Definition at line 78 of file Radiation.h.

Rndm::Numbers GenDecay::BetaRadiation::m_rand [mutable, private]

Definition at line 79 of file Radiation.h.

double GenDecay::Radiation::m_energy [protected, inherited]

Definition at line 32 of file Radiation.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:21:06 for GenDecay by doxygen 1.7.4