BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
dchain::ChargedVisibleList< Charged, CandidateClass > Class Template Reference

#include <ChargedVisibleList.h>

+ Inheritance diagram for dchain::ChargedVisibleList< Charged, CandidateClass >:

Public Types

typedef MuteWholeItr< Charged > iterator
 
typedef WholeItr< Charged > const_iterator
 
typedef PartialItr< Charged > const_partial_iterator
 
typedef Charged value_type
 
typedef ChargedVisibleList< Charged, CandidateClass > self_type
 
- 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

 ChargedVisibleList ()
 
 ChargedVisibleList (const self_type &aOtherList)
 
template<class TSelector >
 ChargedVisibleList (const self_type &aOtherList, const TSelector &aSel)
 
template<class WitnessIterator >
 ChargedVisibleList (WitnessIterator first, WitnessIterator last)
 
template<class WitnessIterator , class TSelector >
 ChargedVisibleList (WitnessIterator first, WitnessIterator last, const TSelector &aFunctionalObject)
 
virtual ~ChargedVisibleList ()
 
const self_typeoperator= (const self_type &aOtherList)
 
template<class Witness >
const self_typeoperator= (const Witness &aWitnessList)
 
template<class TSelector >
FillListWithSelection< self_type, TSelector > operator[] (const TSelector &iSel)
 
iterator particle_begin ()
 
iterator particle_end ()
 
ChosenChargeList< Charged, CandidateClass > & plus () const
 
ChosenChargeList< Charged, CandidateClass > & minus () const
 
const_iterator particle_begin () const
 
const_iterator particle_end () const
 
template<class TAnalyze >
void iterate (const TAnalyze &analyze) const
 
template<class TAnalyze >
void iterate (TAnalyze &analyze) const
 
template<class TSelect >
SelectiveInserter< self_type, TSelect > selectiveInserter (const TSelect &iSelect)
 creates an insert iterator that filters based on iSelect
 
template<class THolder , class TSelect >
bool attempt_insert (THolder &pPossible, const TSelect &aSelect)
 
template<class THolder >
void insert (THolder &pPossible)
 
void eraseContents ()
 
void erase ()
 
template<class TMaker , class TSelector >
void fill (const LabeledParticleList< Charged, CandidateClass > &aList, const TMaker &aMaker, const TSelector &aSel)
 
template<class Iterator , class TMaker , class TSelector >
void fill (Iterator first, Iterator last, const TMaker &aMaker, const TSelector &aSel=SelectAll< Charged >())
 
- 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 LabeledParticleList< Charged, CandidateClass > & labeledCandidateList ()
 
virtual const LabeledParticleList< Charged, CandidateClass > & labeledCandidateList () const
 
virtual dchain::LabeledCandidateList< CandidateClass > & labeledCandidateList ()=0
 
virtual const dchain::LabeledCandidateList< CandidateClass > & labeledCandidateList () const =0
 

Detailed Description

template<class Charged, class CandidateClass = typename Charged::CandidateClass>
class dchain::ChargedVisibleList< Charged, CandidateClass >

Definition at line 137 of file ChargedVisibleList.h.

Member Typedef Documentation

◆ const_iterator

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
typedef WholeItr< Charged > dchain::ChargedVisibleList< Charged, CandidateClass >::const_iterator

Definition at line 144 of file ChargedVisibleList.h.

◆ const_partial_iterator

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
typedef PartialItr< Charged > dchain::ChargedVisibleList< Charged, CandidateClass >::const_partial_iterator

Definition at line 145 of file ChargedVisibleList.h.

◆ iterator

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
typedef MuteWholeItr< Charged > dchain::ChargedVisibleList< Charged, CandidateClass >::iterator

Definition at line 143 of file ChargedVisibleList.h.

◆ self_type

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
typedef ChargedVisibleList<Charged,CandidateClass> dchain::ChargedVisibleList< Charged, CandidateClass >::self_type

Definition at line 149 of file ChargedVisibleList.h.

◆ value_type

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
typedef Charged dchain::ChargedVisibleList< Charged, CandidateClass >::value_type

