BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
dchain::DecayList< DecayClass, CandidateClass > Class Template Reference

#include <DecayList.h>

+ Inheritance diagram for dchain::DecayList< DecayClass, CandidateClass >:

Public Types

typedef MuteWholeItr< DecayClass > iterator
 
typedef WholeItr< DecayClass > const_iterator
 
typedef PartialItr< DecayClass > const_partial_iterator
 
typedef DecayClass value_type
 
typedef DecayList< DecayClass, CandidateClass > self_type
 
- Public Types inherited from dchain::ConjugateList< CandidateClass >
typedef dchain::MuteWholeCandidateItr< CandidateClass > iterator
 
typedef dchain::WholeCandidateItr< CandidateClass > const_iterator
 
typedef dchain::PartialCandidateItr< CandidateClass > const_partial_iterator
 
- Public Types inherited from dchain::CandidateList< CandidateClass >
typedef dchain::MuteWholeCandidateItr< CandidateClass > iterator
 
typedef dchain::WholeCandidateItr< CandidateClass > const_iterator
 
typedef dchain::PartialCandidateItr< CandidateClass > const_partial_iterator
 
typedef dchain::LabeledCandidate< CandidateClass > value_type
 

Public Member Functions

 DecayList ()
 
 DecayList (const self_type &aOtherList)
 
virtual ~DecayList ()
 
template<class TDecay >
const self_typeoperator= (const DecayList< TDecay, CandidateClass > &aOtherList)
 
const self_typeoperator= (const CombinatoricList< CandidateClass > &aOtherList)
 
const self_typeoperator= (const DecayList< DecayClass, CandidateClass > &aOtherList)
 
template<class TList >
void operator+= (const TList &aOtherList)
 
template<class TSelector >
FillListWithSelection< self_type, TSelector > operator[] (const TSelector &iSel)
 
virtual iterator particle_begin ()
 
virtual iterator particle_end ()
 
const DecayList< DecayClass, CandidateClass > bar () const
 
const DecayList< DecayClass, CandidateClass > & operator() () const
 
virtual const_iterator particle_begin () const
 
virtual const_iterator particle_end () const
 
virtual const_partial_iterator partial_particle_begin () const
 
virtual const_partial_iterator partial_particle_end () const
 
template<class TAnalyze >
void iterate (const TAnalyze &analyze) const
 
template<class TAnalyzer >
void conjugation_iterate (const TAnalyzer &analyzer) const
 
template<class TAnalyze >
void iterate (TAnalyze &analyze) const
 
template<class TAnalyze >
void partial_iterate (TAnalyze &analyze) const
 
void eraseContents ()
 
void erase ()
 
 DecayList (LabeledParticleList< DecayClass, CandidateClass > &aLabeledDecayList, conjugation::Label aLabel)
 
template<class TSelect >
bool attempt_insert (DecayClass *pPossible, const conjugation::Label aLabel, const TSelect &aSelect)
 
template<class THolder >
void insert (THolder &pPossible, const conjugation::Label aLabel)
 
template<class TDecayList , class TSelector >
void fill (const TDecayList &aList, const TSelector &aSel=SelectAll< DecayClass >())
 
- Public Member Functions inherited from dchain::ConjugateList< CandidateClass >
 ConjugateList (const conjugation::Label aLabel)
 
virtual ~ConjugateList ()
 
virtual bool isSelfConjugate () const
 
bool isConjugateOf (const ConjugateList< CandidateClass > &aList) const
 
int partial_size () const
 
virtual const_partial_iterator partial_begin () const
 
virtual const_partial_iterator partial_end () const
 
template<class TAnalyzer >
void conjugation_iterate (const TAnalyzer &analyzer) const
 
template<class TAnalyzer >
void partial_iterate (const TAnalyzer &analyze) const
 
const_partial_iterator conjugate_partial_begin () const
 
const_partial_iterator conjugate_partial_end () const
 
virtual conjugation::Label label () const
 
- Public Member Functions inherited from dchain::CandidateList< CandidateClass >
 CandidateList ()
 
virtual ~CandidateList ()
 
virtual iterator begin ()
 
virtual iterator end ()
 
virtual bool empty () const
 
virtual int size () const
 
virtual const_iterator begin () const
 
virtual const_iterator end () const
 
template<class TAnalyzer >
void iterate (const TAnalyzer &analyze) const
 

Protected Member Functions

virtual LabeledCandidateList< CandidateClass > & labeledCandidateList ()
 
virtual LabeledParticleList< DecayClass, CandidateClass > & labeledParticleList ()
 
