CMS 3D CMS Logo

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

reco::CompositeRefBaseCandidate Class Reference

#include <CompositeRefBaseCandidate.h>

Inheritance diagram for reco::CompositeRefBaseCandidate:
reco::LeafCandidate reco::Candidate pat::MHT reco::GenericJet

List of all members.

Public Types

typedef std::vector
< CandidateBaseRef
daughters
 collection of references to daughters

Public Member Functions

void addDaughter (const CandidateBaseRef &)
 add a daughter via a reference
virtual const_iterator begin () const
 first daughter const_iterator
virtual iterator begin ()
 first daughter iterator
void clearDaughters ()
 clear daughter references
virtual CompositeRefBaseCandidateclone () const
 returns a clone of the candidate
 CompositeRefBaseCandidate (Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values
 CompositeRefBaseCandidate (const Candidate &c)
 constructor from a particle
 CompositeRefBaseCandidate (Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values
 CompositeRefBaseCandidate ()
 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
CandidateBaseRef daughterRef (size_type i) const
 reference to daughter at given position
virtual const_iterator end () const
 last daughter const_iterator
virtual iterator end ()
 last daughter iterator
virtual const Candidatemother (size_type) const
 return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode)
virtual size_t numberOfDaughters () const
 number of daughters
virtual size_t numberOfMothers () const
 number of mothers
virtual ~CompositeRefBaseCandidate ()
 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

Detailed Description

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

Author:
Luca Lista, INFN
Version:
Id:
CompositeRefBaseCandidate.h,v 1.22 2009/11/02 21:46:52 srappocc Exp

Definition at line 19 of file CompositeRefBaseCandidate.h.


Member Typedef Documentation

const iterator implementation

Reimplemented from reco::LeafCandidate.

Definition at line 67 of file CompositeRefBaseCandidate.h.

collection of references to daughters

Reimplemented from reco::LeafCandidate.

Definition at line 22 of file CompositeRefBaseCandidate.h.

iterator implementation

Reimplemented from reco::LeafCandidate.

Definition at line 69 of file CompositeRefBaseCandidate.h.


Constructor & Destructor Documentation

reco::CompositeRefBaseCandidate::CompositeRefBaseCandidate ( ) [inline]

default constructor

Definition at line 24 of file CompositeRefBaseCandidate.h.

Referenced by clone().

: LeafCandidate() { }
reco::CompositeRefBaseCandidate::CompositeRefBaseCandidate ( 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 26 of file CompositeRefBaseCandidate.h.

                                                                                          :
      LeafCandidate( q, p4, vtx, pdgId, status, integerCharge ) { }
reco::CompositeRefBaseCandidate::CompositeRefBaseCandidate ( 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 30 of file CompositeRefBaseCandidate.h.

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

constructor from a particle

Definition at line 34 of file CompositeRefBaseCandidate.h.

: LeafCandidate( c ) { }
CompositeRefBaseCandidate::~CompositeRefBaseCandidate ( ) [virtual]

destructor

Definition at line 7 of file CompositeRefBaseCandidate.cc.

                                                      { 
}

Member Function Documentation

void reco::CompositeRefBaseCandidate::addDaughter ( const CandidateBaseRef cand) [inline]

add a daughter via a reference

Definition at line 76 of file CompositeRefBaseCandidate.h.

References dau.

Referenced by reco::GenericJet::GenericJet().

                                                                                    { 
    dau.push_back( cand ); 
  }
Candidate::const_iterator CompositeRefBaseCandidate::begin ( void  ) const [virtual]

first daughter const_iterator

Reimplemented from reco::LeafCandidate.

Definition at line 14 of file CompositeRefBaseCandidate.cc.

References dau.

                                                               { 
  return const_iterator( new const_iterator_imp_specific( dau.begin() ) ); 
}
Candidate::iterator CompositeRefBaseCandidate::begin ( void  ) [virtual]

first daughter iterator

Reimplemented from reco::LeafCandidate.

Definition at line 22 of file CompositeRefBaseCandidate.cc.

                                                   { 
  return iterator( new iterator_imp_specific ); 
}
void reco::CompositeRefBaseCandidate::clearDaughters ( ) [inline]

clear daughter references

Definition at line 61 of file CompositeRefBaseCandidate.h.

References dau.

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

returns a clone of the candidate

Reimplemented from reco::LeafCandidate.

Definition at line 10 of file CompositeRefBaseCandidate.cc.

References CompositeRefBaseCandidate().

                                                                   { 
  return new CompositeRefBaseCandidate( * this ); 
}
const Candidate * CompositeRefBaseCandidate::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 CompositeRefBaseCandidate.cc.

References dau, i, and numberOfDaughters().

                                                                         { 
  return ( i < numberOfDaughters() ) ? & * dau[ i ] : 0; // i >= 0, since i is unsigned
}
Candidate * CompositeRefBaseCandidate::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 CompositeRefBaseCandidate.cc.

                                                             { 
  return 0;
}
CandidateBaseRef reco::CompositeRefBaseCandidate::daughterRef ( size_type  i) const [inline]

reference to daughter at given position

Definition at line 63 of file CompositeRefBaseCandidate.h.

References dau, and i.

{ return dau[ i ]; }
Candidate::const_iterator CompositeRefBaseCandidate::end ( void  ) const [virtual]

last daughter const_iterator

Reimplemented from reco::LeafCandidate.

Definition at line 18 of file CompositeRefBaseCandidate.cc.

References dau.

                                                             { 
  return const_iterator( new const_iterator_imp_specific( dau.end() ) ); 
}    
Candidate::iterator CompositeRefBaseCandidate::end ( void  ) [virtual]

last daughter iterator

Reimplemented from reco::LeafCandidate.

Definition at line 26 of file CompositeRefBaseCandidate.cc.

                                                 { 
  return iterator( new iterator_imp_specific ); 
}    
const Candidate * CompositeRefBaseCandidate::mother ( size_type  i) const [virtual]

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

Reimplemented from reco::LeafCandidate.

Definition at line 34 of file CompositeRefBaseCandidate.cc.

                                                                       { 
 return 0;
}
size_t CompositeRefBaseCandidate::numberOfDaughters ( ) const [virtual]

number of daughters

Reimplemented from reco::LeafCandidate.

Definition at line 42 of file CompositeRefBaseCandidate.cc.

References dau.

Referenced by daughter(), and reco::GenericJet::nConstituents().

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

number of mothers

Reimplemented from reco::LeafCandidate.

Definition at line 46 of file CompositeRefBaseCandidate.cc.

                                                        { 
  return 0;
}
bool CompositeRefBaseCandidate::overlap ( const Candidate c2) const [private, virtual]

check overlap with another candidate

Reimplemented from reco::LeafCandidate.

Definition at line 50 of file CompositeRefBaseCandidate.cc.

References Exception.

                                                                    {
  throw cms::Exception( "Error" ) << "can't check overlap internally for CompositeRefBaseCanddate";
}

Member Data Documentation

collection of references to daughters

Definition at line 71 of file CompositeRefBaseCandidate.h.

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