/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/DecayChain/DecayChain-00-00-03-slc6tag/DecayChain/List/Template/ChargedVisibleList.cc

Go to the documentation of this file.
00001 #ifndef DCHAIN_CHARGEDVISIBLELIST_CC
00002 #define DCHAIN_CHARGEDVISIBLELIST_CC
00003 // -*- C++ -*-
00004 //
00005 // Package:     DChain
00006 // Module:      ChargedVisibleList
00007 // 
00008 // Description: <one line class summary>
00009 //
00010 // Implimentation:
00011 //     <Notes on implimentation>
00012 //
00013 // Author:      Simon Patton
00014 // Created:     Fri Oct  4 11:04:56 EDT 1996
00015 // $Id: ChargedVisibleList.cc,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $
00016 //
00017 // Revision history
00018 //
00019 // $Log: ChargedVisibleList.cc,v $
00020 // Revision 1.1.1.1  2009/03/03 06:06:56  maqm
00021 // first import of DecayChain
00022 //
00023 // Revision 1.1  2006/01/11 20:28:34  cdj
00024 // massive class renaming, addition of [] for selection and unit tests
00025 //
00026 // Revision 1.5  2003/08/01 13:48:43  mrs43
00027 // changed plus and minus methods of ChargedVisibleList to const
00028 //
00029 // Revision 1.4  2003/05/15 19:56:11  cdj
00030 // revamped memory handling so always use a ReferenceHolder to deal with the reference counting
00031 //
00032 // Revision 1.3  2003/03/13 20:19:16  cleo3
00033 // now compiles under Linux
00034 //
00035 // Revision 1.2  2000/12/30 19:43:32  cdj
00036 // no more missing symbols under OSF1
00037 //
00038 // Revision 1.1.1.1  2000/12/18 22:16:55  cdj
00039 // imported DChain
00040 //
00041 // Revision 1.14  1998/08/20 20:00:08  sjp
00042 // Modified to use DChainBoolean
00043 //
00044 // Revision 1.13  1998/08/19 20:46:19  sjp
00045 // Fixed comments and removed report references
00046 //
00047 // Revision 1.12  1998/04/17 19:14:46  sjp
00048 // Modified to use latest type
00049 //
00050 // Revision 1.11  1997/09/17 20:05:34  sjp
00051 // Removed filling to superclass
00052 //
00053 // Revision 1.10  1997/09/03 14:58:18  sjp
00054 // Use new report.h and TBParticlePoint
00055 //
00056 // Revision 1.9  1997/08/28 07:00:17  sjp
00057 // Modified files to handle complete templating
00058 //
00059 // Revision 1.8  1997/08/19 23:02:32  sjp
00060 // Restructured package to be independent of Rock
00061 //
00062 // Revision 1.7  1997/08/19 15:55:28  sjp
00063 // Modified list to have no dependence on any other
00064 //   structures except its contents, which must have
00065 //   certain `typedef' available to use.
00066 //
00067 // Revision 1.6  1997/08/15 21:33:00  sjp
00068 // Updated to use <package>/<file>.h include structure.
00069 // Updated to use bug flags specified in Experiement.h
00070 //
00071 // Revision 1.5  1997/01/31 20:17:28  sjp
00072 // Modified to use the new `bug' include files
00073 //
00074 // Revision 1.4  1997/01/21 20:34:26  sjp
00075 // Changed CPP flags and include because of library reorganization
00076 //
00077 // Revision 1.3  1996/12/20 21:15:57  sjp
00078 // Ammended to allow for LabaledLists being reference counted.
00079 // Added dropLink() for all created entries.
00080 //
00081 // Revision 1.2  1996/11/05 19:30:35  sjp
00082 // Added definition for filling for TruthTable.
00083 //
00084 // Revision 1.1  1996/11/04 19:36:39  sjp
00085 // New file for new `List' module
00086 //
00087 
00088 // system include files
00089 #include <stdlib.h>  // required for 'exit'
00090 
00091 // user include files
00092 #include "DecayChain/Element/conjugation.h"
00093 #include "DecayChain/Element/LabeledParticle.h"
00094 #include "DecayChain/Iterator/MuteWholeItr.h"
00095 #include "DecayChain/Iterator/WholeItr.h"
00096 #include "DecayChain/List/LabeledParticleList.h"
00097 #include "DecayChain/List/ChosenChargeList.h"
00098 
00099 #include "DecayChain/List/ChargedVisibleList.h"
00100 
00101 // STL include files
00102 //#include <vector>
00103 
00104 namespace dchain {
00105 //
00106 // constants, enums and typedefs
00107 //
00108 
00109 //
00110 // static data member definitions
00111 //
00112 
00113 //
00114 // constructors and destructor
00115 //
00116 
00117 template < class Charged , class CandidateClass >
00118 ChargedVisibleList< Charged , CandidateClass >::
00119 ChargedVisibleList():
00120    m_list( (new LabeledParticleList< Charged , CandidateClass >) ),
00121    m_plusList(0),
00122    m_minusList(0)
00123 {
00124 }
00125 template < class Charged , class CandidateClass >
00126 ChargedVisibleList< Charged , CandidateClass >::
00127 ChargedVisibleList( const ChargedVisibleList< Charged , CandidateClass >&  aOtherList ):
00128    m_list( (new LabeledParticleList< Charged , CandidateClass >) ),
00129    m_plusList(0),
00130    m_minusList(0)
00131 {
00132    typedef typename MakerTrait<Charged>::maker_type Maker;
00133   fill( *(aOtherList.m_list), Maker(), SelectAll<Charged>() ) ;
00134 }
00135 
00136 template < class Charged , class CandidateClass >
00137 ChargedVisibleList< Charged , CandidateClass >::~ChargedVisibleList()
00138 {
00139    delete m_plusList;
00140    delete m_minusList;
00141 }
00142 
00143 //
00144 // assignment operators
00145 //
00146 
00147 template < class Charged , class CandidateClass >
00148 const ChargedVisibleList< Charged , CandidateClass >& ChargedVisibleList< Charged , CandidateClass >::operator=( const ChargedVisibleList< Charged , CandidateClass >& aOtherList )
00149 {
00150    eraseContents() ;
00151    typedef typename MakerTrait<Charged>::maker_type Maker;
00152    fill( *(aOtherList.m_list), Maker(), SelectAll<Charged>() ) ;
00153    return ( *this ) ;
00154 }
00155 
00156 //
00157 // member functions
00158 //
00159 
00160 template < class Charged , class CandidateClass >
00161 typename ChargedVisibleList< Charged , CandidateClass >::iterator 
00162 ChargedVisibleList< Charged , CandidateClass >::particle_begin()
00163 {
00164    return ( m_list->begin() ) ;
00165 }
00166 
00167 template < class Charged , class CandidateClass >
00168 typename ChargedVisibleList< Charged , CandidateClass >::iterator 
00169 ChargedVisibleList< Charged , CandidateClass >::particle_end()
00170 {
00171    return ( m_list->end() ) ;
00172 }
00173 
00174 template < class Charged , class CandidateClass >
00175 ChosenChargeList< Charged , CandidateClass >&
00176 ChargedVisibleList< Charged , CandidateClass >::plus() const
00177 {
00178    if ( m_plusList == 0 ) {
00179       m_plusList = new ChosenChargeList< Charged, CandidateClass >( *m_list, kPlus );
00180    }
00181    return (*m_plusList);
00182 }
00183 
00184 template < class Charged , class CandidateClass >
00185 ChosenChargeList< Charged , CandidateClass >&
00186 ChargedVisibleList< Charged , CandidateClass >::minus() const
00187 {
00188    if ( m_minusList == 0 ) {
00189       m_minusList = new ChosenChargeList< Charged , CandidateClass >( *m_list , kMinus );
00190    }
00191    return (*m_minusList);
00192 }
00193 
00194 template < class Charged , class CandidateClass >
00195 LabeledParticleList< Charged , CandidateClass >& 
00196 ChargedVisibleList< Charged , CandidateClass >::labeledCandidateList()
00197 {
00198    return ( *m_list ) ;
00199 }
00200 
00201 
00202 template < class Charged , class CandidateClass >
00203 void ChargedVisibleList< Charged , CandidateClass >::eraseContents()
00204 {
00205    m_list->erase( m_list->begin() ,
00206                   m_list->end() ) ;
00207 }
00208 
00209 //
00210 // const member functions
00211 //
00212 
00213 template < class Charged , class CandidateClass >
00214 typename ChargedVisibleList< Charged , CandidateClass >::const_iterator ChargedVisibleList< Charged , CandidateClass >::particle_begin() const
00215 {
00216 // Need to cast to 'const' to get the right function call
00217   return ( (*(const LabeledParticleList< Charged , CandidateClass >*)(m_list.pointer())).begin() ) ;
00218 }
00219 
00220 template < class Charged , class CandidateClass >
00221 typename ChargedVisibleList< Charged , CandidateClass >::const_iterator ChargedVisibleList< Charged , CandidateClass >::particle_end() const
00222 {
00223 // Need to cast to 'const' to get the right function call
00224   return ( (*(const LabeledParticleList< Charged , CandidateClass >*)(m_list.pointer())).end() ) ;
00225 }
00226 
00227 
00228 template < class Charged , class CandidateClass >
00229 const LabeledParticleList< Charged , CandidateClass >& 
00230 ChargedVisibleList< Charged , CandidateClass >::labeledCandidateList() const
00231 {
00232    return ( *m_list ) ;
00233 }
00234 
00235 //
00236 // static member functions
00237 //
00238 }
00239 #endif /* DCHAIN_CHARGEDVISIBLELIST_CC */

Generated on Tue Nov 29 22:58:23 2016 for BOSS_7.0.2 by  doxygen 1.4.7