CLHEP/HepPDT/DecayModelBase.hh

00001 // $Id: DecayModelBase.hh,v 1.5 2002/04/18 20:15:17 garren Exp $
00002 // ----------------------------------------------------------------------
00003 //
00004 // DecayModelBase.hh
00005 // Author:  Lynn Garren, Walter Brown, Marc Paterno
00006 //
00007 // Note: users' decay models inheriting from this class must have
00008 //  an explicit constructor that takes a const reference to a vector of doubles
00009 //  as well as implentations of all methods declared pure virtual.
00010 // User code will need :
00011 //     #include "CLHEP/HepPDT/DecayModelBase.hh"
00012 //     REGISTER_DECAY_MODE(ModeA,ModeA::Config)
00013 //
00014 // ----------------------------------------------------------------------
00015 #ifndef DECAYMODELBASE_HH
00016 #define DECAYMODELBASE_HH
00017 
00018 #include "CLHEP/config/CLHEP.h"
00019 #include <string>
00020 #include <vector>
00021 
00022 #define REGISTER_DECAY_MODE(type,config) \
00023     namespace { HepPDT::RegisterMe<type,config> registered##type(#type); }
00024 
00025 
00026 namespace HepPDT {
00027 
00032 template< class CONFIG >
00033 class DecayModelBase  {
00034 
00035 public:
00036   typedef          CONFIG               Config; // Template Parameter
00037   typedef typename CONFIG::ParticleData PD;     // ParticleDataType
00038   typedef typename CONFIG::PT           PT;     // ParticleType
00039 
00040   // ---  death:
00041   virtual ~DecayModelBase() {;}
00042 
00043   // ---  copying:
00044   //
00045   inline DecayModelBase( const DecayModelBase<CONFIG> & orig ) {;}
00046   inline DecayModelBase &  operator = ( const DecayModelBase<CONFIG> & rhs ) { return *this; }
00047   inline void swap( DecayModelBase<CONFIG> & other ) {;}
00048 
00049   // --- decay method placeholder
00050   //
00051   virtual void decay( const std::vector< PD > & products,
00052                       const PT                & parent,
00053                       std::vector<PT>         & daughters ) = 0;
00054    
00055   // accessor placeholders
00056   virtual int         parameters( std::vector<double> & fillme) const = 0;
00057   virtual std::string name() const = 0;
00058   
00059 protected:
00060 
00061   // --- birth
00062   DecayModelBase(  ) {;}
00063 
00064   // ---  DecayModelBase<>-specific data, e.g., Helicity and/or PartialWaveAmplitudes
00065   //
00066 
00067 };  // DecayModelBase
00068 
00069 template< class CONFIG >
00070 inline 
00071 void  swap( DecayModelBase<CONFIG> & first, DecayModelBase<CONFIG> & second ) {
00072   first.swap( second );
00073 }
00074 
00075 }       // HepPDT
00076 
00077 #endif // DECAYMODELBASE_HH
00078 

Class Library for High Energy Physics (version 1.8)