Definition at line 147 of file ChargedVisibleList.h.

Constructor & Destructor Documentation

◆ ChargedVisibleList() [1/5]

template<class Charged , class CandidateClass >
dchain::ChargedVisibleList< Charged, CandidateClass >::ChargedVisibleList

inserts into the list only if the the selector returns true

Definition at line 118 of file ChargedVisibleList.cc.

119 :
121 m_plusList(0),
122 m_minusList(0)
123{
124}

◆ ChargedVisibleList() [2/5]

template<class Charged , class CandidateClass >
dchain::ChargedVisibleList< Charged, CandidateClass >::ChargedVisibleList ( const self_type aOtherList)

Definition at line 126 of file ChargedVisibleList.cc.

127 :
129 m_plusList(0),
130 m_minusList(0)
131{
132 typedef typename MakerTrait<Charged>::maker_type Maker;
133 fill( *(aOtherList.m_list), Maker(), SelectAll<Charged>() ) ;
134}
void fill(const LabeledParticleList< Charged, CandidateClass > &aList, const TMaker &aMaker, const TSelector &aSel)

◆ ChargedVisibleList() [3/5]

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
template<class TSelector >
dchain::ChargedVisibleList< Charged, CandidateClass >::ChargedVisibleList ( const self_type aOtherList,
const TSelector &  aSel 
)
inline

Definition at line 158 of file ChargedVisibleList.h.

159 :
161 m_plusList(0),
162 m_minusList(0)
163 {
164 fill(*(aOtherList.m_list),
166 aSel);
167 }

◆ ChargedVisibleList() [4/5]

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
template<class WitnessIterator >
dchain::ChargedVisibleList< Charged, CandidateClass >::ChargedVisibleList ( WitnessIterator  first,
WitnessIterator  last 
)
inline

Definition at line 170 of file ChargedVisibleList.h.

170 :
172 m_plusList(0),
173 m_minusList(0)
174 {
175 fill(first, last, typename MakerTrait<Charged>::maker_type() ); }

◆ ChargedVisibleList() [5/5]

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
template<class WitnessIterator , class TSelector >
dchain::ChargedVisibleList< Charged, CandidateClass >::ChargedVisibleList ( WitnessIterator  first,
WitnessIterator  last,
const TSelector &  aFunctionalObject 
)
inline

Definition at line 178 of file ChargedVisibleList.h.

179 :
181 m_plusList(0),
182 m_minusList(0)
183 {
184 fill(first, last,
185 typename MakerTrait<Charged>::maker_type(), aFunctionalObject); }

◆ ~ChargedVisibleList()

template<class Charged , class CandidateClass >
dchain::ChargedVisibleList< Charged, CandidateClass >::~ChargedVisibleList
virtual

Definition at line 137 of file ChargedVisibleList.cc.

138{
139 delete m_plusList;
140 delete m_minusList;
141}

Member Function Documentation

◆ attempt_insert()

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
template<class THolder , class TSelect >
bool dchain::ChargedVisibleList< Charged, CandidateClass >::attempt_insert ( THolder &  pPossible,
const TSelect &  aSelect 
)
inline

Definition at line 243 of file ChargedVisibleList.h.

244 {
245 //std::cout << " @ ChargedVisibleList::attempt_insert() " << __LINE__ << std::endl;
246 bool returnValue = (aSelect)(*pPossible);
247 if (returnValue) {
248 this->insert(pPossible);
249 }
250 return returnValue;
251 }
void insert(THolder &pPossible)

Referenced by dchain::ChargedVisibleList< Charged, CandidateClass >::fill().

◆ erase()

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
void dchain::ChargedVisibleList< Charged, CandidateClass >::erase ( )
inline

Definition at line 266 of file ChargedVisibleList.h.

266 {
268 }

◆ eraseContents()

template<class Charged , class CandidateClass >
void dchain::ChargedVisibleList< Charged, CandidateClass >::eraseContents

