/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
Li9He8Decayerator Class Reference

Generate radioactive decay events. More...

#include <Li9He8Decayerator.h>

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

List of all members.

Public Member Functions

 Li9He8Decayerator (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~Li9He8Decayerator ()
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 (TVector3 &, double, int)

Private Attributes

double m_Li9fraction
bool m_completedecay
double alpha_mass
IRndmGenSvc * rgs
Rndm::Numbers m_uni
IParticlePropertySvc * m_pps

Detailed Description

Generate radioactive decay events.

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

Definition at line 29 of file Li9He8Decayerator.h.


Constructor & Destructor Documentation

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

Definition at line 16 of file Li9He8Decayerator.cc.

    : GaudiTool(type,name,parent)
{
  declareInterface<IHepMCEventMutator>(this);
  
  declareProperty("Li9fraction", m_Li9fraction=0.90, 
                  "Li9 fraction Li9/(Li9+He8)");
  declareProperty("CompleteDecay",m_completedecay=0,
                  "Complete Decay include decay channels without neutron");
  
}
Li9He8Decayerator::~Li9He8Decayerator ( ) [virtual]

Definition at line 30 of file Li9He8Decayerator.cc.

{
}

Member Function Documentation

StatusCode Li9He8Decayerator::initialize ( ) [virtual]

Definition at line 115 of file Li9He8Decayerator.cc.

{
  //random number
  if (service("RndmGenSvc",rgs,true).isFailure()) {
    fatal() << "Failed to get random service" << endreq;
    return StatusCode::FAILURE;        
  }
  StatusCode sc = m_uni.initialize(rgs, Rndm::Flat(0,1));
  if (sc.isFailure()) {
    throw GaudiException("Failed to initialize uniform random numbers",
                         "GtDecayerator::DecayRates",StatusCode::FAILURE);
  }
  //particle property
  m_pps = svc<IParticlePropertySvc>( "ParticlePropertySvc", true ) ;
  ParticleProperty*  ppp = m_pps->findByStdHepID( 1000020040 );//alpha
  if ( ppp ) {
    alpha_mass = ppp->mass();
  } else {
    alpha_mass = 3727.379;
  }

  return StatusCode::SUCCESS;
}
StatusCode Li9He8Decayerator::finalize ( ) [virtual]

Definition at line 139 of file Li9He8Decayerator.cc.

{
  return StatusCode::SUCCESS;
}
StatusCode Li9He8Decayerator::mutate ( HepMC::GenEvent event) [virtual]

!! I = 1 is assigned fo all excitation states !!!

Implements IHepMCEventMutator.

Definition at line 44 of file Li9He8Decayerator.cc.

{
    TVector3 pElectron(0,0,0);
    TVector3 pNeutron(0,0,0); 
    TVector3 pGamma(0,0,0); 
    TVector3 pAlpha1(0,0,0); 
    TVector3 pAlpha2(0,0,0);

    // PDG code for Ions (Geant4 version)
    // Nuclear codes are given as 10-digit numbers +-100ZZZAAAI.
    //For a nucleus consisting of np protons and nn neutrons
    // A = np + nn and Z = np.
    // I gives the isomer level, with I = 0 corresponding
    // to the ground state and I >0 to excitations

    int mo_pid = 0;
    Li9He8 decay(rgs);
    if( m_uni() < m_Li9fraction ){//Li9 decay
      mo_pid = 1000030090;
      decay.Li9Decay(pElectron, pNeutron, pAlpha1, pAlpha2, 
                     alpha_mass, m_completedecay);
    }
    else{
      mo_pid = 1000020080;
      decay.He8Decay(pElectron, pNeutron, pGamma, m_completedecay);
    }

    //the new GenVertex will be deleted by GenEvent destructor
    HepMC::GenVertex* vertex = new HepMC::GenVertex(HepMC::FourVector(0,0,0,0));
    event.add_vertex(vertex);
    event.set_signal_process_vertex(vertex);

    int pid = 0;
    if( pElectron.Mag2()>0 ){
      pid = 11;
      HepMC::GenParticle* particle = make_particle(pElectron, 
                                                   electron_mass_c2, pid);
      vertex->add_particle_out(particle);
    }
    if( pNeutron.Mag2()>0 ){
      pid = 2112;
      HepMC::GenParticle* particle = make_particle(pNeutron, 
                                                   neutron_mass_c2, pid);
      vertex->add_particle_out(particle);
    }
    if( pGamma.Mag2()>0 ){
      pid = 22;
      HepMC::GenParticle* particle = make_particle(pGamma, 0, pid);
      vertex->add_particle_out(particle);
    }
    if( pAlpha1.Mag2()>0 ){
      pid = 1000020040;
      HepMC::GenParticle* particle = make_particle(pAlpha1, alpha_mass, pid);
      vertex->add_particle_out(particle);
    }
    if( pAlpha2.Mag2()>0 ){
      pid = 1000020040;
      HepMC::GenParticle* particle = make_particle(pAlpha2, alpha_mass, pid);
      vertex->add_particle_out(particle);
    }

    HepMC::GenParticle* particle_in = 
      new HepMC::GenParticle(HepMC::FourVector(0,0,0,0),mo_pid,2);
    // Save mother particle as info particle (default status=2)
    vertex->add_particle_in(particle_in);

    return StatusCode::SUCCESS;
}
HepMC::GenParticle * Li9He8Decayerator::make_particle ( TVector3 &  vect,
double  mass,
int  pid 
) [private]

Definition at line 34 of file Li9He8Decayerator.cc.

{
  double energy = sqrt(vect.Mag2()+mass*mass);
  HepMC::FourVector fourmom(vect.x()/MeV,vect.y()/MeV,vect.z()/MeV,
                            energy/MeV);
  //the new GenParticle will be deleted by GenVertex destructor
  return new HepMC::GenParticle(fourmom,pid,1/*=status*/);
}

Member Data Documentation

Definition at line 47 of file Li9He8Decayerator.h.

Definition at line 48 of file Li9He8Decayerator.h.

Definition at line 49 of file Li9He8Decayerator.h.

IRndmGenSvc* Li9He8Decayerator::rgs [private]

Definition at line 51 of file Li9He8Decayerator.h.

Rndm::Numbers Li9He8Decayerator::m_uni [private]

Definition at line 52 of file Li9He8Decayerator.h.

IParticlePropertySvc* Li9He8Decayerator::m_pps [private]

Definition at line 54 of file Li9He8Decayerator.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:22:42 for Li9He8Decay by doxygen 1.7.4