virtual const LabeledCandidateList< CandidateClass > & labeledCandidateList () const
 
virtual const LabeledParticleList< DecayClass, CandidateClass > & labeledParticleList () const
 
- Protected Member Functions inherited from dchain::ConjugateList< CandidateClass >
void setLabel (const conjugation::Label aLabel)
 
virtual dchain::LabeledCandidateList< CandidateClass > & labeledCandidateList ()=0
 
virtual const dchain::LabeledCandidateList< CandidateClass > & labeledCandidateList () const =0
 

Friends

DecayList< DecayClass, CandidateClass > operator+ (const DecayList< DecayClass, CandidateClass > &iList1, const DecayList< DecayClass, CandidateClass > &iList2)
 

Detailed Description

template<class DecayClass, class CandidateClass = typename DecayClass::CandidateClass>
class dchain::DecayList< DecayClass, CandidateClass >

Definition at line 74 of file DecayList.h.

Member Typedef Documentation

◆ const_iterator

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
typedef WholeItr< DecayClass > dchain::DecayList< DecayClass, CandidateClass >::const_iterator

Definition at line 84 of file DecayList.h.

◆ const_partial_iterator

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
typedef PartialItr< DecayClass > dchain::DecayList< DecayClass, CandidateClass >::const_partial_iterator

Definition at line 85 of file DecayList.h.

◆ iterator

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
typedef MuteWholeItr< DecayClass > dchain::DecayList< DecayClass, CandidateClass >::iterator

Definition at line 83 of file DecayList.h.

◆ self_type

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
typedef DecayList< DecayClass , CandidateClass > dchain::DecayList< DecayClass, CandidateClass >::self_type

Definition at line 89 of file DecayList.h.

◆ value_type

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
typedef DecayClass dchain::DecayList< DecayClass, CandidateClass >::value_type

Definition at line 87 of file DecayList.h.

Constructor & Destructor Documentation

◆ DecayList() [1/3]

template<class DecayClass , class CandidateClass >
dchain::DecayList< DecayClass, CandidateClass >::DecayList

Definition at line 116 of file DecayList.cc.

116 :
117 ConjugateList< CandidateClass >( conjugation::kNone ) ,
119{
120}

◆ DecayList() [2/3]

template<class DecayClass , class CandidateClass >
dchain::DecayList< DecayClass, CandidateClass >::DecayList ( const self_type aOtherList)

Definition at line 123 of file DecayList.cc.

123 :
124 ConjugateList< CandidateClass >( conjugation::kNone ) ,
126{
127 fill( aOtherList, SelectAll<DecayClass>() ) ;
128}
void fill(const TDecayList &aList, const TSelector &aSel=SelectAll< DecayClass >())
Definition: DecayList.h:227

◆ ~DecayList()

template<class DecayClass , class CandidateClass >
dchain::DecayList< DecayClass, CandidateClass >::~DecayList
virtual

Definition at line 139 of file DecayList.cc.

140{
141}

◆ DecayList() [3/3]

template<class DecayClass , class CandidateClass >
dchain::DecayList< DecayClass, CandidateClass >::DecayList ( LabeledParticleList< DecayClass, CandidateClass > &  aLabeledDecayList,
conjugation::Label  aLabel 
)

Definition at line 132 of file DecayList.cc.

132 :
133 ConjugateList< CandidateClass >( aLabel ) ,
134 m_list( &aLabeledList )
135{
136}

Member Function Documentation

◆ attempt_insert()

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
template<class TSelect >
bool dchain::DecayList< DecayClass, CandidateClass >::attempt_insert ( DecayClass *  pPossible,
const conjugation::Label  aLabel,
const TSelect &  aSelect 
)
inline

Definition at line 206 of file DecayList.h.

208 {
209 ReferenceHolder<DecayClass> pHolder( pPossible );
210 bool returnValue = aSelect(*pPossible);
211 if (returnValue) {
212 this->insert(pPossible,aLabel);
213 }
214 return returnValue;
215 }
void insert(THolder &pPossible, const conjugation::Label aLabel)
Definition: DecayList.h:218

Referenced by dchain::DecayList< DecayClass, CandidateClass >::fill(), and dchain::operator+().

◆ bar()

template<class DecayClass , class CandidateClass >
const DecayList< DecayClass, CandidateClass > dchain::DecayList< DecayClass, CandidateClass >::bar

Definition at line 199 of file DecayList.cc.

