CLHEP/HepPDT/DecayDataT.hh

00001 // $Id: DecayDataT.hh,v 1.5 2002/04/18 20:15:15 garren Exp $
00002 // ----------------------------------------------------------------------
00003 //
00004 // DecayDataT.hh
00005 //
00006 // ----------------------------------------------------------------------
00007 #ifndef DECAYDATAT_HH
00008 #define DECAYDATAT_HH
00009 
00010 #include "CLHEP/config/CLHEP.h"
00011 #include <vector>
00012 
00013 #include "CLHEP/HepPDT/DecayChannelT.hh"
00014 
00015 namespace HepPDT {
00016 
00021 template< class Config >
00022 class DecayDataT {
00023 
00024 public:
00025   // --- useful typedef's
00026   //
00027   typedef typename Config::PT           PT;     // ParticleType
00028 
00029   // ---  birth/death:
00030   //
00031   inline DecayDataT( );
00032   inline DecayDataT( std::vector<DecayChannelT<Config> > const & dv );
00033   inline ~DecayDataT();
00034 
00035   // ---  copying:
00036   //
00037   inline DecayDataT( DecayDataT<Config> const & orig );
00038   inline DecayDataT & operator = ( DecayDataT<Config> const & rhs );
00039   inline void swap( DecayDataT<Config> & other );
00040 
00041   // ---  accessors:
00042   //
00043   bool                   isStable()     const;
00044   int                    size()         const { return itsDecayList.size(); }
00045   DecayChannelT<Config>  channel( int i ) const { return itsDecayList[i]; }
00046 
00047   // ---  decay methods:
00048   //
00049   // ask for a specific decay
00050   bool  decay( int i, const PT & parent, std::vector<PT> & daughters );
00051   // do a random decay based on a number from 0 to 1
00052   bool  decay( double rdm, const PT & parent, std::vector<PT> & daughters );
00053   
00054   inline void write( std::ostream & os ) const;
00055 
00056   // ---  mutators:
00057   //
00058   void  appendMode( DecayChannelT<Config> );
00059 
00060 private:
00061 
00062   std::vector<DecayChannelT<Config> > itsDecayList; 
00063 
00064 };  // DecayDataT
00065 
00066 template< class Config >
00067 inline
00068 void swap( DecayDataT<Config> & first, DecayDataT<Config> & second )  {
00069   first.swap( second );
00070 }
00071 
00072 }       // HepPDT
00073 
00074 #include "CLHEP/HepPDT/DecayDataT.icc"
00075 
00076 #endif // DECAYDATAT_HH

Class Library for High Energy Physics (version 1.8)