CLHEP/HepPDT/DecayChannelT.hh

00001 // $Id: DecayChannelT.hh,v 1.6 2002/04/18 20:15:13 garren Exp $
00002 // ----------------------------------------------------------------------
00003 //
00004 // DecayChannelT.hh
00005 //
00006 // ----------------------------------------------------------------------
00007 #ifndef DECAYCHANNELT_HH
00008 #define DECAYCHANNELT_HH
00009 
00010 #include "CLHEP/config/CLHEP.h"
00011 #include <vector>
00012 #include <string>
00013 
00014 #include "CLHEP/HepPDT/Measurement.hh"
00015 #include "CLHEP/HepPDT/NullDecayModelT.hh"
00016 #include "CLHEP/HepPDT/DecayModelBase.hh"
00017 #include "CLHEP/HepPDT/DMFactory.hh"
00018 
00019 namespace HepPDT {
00020 
00025 template< class Config >
00026 class DecayChannelT  {
00027 
00028 public:
00029   // --- useful typedef's
00030   //
00031   typedef typename Config::ParticleData PD;     // ParticleDataType
00032   typedef typename Config::PT           PT;     // ParticleType
00033 
00034   typedef std::vector< PD >    ProductMap;
00035 
00036   // ---  birth/death:
00037   //
00038   // defaults 'cause we need vector<DecayChannelT<> >
00039   inline DecayChannelT( const std::string & name = "unknown", 
00040                  const Measurement & branchFrac = Measurement(), 
00041                  const ProductMap & decaylist = ProductMap(), 
00042                  const std::vector<double> & dmparam = std::vector<double>() );
00043   virtual ~DecayChannelT();
00044 
00045   // ---  copying:
00046   //
00047   inline DecayChannelT( const DecayChannelT<Config> & orig );
00048   inline DecayChannelT & operator = ( const DecayChannelT<Config> & rhs );
00049   inline void swap( DecayChannelT<Config> & other );
00050 
00051   // ---  accessors:
00052   //
00053   std::string                 decayName()         const { return itsDecayName; }
00054   Measurement                 branchingFraction() const { return itsBranchingFraction; }
00055   int                         size()              const { return itsDecayChannelProducts.size(); }
00056   PD                          decayProduct(int i) const { return itsDecayChannelProducts[i]; }
00057   DecayModelBase<Config> const & decayModel()     const { return *itsDecayModel; }
00058   
00059   inline void write( std::ostream & os ) const;
00060 
00061   // ---  mutators:
00062   //
00063   void  setBranchingFraction( Measurement const & rate ) { itsBranchingFraction = rate; }
00064   inline void  appendDecayChannelProduct( PD const & dcp );
00065 
00066   // ---  decay method:
00067   //
00068   void decay( const PT & parent, std::vector<PT> & daughters ); 
00069   
00070 private:
00071 
00072   // ---  class-specific data:
00073   //
00074   std::string              itsDecayName;
00075   Measurement              itsBranchingFraction;
00076   ProductMap               itsDecayChannelProducts;
00077   std::vector<double>   itsDecayModelParameters;
00078   DecayModelBase<Config> * itsDecayModel;
00079 
00080 };  // DecayChannelT
00081 
00082 template< class Config >
00083 inline
00084 void  swap( DecayChannelT<Config> & first, DecayChannelT<Config> & second )  {
00085   first.swap( second );
00086 }
00087 
00088 }       // HepPDT
00089 
00090 #include "CLHEP/HepPDT/DecayChannelT.icc"
00091 
00092 #endif // DECAYCHANNELT_HH
00093 

Class Library for High Energy Physics (version 1.8)