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

Go to the documentation of this file.
00001 #ifndef DCHAIN_NEUTRALNCVISIBLELIST_CC
00002 #define DCHAIN_NEUTRALNCVISIBLELIST_CC
00003 // -*- C++ -*-
00004 //
00005 // Package:     DChain
00006 // Module:      NeutralNCVisibleList
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: NeutralNCVisibleList.cc,v 1.2 2009/06/22 08:38:08 zoujh Exp $
00016 //
00017 // Revision history
00018 //
00019 // $Log: NeutralNCVisibleList.cc,v $
00020 // Revision 1.2  2009/06/22 08:38:08  zoujh
00021 // See ChangeLog
00022 //
00023 // Revision 1.1.1.1  2009/03/03 06:06:56  maqm
00024 // first import of DecayChain
00025 //
00026 // Revision 1.1  2006/01/11 20:28:40  cdj
00027 // massive class renaming, addition of [] for selection and unit tests
00028 //
00029 //
00030 
00031 // system include files
00032 #include <stdlib.h>  // required for 'exit'
00033 
00034 // user include files
00035 #include "DecayChain/Function/DCSelectionFunction.h"
00036 #include "DecayChain/Function/DCAnalysisFunction.h"
00037 #include "DecayChain/Element/conjugation.h"
00038 #include "DecayChain/Element/LabeledParticle.h"
00039 #include "DecayChain/Iterator/MuteWholeItr.h"
00040 #include "DecayChain/Iterator/WholeItr.h"
00041 #include "DecayChain/List/LabeledParticleList.h"
00042 #include "DecayChain/List/ChosenConjugateList.h"
00043 
00044 #include "DecayChain/List/NeutralNCVisibleList.h"
00045 
00046 //
00047 // constants, enums and typedefs
00048 //
00049 namespace dchain {
00050 
00051 //
00052 // static data member definitions
00053 //
00054 
00055 //
00056 // constructors and destructor
00057 //
00058 
00059 template < class NeutralNC , class CandidateClass >
00060 NeutralNCVisibleList< NeutralNC , CandidateClass >::
00061 NeutralNCVisibleList() :
00062    m_list( (new dchain::LabeledParticleList< NeutralNC , CandidateClass >) ),
00063    m_ntBarList(0),
00064    m_isBarList(0)
00065 {
00066 }
00067 
00068 template < class NeutralNC , class CandidateClass >
00069 NeutralNCVisibleList< NeutralNC , CandidateClass >::
00070 NeutralNCVisibleList(const NeutralNCVisibleList<NeutralNC, CandidateClass>&
00071                      aOtherList ) :
00072    m_list( (new dchain::LabeledParticleList< NeutralNC , CandidateClass >) ),
00073    m_ntBarList(0),
00074    m_isBarList(0)
00075 {
00076    typedef typename MakerTrait<NeutralNC>::maker_type Maker;
00077   fill( *(aOtherList.m_list), Maker(), SelectAll<NeutralNC>() ) ;
00078 }
00079 
00080 
00081 template < class NeutralNC , class CandidateClass >
00082 NeutralNCVisibleList< NeutralNC , CandidateClass >::~NeutralNCVisibleList()
00083 {
00084    delete m_ntBarList;
00085    delete m_isBarList;
00086 }
00087 
00088 //
00089 // assignment operators
00090 //
00091 
00092 /*
00093 template < class NeutralNC , class CandidateClass >
00094 const NeutralNCVisibleList< NeutralNC , CandidateClass >& NeutralNCVisibleList< NeutralNC , CandidateClass >::operator=( const NeutralNCVisibleList< NeutralNC , CandidateClass >& aOtherList )
00095 {
00096    eraseContents() ;
00097    typedef typename MakerTrait<NeutralNC>::maker_type Maker;
00098    fill( *(aOtherList.m_list), Maker(), SelectAll<NeutralNC>() ) ;
00099    return ( *this ) ;
00100 }
00101 */
00102 
00103 //
00104 // member functions
00105 //
00106 
00107 template < class NeutralNC , class CandidateClass >
00108 typename NeutralNCVisibleList< NeutralNC , CandidateClass >::iterator
00109 NeutralNCVisibleList< NeutralNC , CandidateClass >::particle_begin()
00110 {
00111    return ( m_list->begin() ) ;
00112 }
00113 
00114 template < class NeutralNC , class CandidateClass >
00115 typename NeutralNCVisibleList< NeutralNC , CandidateClass >::iterator
00116 NeutralNCVisibleList< NeutralNC , CandidateClass >::particle_end()
00117 {
00118    return ( m_list->end() ) ;
00119 }
00120 
00121 template < class NeutralNC , class CandidateClass >
00122 dchain::ChosenConjugateList< NeutralNC , CandidateClass >&
00123 NeutralNCVisibleList< NeutralNC , CandidateClass >::operator()()
00124 {
00125    if ( m_ntBarList == 0 ) {
00126       m_ntBarList = new ChosenConjugateList< NeutralNC, CandidateClass >(*m_list, kIsntBar);
00127    }
00128 
00129    return (*m_ntBarList);
00130 }
00131 
00132 template < class NeutralNC , class CandidateClass >
00133 dchain::ChosenConjugateList< NeutralNC , CandidateClass >&
00134 NeutralNCVisibleList< NeutralNC , CandidateClass >::bar()
00135 {
00136    if ( m_isBarList == 0 ) {
00137       m_isBarList = new ChosenConjugateList< NeutralNC, CandidateClass >(*m_list, kIsBar);
00138    }
00139 
00140    return (*m_isBarList);
00141 }
00142 
00143 template < class NeutralNC , class CandidateClass >
00144 dchain::LabeledParticleList< NeutralNC, CandidateClass >&
00145 NeutralNCVisibleList< NeutralNC , CandidateClass >::labeledCandidateList()
00146 {
00147    return ( *m_list ) ;
00148 }
00149 
00150 
00151 template < class NeutralNC , class CandidateClass >
00152 void NeutralNCVisibleList< NeutralNC , CandidateClass >::eraseContents()
00153 {
00154    m_list->erase( m_list->begin() ,
00155                   m_list->end() ) ;
00156 }
00157 
00158 //
00159 // const member functions
00160 //
00161 
00162 template < class NeutralNC , class CandidateClass >
00163 typename NeutralNCVisibleList< NeutralNC , CandidateClass >::const_iterator
00164 NeutralNCVisibleList< NeutralNC , CandidateClass >::particle_begin() const
00165 {
00166 // Need to cast to 'const' to get the right function call
00167   return ( (*(const dchain::LabeledParticleList< NeutralNC , CandidateClass >*)(m_list.pointer())).begin() ) ;
00168 }
00169 
00170 template < class NeutralNC , class CandidateClass >
00171 typename NeutralNCVisibleList< NeutralNC , CandidateClass >::const_iterator
00172 NeutralNCVisibleList< NeutralNC , CandidateClass >::particle_end() const
00173 {
00174 // Need to cast to 'const' to get the right function call
00175   return ( (*(const dchain::LabeledParticleList< NeutralNC , CandidateClass >*)(m_list.pointer())).end() ) ;
00176 }
00177 
00178 
00179 template < class NeutralNC , class CandidateClass >
00180 const dchain::LabeledParticleList< NeutralNC, CandidateClass >&
00181 NeutralNCVisibleList< NeutralNC , CandidateClass >::labeledCandidateList() const
00182 {
00183    return ( *m_list ) ;
00184 }
00185 
00186 //
00187 // static member functions
00188 //
00189 }
00190 #endif /* DCHAIN_NEUTRALNCVISIBLELIST_CC */

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