◆ fill() [1/2]

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
template<class TMaker , class TSelector >
void dchain::ChargedVisibleList< Charged, CandidateClass >::fill ( const LabeledParticleList< Charged, CandidateClass > &  aList,
const TMaker &  aMaker,
const TSelector &  aSel 
)
inline

Definition at line 271 of file ChargedVisibleList.h.

273 {
274
275 for( const_iterator entry(aList.begin()); entry != aList.end(); ++entry){
276 //NOTE: even though this is really just calling the copy constructor
277 //it is best to use the maker since it allows further control
278 const Charged& from((*entry)());
279 typename ResultTypeTrait<TMaker>::type localCopy( aMaker(from) );
280
281 attempt_insert(localCopy,aSel);
282 }
283
284 }
WholeItr< Charged > const_iterator
bool attempt_insert(THolder &pPossible, const TSelect &aSelect)
T::result_type type
Definition: MakerTrait.h:55

Referenced by dchain::ChargedVisibleList< Charged, CandidateClass >::ChargedVisibleList(), dchain::fill_using_selector(), and dchain::ChargedVisibleList< Charged, CandidateClass >::operator=().

◆ fill() [2/2]

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
template<class Iterator , class TMaker , class TSelector >
void dchain::ChargedVisibleList< Charged, CandidateClass >::fill ( Iterator  first,
Iterator  last,
const TMaker &  aMaker,
const TSelector &  aSel = SelectAll<Charged>() 
)
inline

Definition at line 286 of file ChargedVisibleList.h.

288 {
289 //std::cout << " @ ChargedVisibleList::fill() " << __LINE__ << std::endl;
290 //std::cout << "size before transform: " << m_list->size() << std::endl;
291 std::transform(first,last,
292 selectiveInserter(aSel),
293 aMaker);
294 //std::cout << "size after transform: " << m_list->size() << std::endl;
295 }
SelectiveInserter< self_type, TSelect > selectiveInserter(const TSelect &iSelect)
creates an insert iterator that filters based on iSelect

◆ insert()

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
template<class THolder >
void dchain::ChargedVisibleList< Charged, CandidateClass >::insert ( THolder &  pPossible)
inline

Definition at line 254 of file ChargedVisibleList.h.

254 {
255 if (0 < charge_sign(pPossible)) {
256 m_list->push_back( LabeledParticle< Charged >( pPossible ,
257 kPlus ) ) ;
258 }
259 else {
260 m_list->push_back( LabeledParticle< Charged >( pPossible ,
261 kMinus ) ) ;
262 }
263 }
int charge_sign(const T &iCharged)

Referenced by dchain::ChargedVisibleList< Charged, CandidateClass >::attempt_insert().

◆ iterate() [1/2]

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

Definition at line 218 of file ChargedVisibleList.h.

218 {
219 const_iterator finished ( particle_end() ) ;
220 for ( const_iterator entry ( particle_begin() ) ;
221 entry != finished ;
222 ++entry ) {
223 analyze( (*entry)() ) ;
224 }
225 }

◆ iterate() [2/2]

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

Definition at line 228 of file ChargedVisibleList.h.

228 {
229 const_iterator finished ( particle_end() ) ;
230 for ( const_iterator entry ( particle_begin() ) ;
231 entry != finished ;
232 ++entry ) {
233 analyze( (*entry)() ) ;
234 }
235 }

◆ labeledCandidateList() [1/2]

template<class Charged , class CandidateClass >
LabeledParticleList< Charged, CandidateClass > & dchain::ChargedVisibleList< Charged, CandidateClass >::labeledCandidateList
protectedvirtual

Implements dchain::CandidateList< CandidateClass >.

Definition at line 196 of file ChargedVisibleList.cc.

197{
198 return ( *m_list ) ;
199}

Referenced by DCChargedVisibleList< Charged, CandidateClass >::operator=().

◆ labeledCandidateList() [2/2]

template<class Charged , class CandidateClass >
const LabeledParticleList< Charged, CandidateClass > & dchain::ChargedVisibleList< Charged, CandidateClass >::labeledCandidateList
protectedvirtual

Implements dchain::CandidateList< CandidateClass >.

Definition at line 230 of file ChargedVisibleList.cc.

