BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
ConjugateList.h
Go to the documentation of this file.
1#ifndef DCHAIN_CONJUGATELIST_H
2#define DCHAIN_CONJUGATELIST_H
3// -*- C++ -*-
4//
5// Package: DChain
6// Module: ConjugateList
7//
8// Description: container of subclasses of Candidate, used for partial iteration
9//
10// Usage:
11// <usage>
12//
13// Author: Simon Patton
14// Created: Wed Sep 11 15:59:57 EDT 1996
15// $Id: ConjugateList.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $
16//
17// Revision history
18//
19// $Log: ConjugateList.h,v $
20// Revision 1.1.1.1 2009/03/03 06:06:56 maqm
21// first import of DecayChain
22//
23// Revision 1.1 2006/01/11 20:28:22 cdj
24// massive class renaming, addition of [] for selection and unit tests
25//
26// Revision 1.2 2001/04/04 15:01:00 cdj
27// made label public (needed for storage)
28//
29// Revision 1.1.1.1 2000/12/18 22:16:52 cdj
30// imported DChain
31//
32// Revision 1.12 1998/08/21 00:52:41 sjp
33// Modifier to no longer use typedefs
34//
35// Revision 1.11 1998/08/20 19:59:01 sjp
36// Modified to use DChainBoolean
37//
38// Revision 1.10 1998/04/17 19:11:02 sjp
39// Modified to use latest types
40//
41// Revision 1.9 1997/08/28 06:59:50 sjp
42// Modified files to handle complete templating
43//
44// Revision 1.8 1997/08/26 04:14:12 sjp
45// Made Candidate handling objects into `CandidateClass' Templates
46//
47// Revision 1.7 1997/08/19 23:02:18 sjp
48// Restructured package to be independent of Rock
49//
50// Revision 1.6 1997/08/15 21:32:16 sjp
51// Updated to use <package>/<file>.h include structure.
52// Updated to use bug flags specified in Experiement.h
53//
54// Revision 1.5 1997/01/22 16:27:16 sjp
55// Fixed error in pre-processor labels
56//
57// Revision 1.4 1997/01/21 20:33:45 sjp
58// Changed CPP flags and include because of library reorganization
59//
60// Revision 1.3 1997/01/19 20:28:35 sjp
61// Changed LargeCount to Count
62//
63// Revision 1.2 1996/12/20 21:19:08 sjp
64// Extended pathnames for Include files
65//
66// Revision 1.1 1996/11/04 19:35:54 sjp
67// New file for new `List' module
68//
69
70// system include files
71
72// user include files
73#include "DecayChain/Element/conjugation.h" // enum
74#include "DecayChain/List/CandidateList.h" // superclass declaration
75
76// forward declarations
77template < class Arg > class DCAnalysisFunction ;
78template < class Arg > class DCConjugateFunction ;
79template < class Arg > class DCCombinatoricQuery ;
80
81namespace dchain {
82template < class CandidateClass >
83class ConjugateList : public dchain::CandidateList< CandidateClass >
84{
85 // friend classses and functions
86// DCCombinatoricQuery is a friend so that CombinatoricList can check the
87// LabeledCandidateList and Label to determine whether a set of
88// ConjugateLists are self-conjugate, and can use
89// conjugate_partial_begin() and conjugate_partial_end() to build up
90// the `conjugate' half of the DCCombinatoricQuery
91 friend class DCCombinatoricQuery< CandidateClass > ;
92
93 public:
94 // constants, enums and typedefs
98 // Constructors and destructor
99 ConjugateList( const conjugation::Label aLabel ) ;
100 virtual ~ConjugateList() ;
101
102 // member functions
103
104 // const member functions
105 virtual bool isSelfConjugate() const ;
106 bool isConjugateOf( const ConjugateList< CandidateClass >& aList ) const ;
107 int partial_size() const ;
108
109 virtual const_partial_iterator partial_begin() const ;
110 virtual const_partial_iterator partial_end() const ;
111
112 /** TAnalyzer takes two arguments
113 1) const CandidateClass&
114 2) a bool which is 'true' if the candiate matches the present conjugation
115 */
116 template <class TAnalyzer>
117 void conjugation_iterate( const TAnalyzer& analyzer) const
118 {
119 const_iterator finished ( this->end() ) ;
120 for ( const_iterator entry ( this->begin() ) ;
121 entry != finished ;
122 ++entry ) {
123 analyze( (*entry)() , (*entry).label() == m_label ) ;
124 }
125 }
126
127 template<class TAnalyzer>
128 void partial_iterate( const TAnalyzer& analyze ) const {
129 const_partial_iterator finished ( partial_end() ) ;
130 for ( const_partial_iterator entry ( partial_begin() ) ;
131 entry != finished ;
132 ++entry ) {
133 analyze( (*entry)() ) ;
134 }
135 }
136
137
138 // static member functions
139
140 // special member functions
141//- Note: following two function are used by DCCombinatoricQuery only!
144
145 virtual conjugation::Label label() const ;
146
147 protected:
148
149 // protected member functions
150 void setLabel( const conjugation::Label aLabel) ;
151
152 // protected const member functions
153
154 private:
155 // Constructors and destructor
156 ConjugateList() ; // stop default
157 ConjugateList( const ConjugateList& ) ; // stop default
158
159 // assignment operator(s)
160 const ConjugateList& operator=( const ConjugateList& ) ; // stop default
161
162 // private member functions
163
164 // private const member functions
165
166 // data members
167 conjugation::Label m_label ;
168
169 // static data members
170
171};
172
173// inline function definitions
174}
175
176// function definitions
178
179#endif /* DCHAIN_CONJUGATELIST_H */
virtual iterator begin()
virtual iterator end()
const_partial_iterator conjugate_partial_begin() const
bool isConjugateOf(const ConjugateList< CandidateClass > &aList) const
dchain::PartialCandidateItr< CandidateClass > const_partial_iterator
Definition: ConjugateList.h:97
dchain::WholeCandidateItr< CandidateClass > const_iterator
Definition: ConjugateList.h:96
const_partial_iterator conjugate_partial_end() const
dchain::MuteWholeCandidateItr< CandidateClass > iterator
Definition: ConjugateList.h:95
virtual conjugation::Label label() const
virtual const_partial_iterator partial_begin() const
void setLabel(const conjugation::Label aLabel)
void conjugation_iterate(const TAnalyzer &analyzer) const
virtual bool isSelfConjugate() const
virtual const_partial_iterator partial_end() const
void partial_iterate(const TAnalyzer &analyze) const