00001 #ifndef DCHAIN_LABELEDPARTICLELIST_H 00002 #define DCHAIN_LABELEDPARTICLELIST_H 00003 // -*- C++ -*- 00004 // 00005 // Package: DChain 00006 // Module: LabeledDecayList 00007 // 00008 // Description: Container of `primary'/`conjugate' particle subclasses of Candidate 00009 // 00010 // Usage: 00011 // <usage> 00012 // 00013 // Author: Simon Patton 00014 // Created: Fri Sep 13 17:58:11 EDT 1996 00015 // $Id: LabeledParticleList.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $ 00016 // 00017 // Revision history 00018 // 00019 // $Log: LabeledParticleList.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:29 cdj 00024 // massive class renaming, addition of [] for selection and unit tests 00025 // 00026 // Revision 1.1.1.1 2000/12/18 22:16:53 cdj 00027 // imported DChain 00028 // 00029 // Revision 1.17 1998/08/28 05:19:16 sjp 00030 // Updated to subclass from IndexedLabeled class 00031 // 00032 // Revision 1.16 1998/08/21 00:52:42 sjp 00033 // Modifier to no longer use typedefs 00034 // 00035 // Revision 1.15 1998/08/20 19:59:04 sjp 00036 // Modified to use DChainBoolean 00037 // 00038 // Revision 1.14 1998/08/19 20:39:51 sjp 00039 // Fixed include path for defintions 00040 // 00041 // Revision 1.13 1998/05/04 19:08:00 sjp 00042 // Move forward declaration of vector, so alway made 00043 // 00044 // Revision 1.12 1998/04/17 19:11:03 sjp 00045 // Modified to use latest types 00046 // 00047 // Revision 1.11 1997/08/28 06:59:52 sjp 00048 // Modified files to handle complete templating 00049 // 00050 // Revision 1.10 1997/08/26 04:14:13 sjp 00051 // Made Candidate handling objects into `CandidateClass' Templates 00052 // 00053 // Revision 1.9 1997/08/19 23:02:22 sjp 00054 // Restructured package to be independent of Rock 00055 // 00056 // Revision 1.8 1997/08/19 16:17:43 sjp 00057 // Improved handling of STL containers 00058 // 00059 // Revision 1.7 1997/08/15 21:32:26 sjp 00060 // Updated to use <package>/<file>.h include structure. 00061 // Updated to use bug flags specified in Experiement.h 00062 // 00063 // Revision 1.6 1997/01/31 20:17:07 sjp 00064 // Modified to use the new `bug' include files 00065 // 00066 // Revision 1.5 1997/01/22 16:27:23 sjp 00067 // Fixed error in pre-processor labels 00068 // 00069 // Revision 1.4 1997/01/21 20:33:54 sjp 00070 // Changed CPP flags and include because of library reorganization 00071 // 00072 // Revision 1.3 1997/01/19 20:28:38 sjp 00073 // Changed LargeCount to Count 00074 // 00075 // Revision 1.2 1996/12/20 21:19:14 sjp 00076 // Extended pathnames for Include files 00077 // 00078 // Revision 1.1 1996/11/04 19:36:02 sjp 00079 // New file for new `List' module 00080 // 00081 00082 // system include files 00083 00084 // user include files 00085 #include "DecayChain/Element/conjugation.h" // enumarator 00086 #include "DecayChain/List/IndexedLabeledParticles.h" // superclass 00087 #include "DecayChain/Iterator/MuteWholeItr.h" 00088 #include "DecayChain/Iterator/WholeItr.h" 00089 #include "DecayChain/Iterator/PartialItr.h" 00090 #include "DecayChain/Element/LabeledParticle.h" 00091 00092 #include <vector> 00093 00094 #ifndef _labeledparticlelist_vector_ 00095 // The following CPP macro is used to avoid having to typedef 00096 // a map in the class. Why? Because things can get messy, at 00097 // least in the g++ compiler as the typedef can cause instantiation 00098 // when not all the necessary information is available! 00099 #define _labeledparticlelist_vector_ std::vector< LabeledParticle< ParticleClass > > 00100 #endif 00101 00102 // 00103 // Note: To avoid a myriad of conpiler flags it is easier to 00104 // have a two parameter template class. The instantiation 00105 // of this class must look like 00106 // 00107 // template class LabeledDecayList< A , A::CandidateClass > ; 00108 00109 namespace dchain { 00110 template < class ParticleClass , class CandidateClass > 00111 class LabeledParticleList 00112 : public IndexedLabeledParticles< ParticleClass , CandidateClass > 00113 { 00114 // friend classses and functions 00115 00116 public: 00117 // constants, enums and typedefs 00118 typedef MuteWholeItr< ParticleClass > iterator ; 00119 typedef WholeItr< ParticleClass > const_iterator ; 00120 typedef PartialItr< ParticleClass > const_partial_iterator ; 00121 00122 // Constructors and destructor 00123 LabeledParticleList() ; 00124 virtual ~LabeledParticleList() ; 00125 00126 // member functions 00127 LabeledParticle< ParticleClass >& operator[]( const int aIndex ) ; 00128 iterator begin() ; 00129 iterator end() ; 00130 void push_back( const LabeledParticle< ParticleClass >& aEntry ) ; 00131 virtual void erase_elements( int aStart , 00132 int aFinish ) ; 00133 00134 // const member functions 00135 const LabeledParticle< ParticleClass >& operator[]( const int aIndex ) const ; 00136 virtual bool empty() const ; 00137 virtual bool empty( const typename conjugation::Label aLabel ) const ; 00138 virtual int size() const ; 00139 virtual int size( const typename conjugation::Label aLabel ) const ; 00140 const_iterator begin() const ; 00141 const_partial_iterator begin( const typename conjugation::Label aLabel ) const ; 00142 const_iterator end() const ; 00143 const_partial_iterator end( const typename conjugation::Label aLabel ) const ; 00144 00145 // static member functions 00146 00147 protected: 00148 // protected member functions 00149 virtual LabeledCandidate< CandidateClass >& labeledCandidateClass( const int aIndex ) ; 00150 virtual LabeledParticle< ParticleClass >& labeledParticleClass( const int aIndex ) ; 00151 00152 // protected const member functions 00153 virtual const LabeledCandidate< CandidateClass >& labeledCandidateClass( const int aIndex ) const ; 00154 virtual const LabeledParticle< ParticleClass >& labeledParticleClass( const int aIndex ) const ; 00155 00156 private: 00157 // Constructors and destructor 00158 LabeledParticleList( const LabeledParticleList< ParticleClass , CandidateClass >& ) ; // stop default 00159 00160 // assignment operator(s) 00161 const LabeledParticleList< ParticleClass , CandidateClass >& operator=( const LabeledParticleList< ParticleClass , typename ParticleClass::CandidateClass >& ) ; // stop default 00162 00163 // private member functions 00164 00165 // private const member functions 00166 00167 // data members 00168 _labeledparticlelist_vector_& m_list ; 00169 00170 // static data members 00171 00172 } ; 00173 } 00174 // inline function definitions 00175 00176 // function definitions 00177 #include "DecayChain/List/Template/LabeledParticleList.cc" 00178 00179 #endif /* DCHAIN_LABELEDPARTICLELIST_H */