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

In This Package:

DecayRates.h
Go to the documentation of this file.
00001 
00014 #ifndef DECAYRATES_H
00015 #define DECAYRATES_H
00016 
00017 #include "GenDecay/NucVisitor.h"
00018 
00019 #include "GaudiKernel/RndmGenerators.h"
00020 
00021 #include <more/phys/ens.h>
00022 #include <map>
00023 #include <vector>
00024 
00025 class IRndmGenSvc;
00026 
00027 namespace GenDecay {
00028 
00031 class DecayRates : public GenDecay::NucVisitor
00032 {
00033 public:
00034     typedef std::map<more::phys::nucleus,double> AbundanceMap_t;
00035     typedef std::pair<NucDecay*,double> DecayValuePair_t;
00036     typedef std::vector<DecayValuePair_t> DecayValues_t;
00037     typedef std::map<NucState*,double> StateValueMap_t;
00038 
00044     DecayRates(const AbundanceMap_t& abundance,
00045                bool secularEquilibrium, double corrTime, double epsTime,
00046                IRndmGenSvc *rgs);
00047 
00050     DecayRates(bool secularEquilibrium, double corrTime, double epsTime,
00051                IRndmGenSvc *rgs);
00052 
00053     virtual ~DecayRates();
00054 
00055     // Set an entry in to the abundance map.  It is assumed this is an
00056     // abundance for a ground state.
00057     void addAbundance(more::phys::nucleus nuc, double abundance);
00058 
00059     // Return a randomly chosen decay from the chain
00060     NucDecay* decay();
00061 
00062     // Return a randomly chosen decay from a particular mother
00063     NucDecay* decay_state(NucState* nuc);
00064 
00065     // Access the collection of uncorrelated mothers from this chain
00066     const std::vector<NucState*>& mothers() const { return m_mothers; }
00067     double totalRate() const { return m_totalDecayRate; }
00068 
00070     DecayValues_t decayTimes(NucDecay* decay);
00071 
00072     double uni() { return m_uni(); }
00073 
00075     const std::vector<double>& motherRate() { return m_motherRate; }
00076 
00077 protected:
00078 
00079     // Visitor pattern.  Client should call descend()
00080 
00081     // Build up map from decay to mean rate
00082     bool visit(NucState* mother, NucState* /*daughter*/, NucDecay* decay);
00083 
00084     // Call once after top-level descend() is called
00085     virtual void postDescend();
00086 
00087 
00088 private:
00089     void get_decay_times(NucDecay* decay, DecayValues_t& decayTime, double now);
00090 
00091     AbundanceMap_t m_forcedAbundance; // user input abundance
00092     std::map<NucState*,double> m_bookkeeping;
00093 
00094     bool m_secEq;
00095     double m_correlationTime;   // seconds
00096     double m_epsilonTime;        // seconds
00097 
00098     // secular equilibrium rate, take from chain's mother
00099     double m_secEqRate;
00100 
00101     // Cache mean decay rate of each mother
00102     StateValueMap_t m_meanDecayTimes;
00103 
00104     // uncorrelated mothers
00105     std::vector<NucState*> m_mothers; 
00106     std::vector<double> m_motherRate; // abundance corrected mean decay rate
00107     double m_totalDecayRate;          // cached sum of above
00108 
00109     Rndm::Numbers m_uni;
00110 
00111 };
00112 
00113 
00114 }
00115 #endif  // DECAYRATES_H
| 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