200{
201 return ( DecayList< DecayClass , CandidateClass >( *m_list ,
202 otherLabel( this->label() ) ) ) ;
203}
virtual conjugation::Label label() const
conjugation::Label otherLabel(const conjugation::Label &aLabel)
Definition: conjugation.h:51

◆ conjugation_iterate()

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
template<class TAnalyzer >
void dchain::DecayList< DecayClass, CandidateClass >::conjugation_iterate ( const TAnalyzer &  analyzer) const
inline

Definition at line 154 of file DecayList.h.

155 {
156 const_iterator finished ( particle_end() ) ;
157 for ( const_iterator entry ( particle_begin() ) ;
158 entry != finished ;
159 ++entry ) {
160 analyze( (*entry)() , (*entry).label() == this->label() ) ;
161 }
162 }
WholeItr< DecayClass > const_iterator
Definition: DecayList.h:84
virtual iterator particle_begin()
Definition: DecayList.cc:169
virtual iterator particle_end()
Definition: DecayList.cc:176

Referenced by dchain::CombinatoricList< CandidateClass >::conjugation_iterate().

◆ erase()

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
void dchain::DecayList< DecayClass, CandidateClass >::erase ( )
inline

Definition at line 187 of file DecayList.h.

187 {
189 }
void eraseContents()
Definition: DecayList.cc:243

Referenced by dchain::DecayList< DecayClass, CandidateClass >::operator=().

◆ eraseContents()

template<class DecayClass , class CandidateClass >
void dchain::DecayList< DecayClass, CandidateClass >::eraseContents

Definition at line 243 of file DecayList.cc.

244{
245 m_list->erase( m_list->begin() ,
246 m_list->end() ) ;
247}

Referenced by dchain::DecayList< DecayClass, CandidateClass >::erase().

◆ fill()

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
template<class TDecayList , class TSelector >
void dchain::DecayList< DecayClass, CandidateClass >::fill ( const TDecayList< DecayClass, CandidateClass > &  aList,
const TSelector &  aSel = SelectAll<DecayClass>() 
)
inline

Definition at line 227 of file DecayList.h.

227 {
228 //std::cout << "@DecayList::fill()" << std::endl;
229 setLabel( aList.label() ) ;
230 typename TDecayList::const_iterator finished( aList.particle_end() ) ;
231 for ( typename TDecayList::const_iterator entry( aList.particle_begin() ) ;
232 entry != finished ;
233 ++entry ) {
234 //std::cout << "@ DecayList::fill()" << std::endl;
235 DecayClass* localCopy = new DecayClass( (*entry).particle() ) ;
236 attempt_insert( localCopy ,
237 (*entry).label(),
238 aSel ) ;
239 }
240 }
void setLabel(const conjugation::Label aLabel)
bool attempt_insert(DecayClass *pPossible, const conjugation::Label aLabel, const TSelect &aSelect)
Definition: DecayList.h:206

Referenced by dchain::DecayList< DecayClass, CandidateClass >::DecayList(), dchain::DecayList< DecayClass, CandidateClass >::operator+=(), and dchain::DecayList< DecayClass, CandidateClass >::operator=().

◆ insert()

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
template<class THolder >
void dchain::DecayList< DecayClass, CandidateClass >::insert ( THolder &  pPossible,
const conjugation::Label  aLabel 
)
inline

Definition at line 218 of file DecayList.h.

219 {
220 m_list->push_back( LabeledParticle< DecayClass >( pPossible ,
221 aLabel ) ) ;
222 }

Referenced by dchain::DecayList< DecayClass, CandidateClass >::attempt_insert().

◆ iterate() [1/2]

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
template<class TAnalyze >
void dchain::DecayList< DecayClass, CandidateClass >::iterate ( const TAnalyze &  analyze) const
inline

Definition at line 144 of file DecayList.h.

144 {
145 const_iterator finished ( particle_end() ) ;
146 for ( const_iterator entry ( particle_begin() ) ;
147 entry != finished ;
148 ++entry ) {
149 analyze( (*entry).particle() ) ;
150 }
151 }

Referenced by dchain::CombinatoricList< CandidateClass >::iterate().

◆ iterate() [2/2]

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
template<class TAnalyze >
void dchain::DecayList< DecayClass, CandidateClass >::iterate ( TAnalyze &  analyze) const
inline

Definition at line 165 of file DecayList.h.

165 {
166 const_iterator finished ( particle_end() ) ;
167 for ( const_iterator entry ( particle_begin() ) ;
168 entry != finished ;
169 ++entry ) {
170 analyze( (*entry).particle() ) ;
171 }
172 }

