BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
DecayList.cc
Go to the documentation of this file.
1#ifndef DCHAIN_DECAYLIST_CC
2#define DCHAIN_DECAYLIST_CC
3// -*- C++ -*-
4//
5// Package: DChain
6// Module: DecayList
7//
8// Description: container of subclasses of Decay, used for iteration
9//
10// Implimentation:
11// <Notes on implimentation>
12//
13// Author: Simon Patton
14// Created: Fri Oct 4 11:04:56 EDT 1996
15// $Id: DecayList.cc,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $
16//
17// Revision history
18//
19// $Log: DecayList.cc,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:39 cdj
24// massive class renaming, addition of [] for selection and unit tests
25//
26// Revision 1.6 2003/10/23 18:43:41 cdj
27// can now use DecayList with other Decay objects
28//
29// Revision 1.5 2003/05/16 18:33:39 cdj
30// previous change now works properly on OSF
31//
32// Revision 1.4 2003/05/15 19:56:12 cdj
33// revamped memory handling so always use a ReferenceHolder to deal with the reference counting
34//
35// Revision 1.3 2003/03/13 20:19:16 cleo3
36// now compiles under Linux
37//
38// Revision 1.2 2001/03/23 23:07:48 urner
39// modification needed to add pi0 eta and Ks decay lists in CleoDChain
40//
41// Revision 1.1.1.1 2000/12/18 22:16:55 cdj
42// imported DChain
43//
44// Revision 1.13 1998/08/20 20:00:07 sjp
45// Modified to use DChainBoolean
46//
47// Revision 1.12 1998/08/19 20:46:18 sjp
48// Fixed comments and removed report references
49//
50// Revision 1.11 1998/06/30 23:42:06 sjp
51// Cleaned up return object from labeledCandidateList
52//
53// Revision 1.10 1998/05/01 20:20:03 sjp
54// Removed unnecessary functions which were causing infinate loop
55//
56// Revision 1.9 1998/04/17 19:14:45 sjp
57// Modified to use latest type
58//
59// Revision 1.8 1997/09/03 14:58:17 sjp
60// Use new report.h and TBParticlePoint
61//
62// Revision 1.7 1997/08/28 07:00:15 sjp
63// Modified files to handle complete templating
64//
65// Revision 1.6 1997/08/19 23:02:31 sjp
66// Restructured package to be independent of Rock
67//
68// Revision 1.5 1997/08/15 21:32:58 sjp
69// Updated to use <package>/<file>.h include structure.
70// Updated to use bug flags specified in Experiement.h
71//
72// Revision 1.4 1997/01/31 20:17:26 sjp
73// Modified to use the new `bug' include files
74//
75// Revision 1.3 1997/01/21 20:34:38 sjp
76// Changed CPP flags and include because of library reorganization
77//
78// Revision 1.2 1996/12/20 21:16:01 sjp
79// Ammended to allow for LabaledLists being reference counted.
80// Added dropLink() for all created entries.
81//
82// Revision 1.1 1996/11/04 19:36:49 sjp
83// New file for new `List' module
84//
85
86// system include files
87#include <stdlib.h> // required for 'exit'
88
89// user include files
100
102
103//
104// constants, enums and typedefs
105//
106
108// static data member definitions
110
111//
112// constructors and destructor
113//
114namespace dchain {
115template < class DecayClass , class CandidateClass >
117 ConjugateList< CandidateClass >( conjugation::kNone ) ,
118 m_list( (new LabeledParticleList< DecayClass , CandidateClass >) )
119{
120}
121
122template < class DecayClass , class CandidateClass >
124 ConjugateList< CandidateClass >( conjugation::kNone ) ,
125 m_list( (new LabeledParticleList< DecayClass , CandidateClass >) )
126{
127 fill( aOtherList, SelectAll<DecayClass>() ) ;
128}
129
131template < class DecayClass , class CandidateClass >
133 ConjugateList< CandidateClass >( aLabel ) ,
134 m_list( &aLabeledList )
138template < class DecayClass , class CandidateClass >
140{
141}
142
143//
144// assignment operators
145//
146
147template < class DecayClass , class CandidateClass >
149{
150 //std::cout << "@DecayList::operator=() ... (DecayList)" << std::endl;
151 m_list->erase( m_list->begin() ,
152 m_list->end() ) ;
153 fill( aOtherList, SelectAll<DecayClass>() ) ;
154 return ( *this ) ;
155}
156
157template < class DecayClass , class CandidateClass >
159{
160 //std::cout << "@DecayList::operator=() ... (CombinatoricList)" << std::endl;
161 return ( *this = static_cast<const DecayList<typename DCCandidateTraits<CandidateClass>::DecayClass, CandidateClass>& >(aOtherList) ) ;
162}
163
164//
165// member functions
166//
167
168template < class DecayClass , class CandidateClass >
170{
171 //std::cout << "@DecayList::particle_begin() -- iterator" << std::endl;
172 return ( m_list->begin() ) ;
173}
174
175template < class DecayClass , class CandidateClass >
177{
178 return ( m_list->end() ) ;
179}
180
181template < class DecayClass , class CandidateClass >
183{
184 return ( *m_list ) ;
186
187template < class DecayClass , class CandidateClass >
189{
190 return ( *m_list ) ;
191}
193
194//
195// const member functions
196//
197
198template < class DecayClass , class CandidateClass >
200{
202 otherLabel( this->label() ) ) ) ;
204
205template < class DecayClass , class CandidateClass >
207{
208 return ( *this ) ;
209}
210
211template < class DecayClass , class CandidateClass >
213{
214// Need to cast to 'const' to get the right function call
215 //std::cout << "@DecayList::particle_begin() -- const_iterator" << std::endl;
216 return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).begin() ) ;
217}
218
219template < class DecayClass , class CandidateClass >
221{
222// Need to cast to 'const' to get the right function call
223 return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).end() ) ;
224}
225
226template < class DecayClass , class CandidateClass >
228{
229// Need to cast to 'const' to get the right function call
230 return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).begin( this->label() ) ) ;
231}
232
233template < class DecayClass , class CandidateClass >
235{
236// Need to cast to 'const' to get the right function call
237 return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).end( this->label() ) ) ;
238}
239
240
241
242template < class DecayClass , class CandidateClass >
244{
245 m_list->erase( m_list->begin() ,
246 m_list->end() ) ;
247}
248
249
250template < class DecayClass , class CandidateClass >
252{
253 return ( *m_list ) ;
254}
255
256
257template < class DecayClass , class CandidateClass >
259{
260 return ( *m_list ) ;
261}
262
263//
264// static member functions
265//
266}
267#endif /* DCHAIN_DECAYLIST_CC */
void fill(NTuple::Array< double > &nt_p4, const HepLorentzVector &p4)
Definition: MyUtil.cxx:3
virtual const_partial_iterator partial_particle_begin() const
Definition: DecayList.cc:227
virtual LabeledParticleList< DecayClass, CandidateClass > & labeledParticleList()
Definition: DecayList.cc:188
void eraseContents()
Definition: DecayList.cc:243
virtual const_partial_iterator partial_particle_end() const
Definition: DecayList.cc:234
const DecayList< DecayClass, CandidateClass > bar() const
Definition: DecayList.cc:199
virtual iterator particle_begin()
Definition: DecayList.cc:169
virtual LabeledCandidateList< CandidateClass > & labeledCandidateList()
Definition: DecayList.cc:182
virtual ~DecayList()
Definition: DecayList.cc:139
const DecayList< DecayClass, CandidateClass > & operator()() const
Definition: DecayList.cc:206
virtual iterator particle_end()
Definition: DecayList.cc:176
void fill(const TDecayList &aList, const TSelector &aSel=SelectAll< DecayClass >())
Definition: DecayList.h:227
const self_type & operator=(const DecayList< TDecay, CandidateClass > &aOtherList)
Definition: DecayList.h:100
conjugation::Label otherLabel(const conjugation::Label &aLabel)
Definition: conjugation.h:51