CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DataFormats/Candidate/src/CompositeRefCandidate.cc

Go to the documentation of this file.
00001 // $Id: CompositeRefCandidate.cc,v 1.9 2010/12/06 20:04:17 wmtan Exp $
00002 #include "DataFormats/Candidate/interface/CompositeRefCandidate.h"
00003 #include "FWCore/Utilities/interface/Exception.h"
00004 
00005 using namespace reco;
00006 
00007 CompositeRefCandidate::~CompositeRefCandidate() { 
00008 }
00009 
00010 CompositeRefCandidate * CompositeRefCandidate::clone() const { 
00011   return new CompositeRefCandidate( * this ); 
00012 }
00013 
00014 Candidate::const_iterator CompositeRefCandidate::begin() const { 
00015   return const_iterator( new const_iterator_imp_specific( dau.begin() ) ); 
00016 }
00017 
00018 Candidate::const_iterator CompositeRefCandidate::end() const { 
00019   return const_iterator( new const_iterator_imp_specific( dau.end() ) ); 
00020 }    
00021 
00022 Candidate::iterator CompositeRefCandidate::begin() { 
00023   return iterator( new iterator_imp_specific ); 
00024 }
00025 
00026 Candidate::iterator CompositeRefCandidate::end() { 
00027   return iterator( new iterator_imp_specific ); 
00028 }    
00029 
00030 const Candidate * CompositeRefCandidate::daughter( size_type i ) const { 
00031   return ( i < numberOfDaughters() ) ? & * dau[ i ] : 0; // i >= 0, since i is unsigned
00032 }
00033 
00034 const Candidate * CompositeRefCandidate::mother( size_type i ) const { 
00035   return ( i < numberOfMothers() ) ? & * mom[ i ] : 0; // i >= 0, since i is unsigned
00036 }
00037 
00038 Candidate * CompositeRefCandidate::daughter( size_type i ) { 
00039   return 0;
00040 }
00041 
00042 size_t CompositeRefCandidate::numberOfDaughters() const { 
00043   return dau.size(); 
00044 }
00045 
00046 size_t CompositeRefCandidate::numberOfMothers() const { 
00047   return mom.size();
00048 }
00049 
00050 bool CompositeRefCandidate::overlap( const Candidate & c2 ) const {
00051   throw cms::Exception( "Error" ) << "can't check overlap internally for CompositeRefCanddate";
00052 }