/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 | Private Member Functions | Private Attributes
GenDecay::NucVisitor Class Reference

#include <NucVisitor.h>

Inheritance diagram for GenDecay::NucVisitor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 NucVisitor (double min_br=0.0)
virtual ~NucVisitor ()
virtual void descend (NucState *state)
 Start the visitation with the given state.
virtual bool visit (NucState *, NucState *, NucDecay *)=0
 Subclass must override.
virtual void preDescend ()
 Hooks called before and after actual descent through the hiearchy.
virtual void postDescend ()
void setMap (std::map< NucDecay *, int > &map)

Private Member Functions

void _descend (NucState *state)
void _origin (NucState *state)
void addResidual ()

Private Attributes

double m_minBranchFraction
std::map< NucDecay *, int > m_countMap

Detailed Description

Definition at line 27 of file NucVisitor.h.


Constructor & Destructor Documentation

NucVisitor::NucVisitor ( double  min_br = 0.0)

Definition at line 9 of file NucVisitor.cc.

    : m_minBranchFraction(min_br)
{
}
NucVisitor::~NucVisitor ( ) [virtual]

Definition at line 14 of file NucVisitor.cc.

{}

Member Function Documentation

void NucVisitor::descend ( NucState state) [virtual]

Start the visitation with the given state.

Definition at line 16 of file NucVisitor.cc.

{
    this->preDescend();
    this->_descend(state);
    this->addResidual();
    this->postDescend();
}
virtual bool GenDecay::NucVisitor::visit ( NucState ,
NucState ,
NucDecay  
) [pure virtual]

Subclass must override.

Implemented in GenDecay::DecayRates.

virtual void GenDecay::NucVisitor::preDescend ( ) [inline, virtual]

Hooks called before and after actual descent through the hiearchy.

Subclass may optionally implement.

Definition at line 43 of file NucVisitor.h.

{}
virtual void GenDecay::NucVisitor::postDescend ( ) [inline, virtual]

Reimplemented in GenDecay::DecayRates.

Definition at line 44 of file NucVisitor.h.

{}
void GenDecay::NucVisitor::setMap ( std::map< NucDecay *, int > &  map) [inline]

Definition at line 45 of file NucVisitor.h.

{ m_countMap = map;}
void NucVisitor::_descend ( NucState state) [private]

Definition at line 24 of file NucVisitor.cc.

{
    vector<NucDecay*> &decays = state->decays();
    for (size_t ind=0; ind < decays.size(); ++ind) {

        if (decays[ind]->fraction < m_minBranchFraction) continue;

        NucDecay* decay = decays[ind];
        NucState* daughter = decay->daughter;
        if (!m_countMap[decay])
        {   
            m_countMap[decay] +=1;
            std::cout << "--------------------------------------------"<<"\n";
            std::cout << "Visit Decay down:" << "\n";
        
        if (this->visit(state,daughter,decay)) {
            _origin(daughter);
            _descend(daughter);
        }
        }
    }
}
void NucVisitor::_origin ( NucState state) [private]

Definition at line 49 of file NucVisitor.cc.

{
    vector<NucDecay*> &origin_decays = state -> origin_decays();
    for (size_t ind=0; ind < origin_decays.size(); ++ind)
    {
        NucDecay* origin_decay = origin_decays[ind];
        NucState* mother = origin_decay->mother;
        if (m_countMap[origin_decay]) continue;
        m_countMap[origin_decay] +=1;

        _origin(mother);
        std::cout << "--------------------------------------------" << "\n";
        std::cout << "Visit Decay up:" << "\n";
        this->visit(mother,state,origin_decay);
    }

    return;
}
void NucVisitor::addResidual ( ) [private]

Definition at line 68 of file NucVisitor.cc.

{
   for (std::map<NucDecay*,int>::iterator it = m_countMap.begin();
                                          it != m_countMap.end(); ++ it)
   {
        if (it -> second == 0)
            _descend(it->first->mother);

        it -> second += 1;

   }
}

Member Data Documentation

Definition at line 29 of file NucVisitor.h.

std::map<NucDecay*,int> GenDecay::NucVisitor::m_countMap [private]

Definition at line 30 of file NucVisitor.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