BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
CombinatoricList.h
Go to the documentation of this file.
1#ifndef DCHAIN_COMBINATORICLIST_H
2#define DCHAIN_COMBINATORICLIST_H
3// -*- C++ -*-
4//
5// Package: DChain
6// Module: CombinatoricList
7//
8// Description: List to hold a ConjugateList of Candidates built
9// from DecayClass Class.
10//
11// Usage:
12// <usage>
13//
14// Author: Simon Patton
15// Created: Fri Oct 4 11:04:47 EDT 1996
16// $Id: CombinatoricList.h,v 1.2 2009/09/22 08:22:26 hujf Exp $
17//
18// Revision history
19//
20// $Log: CombinatoricList.h,v $
21// Revision 1.2 2009/09/22 08:22:26 hujf
22// see ChangeLog
23//
24// Revision 1.1.1.1 2009/03/03 06:06:56 maqm
25// first import of DecayChain
26//
27// Revision 1.2 2006/02/04 17:31:10 wsun
28// Made CombinatoricList::label() public instead of protected.
29//
30// Revision 1.1 2006/01/11 20:28:21 cdj
31// massive class renaming, addition of [] for selection and unit tests
32//
33//
34
35// system include files
36
37//...
38template< class CandidateClass >
40 public:
41 typedef typename CandidateClass::DecayEvidence DecayClass;
42};
43
44// user include files
45
46#include "DecayChain/List/DecayList.h" // superclass declaration
48
49// forward declarations
50//template< class DecayClass , class CandidateClass > class DCDecayList ; //for backwards compatibility
51
52template < class Arg > class DCAnalysisFunction ;
53
54#include <vector>
55
56#ifndef _combinatoriclist_vector_
57// The following CPP macro is used to avoid having to typedef
58// a map in the class. Why? Because things can get messy, at
59// least in the g++ compiler as the typedef can cause instantiation
60// when not all the necessary information is available!
61#define _combinatoriclist_vector_ std::vector<const ConjugateList< CandidateClass >* >
62#endif
63
64namespace dchain {
65template< class CandidateClass>
66class CombinatoricList;
67
68template< class CandidateClass>
69class ConjugateList;
70
71template< class CandidateClass>
72CombinatoricList< CandidateClass > operator*(
73 const ConjugateList< CandidateClass >& lhs ,
74 const ConjugateList< CandidateClass >& rhs ) ;
75
76template< class CandidateClass>
77CombinatoricList< CandidateClass > operator*(
78 const CombinatoricList< CandidateClass >& lhs ,
79 const ConjugateList< CandidateClass >& rhs ) ;
80
81template< class CandidateClass>
82CombinatoricList< CandidateClass > operator*(
83 const ConjugateList< CandidateClass >& lhs ,
84 const CombinatoricList< CandidateClass >& rhs ) ;
85
86template< class CandidateClass>
87CombinatoricList< CandidateClass > operator*(
88 const CombinatoricList< CandidateClass >& lhs ,
89 const CombinatoricList< CandidateClass >& rhs ) ;
90
91//
92// Note: To avoid a myriad of conpiler flags it is easier to
93// have a two parameter template class. The instantiation
94// of this class must look like
95//
96// template class CombinatoricList< A , A::CandidateClass > ;
97
98template < class CandidateClass >
99class CombinatoricList : public dchain::DecayList< typename DCCandidateTraits<CandidateClass>::DecayClass , CandidateClass >
100{
101 public:
103 private:
104 // friend classses and functions
105// This class is a friend so that it can use the protected constructor
106// that takes a ConjugateList as its argument
107 friend class dchain::DecayList< DecayClass , CandidateClass > ;
108 //friend class DCDecayList< DecayClass , CandidateClass > ; //for backwards compatibility
109
110// These are `friends' as these are the only way a CombinatoricList
111// should be created, i.e. it need access to the private constructors
112 friend CombinatoricList< CandidateClass > operator* <CandidateClass> (
115 friend CombinatoricList< CandidateClass > operator* <CandidateClass> (
118 friend CombinatoricList< CandidateClass > operator* <CandidateClass> (
121 friend CombinatoricList< CandidateClass > operator* <CandidateClass> (
124
125 public:
126 // constants, enums and typedefs
130
131 // Constructors and destructor
132 virtual ~CombinatoricList() ;
133
134 // used by Decay<> for single product DecayClass trees
136
137 virtual conjugation::Label label() const ;
138
139 // member functions
144
145 // const member functions
148 virtual bool isSelfConjugate() const ;
149
153 partial_begin() const ;
155 partial_end() const ;
156 virtual const_iterator particle_begin() const ;
157 virtual const_iterator particle_end() const ;
160
161 using ConjugateList< CandidateClass >::iterate;
162 template<class TAnalyze>
163 void iterate( const TAnalyze& analyze) const {
164 fill();
166 }
167
168 template < class TAnalyzer>
169 void conjugation_iterate( const TAnalyzer& analyze) const
170 {
171 fill();
173 }
174
175 template<class TAnalyze>
176 void partial_iterate( TAnalyze& analyze ) const
177 {
178 fill();
180 }
181
182 // static member functions
183
184 protected:
185 // Constructors and destructor
186 // used by operator* functions to build up CombinatoricLists
199
200 protected:
201 // protected member functions
203
204 // protected const member functions
206
207 private:
208 // Constructors and destructor
209 CombinatoricList( void ) ; // stop default
210
211 public:
213 const CombinatoricList< CandidateClass >& aOtherList ) ;
214
215
216 // stop default
217
218 // assignment operator(s)
220 const CombinatoricList< CandidateClass >& aOtherList ) ;
221 private:
222 // stop default
223
224 // private member functions
225
226 // private const member functions
227 void determineConjugation() const ;
228 void fill() const ;
229
230 // data members
231 _combinatoriclist_vector_& m_listOfLists ;
232 mutable bool m_listFilled ;
233 bool m_conjugationKnown ;
234
235 // static data members
236
237} ;
238
239// inline function definitions
240
241template< class CandidateClass>
242inline
243 CombinatoricList< CandidateClass >
246{
247 return CombinatoricList<CandidateClass>( lhs, rhs);
248}
249
250template< class CandidateClass>
251inline
255{
256 return CombinatoricList<CandidateClass>( lhs, rhs);
257}
258
259template< class CandidateClass>
260inline
264{
265 return CombinatoricList<CandidateClass>( lhs, rhs);
266}
267
268template< class CandidateClass>
269inline
273{
274 return CombinatoricList<CandidateClass>( lhs, rhs);
275}
276}
277
278// function definitions
280
281#endif /* DCHAIN_COMBINATORICLIST_H */
#define _combinatoriclist_vector_
void fill(NTuple::Array< double > &nt_p4, const HepLorentzVector &p4)
Definition: MyUtil.cxx:3
CandidateClass::DecayEvidence DecayClass
virtual dchain::DecayList< DecayClass, CandidateClass >::iterator particle_end()
dchain::DecayList< DecayClass, CandidateClass >::const_iterator const_iterator
DCCandidateTraits< CandidateClass >::DecayClass DecayClass
virtual const dchain::DecayList< DecayClass, CandidateClass > bar() const
void iterate(const TAnalyze &analyze) const
virtual const_partial_iterator partial_particle_end() const
void partial_iterate(TAnalyze &analyze) const
virtual dchain::DecayList< DecayClass, CandidateClass >::iterator particle_begin()
CombinatoricList< CandidateClass > & operator=(const CombinatoricList< CandidateClass > &aOtherList)
virtual dchain::CandidateList< CandidateClass >::iterator end()
virtual const_partial_iterator partial_particle_begin() const
void conjugation_iterate(const TAnalyzer &analyze) const
virtual bool isSelfConjugate() const
virtual dchain::CandidateList< CandidateClass >::iterator begin()
virtual dchain::LabeledCandidateList< CandidateClass > & labeledCandidateList()
virtual dchain::CandidateList< CandidateClass >::const_partial_iterator partial_end() const
virtual const dchain::DecayList< DecayClass, CandidateClass > & operator()() const
dchain::DecayList< DecayClass, CandidateClass >::const_partial_iterator const_partial_iterator
virtual conjugation::Label label() const
virtual dchain::CandidateList< CandidateClass >::const_partial_iterator partial_begin() const
dchain::DecayList< DecayClass, CandidateClass >::iterator iterator
void iterate(const TAnalyze &analyze) const
Definition: DecayList.h:149
void partial_iterate(TAnalyze &analyze) const
Definition: DecayList.h:181
void conjugation_iterate(const TAnalyzer &analyzer) const
Definition: DecayList.h:159
CombinatoricList< CandidateClass > operator*(const ConjugateList< CandidateClass > &lhs, const ConjugateList< CandidateClass > &rhs)