CMS 3D CMS Logo

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

reco::CompositePtrCandidate Class Reference

#include <CompositePtrCandidate.h>

Inheritance diagram for reco::CompositePtrCandidate:
reco::LeafCandidate reco::Candidate pat::Hemisphere reco::Jet reco::RecoTauPiZero reco::WMuNuCandidatePtr pat::PATObject< reco::Jet > reco::BasicJet reco::CaloJet reco::GenJet reco::JPTJet reco::PFClusterJet reco::PFJet reco::TrackJet

List of all members.

Public Types

typedef std::vector< CandidatePtrdaughters
 collection of references to daughters
typedef std::vector< CandidatePtrmothers
 collection of references to daughters

Public Member Functions

void addDaughter (const CandidatePtr &)
 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 CompositePtrCandidateclone () const
 returns a clone of the candidate
 CompositePtrCandidate (Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values
 CompositePtrCandidate (const Candidate &p)
 constructor from a Candidate
 CompositePtrCandidate (Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values
 CompositePtrCandidate ()
 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
CandidatePtr daughterPtr (size_type i) const
 reference to daughter at given position
const daughtersdaughterPtrVector () 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
virtual size_t numberOfDaughters () const
 number of daughters
virtual size_t numberOfMothers () const
 number of mothers
virtual size_type numberOfSourceCandidatePtrs () const
virtual CandidatePtr sourceCandidatePtr (size_type i) const
virtual ~CompositePtrCandidate ()
 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::Ptr <...>) to reco::Candidate stored in a separate collection.

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

Definition at line 20 of file CompositePtrCandidate.h.


Member Typedef Documentation

const iterator implementation

Reimplemented from reco::LeafCandidate.

Definition at line 82 of file CompositePtrCandidate.h.

collection of references to daughters

Reimplemented from reco::LeafCandidate.

Definition at line 23 of file CompositePtrCandidate.h.

iterator implementation

Reimplemented from reco::LeafCandidate.

Definition at line 84 of file CompositePtrCandidate.h.

collection of references to daughters

Definition at line 25 of file CompositePtrCandidate.h.


Constructor & Destructor Documentation

reco::CompositePtrCandidate::CompositePtrCandidate ( ) [inline]

default constructor

Definition at line 27 of file CompositePtrCandidate.h.

Referenced by clone().

: LeafCandidate() { }
reco::CompositePtrCandidate::CompositePtrCandidate ( 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 CompositePtrCandidate.h.

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

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

constructor from a Candidate

Definition at line 37 of file CompositePtrCandidate.h.

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

destructor

Definition at line 7 of file CompositePtrCandidate.cc.

                                              { 
}

Member Function Documentation

void reco::CompositePtrCandidate::addDaughter ( const CandidatePtr cand) [inline]
Candidate::const_iterator CompositePtrCandidate::begin ( void  ) const [virtual]
Candidate::iterator CompositePtrCandidate::begin ( void  ) [virtual]

first daughter iterator

Reimplemented from reco::LeafCandidate.

Definition at line 22 of file CompositePtrCandidate.cc.

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

clear daughter references

Definition at line 62 of file CompositePtrCandidate.h.

References dau.

Referenced by reco::tau::xclean::CrossCleanPiZeros< PtrIter >::operator()(), and RecoTauJetRegionProducer::produce().

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

returns a clone of the candidate

Reimplemented from reco::LeafCandidate.

Reimplemented in reco::BasicJet, reco::CaloJet, reco::GenJet, reco::JPTJet, reco::PFClusterJet, reco::PFJet, reco::TrackJet, and pat::Jet.

Definition at line 10 of file CompositePtrCandidate.cc.

References CompositePtrCandidate().

Referenced by ChainedJetCorrector::correction().

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

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

Reimplemented from reco::LeafCandidate.

Reimplemented in pat::Jet.

Definition at line 30 of file CompositePtrCandidate.cc.

References dau, i, and numberOfDaughters().

Referenced by reco::Jet::getJetConstituentsQuick(), reco::RecoTauPiZero::maxDeltaEta(), reco::RecoTauPiZero::maxDeltaPhi(), reco::RecoTauPiZero::numberOfElectrons(), and reco::RecoTauPiZero::numberOfGammas().

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

                                                         { 
  return 0;
}
CandidatePtr reco::CompositePtrCandidate::daughterPtr ( size_type  i) const [inline]
const daughters& reco::CompositePtrCandidate::daughterPtrVector ( ) const [inline]
Candidate::const_iterator CompositePtrCandidate::end ( void  ) const [virtual]

last daughter const_iterator

Reimplemented from reco::LeafCandidate.

Definition at line 18 of file CompositePtrCandidate.cc.

References dau.

Referenced by PFJetIDSelectionFunctor::firstDataCuts(), reco::GenJet::getGenConstituent(), and CastorTowerJetMonitor::processEventJets().

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

last daughter iterator

Reimplemented from reco::LeafCandidate.

Definition at line 26 of file CompositePtrCandidate.cc.

                                             { 
  return iterator( new iterator_imp_specific ); 
}    
const Candidate * CompositePtrCandidate::mother ( size_t  i = 0) const [virtual]

return pointer to mother

Reimplemented from reco::LeafCandidate.

Definition at line 34 of file CompositePtrCandidate.cc.

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

number of mothers

Reimplemented from reco::LeafCandidate.

Definition at line 46 of file CompositePtrCandidate.cc.

                                                    { 
  return 0;
}
size_t CompositePtrCandidate::numberOfSourceCandidatePtrs ( ) const [virtual]

number of source candidates ( the candidates used to construct this Candidate). for CompositeRefBaseCandidates, the source candidates are the daughters.

Reimplemented from reco::LeafCandidate.

Definition at line 50 of file CompositePtrCandidate.cc.

References numberOfDaughters().

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

check overlap with another candidate

Reimplemented from reco::LeafCandidate.

Reimplemented in reco::BasicJet, reco::CaloJet, reco::GenJet, reco::JPTJet, reco::PFClusterJet, reco::PFJet, and reco::TrackJet.

Definition at line 58 of file CompositePtrCandidate.cc.

References Exception.

                                                                {
  throw cms::Exception( "Error" ) << "can't check overlap internally for CompositePtrCanddate";
}
CandidatePtr CompositePtrCandidate::sourceCandidatePtr ( size_type  i) const [virtual]

return a RefToBase to one of the source Candidates ( the candidates used to construct this Candidate). for CompositeRefBaseCandidates, the source candidates are the daughters.

Reimplemented from reco::LeafCandidate.

Definition at line 54 of file CompositePtrCandidate.cc.

References daughterPtr().

                                                                          {
  return daughterPtr(i);
}

Member Data Documentation