◆ labeledCandidateList() [1/2]

template<class DecayClass , class CandidateClass >
dchain::LabeledCandidateList< CandidateClass > & dchain::DecayList< DecayClass, CandidateClass >::labeledCandidateList
protectedvirtual

Implements dchain::CandidateList< CandidateClass >.

Reimplemented in dchain::CombinatoricList< CandidateClass >.

Definition at line 182 of file DecayList.cc.

183{
184 return ( *m_list ) ;
185}

◆ labeledCandidateList() [2/2]

template<class DecayClass , class CandidateClass >
const LabeledCandidateList< CandidateClass > & dchain::DecayList< DecayClass, CandidateClass >::labeledCandidateList
protectedvirtual

Implements dchain::CandidateList< CandidateClass >.

Reimplemented in dchain::CombinatoricList< CandidateClass >.

Definition at line 251 of file DecayList.cc.

252{
253 return ( *m_list ) ;
254}

◆ labeledParticleList() [1/2]

template<class DecayClass , class CandidateClass >
dchain::LabeledParticleList< DecayClass, CandidateClass > & dchain::DecayList< DecayClass, CandidateClass >::labeledParticleList
protectedvirtual

Definition at line 188 of file DecayList.cc.

189{
190 return ( *m_list ) ;
191}

◆ labeledParticleList() [2/2]

template<class DecayClass , class CandidateClass >
const LabeledParticleList< DecayClass, CandidateClass > & dchain::DecayList< DecayClass, CandidateClass >::labeledParticleList
protectedvirtual

Definition at line 258 of file DecayList.cc.

259{
260 return ( *m_list ) ;
261}

◆ operator()()

template<class DecayClass , class CandidateClass >
const DecayList< DecayClass, CandidateClass > & dchain::DecayList< DecayClass, CandidateClass >::operator()

Definition at line 206 of file DecayList.cc.

207{
208 return ( *this ) ;
209}

◆ operator+=()

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
template<class TList >
void dchain::DecayList< DecayClass, CandidateClass >::operator+= ( const TList &  aOtherList)
inline

Definition at line 112 of file DecayList.h.

112 {
113
114 if(this->size() != 0 ) {
115 //only check compatable conjugation if something already in
116 // this list, otherwise could have problem with default value
117 bool can_only_add_lists_with_same_conjugation =
118 this->isSelfConjugate()== aOtherList.isSelfConjugate();
119 assert(can_only_add_lists_with_same_conjugation);
120 }
121 fill(aOtherList);
122 }
virtual int size() const
virtual bool isSelfConjugate() const

◆ operator=() [1/3]

template<class DecayClass , class CandidateClass >
const DecayList< DecayClass, CandidateClass > & dchain::DecayList< DecayClass, CandidateClass >::operator= ( const CombinatoricList< CandidateClass > &  aOtherList)

Definition at line 158 of file DecayList.cc.

159{
160 //std::cout << "@DecayList::operator=() ... (CombinatoricList)" << std::endl;
161 return ( *this = static_cast<const DecayList<typename DCCandidateTraits<CandidateClass>::DecayClass, CandidateClass>& >(aOtherList) ) ;
162}

◆ operator=() [2/3]

template<class DecayClass , class CandidateClass >
const DecayList< DecayClass, CandidateClass > & dchain::DecayList< DecayClass, CandidateClass >::operator= ( const DecayList< DecayClass, CandidateClass > &  aOtherList)

Definition at line 148 of file DecayList.cc.

149{
150 //std::cout << "@DecayList::operator=() ... (DecayList)" << std::endl;
151 m_list->erase( m_list->begin() ,
152 m_list->end() ) ;
153 fill( aOtherList, SelectAll<DecayClass>() ) ;
154 return ( *this ) ;
155}

◆ operator=() [3/3]

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
template<class TDecay >
const self_type & dchain::DecayList< DecayClass, CandidateClass >::operator= ( const DecayList< TDecay, CandidateClass > &  aOtherList)
inline

Definition at line 100 of file DecayList.h.

100 {
101 m_list->erase( m_list->begin() ,
102 m_list->end() ) ;
103 fill( aOtherList, SelectAll<DecayClass>() ) ;
104 return ( *this ) ;
105 }

◆ operator[]()

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
template<class TSelector >
FillListWithSelection< self_type, TSelector > dchain::DecayList< DecayClass, CandidateClass >::operator[] ( const TSelector &  iSel)
inline

Definition at line 125 of file DecayList.h.

