BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
ChargedVisibleList.cc
Go to the documentation of this file.
1#ifndef DCHAIN_CHARGEDVISIBLELIST_CC
2#define DCHAIN_CHARGEDVISIBLELIST_CC
3// -*- C++ -*-
4//
5// Package: DChain
6// Module: ChargedVisibleList
7//
8// Description: <one line class summary>
9//
10// Implimentation:
11// <Notes on implimentation>
12//
13// Author: Simon Patton
14// Created: Fri Oct 4 11:04:56 EDT 1996
15// $Id: ChargedVisibleList.cc,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $
16//
17// Revision history
18//
19// $Log: ChargedVisibleList.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:34 cdj
24// massive class renaming, addition of [] for selection and unit tests
25//
26// Revision 1.5 2003/08/01 13:48:43 mrs43
27// changed plus and minus methods of ChargedVisibleList to const
28//
29// Revision 1.4 2003/05/15 19:56:11 cdj
30// revamped memory handling so always use a ReferenceHolder to deal with the reference counting
31//
32// Revision 1.3 2003/03/13 20:19:16 cleo3
33// now compiles under Linux
34//
35// Revision 1.2 2000/12/30 19:43:32 cdj
36// no more missing symbols under OSF1
37//
38// Revision 1.1.1.1 2000/12/18 22:16:55 cdj
39// imported DChain
40//
41// Revision 1.14 1998/08/20 20:00:08 sjp
42// Modified to use DChainBoolean
43//
44// Revision 1.13 1998/08/19 20:46:19 sjp
45// Fixed comments and removed report references
46//
47// Revision 1.12 1998/04/17 19:14:46 sjp
48// Modified to use latest type
49//
50// Revision 1.11 1997/09/17 20:05:34 sjp
51// Removed filling to superclass
52//
53// Revision 1.10 1997/09/03 14:58:18 sjp
54// Use new report.h and TBParticlePoint
55//
56// Revision 1.9 1997/08/28 07:00:17 sjp
57// Modified files to handle complete templating
58//
59// Revision 1.8 1997/08/19 23:02:32 sjp
60// Restructured package to be independent of Rock
61//
62// Revision 1.7 1997/08/19 15:55:28 sjp
63// Modified list to have no dependence on any other
64// structures except its contents, which must have
65// certain `typedef' available to use.
66//
67// Revision 1.6 1997/08/15 21:33:00 sjp
68// Updated to use <package>/<file>.h include structure.
69// Updated to use bug flags specified in Experiement.h
70//
71// Revision 1.5 1997/01/31 20:17:28 sjp
72// Modified to use the new `bug' include files
73//
74// Revision 1.4 1997/01/21 20:34:26 sjp
75// Changed CPP flags and include because of library reorganization
76//
77// Revision 1.3 1996/12/20 21:15:57 sjp
78// Ammended to allow for LabaledLists being reference counted.
79// Added dropLink() for all created entries.
80//
81// Revision 1.2 1996/11/05 19:30:35 sjp
82// Added definition for filling for TruthTable.
83//
84// Revision 1.1 1996/11/04 19:36:39 sjp
85// New file for new `List' module
86//
87
88// system include files
89#include <stdlib.h> // required for 'exit'
90
91// user include files
98
100
101// STL include files
102//#include <vector>
103
104namespace dchain {
105//
106// constants, enums and typedefs
107//
108
109//
110// static data member definitions
111//
112
113//
114// constructors and destructor
115//
116
117template < class Charged , class CandidateClass >
120 m_list( (new LabeledParticleList< Charged , CandidateClass >) ),
121 m_plusList(0),
122 m_minusList(0)
123{
124}
125template < class Charged , class CandidateClass >
128 m_list( (new LabeledParticleList< Charged , CandidateClass >) ),
129 m_plusList(0),
130 m_minusList(0)
131{
132 typedef typename MakerTrait<Charged>::maker_type Maker;
133 fill( *(aOtherList.m_list), Maker(), SelectAll<Charged>() ) ;
134}
135
136template < class Charged , class CandidateClass >
138{
139 delete m_plusList;
140 delete m_minusList;
141}
142
143//
144// assignment operators
145//
146
147template < class Charged , class CandidateClass >
149{
150 eraseContents() ;
151 typedef typename MakerTrait<Charged>::maker_type Maker;
152 fill( *(aOtherList.m_list), Maker(), SelectAll<Charged>() ) ;
153 return ( *this ) ;
154}
157// member functions
158//
159
160template < class Charged , class CandidateClass >
163{
164 return ( m_list->begin() ) ;
165}
166
167template < class Charged , class CandidateClass >
170{
171 return ( m_list->end() ) ;
172}
173
174template < class Charged , class CandidateClass >
177{
178 if ( m_plusList == 0 ) {
179 m_plusList = new ChosenChargeList< Charged, CandidateClass >( *m_list, kPlus );
180 }
181 return (*m_plusList);
182}
183
184template < class Charged , class CandidateClass >
188 if ( m_minusList == 0 ) {
189 m_minusList = new ChosenChargeList< Charged , CandidateClass >( *m_list , kMinus );
191 return (*m_minusList);
192}
193
194template < class Charged , class CandidateClass >
197{
198 return ( *m_list ) ;
199}
200
201
202template < class Charged , class CandidateClass >
204{
205 m_list->erase( m_list->begin() ,
206 m_list->end() ) ;
210// const member functions
211//
213template < class Charged , class CandidateClass >
215{
216// Need to cast to 'const' to get the right function call
217 return ( (*(const LabeledParticleList< Charged , CandidateClass >*)(m_list.pointer())).begin() ) ;
218}
219
220template < class Charged , class CandidateClass >
222{
223// Need to cast to 'const' to get the right function call
224 return ( (*(const LabeledParticleList< Charged , CandidateClass >*)(m_list.pointer())).end() ) ;
225}
226
227
228template < class Charged , class CandidateClass >
231{
232 return ( *m_list ) ;
233}
234
235//
236// static member functions
237//
238}
239#endif /* DCHAIN_CHARGEDVISIBLELIST_CC */
void fill(NTuple::Array< double > &nt_p4, const HepLorentzVector &p4)
Definition: MyUtil.cxx:3
void fill(const LabeledParticleList< Charged, CandidateClass > &aList, const TMaker &aMaker, const TSelector &aSel)
ChosenChargeList< Charged, CandidateClass > & plus() const
ChosenChargeList< Charged, CandidateClass > & minus() const
virtual LabeledParticleList< Charged, CandidateClass > & labeledCandidateList()
const self_type & operator=(const self_type &aOtherList)