00001 #ifndef DCHAIN_LABELEDPARTICLE_H 00002 #define DCHAIN_LABELEDPARTICLE_H 00003 // -*- C++ -*- 00004 // 00005 // Package: DChain 00006 // Module: LabeledParticle 00007 // 00008 // Description: pairing of subclass of Decay<> and Conjugation::Label 00009 // 00010 // Usage: 00011 // <usage> 00012 // 00013 // Author: Simon Patton 00014 // Created: Wed Sep 18 14:47:30 EDT 1996 00015 // $Id: LabeledParticle.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $ 00016 // 00017 // Revision history 00018 // 00019 // $Log: LabeledParticle.h,v $ 00020 // Revision 1.1.1.1 2009/03/03 06:06:56 maqm 00021 // first import of DecayChain 00022 // 00023 // Revision 1.1 2006/01/11 20:28:08 cdj 00024 // massive class renaming, addition of [] for selection and unit tests 00025 // 00026 // Revision 1.1.1.1 2000/12/18 22:16:49 cdj 00027 // imported DChain 00028 // 00029 // Revision 1.9 1998/08/19 20:56:00 sjp 00030 // Added include of definitions 00031 // 00032 // Revision 1.8 1997/08/28 06:59:19 sjp 00033 // Modified files to handle complete templating 00034 // 00035 // Revision 1.7 1997/08/26 04:12:58 sjp 00036 // Made Candidate handling objects into `CandidateClass' Templates 00037 // 00038 // Revision 1.6 1997/08/19 23:01:43 sjp 00039 // Restructured package to be independent of Rock 00040 // 00041 // Revision 1.5 1997/08/15 21:32:20 sjp 00042 // Updated to use <package>/<file>.h include structure. 00043 // Updated to use bug flags specified in Experiement.h 00044 // 00045 // Revision 1.4 1997/01/22 16:27:18 sjp 00046 // Fixed error in pre-processor labels 00047 // 00048 // Revision 1.3 1997/01/21 20:33:48 sjp 00049 // Changed CPP flags and include because of library reorganization 00050 // 00051 // Revision 1.2 1996/12/20 21:19:09 sjp 00052 // Extended pathnames for Include files 00053 // 00054 // Revision 1.1 1996/11/04 19:35:57 sjp 00055 // New file for new `List' module 00056 // 00057 00058 // system include files 00059 00060 // user include files 00061 #include "DecayChain/Element/conjugation.h" // enumerator 00062 #include "DecayChain/Element/LabeledCandidate.h" // superclass 00063 00064 // forward declarations 00065 namespace dchain { 00066 00067 template <class T> 00068 struct ParticleTraits { 00069 typedef typename T::CandidateClass CandidateType; 00070 }; 00071 00072 template < class T > 00073 class LabeledParticle : public LabeledCandidate< typename ParticleTraits<T>::CandidateType > 00074 { 00075 // friend classses and functions 00076 00077 public: 00078 // constants, enums and typedefs 00079 00080 // Constructors and destructor 00081 LabeledParticle() {} 00082 LabeledParticle( const LabeledParticle< T >& aOtherLabeled ) : 00083 LabeledCandidate<typename ParticleTraits<T>::CandidateType>(aOtherLabeled) {} 00084 00085 template<class THolder> 00086 LabeledParticle( THolder aT , 00087 const typename conjugation::Label aLabel ) : 00088 LabeledCandidate<typename ParticleTraits<T>::CandidateType>(aT,aLabel) {} 00089 00090 // assignment operator(s) 00091 //const LabeledParticle< T >& operator=( const LabeledParticle< T >& aOtherLabeled ) ; 00092 00093 // member functions 00094 00095 // const member functions 00096 // note: The following function can NOT be virtual as its return type changes 00097 // for Tes 00098 const T& operator()() const { 00099 return *static_cast<const T*>(this->pointer()); 00100 } 00101 // 00102 const T& particle() const { 00103 return *static_cast<const T*>(this->pointer()); 00104 } 00105 00106 // static member functions 00107 00108 protected: 00109 // protected member functions 00110 00111 // protected const member functions 00112 00113 private: 00114 // Constructors and destructor 00115 00116 // private member functions 00117 00118 // private const member functions 00119 00120 // data members 00121 00122 // static data members 00123 00124 }; 00125 00126 } 00127 #endif /* DCHAIN_LABELEDPARTICLE_H */