00001 #ifndef DCHAIN_CHOSENCHARGELIST_H
00002 #define DCHAIN_CHOSENCHARGELIST_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "DecayChain/List/ConjugateList.h"
00032 #include "DecayChain/Element/MutableReferenceHolder.h"
00033
00034
00035 namespace dchain {
00036 template < class Charged , class CandidateClass > class ChargedVisibleList ;
00037 }
00038
00039 namespace dchain {
00040
00041 template < class DecayClass > class MuteWholeItr ;
00042 template < class DecayClass > class WholeItr ;
00043 template < class DecayClass > class PartialItr ;
00044 template < class DecayClass , class CandidateClass > class LabeledParticleList ;
00045 }
00046
00047
00048
00049 template < class Arg > class DCAnalysisFunction ;
00050
00051 namespace dchain {
00052
00053 template < class Charged , class CandidateClass >
00054 class ChosenChargeList : public ConjugateList< CandidateClass >
00055 {
00056
00057 friend class dchain::ChargedVisibleList< Charged , CandidateClass > ;
00058
00059 public:
00060
00061 typedef dchain::MuteWholeItr< Charged > iterator ;
00062 typedef dchain::WholeItr< Charged > const_iterator ;
00063 typedef dchain::PartialItr< Charged > const_partial_iterator ;
00064
00065
00066 virtual ~ChosenChargeList() ;
00067
00068
00069 iterator particle_begin() ;
00070 iterator particle_end() ;
00071
00072
00073 const_iterator particle_begin() const ;
00074 const_iterator particle_end() const ;
00075 const_partial_iterator partial_particle_begin() const ;
00076 const_partial_iterator partial_particle_end() const ;
00077
00078 template < class TAnalyzer >
00079 void iterate( const TAnalyzer& analyzer) const
00080 {
00081 const_iterator finished ( particle_end() ) ;
00082 for ( const_iterator entry ( particle_begin() ) ;
00083 entry != finished ;
00084 ++entry ) {
00085 analyze( (*entry)() ) ;
00086 }
00087 }
00088 template < class TAnalyzer>
00089 void conjugation_iterate( const TAnalyzer& analyzer) const
00090 {
00091 const_iterator finished ( particle_end() ) ;
00092 for ( const_iterator entry ( particle_begin() ) ;
00093 entry != finished ;
00094 ++entry ) {
00095 analyze( (*entry)() , (*entry).label() == this->label() ) ;
00096 }
00097 }
00098
00099 template < class TAnalyzer>
00100 void partial_iterate( const TAnalyzer& analyzer ) const {
00101 const_partial_iterator finished ( partial_particle_end() ) ;
00102 for ( const_partial_iterator entry ( partial_particle_begin() ) ;
00103 entry != finished ;
00104 ++entry ) {
00105 analyze( (*entry)() ) ;
00106 }
00107 }
00108
00109
00110 protected:
00111
00112 ChosenChargeList( dchain::LabeledParticleList< Charged , CandidateClass >& aLabeledDecayList ,
00113 const conjugation::Label aLabel ) ;
00114
00115
00116 virtual dchain::LabeledCandidateList< CandidateClass >& labeledCandidateList() ;
00117
00118
00119 virtual const dchain::LabeledCandidateList< CandidateClass >& labeledCandidateList() const ;
00120
00121 private:
00122
00123 ChosenChargeList() ;
00124 ChosenChargeList( const ChosenChargeList< Charged , CandidateClass >& aOtherList ) ;
00125
00126
00127 const ChosenChargeList< Charged , CandidateClass >& operator=( const ChosenChargeList< Charged , CandidateClass >& aOtherList ) ;
00128
00129
00130
00131
00132
00133
00134 MutableReferenceHolder< dchain::LabeledParticleList< Charged , CandidateClass > > m_list ;
00135
00136
00137
00138 } ;
00139 }
00140
00141
00142
00143 #include "DecayChain/List/Template/ChosenChargeList.cc"
00144
00145 #endif