/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 | Static Public Member Functions | Private Member Functions | Private Attributes
GtDecayerator Class Reference

Generate radioactive decay events. More...

#include <GtDecayerator.h>

Inheritance diagram for GtDecayerator:
Inheritance graph
[legend]
Collaboration diagram for GtDecayerator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GtDecayerator (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~GtDecayerator ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode mutate (HepMC::GenEvent &event)

Static Public Member Functions

static const InterfaceID & interfaceID ()

Private Member Functions

HepMC::GenParticlemake_particle (GenDecay::NucState &state, int status=2)
HepMC::GenParticlemake_particle (GenDecay::NucDecay &dk)

Private Attributes

std::string m_parentNuclide
 Property: ParentNuclide.
double m_parentAbundance
 Property: ParentAbundance.
std::map< std::string, double > m_abundanceMap
 Property: AbundanceMap.
bool m_secularEquilibrium
 Property: SecularEquilibrium.
double m_correlationTime
 Property: CorrelationTime.
GenDecay::DecayRatesm_rates

Detailed Description

Generate radioactive decay events.

bv@bnl.gov Wed May 13 16:05:04 2009

Definition at line 33 of file GtDecayerator.h.


Constructor & Destructor Documentation

GtDecayerator::GtDecayerator ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 24 of file GtDecayerator.cc.

    : GaudiTool(type,name,parent)
    , m_rates(0)
{
    declareInterface<IHepMCEventMutator>(this);

    declareProperty("ParentNuclide", m_parentNuclide="", 
                    "Name of the parent nuclide, eg U-238");
    declareProperty("ParentAbundance",m_parentAbundance=0,
                    "The parent nuclide abundance");
    declareProperty("AbundanceMap",m_abundanceMap,
                    "Map nuclide name to its abundance");
    declareProperty("SecularEquilibrium",m_secularEquilibrium=true,
                    "Set uncorrelated daughter nuclides in secular equilibrium with the parent");
    declareProperty("CorrelationTime",m_correlationTime=0,
                    "Nuclide with shorter lifetime will be corelated parent");
}
GtDecayerator::~GtDecayerator ( ) [virtual]

Definition at line 44 of file GtDecayerator.cc.

{
}

Member Function Documentation

virtual StatusCode GtDecayerator::initialize ( ) [virtual]
virtual StatusCode GtDecayerator::finalize ( ) [virtual]
StatusCode GtDecayerator::mutate ( HepMC::GenEvent event) [virtual]

Implements IHepMCEventMutator.

Definition at line 103 of file GtDecayerator.cc.

{
    NucDecay* decay = 0;
    const Radiation* radiation = 0;
    do {
        decay = m_rates->decay();
        if (!decay) {
            error() << "Failed to retrieve a decay!" << endreq;
            return StatusCode::FAILURE;
        }

        // Check that primary radiation is known.  
        radiation = decay_radiation(*decay);
        if (!radiation) {
            warning() << "failed to get radiation from decay of " << *(decay->mother) 
                      << " via " << *decay << " skipping" << endreq;
        }

    } while (!radiation);

    DecayRates::DecayValues_t decayTimes = m_rates->decayTimes(decay);
    HepMC::GenVertex* last_vertex = 0;
    NucState* last_daughter = 0;
    for (size_t ind = 0; ind < decayTimes.size(); ++ind) {

        NucDecay* dk = decayTimes[ind].first;

        HepMC::GenParticle* particle = make_particle(*dk);
        if (!particle) {
            warning() << "failed to get radiation from decay of " << *(dk->mother) 
                      << " via " << *dk << " with fraction=" << dk->fraction
                      << " skipping" << endreq;
            continue;
        }

        double time = more_to_clhep_time(decayTimes[ind].second);
        HepMC::GenVertex* vertex = new HepMC::GenVertex(HepMC::FourVector(0,0,0,time));
        last_vertex = vertex;

        debug() << "Decay: " << *(dk->mother) 
                << " to " << *(dk->daughter)
                << " via " << *dk
                << " @ " << time/CLHEP::second << " seconds"
                << " (lifetime:" << dk->mother->lifetime() << " seconds)"
                << endreq;

        event.add_vertex(vertex);
        if (decay == dk) {      // first in chain
            event.set_signal_process_vertex(vertex);
        }
        
        vertex->add_particle_out(particle);

        // Save mother particle as info particle (default status=2)
        particle = make_particle(*(dk->mother));
        if (particle) {
            vertex->add_particle_in(particle);
        }

        last_daughter = dk->daughter;
    }

    // Save final daughter as outgoing
    if (last_vertex && last_daughter) {
        HepMC::GenParticle* dp = make_particle(*last_daughter,1);
        if (dp) {
            last_vertex->add_particle_out(dp);
        }
    }

    debug() << "Decay of " << *(decay->mother) << " via " << *decay 
            << " produced " << event.particles_size() 
            << " particles in " << event.vertices_size() << " vertices" 
            << endreq;
    //    event.print() ;  // djaffe



    return StatusCode::SUCCESS;
}
HepMC::GenParticle* GtDecayerator::make_particle ( GenDecay::NucState state,
int  status = 2 
) [private]
HepMC::GenParticle * GtDecayerator::make_particle ( GenDecay::NucDecay dk) [private]

Definition at line 49 of file GtDecayerator.cc.

{
    const Radiation* rad = decay_radiation(dk);
    if (!rad) return 0;

    double kine = rad->kineticEnergy();
    double mass = rad->mass();
    double mom = sqrt((kine+mass)*(kine+mass) - mass*mass);

    debug() << "make_particle: type " << rad->type() << " pid " << rad->pid() << " KE(MeV) " << kine/CLHEP::MeV << " mass(MeV) " << mass/CLHEP::MeV << endreq;
    if ( rad->type() == EleCapture ) debug() << "make_particle: this type " << rad->type() << " is electron capture " << endreq;

    // Pick random direction

    // cos(angle) from mean direction
    double costh = m_rates->uni()*2.0 - 1.0;
    double sinth = sqrt(1-costh*costh);

    // azimuth angle around mean direction
    double phi = m_rates->uni()*360.0*CLHEP::degree;
    double cosphi = cos(phi);
    double sinphi = sin(phi);
        
    CLHEP::Hep3Vector dir(sinth*cosphi,sinth*sinphi,costh);

    CLHEP::HepLorentzVector lorvec(mom*dir,kine+mass);
    HepMC::FourVector fourmom(lorvec);

    // for electron capture, assign HEPEVT status code 3 signifying "a documentation line, defined separately from the event 
    // history. This could include the two incoming reacting particles, etc."
    // HEPEVT status code 1 is the standard code for particles to be propagated further
    // HEPEVT standard: http://cepa.fnal.gov/psm/simulation/mcgen/lund/pythia_manual/pythia6.3/pythia6301/node39.html
    int status = 1;
    if ( rad->type() == EleCapture && rad->pid() == 0 ) status = 3;
    debug() << "make_particle: assigning status " << status << " for this particle " << endreq;

    return new HepMC::GenParticle(fourmom,rad->pid(),status);
}

Member Data Documentation

std::string GtDecayerator::m_parentNuclide [private]

Property: ParentNuclide.

Name of the begining of a radioactive decay chain. This can be set in any format that is understood by libmore. This is basically a case insenstive combonation of the element abreviation and the atomic mass. Eg, u-238 U238 238u.

Definition at line 56 of file GtDecayerator.h.

Property: ParentAbundance.

Set the abundance of the parent nuclide. That is, the number of nuclides of the parent's type.

Definition at line 62 of file GtDecayerator.h.

std::map<std::string,double> GtDecayerator::m_abundanceMap [private]

Property: AbundanceMap.

A map of string to double that gives abundances of specific nuclide types. If the parent is listed and ParentAbundance is set the latter takes precedence.

Definition at line 68 of file GtDecayerator.h.

Property: SecularEquilibrium.

Set abundances of uncorrelated daughter nuclides (see CorrelationTime property) to secular equilibrium with the parent. If any values are given by the AbundanceMap property, they will take precedence.

Definition at line 75 of file GtDecayerator.h.

Property: CorrelationTime.

Any nuclide in the chain that has a decay branch with a half life (total nuclide halflife * branching fraction) shorter than this correlation time will be considered correlated with the parent(s) that produced it and the resulting kinematics will include both parent and child decays together and with a time chosen based on the parent abundance. Otherwise, the decay of the nuclide is considered independent from its parent and will decay based on its own abundance.

Definition at line 87 of file GtDecayerator.h.

Definition at line 90 of file GtDecayerator.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