◆ partial_iterate()

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
template<class TAnalyze >
void dchain::DecayList< DecayClass, CandidateClass >::partial_iterate ( TAnalyze &  analyze) const
inline

Definition at line 176 of file DecayList.h.

177 {
180 entry != finished ;
181 ++entry ) {
182 analyze( (*entry).particle() ) ;
183 }
184 }
virtual const_partial_iterator partial_particle_begin() const
Definition: DecayList.cc:227
virtual const_partial_iterator partial_particle_end() const
Definition: DecayList.cc:234
PartialItr< DecayClass > const_partial_iterator
Definition: DecayList.h:85

Referenced by dchain::CombinatoricList< CandidateClass >::partial_iterate().

◆ partial_particle_begin()

template<class DecayClass , class CandidateClass >
DecayList< DecayClass, CandidateClass >::const_partial_iterator dchain::DecayList< DecayClass, CandidateClass >::partial_particle_begin
virtual

Reimplemented in dchain::CombinatoricList< CandidateClass >.

Definition at line 227 of file DecayList.cc.

228{
229// Need to cast to 'const' to get the right function call
230 return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).begin( this->label() ) ) ;
231}

Referenced by dchain::DecayList< DecayClass, CandidateClass >::partial_iterate().

◆ partial_particle_end()

template<class DecayClass , class CandidateClass >
DecayList< DecayClass, CandidateClass >::const_partial_iterator dchain::DecayList< DecayClass, CandidateClass >::partial_particle_end
virtual

Reimplemented in dchain::CombinatoricList< CandidateClass >.

Definition at line 234 of file DecayList.cc.

235{
236// Need to cast to 'const' to get the right function call
237 return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).end( this->label() ) ) ;
238}

Referenced by dchain::DecayList< DecayClass, CandidateClass >::partial_iterate().

◆ particle_begin() [1/2]

template<class DecayClass , class CandidateClass >
DecayList< DecayClass, CandidateClass >::iterator dchain::DecayList< DecayClass, CandidateClass >::particle_begin
virtual

Reimplemented in dchain::CombinatoricList< CandidateClass >.

Definition at line 169 of file DecayList.cc.

170{
171 //std::cout << "@DecayList::particle_begin() -- iterator" << std::endl;
172 return ( m_list->begin() ) ;
173}

Referenced by dchain::DecayList< DecayClass, CandidateClass >::conjugation_iterate(), ChargedDReconstruction::execute(), DsReconstruction::execute(), NeutralDReconstruction::execute(), and dchain::DecayList< DecayClass, CandidateClass >::iterate().

◆ particle_begin() [2/2]

template<class DecayClass , class CandidateClass >
DecayList< DecayClass, CandidateClass >::const_iterator dchain::DecayList< DecayClass, CandidateClass >::particle_begin
virtual

Reimplemented in dchain::CombinatoricList< CandidateClass >.

Definition at line 212 of file DecayList.cc.

213{
214// Need to cast to 'const' to get the right function call
215 //std::cout << "@DecayList::particle_begin() -- const_iterator" << std::endl;
216 return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).begin() ) ;
217}

◆ particle_end() [1/2]

template<class DecayClass , class CandidateClass >
DecayList< DecayClass, CandidateClass >::iterator dchain::DecayList< DecayClass, CandidateClass >::particle_end
virtual

◆ particle_end() [2/2]

template<class DecayClass , class CandidateClass >
DecayList< DecayClass, CandidateClass >::const_iterator dchain::DecayList< DecayClass, CandidateClass >::particle_end
virtual

Reimplemented in dchain::CombinatoricList< CandidateClass >.

Definition at line 220 of file DecayList.cc.

221{
222// Need to cast to 'const' to get the right function call
223 return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).end() ) ;
224}

Friends And Related Function Documentation

◆ operator+

template<class DecayClass , class CandidateClass = typename DecayClass::CandidateClass>
DecayList< DecayClass, CandidateClass > operator+ ( const DecayList< DecayClass, CandidateClass > &  iList1,
const DecayList< DecayClass, CandidateClass > &  iList2 
)
friend

Definition at line 258 of file DecayList.h.

261{
262 bool can_only_add_lists_with_same_conjugation =
263 iList1.isSelfConjugate()== iList2.isSelfConjugate();
264 assert(can_only_add_lists_with_same_conjugation);
265
266 DecayList< DecayClass, CandidateClass> returnValue( iList1 );
267 if( &iList1 != &iList2 ) {
268 returnValue.fill( iList2, SelectAll<DecayClass>() );
269 }
270 return returnValue;
271}

The documentation for this class was generated from the following files: