CMS 3D CMS Logo

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

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