BOSS 7.0.6
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.1.1.1 2009/03/03 06:06:56 maqm Exp $
17//
18// Revision history
19//
20// $Log: CombinatoricList.h,v $
21// Revision 1.1.1.1 2009/03/03 06:06:56 maqm
22// first import of DecayChain
23//
24// Revision 1.2 2006/02/04 17:31:10 wsun
25// Made CombinatoricList::label() public instead of protected.
26//
27// Revision 1.1 2006/01/11 20:28:21 cdj
28// massive class renaming, addition of [] for selection and unit tests
29//
30//
31
32// system include files
33
34//...
35template< class CandidateClass >
37 public:
38 typedef typename CandidateClass::DecayEvidence DecayClass;
39};
40
41// user include files
42
43#include "DecayChain/List/DecayList.h" // superclass declaration
45
46// forward declarations
47//template< class DecayClass , class CandidateClass > class DCDecayList ; //for backwards compatibility
48
49template < class Arg > class DCAnalysisFunction ;
50
51#include <vector>
52
53#ifndef _combinatoriclist_vector_
54// The following CPP macro is used to avoid having to typedef
55// a map in the class. Why? Because things can get messy, at
56// least in the g++ compiler as the typedef can cause instantiation
57// when not all the necessary information is available!
58#define _combinatoriclist_vector_ std::vector<const ConjugateList< CandidateClass >* >
59#endif
60
61namespace dchain {
62template< class CandidateClass>
63class CombinatoricList;
64
65template< class CandidateClass>
66class ConjugateList;
67
68template< class CandidateClass>
69CombinatoricList< CandidateClass > operator*(
70 const ConjugateList< CandidateClass >& lhs ,
71 const ConjugateList< CandidateClass >& rhs ) ;
72
73template< class CandidateClass>
74CombinatoricList< CandidateClass > operator*(
75 const CombinatoricList< CandidateClass >& lhs ,
76 const ConjugateList< CandidateClass >& rhs ) ;
77
78template< class CandidateClass>
79CombinatoricList< CandidateClass > operator*(
80 const ConjugateList< CandidateClass >& lhs ,
81 const CombinatoricList< CandidateClass >& rhs ) ;
82
83template< class CandidateClass>
84CombinatoricList< CandidateClass > operator*(
85 const CombinatoricList< CandidateClass >& lhs ,
86 const CombinatoricList< CandidateClass >& rhs ) ;
87
88//
89// Note: To avoid a myriad of conpiler flags it is easier to
90// have a two parameter template class. The instantiation
91// of this class must look like
92//
93// template class CombinatoricList< A , A::CandidateClass > ;
94
95template < class CandidateClass >
96class CombinatoricList : public dchain::DecayList< typename DCCandidateTraits<CandidateClass>::DecayClass , CandidateClass >
97{
98 public:
100 private:
101 // friend classses and functions
102// This class is a friend so that it can use the protected constructor
103// that takes a ConjugateList as its argument
104 friend class dchain::DecayList< DecayClass , CandidateClass > ;
105 //friend class DCDecayList< DecayClass , CandidateClass > ; //for backwards compatibility
106
107// These are `friends' as these are the only way a CombinatoricList
108// should be created, i.e. it need access to the private constructors
109 friend CombinatoricList< CandidateClass > operator* <CandidateClass> (
112 friend CombinatoricList< CandidateClass > operator* <CandidateClass> (
115 friend CombinatoricList< CandidateClass > operator* <CandidateClass> (
118 friend CombinatoricList< CandidateClass > operator* <CandidateClass> (
121
122 public:
123 // constants, enums and typedefs
127
128 // Constructors and destructor
129 virtual ~CombinatoricList() ;
130
131 // used by Decay<> for single product DecayClass trees
133
134 virtual conjugation::Label label() const ;
135
136 // member functions
141
142 // const member functions
145 virtual bool isSelfConjugate() const ;
146
150 partial_begin() const ;
152 partial_end() const ;
153 virtual const_iterator particle_begin() const ;
154 virtual const_iterator particle_end() const ;
157
158 using ConjugateList< CandidateClass >::iterate;
159 template<class TAnalyze>
160 void iterate( const TAnalyze& analyze) const {
161 fill();
163 }
164
165 template < class TAnalyzer>
166 void conjugation_iterate( const TAnalyzer& analyze) const
167 {
168 fill();
170 }
171
172 template<class TAnalyze>
173 void partial_iterate( TAnalyze& analyze ) const
174 {
175 fill();
177 }
178
179 // static member functions
180
181 protected:
182 // Constructors and destructor
183 // used by operator* functions to build up CombinatoricLists
196
197 protected:
198 // protected member functions
200
201 // protected const member functions
203
204 private:
205 // Constructors and destructor
206 CombinatoricList( void ) ; // stop default
207
208 public:
210 const CombinatoricList< CandidateClass >& aOtherList ) ;
211
212 private:
213
214 // stop default
215
216 // assignment operator(s)
217 const CombinatoricList< CandidateClass >& operator=(
218 const CombinatoricList< CandidateClass >& aOtherList ) ;
219 // stop default
220
221 // private member functions
222
223 // private const member functions
224 void determineConjugation() const ;
225 void fill() const ;
226
227 // data members
228 _combinatoriclist_vector_& m_listOfLists ;
229 mutable bool m_listFilled ;
230 bool m_conjugationKnown ;
231
232 // static data members
233
234} ;
235
236// inline function definitions
237
238template< class CandidateClass>
239inline
240CombinatoricList< CandidateClass >
243{
244 return CombinatoricList<CandidateClass>( lhs, rhs);
245}
246
247template< class CandidateClass>
248inline
252{
253 return CombinatoricList<CandidateClass>( lhs, rhs);
254}
255
256template< class CandidateClass>
257inline
261{
262 return CombinatoricList<CandidateClass>( lhs, rhs);
263}
264
265template< class CandidateClass>
266inline
270{
271 return CombinatoricList<CandidateClass>( lhs, rhs);
272}
273}
274
275// function definitions
277
278#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()
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:144
void partial_iterate(TAnalyze &analyze) const
Definition: DecayList.h:176
void conjugation_iterate(const TAnalyzer &analyzer) const
Definition: DecayList.h:154
CombinatoricList< CandidateClass > operator*(const ConjugateList< CandidateClass > &lhs, const ConjugateList< CandidateClass > &rhs)