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

Go to the documentation of this file.
00001 #ifndef DCHAIN_DECAYLIST_CC
00002 #define DCHAIN_DECAYLIST_CC
00003 // -*- C++ -*-
00004 //
00005 // Package:     DChain
00006 // Module:      DecayList
00007 // 
00008 // Description: container of subclasses of Decay, used for iteration
00009 //
00010 // Implimentation:
00011 //     <Notes on implimentation>
00012 //
00013 // Author:      Simon Patton
00014 // Created:     Fri Oct  4 11:04:56 EDT 1996
00015 // $Id: DecayList.cc,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $
00016 //
00017 // Revision history
00018 //
00019 // $Log: DecayList.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:39  cdj
00024 // massive class renaming, addition of [] for selection and unit tests
00025 //
00026 // Revision 1.6  2003/10/23 18:43:41  cdj
00027 // can now use DecayList with other Decay objects
00028 //
00029 // Revision 1.5  2003/05/16 18:33:39  cdj
00030 // previous change now works properly on OSF
00031 //
00032 // Revision 1.4  2003/05/15 19:56:12  cdj
00033 // revamped memory handling so always use a ReferenceHolder to deal with the reference counting
00034 //
00035 // Revision 1.3  2003/03/13 20:19:16  cleo3
00036 // now compiles under Linux
00037 //
00038 // Revision 1.2  2001/03/23 23:07:48  urner
00039 // modification needed to add pi0 eta and Ks decay lists in CleoDChain
00040 //
00041 // Revision 1.1.1.1  2000/12/18 22:16:55  cdj
00042 // imported DChain
00043 //
00044 // Revision 1.13  1998/08/20 20:00:07  sjp
00045 // Modified to use DChainBoolean
00046 //
00047 // Revision 1.12  1998/08/19 20:46:18  sjp
00048 // Fixed comments and removed report references
00049 //
00050 // Revision 1.11  1998/06/30 23:42:06  sjp
00051 // Cleaned up return object from labeledCandidateList
00052 //
00053 // Revision 1.10  1998/05/01 20:20:03  sjp
00054 // Removed unnecessary functions which were causing infinate loop
00055 //
00056 // Revision 1.9  1998/04/17 19:14:45  sjp
00057 // Modified to use latest type
00058 //
00059 // Revision 1.8  1997/09/03 14:58:17  sjp
00060 // Use new report.h and TBParticlePoint
00061 //
00062 // Revision 1.7  1997/08/28 07:00:15  sjp
00063 // Modified files to handle complete templating
00064 //
00065 // Revision 1.6  1997/08/19 23:02:31  sjp
00066 // Restructured package to be independent of Rock
00067 //
00068 // Revision 1.5  1997/08/15 21:32:58  sjp
00069 // Updated to use <package>/<file>.h include structure.
00070 // Updated to use bug flags specified in Experiement.h
00071 //
00072 // Revision 1.4  1997/01/31 20:17:26  sjp
00073 // Modified to use the new `bug' include files
00074 //
00075 // Revision 1.3  1997/01/21 20:34:38  sjp
00076 // Changed CPP flags and include because of library reorganization
00077 //
00078 // Revision 1.2  1996/12/20 21:16:01  sjp
00079 // Ammended to allow for LabaledLists being reference counted.
00080 // Added dropLink() for all created entries.
00081 //
00082 // Revision 1.1  1996/11/04 19:36:49  sjp
00083 // New file for new `List' module
00084 //
00085 
00086 // system include files
00087 #include <stdlib.h>  // required for 'exit'
00088 
00089 // user include files
00090 #include "DecayChain/Function/DCSelectionFunction.h"
00091 #include "DecayChain/Function/DCAnalysisFunction.h"
00092 #include "DecayChain/Function/DCConjugateFunction.h"
00093 #include "DecayChain/Element/conjugation.h"
00094 #include "DecayChain/Element/LabeledParticle.h"
00095 #include "DecayChain/Iterator/MuteWholeItr.h"
00096 #include "DecayChain/Iterator/WholeItr.h"
00097 #include "DecayChain/Iterator/PartialItr.h"
00098 #include "DecayChain/List/LabeledParticleList.h"
00099 #include "DecayChain/List/CombinatoricList.h"
00100 
00101 #include "DecayChain/List/DecayList.h"
00102 
00103 //
00104 // constants, enums and typedefs
00105 //
00106 
00107 //
00108 // static data member definitions
00109 //
00110 
00111 //
00112 // constructors and destructor
00113 //
00114 namespace dchain {
00115 template < class DecayClass , class CandidateClass >
00116 DecayList< DecayClass , CandidateClass >::DecayList() :
00117    ConjugateList< CandidateClass >( conjugation::kNone ) ,
00118    m_list( (new LabeledParticleList< DecayClass , CandidateClass >) )
00119 {
00120 }
00121 
00122 template < class DecayClass , class CandidateClass >
00123 DecayList< DecayClass , CandidateClass >::DecayList( const DecayList< DecayClass , CandidateClass >& aOtherList ):
00124    ConjugateList< CandidateClass >( conjugation::kNone ) ,
00125    m_list( (new LabeledParticleList< DecayClass , CandidateClass >) )
00126 {
00127    fill( aOtherList, SelectAll<DecayClass>() ) ;
00128 }
00129 
00130 
00131 template < class DecayClass , class CandidateClass >
00132 DecayList< DecayClass , CandidateClass >::DecayList( LabeledParticleList< DecayClass , CandidateClass >& aLabeledList , conjugation::Label aLabel ) :
00133    ConjugateList< CandidateClass >( aLabel ) ,
00134    m_list( &aLabeledList ) 
00135 {
00136 }
00137 
00138 template < class DecayClass , class CandidateClass >
00139 DecayList< DecayClass , CandidateClass >::~DecayList()
00140 {
00141 }
00142 
00143 //
00144 // assignment operators
00145 //
00146 
00147 template < class DecayClass , class CandidateClass >
00148 const DecayList< DecayClass , CandidateClass >& DecayList< DecayClass , CandidateClass >::operator=( const DecayList< DecayClass , CandidateClass >& aOtherList )
00149 {
00150    //std::cout << "@DecayList::operator=() ... (DecayList)" << std::endl;
00151    m_list->erase( m_list->begin() ,
00152                   m_list->end() ) ;
00153    fill( aOtherList, SelectAll<DecayClass>() ) ;
00154    return ( *this ) ;
00155 }
00156 
00157 template < class DecayClass , class CandidateClass >
00158 const DecayList< DecayClass , CandidateClass >& DecayList< DecayClass , CandidateClass >::operator=( const CombinatoricList< CandidateClass >& aOtherList )
00159 {
00160    //std::cout << "@DecayList::operator=() ... (CombinatoricList)" << std::endl;
00161    return ( *this = static_cast<const DecayList<typename DCCandidateTraits<CandidateClass>::DecayClass, CandidateClass>& >(aOtherList) ) ;
00162 }
00163 
00164 //
00165 // member functions
00166 //
00167 
00168 template < class DecayClass , class CandidateClass >
00169 typename DecayList< DecayClass , CandidateClass >::iterator DecayList< DecayClass , CandidateClass >::particle_begin()
00170 {
00171    //std::cout << "@DecayList::particle_begin() -- iterator" << std::endl;
00172    return ( m_list->begin() ) ;
00173 }
00174 
00175 template < class DecayClass , class CandidateClass >
00176 typename DecayList< DecayClass , CandidateClass >::iterator DecayList< DecayClass , CandidateClass >::particle_end()
00177 {
00178    return ( m_list->end() ) ;
00179 }
00180 
00181 template < class DecayClass , class CandidateClass >
00182 dchain::LabeledCandidateList< CandidateClass >& DecayList< DecayClass , CandidateClass >::labeledCandidateList()
00183 {
00184    return ( *m_list ) ;
00185 }
00186 
00187 template < class DecayClass , class CandidateClass >
00188 dchain::LabeledParticleList< DecayClass , CandidateClass >& DecayList< DecayClass , CandidateClass >::labeledParticleList()
00189 {
00190    return ( *m_list ) ;
00191 }
00192 
00193 
00194 //
00195 // const member functions
00196 //
00197 
00198 template < class DecayClass , class CandidateClass >
00199 const DecayList< DecayClass , CandidateClass > DecayList< DecayClass , CandidateClass >::bar() const
00200 {
00201    return ( DecayList< DecayClass , CandidateClass >( *m_list ,
00202                                       otherLabel( this->label() ) ) ) ;
00203 }
00204 
00205 template < class DecayClass , class CandidateClass >
00206 const DecayList< DecayClass , CandidateClass >& DecayList< DecayClass , CandidateClass >::operator()() const
00207 {
00208    return ( *this ) ;
00209 }
00210 
00211 template < class DecayClass , class CandidateClass >
00212 typename DecayList< DecayClass , CandidateClass >::const_iterator DecayList< DecayClass , CandidateClass >::particle_begin() const
00213 {
00214 // Need to cast to 'const' to get the right function call
00215    //std::cout << "@DecayList::particle_begin() -- const_iterator" << std::endl;
00216    return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).begin() ) ;
00217 }
00218 
00219 template < class DecayClass , class CandidateClass >
00220 typename DecayList< DecayClass , CandidateClass >::const_iterator DecayList< DecayClass , CandidateClass >::particle_end() const
00221 {
00222 // Need to cast to 'const' to get the right function call
00223          return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).end() ) ;
00224 }
00225 
00226 template < class DecayClass , class CandidateClass >
00227 typename DecayList< DecayClass , CandidateClass >::const_partial_iterator DecayList< DecayClass , CandidateClass >::partial_particle_begin() const
00228 {
00229 // Need to cast to 'const' to get the right function call
00230          return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).begin( this->label() ) ) ;
00231 }
00232 
00233 template < class DecayClass , class CandidateClass >
00234 typename DecayList< DecayClass , CandidateClass >::const_partial_iterator DecayList< DecayClass , CandidateClass >::partial_particle_end() const
00235 {
00236 // Need to cast to 'const' to get the right function call
00237          return ( (*(const LabeledParticleList< DecayClass , CandidateClass >*)(m_list.pointer())).end( this->label() ) ) ;
00238 }
00239 
00240 
00241 
00242 template < class DecayClass , class CandidateClass >
00243 void DecayList< DecayClass , CandidateClass >::eraseContents()
00244 {
00245    m_list->erase( m_list->begin() ,
00246                  m_list->end() ) ;
00247 }
00248 
00249 
00250 template < class DecayClass , class CandidateClass >
00251 const LabeledCandidateList< CandidateClass >& DecayList< DecayClass , CandidateClass >::labeledCandidateList() const
00252 {
00253    return ( *m_list ) ;
00254 }
00255 
00256 
00257 template < class DecayClass , class CandidateClass >
00258 const LabeledParticleList< DecayClass , CandidateClass >& DecayList< DecayClass , CandidateClass >::labeledParticleList() const
00259 {
00260    return ( *m_list ) ;
00261 }
00262 
00263 //
00264 // static member functions
00265 //
00266 }
00267 #endif /* DCHAIN_DECAYLIST_CC */

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