00001 #ifndef DCHAIN_CONJUGATELIST_H 00002 #define DCHAIN_CONJUGATELIST_H 00003 // -*- C++ -*- 00004 // 00005 // Package: DChain 00006 // Module: ConjugateList 00007 // 00008 // Description: container of subclasses of Candidate, used for partial iteration 00009 // 00010 // Usage: 00011 // <usage> 00012 // 00013 // Author: Simon Patton 00014 // Created: Wed Sep 11 15:59:57 EDT 1996 00015 // $Id: ConjugateList.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $ 00016 // 00017 // Revision history 00018 // 00019 // $Log: ConjugateList.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:22 cdj 00024 // massive class renaming, addition of [] for selection and unit tests 00025 // 00026 // Revision 1.2 2001/04/04 15:01:00 cdj 00027 // made label public (needed for storage) 00028 // 00029 // Revision 1.1.1.1 2000/12/18 22:16:52 cdj 00030 // imported DChain 00031 // 00032 // Revision 1.12 1998/08/21 00:52:41 sjp 00033 // Modifier to no longer use typedefs 00034 // 00035 // Revision 1.11 1998/08/20 19:59:01 sjp 00036 // Modified to use DChainBoolean 00037 // 00038 // Revision 1.10 1998/04/17 19:11:02 sjp 00039 // Modified to use latest types 00040 // 00041 // Revision 1.9 1997/08/28 06:59:50 sjp 00042 // Modified files to handle complete templating 00043 // 00044 // Revision 1.8 1997/08/26 04:14:12 sjp 00045 // Made Candidate handling objects into `CandidateClass' Templates 00046 // 00047 // Revision 1.7 1997/08/19 23:02:18 sjp 00048 // Restructured package to be independent of Rock 00049 // 00050 // Revision 1.6 1997/08/15 21:32:16 sjp 00051 // Updated to use <package>/<file>.h include structure. 00052 // Updated to use bug flags specified in Experiement.h 00053 // 00054 // Revision 1.5 1997/01/22 16:27:16 sjp 00055 // Fixed error in pre-processor labels 00056 // 00057 // Revision 1.4 1997/01/21 20:33:45 sjp 00058 // Changed CPP flags and include because of library reorganization 00059 // 00060 // Revision 1.3 1997/01/19 20:28:35 sjp 00061 // Changed LargeCount to Count 00062 // 00063 // Revision 1.2 1996/12/20 21:19:08 sjp 00064 // Extended pathnames for Include files 00065 // 00066 // Revision 1.1 1996/11/04 19:35:54 sjp 00067 // New file for new `List' module 00068 // 00069 00070 // system include files 00071 00072 // user include files 00073 #include "DecayChain/Element/conjugation.h" // enum 00074 #include "DecayChain/List/CandidateList.h" // superclass declaration 00075 00076 // forward declarations 00077 template < class Arg > class DCAnalysisFunction ; 00078 template < class Arg > class DCConjugateFunction ; 00079 template < class Arg > class DCCombinatoricQuery ; 00080 00081 namespace dchain { 00082 template < class CandidateClass > 00083 class ConjugateList : public dchain::CandidateList< CandidateClass > 00084 { 00085 // friend classses and functions 00086 // DCCombinatoricQuery is a friend so that CombinatoricList can check the 00087 // LabeledCandidateList and Label to determine whether a set of 00088 // ConjugateLists are self-conjugate, and can use 00089 // conjugate_partial_begin() and conjugate_partial_end() to build up 00090 // the `conjugate' half of the DCCombinatoricQuery 00091 friend class DCCombinatoricQuery< CandidateClass > ; 00092 00093 public: 00094 // constants, enums and typedefs 00095 typedef dchain::MuteWholeCandidateItr< CandidateClass > iterator ; 00096 typedef dchain::WholeCandidateItr< CandidateClass > const_iterator ; 00097 typedef dchain::PartialCandidateItr< CandidateClass > const_partial_iterator ; 00098 // Constructors and destructor 00099 ConjugateList( const conjugation::Label aLabel ) ; 00100 virtual ~ConjugateList() ; 00101 00102 // member functions 00103 00104 // const member functions 00105 virtual bool isSelfConjugate() const ; 00106 bool isConjugateOf( const ConjugateList< CandidateClass >& aList ) const ; 00107 int partial_size() const ; 00108 00109 virtual const_partial_iterator partial_begin() const ; 00110 virtual const_partial_iterator partial_end() const ; 00111 00116 template <class TAnalyzer> 00117 void conjugation_iterate( const TAnalyzer& analyzer) const 00118 { 00119 const_iterator finished ( this->end() ) ; 00120 for ( const_iterator entry ( this->begin() ) ; 00121 entry != finished ; 00122 ++entry ) { 00123 analyze( (*entry)() , (*entry).label() == m_label ) ; 00124 } 00125 } 00126 00127 template<class TAnalyzer> 00128 void partial_iterate( const TAnalyzer& analyze ) const { 00129 const_partial_iterator finished ( partial_end() ) ; 00130 for ( const_partial_iterator entry ( partial_begin() ) ; 00131 entry != finished ; 00132 ++entry ) { 00133 analyze( (*entry)() ) ; 00134 } 00135 } 00136 00137 00138 // static member functions 00139 00140 // special member functions 00141 //- Note: following two function are used by DCCombinatoricQuery only! 00142 const_partial_iterator conjugate_partial_begin() const ; 00143 const_partial_iterator conjugate_partial_end() const ; 00144 00145 virtual conjugation::Label label() const ; 00146 00147 protected: 00148 00149 // protected member functions 00150 void setLabel( const conjugation::Label aLabel) ; 00151 00152 // protected const member functions 00153 00154 private: 00155 // Constructors and destructor 00156 ConjugateList() ; // stop default 00157 ConjugateList( const ConjugateList& ) ; // stop default 00158 00159 // assignment operator(s) 00160 const ConjugateList& operator=( const ConjugateList& ) ; // stop default 00161 00162 // private member functions 00163 00164 // private const member functions 00165 00166 // data members 00167 conjugation::Label m_label ; 00168 00169 // static data members 00170 00171 }; 00172 00173 // inline function definitions 00174 } 00175 00176 // function definitions 00177 #include "DecayChain/List/Template/ConjugateList.cc" 00178 00179 #endif /* DCHAIN_CONJUGATELIST_H */