YAP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | List of all members
ParticleCombinationCache Class Reference

Caches list of ParticleCombination's. More...

#include <ParticleCombinationCache.h>

Inheritance diagram for ParticleCombinationCache:
WeakPtrCache< ParticleCombination >

Public Member Functions

bool equal (const shared_ptr_type &A, const shared_ptr_type &B) const override
 implements equality checking
 
shared_ptr_type fsp (unsigned index)
 
shared_ptr_type composite (const ParticleCombinationVector &D)
 
weak_ptr_type find (unsigned index) const
 
weak_ptr_type find (const ParticleCombinationVector &D) const
 
weak_ptr_type findByUnorderedContent (const std::vector< unsigned > &I) const
 
bool consistent () const
 Check consistency of cache.
 
virtual std::ostream & print (std::ostream &os) const override
 stream the cache elements as a table
 
- Public Member Functions inherited from WeakPtrCache< ParticleCombination >
weak_ptr_type find (shared_ptr_type t) const
 
shared_ptr_type operator[] (shared_ptr_type t)
 
bool empty () const
 
size_t size () const
 
size_t count_expired () const
 
void removeExpired ()
 remove expired Cache_ elements
 
 WeakPtrCache ()=default
 Default constructor (defaulted)
 
 WeakPtrCache (const WeakPtrCache &)=default
 copy constructor (defaulted)
 
 WeakPtrCache (WeakPtrCache &&)=default
 move constructor (defaulted)
 
 WeakPtrCache (std::vector< shared_ptr_type > V)
 Construct cache from vector.
 
virtual ~WeakPtrCache ()=default
 virtual desctructor (defaulted)
 
WeakPtrCacheoperator= (const WeakPtrCache &)=default
 copy assignment operator (defaulted)
 
WeakPtrCacheoperator= (WeakPtrCache &&)=default
 move assignment operator (defaulted)
 
cache_type::iterator begin ()
 
cache_type::const_iterator begin () const
 
cache_type::iterator end ()
 
cache_type::const_iterator end () const
 

Private Member Functions

void addToCache (shared_ptr_type pc) override
 add to cache
 
shared_ptr_type create_fsp (unsigned index) const
 create final-state particle, it is not yet added to cache
 
shared_ptr_type create_copy (const ParticleCombination &other) const
 create copy, it is not yet added to cache
 
shared_ptr_type create_composite (const ParticleCombinationVector &D) const
 create composite ParticleCombination, it is not yet added to cache
 

Additional Inherited Members

- Public Types inherited from WeakPtrCache< ParticleCombination >
using type = ParticleCombination
 object_type
 
using shared_ptr_type = std::shared_ptr< ParticleCombination >
 std::shared_ptr to T More...
 
using weak_ptr_type = std::weak_ptr< ParticleCombination >
 std::weak_ptr to T More...
 
using cache_type = std::set< weak_ptr_type, std::owner_less< weak_ptr_type > >
 A std::set of weak_ptr_type. More...
 

Detailed Description

Caches list of ParticleCombination's.

Author
Johannes Rauch, Daniel Greenwald

Member Function Documentation

shared_ptr_type composite ( const ParticleCombinationVector &  D)
inline

retrieve or create composite particle from daughters. copies daughters into composite, setting copies' parents = shared_from_this()

Parameters
DParticleCombinationVector of daughters to create composite from
weak_ptr_type find ( unsigned  index) const
inline

retrieve final-state particle ParticleCombination Does not add to the cache if ParticleCombination is not found.

Parameters
indexIndex of particle
weak_ptr_type find ( const ParticleCombinationVector &  D) const
inline

retrieve composite particle ParticleCombination from cache. Does not add to the cache if ParticleCombination is not found.

Parameters
Dvector of daughters to construct ParticleCombination from
Returns
weak_ptr to ParticleCombination; is empty if not found.
ParticleCombinationCache::weak_ptr_type findByUnorderedContent ( const std::vector< unsigned > &  I) const

retrieves first entry matching vector of particle indices by unordered content Does not add to the cache if a match is not found.

Parameters
Ivector of unsigned's to look for
Returns
weak_ptr to ParticleCombination; is empty if not found.
shared_ptr_type fsp ( unsigned  index)
inline

retrieve or create final-state particle ParticleCombination

Parameters
indexIndex of particle

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