00001 #ifndef DCHAIN_NEUTRALNCVISIBLELIST_CC
00002 #define DCHAIN_NEUTRALNCVISIBLELIST_CC
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
00032 #include <stdlib.h>
00033
00034
00035 #include "DecayChain/Function/DCSelectionFunction.h"
00036 #include "DecayChain/Function/DCAnalysisFunction.h"
00037 #include "DecayChain/Element/conjugation.h"
00038 #include "DecayChain/Element/LabeledParticle.h"
00039 #include "DecayChain/Iterator/MuteWholeItr.h"
00040 #include "DecayChain/Iterator/WholeItr.h"
00041 #include "DecayChain/List/LabeledParticleList.h"
00042 #include "DecayChain/List/ChosenConjugateList.h"
00043
00044 #include "DecayChain/List/NeutralNCVisibleList.h"
00045
00046
00047
00048
00049 namespace dchain {
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 template < class NeutralNC , class CandidateClass >
00060 NeutralNCVisibleList< NeutralNC , CandidateClass >::
00061 NeutralNCVisibleList() :
00062 m_list( (new dchain::LabeledParticleList< NeutralNC , CandidateClass >) ),
00063 m_ntBarList(0),
00064 m_isBarList(0)
00065 {
00066 }
00067
00068 template < class NeutralNC , class CandidateClass >
00069 NeutralNCVisibleList< NeutralNC , CandidateClass >::
00070 NeutralNCVisibleList(const NeutralNCVisibleList<NeutralNC, CandidateClass>&
00071 aOtherList ) :
00072 m_list( (new dchain::LabeledParticleList< NeutralNC , CandidateClass >) ),
00073 m_ntBarList(0),
00074 m_isBarList(0)
00075 {
00076 typedef typename MakerTrait<NeutralNC>::maker_type Maker;
00077 fill( *(aOtherList.m_list), Maker(), SelectAll<NeutralNC>() ) ;
00078 }
00079
00080
00081 template < class NeutralNC , class CandidateClass >
00082 NeutralNCVisibleList< NeutralNC , CandidateClass >::~NeutralNCVisibleList()
00083 {
00084 delete m_ntBarList;
00085 delete m_isBarList;
00086 }
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107 template < class NeutralNC , class CandidateClass >
00108 typename NeutralNCVisibleList< NeutralNC , CandidateClass >::iterator
00109 NeutralNCVisibleList< NeutralNC , CandidateClass >::particle_begin()
00110 {
00111 return ( m_list->begin() ) ;
00112 }
00113
00114 template < class NeutralNC , class CandidateClass >
00115 typename NeutralNCVisibleList< NeutralNC , CandidateClass >::iterator
00116 NeutralNCVisibleList< NeutralNC , CandidateClass >::particle_end()
00117 {
00118 return ( m_list->end() ) ;
00119 }
00120
00121 template < class NeutralNC , class CandidateClass >
00122 dchain::ChosenConjugateList< NeutralNC , CandidateClass >&
00123 NeutralNCVisibleList< NeutralNC , CandidateClass >::operator()()
00124 {
00125 if ( m_ntBarList == 0 ) {
00126 m_ntBarList = new ChosenConjugateList< NeutralNC, CandidateClass >(*m_list, kIsntBar);
00127 }
00128
00129 return (*m_ntBarList);
00130 }
00131
00132 template < class NeutralNC , class CandidateClass >
00133 dchain::ChosenConjugateList< NeutralNC , CandidateClass >&
00134 NeutralNCVisibleList< NeutralNC , CandidateClass >::bar()
00135 {
00136 if ( m_isBarList == 0 ) {
00137 m_isBarList = new ChosenConjugateList< NeutralNC, CandidateClass >(*m_list, kIsBar);
00138 }
00139
00140 return (*m_isBarList);
00141 }
00142
00143 template < class NeutralNC , class CandidateClass >
00144 dchain::LabeledParticleList< NeutralNC, CandidateClass >&
00145 NeutralNCVisibleList< NeutralNC , CandidateClass >::labeledCandidateList()
00146 {
00147 return ( *m_list ) ;
00148 }
00149
00150
00151 template < class NeutralNC , class CandidateClass >
00152 void NeutralNCVisibleList< NeutralNC , CandidateClass >::eraseContents()
00153 {
00154 m_list->erase( m_list->begin() ,
00155 m_list->end() ) ;
00156 }
00157
00158
00159
00160
00161
00162 template < class NeutralNC , class CandidateClass >
00163 typename NeutralNCVisibleList< NeutralNC , CandidateClass >::const_iterator
00164 NeutralNCVisibleList< NeutralNC , CandidateClass >::particle_begin() const
00165 {
00166
00167 return ( (*(const dchain::LabeledParticleList< NeutralNC , CandidateClass >*)(m_list.pointer())).begin() ) ;
00168 }
00169
00170 template < class NeutralNC , class CandidateClass >
00171 typename NeutralNCVisibleList< NeutralNC , CandidateClass >::const_iterator
00172 NeutralNCVisibleList< NeutralNC , CandidateClass >::particle_end() const
00173 {
00174
00175 return ( (*(const dchain::LabeledParticleList< NeutralNC , CandidateClass >*)(m_list.pointer())).end() ) ;
00176 }
00177
00178
00179 template < class NeutralNC , class CandidateClass >
00180 const dchain::LabeledParticleList< NeutralNC, CandidateClass >&
00181 NeutralNCVisibleList< NeutralNC , CandidateClass >::labeledCandidateList() const
00182 {
00183 return ( *m_list ) ;
00184 }
00185
00186
00187
00188
00189 }
00190 #endif