231{
232 return ( *m_list ) ;
233}

◆ minus()

template<class Charged , class CandidateClass >
ChosenChargeList< Charged, CandidateClass > & dchain::ChargedVisibleList< Charged, CandidateClass >::minus

Definition at line 186 of file ChargedVisibleList.cc.

187{
188 if ( m_minusList == 0 ) {
189 m_minusList = new ChosenChargeList< Charged , CandidateClass >( *m_list , kMinus );
190 }
191 return (*m_minusList);
192}

Referenced by ChargedDReconstruction::execute(), DsReconstruction::execute(), LambdaCReconstruction::execute(), and NeutralDReconstruction::execute().

◆ operator=() [1/2]

template<class Charged , class CandidateClass >
const ChargedVisibleList< Charged, CandidateClass > & dchain::ChargedVisibleList< Charged, CandidateClass >::operator= ( const self_type aOtherList)

Definition at line 148 of file ChargedVisibleList.cc.

149{
150 eraseContents() ;
151 typedef typename MakerTrait<Charged>::maker_type Maker;
152 fill( *(aOtherList.m_list), Maker(), SelectAll<Charged>() ) ;
153 return ( *this ) ;
154}

◆ operator=() [2/2]

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
template<class Witness >
const self_type & dchain::ChargedVisibleList< Charged, CandidateClass >::operator= ( const Witness &  aWitnessList)
inline

Definition at line 192 of file ChargedVisibleList.h.

192 {
194 fill(aWitnessList.begin(), aWitnessList.end(),
197 return ( *this ) ;
198 }

◆ operator[]()

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

Definition at line 202 of file ChargedVisibleList.h.

◆ particle_begin() [1/2]

template<class Charged , class CandidateClass >
ChargedVisibleList< Charged, CandidateClass >::iterator dchain::ChargedVisibleList< Charged, CandidateClass >::particle_begin

◆ particle_begin() [2/2]

template<class Charged , class CandidateClass >
ChargedVisibleList< Charged, CandidateClass >::const_iterator dchain::ChargedVisibleList< Charged, CandidateClass >::particle_begin

Definition at line 214 of file ChargedVisibleList.cc.

215{
216// Need to cast to 'const' to get the right function call
217 return ( (*(const LabeledParticleList< Charged , CandidateClass >*)(m_list.pointer())).begin() ) ;
218}

◆ particle_end() [1/2]

template<class Charged , class CandidateClass >
ChargedVisibleList< Charged, CandidateClass >::iterator dchain::ChargedVisibleList< Charged, CandidateClass >::particle_end

◆ particle_end() [2/2]

template<class Charged , class CandidateClass >
ChargedVisibleList< Charged, CandidateClass >::const_iterator dchain::ChargedVisibleList< Charged, CandidateClass >::particle_end

Definition at line 221 of file ChargedVisibleList.cc.

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

◆ plus()

template<class Charged , class CandidateClass >
ChosenChargeList< Charged, CandidateClass > & dchain::ChargedVisibleList< Charged, CandidateClass >::plus

Definition at line 176 of file ChargedVisibleList.cc.

177{
178 if ( m_plusList == 0 ) {
179 m_plusList = new ChosenChargeList< Charged, CandidateClass >( *m_list, kPlus );
180 }
181 return (*m_plusList);
182}

Referenced by ChargedDReconstruction::execute(), DsReconstruction::execute(), LambdaCReconstruction::execute(), and NeutralDReconstruction::execute().

◆ selectiveInserter()

template<class Charged , class CandidateClass = typename Charged::CandidateClass>
template<class TSelect >
SelectiveInserter< self_type, TSelect > dchain::ChargedVisibleList< Charged, CandidateClass >::selectiveInserter ( const TSelect &  iSelect)
inline

creates an insert iterator that filters based on iSelect

Definition at line 239 of file ChargedVisibleList.h.

239 {
240 return SelectiveInserter<self_type,TSelect>(*this,iSelect); }

Referenced by dchain::ChargedVisibleList< Charged, CandidateClass >::fill().


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