CMS 3D CMS Logo

Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes

reco::CompositeRefCandidate Class Reference

#include <CompositeRefCandidate.h>

Inheritance diagram for reco::CompositeRefCandidate:
reco::LeafCandidate reco::Candidate

List of all members.

Public Types

typedef CandidateRefVector daughters
 collection of references to daughters
typedef CandidateRefVector mothers
 collection of references to daughters

Public Member Functions

void addDaughter (const CandidateRef &)
 add a daughter via a reference
void addMother (const CandidateRef &)
 add a daughter via a reference
virtual iterator begin ()
 first daughter iterator
virtual const_iterator begin () const
 first daughter const_iterator
void clearDaughters ()
 clear daughter references
virtual CompositeRefCandidateclone () const
 returns a clone of the candidate
 CompositeRefCandidate (Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values
 CompositeRefCandidate (const Candidate &p)
 constructor from a candidate
 CompositeRefCandidate (Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values
 CompositeRefCandidate ()
 default constructor
virtual const Candidatedaughter (size_type) const
 return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
virtual Candidatedaughter (size_type)
 return daughter at a given position, i = 0, ... numberOfDaughters() - 1
CandidateRef daughterRef (size_type i) const
 reference to daughter at given position
const daughtersdaughterRefVector () const
 references to daughtes
virtual const_iterator end () const
 last daughter const_iterator
virtual iterator end ()
 last daughter iterator
virtual const Candidatemother (size_t i=0) const
 return pointer to mother
CandidateRef motherRef (size_type i=0) const
 reference to mother at given position
const mothersmotherRefVector () const
 references to mothers
virtual size_t numberOfDaughters () const
 number of daughters
virtual size_t numberOfMothers () const
 number of mothers (zero or one in most of but not all the cases)
void resetDaughters (const edm::ProductID &id)
 set daughters product ID
virtual ~CompositeRefCandidate ()
 destructor

Private Types

typedef
candidate::const_iterator_imp_specific
< daughters
const_iterator_imp_specific
 const iterator implementation
typedef
candidate::iterator_imp_specific_dummy
< daughters
iterator_imp_specific
 iterator implementation

Private Member Functions

virtual bool overlap (const Candidate &) const
 check overlap with another candidate

Private Attributes

daughters dau
 collection of references to daughters
daughters mom
 collection of references to mothers

Detailed Description

a reco::Candidate composed of daughters. The daughters has persistent references (edm::Ref <...>) to reco::Candidate stored in a separate collection.

Author:
Luca Lista, INFN
Version:
Id:
CompositeRefCandidate.h,v 1.25 2009/11/02 21:46:53 srappocc Exp

Definition at line 20 of file CompositeRefCandidate.h.


Member Typedef Documentation

const iterator implementation

Reimplemented from reco::LeafCandidate.

Definition at line 80 of file CompositeRefCandidate.h.

collection of references to daughters

Reimplemented from reco::LeafCandidate.

Definition at line 23 of file CompositeRefCandidate.h.

iterator implementation

Reimplemented from reco::LeafCandidate.

Definition at line 82 of file CompositeRefCandidate.h.

collection of references to daughters

Definition at line 25 of file CompositeRefCandidate.h.


Constructor & Destructor Documentation

reco::CompositeRefCandidate::CompositeRefCandidate ( ) [inline]

default constructor

Definition at line 27 of file CompositeRefCandidate.h.

Referenced by clone().

: LeafCandidate() { }
reco::CompositeRefCandidate::CompositeRefCandidate ( Charge  q,
const LorentzVector p4,
const Point vtx = Point( 0, 0, 0 ),
int  pdgId = 0,
int  status = 0,
bool  integerCharge = true 
) [inline]

constructor from values

Definition at line 29 of file CompositeRefCandidate.h.

                                                                                      :
      LeafCandidate( q, p4, vtx, pdgId, status, integerCharge ) { }
reco::CompositeRefCandidate::CompositeRefCandidate ( Charge  q,
const PolarLorentzVector p4,
const Point vtx = Point( 0, 0, 0 ),
int  pdgId = 0,
int  status = 0,
bool  integerCharge = true 
) [inline]

constructor from values

Definition at line 33 of file CompositeRefCandidate.h.

                                                                                      :
      LeafCandidate( q, p4, vtx, pdgId, status, integerCharge ) { }
reco::CompositeRefCandidate::CompositeRefCandidate ( const Candidate p) [inline, explicit]

constructor from a candidate

Definition at line 37 of file CompositeRefCandidate.h.

: LeafCandidate( p ) { }
CompositeRefCandidate::~CompositeRefCandidate ( ) [virtual]

destructor

Definition at line 7 of file CompositeRefCandidate.cc.

                                              { 
}

Member Function Documentation

void reco::CompositeRefCandidate::addDaughter ( const CandidateRef cand) [inline]

add a daughter via a reference

Definition at line 91 of file CompositeRefCandidate.h.

References dau, and edm::RefVector< C, T, F >::push_back().

                                                                            { 
    dau.push_back( cand ); 
  }
void reco::CompositeRefCandidate::addMother ( const CandidateRef cand) [inline]

add a daughter via a reference

Definition at line 95 of file CompositeRefCandidate.h.

References mom, and edm::RefVector< C, T, F >::push_back().

                                                                          { 
    mom.push_back( cand ); 
  }
Candidate::iterator CompositeRefCandidate::begin ( void  ) [virtual]

first daughter iterator

Reimplemented from reco::LeafCandidate.

Definition at line 22 of file CompositeRefCandidate.cc.

                                               { 
  return iterator( new iterator_imp_specific ); 
}
Candidate::const_iterator CompositeRefCandidate::begin ( void  ) const [virtual]

first daughter const_iterator

Reimplemented from reco::LeafCandidate.

Definition at line 14 of file CompositeRefCandidate.cc.

References edm::RefVector< C, T, F >::begin(), and dau.

void reco::CompositeRefCandidate::clearDaughters ( ) [inline]

clear daughter references

Definition at line 62 of file CompositeRefCandidate.h.

References edm::RefVector< C, T, F >::clear(), and dau.

{ dau.clear(); }
CompositeRefCandidate * CompositeRefCandidate::clone ( void  ) const [virtual]

returns a clone of the candidate

Reimplemented from reco::LeafCandidate.

Definition at line 10 of file CompositeRefCandidate.cc.

References CompositeRefCandidate().

                                                           { 
  return new CompositeRefCandidate( * this ); 
}
Candidate * CompositeRefCandidate::daughter ( size_type  i) [virtual]

return daughter at a given position, i = 0, ... numberOfDaughters() - 1

Reimplemented from reco::LeafCandidate.

Definition at line 38 of file CompositeRefCandidate.cc.

                                                         { 
  return 0;
}
const Candidate * CompositeRefCandidate::daughter ( size_type  i) const [virtual]

return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)

Reimplemented from reco::LeafCandidate.

Definition at line 30 of file CompositeRefCandidate.cc.

References dau, i, and numberOfDaughters().

                                                                     { 
  return ( i < numberOfDaughters() ) ? & * dau[ i ] : 0; // i >= 0, since i is unsigned
}
CandidateRef reco::CompositeRefCandidate::daughterRef ( size_type  i) const [inline]

reference to daughter at given position

Definition at line 64 of file CompositeRefCandidate.h.

References dau, and i.

{ return dau[ i ]; }
const daughters& reco::CompositeRefCandidate::daughterRefVector ( ) const [inline]

references to daughtes

Definition at line 66 of file CompositeRefCandidate.h.

References dau.

{ return dau; }
Candidate::iterator CompositeRefCandidate::end ( void  ) [virtual]

last daughter iterator

Reimplemented from reco::LeafCandidate.

Definition at line 26 of file CompositeRefCandidate.cc.

                                             { 
  return iterator( new iterator_imp_specific ); 
}    
Candidate::const_iterator CompositeRefCandidate::end ( void  ) const [virtual]

last daughter const_iterator

Reimplemented from reco::LeafCandidate.

Definition at line 18 of file CompositeRefCandidate.cc.

References dau, and edm::RefVector< C, T, F >::end().

const Candidate * CompositeRefCandidate::mother ( size_t  i = 0) const [virtual]

return pointer to mother

Reimplemented from reco::LeafCandidate.

Definition at line 34 of file CompositeRefCandidate.cc.

References i, mom, and numberOfMothers().

                                                                   { 
  return ( i < numberOfMothers() ) ? & * mom[ i ] : 0; // i >= 0, since i is unsigned
}
CandidateRef reco::CompositeRefCandidate::motherRef ( size_type  i = 0) const [inline]

reference to mother at given position

Definition at line 68 of file CompositeRefCandidate.h.

References i, and mom.

{ return mom[ i ]; }
const mothers& reco::CompositeRefCandidate::motherRefVector ( ) const [inline]

references to mothers

Definition at line 70 of file CompositeRefCandidate.h.

References mom.

{ return mom; }
size_t CompositeRefCandidate::numberOfDaughters ( ) const [virtual]

number of daughters

Reimplemented from reco::LeafCandidate.

Definition at line 42 of file CompositeRefCandidate.cc.

References dau, and edm::RefVector< C, T, F >::size().

Referenced by daughter().

                                                      { 
  return dau.size(); 
}
size_t CompositeRefCandidate::numberOfMothers ( ) const [virtual]

number of mothers (zero or one in most of but not all the cases)

Reimplemented from reco::LeafCandidate.

Definition at line 46 of file CompositeRefCandidate.cc.

References mom, and edm::RefVector< C, T, F >::size().

Referenced by mother().

                                                    { 
  return mom.size();
}
bool CompositeRefCandidate::overlap ( const Candidate c2) const [private, virtual]

check overlap with another candidate

Reimplemented from reco::LeafCandidate.

Definition at line 50 of file CompositeRefCandidate.cc.

References Exception.

                                                                {
  throw cms::Exception( "Error" ) << "can't check overlap internally for CompositeRefCanddate";
}
void reco::CompositeRefCandidate::resetDaughters ( const edm::ProductID id) [inline]

set daughters product ID

Definition at line 72 of file CompositeRefCandidate.h.

References dau.

{ dau = daughters( id ); }

Member Data Documentation

collection of references to daughters

Definition at line 84 of file CompositeRefCandidate.h.

Referenced by addDaughter(), begin(), clearDaughters(), daughter(), daughterRef(), daughterRefVector(), end(), numberOfDaughters(), and resetDaughters().

collection of references to mothers

Definition at line 86 of file CompositeRefCandidate.h.

Referenced by addMother(), mother(), motherRef(), motherRefVector(), and numberOfMothers().