CMS 3D CMS Logo

reco::CompositeRefCandidateT< D > Class Template Reference

a reco::Candidate composed of daughters. More...

#include <DataFormats/Candidate/interface/CompositeRefCandidateT.h>

Inheritance diagram for reco::CompositeRefCandidateT< D >:

reco::Candidate reco::Particle reco::GenParticle GeneratorTau

List of all members.

Public Types

typedef D daughters
 collection of references to daughters
typedef D mothers
 collection of references to daughters

Public Member Functions

void addDaughter (const typename daughters::value_type &)
 add a daughter via a reference
void addMother (const typename mothers::value_type &)
 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
void clearMothers ()
 clear mother references
virtual CompositeRefCandidateT
< D > * 
clone () const
 returns a clone of the candidate
 CompositeRefCandidateT (const Particle &p)
 constructor from a particle
 CompositeRefCandidateT (Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values
 CompositeRefCandidateT (Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
 constructor from values
 CompositeRefCandidateT ()
 default constructor
virtual Candidatedaughter (size_type)
 return daughter at a given position, i = 0, ... numberOfDaughters() - 1
virtual const Candidatedaughter (size_type) const
 return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
daughters::value_type daughterRef (size_type i) const
 reference to daughter at given position
const daughtersdaughterRefVector () const
 references to daughtes
virtual iterator end ()
 last daughter iterator
virtual const_iterator end () const
 last daughter const_iterator
virtual const Candidatemother (size_type=0) const
 return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode)
daughters::value_type 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
void resetDaughters (const edm::ProductID &id)
 set daughters product ID
void resetMothers (const edm::ProductID &id)
 set mother product ID
virtual ~CompositeRefCandidateT ()
 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

template<typename D>
class reco::CompositeRefCandidateT< D >

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
CompositeRefCandidateT.h,v 1.10.2.1 2009/04/14 08:24:10 gpetrucc Exp

Definition at line 20 of file CompositeRefCandidateT.h.


Member Typedef Documentation

template<typename D>
typedef candidate::const_iterator_imp_specific<daughters> reco::CompositeRefCandidateT< D >::const_iterator_imp_specific [private]

const iterator implementation

Definition at line 84 of file CompositeRefCandidateT.h.

template<typename D>
typedef D reco::CompositeRefCandidateT< D >::daughters

collection of references to daughters

Definition at line 23 of file CompositeRefCandidateT.h.

template<typename D>
typedef candidate::iterator_imp_specific_dummy<daughters> reco::CompositeRefCandidateT< D >::iterator_imp_specific [private]

iterator implementation

Definition at line 86 of file CompositeRefCandidateT.h.

template<typename D>
typedef D reco::CompositeRefCandidateT< D >::mothers

collection of references to daughters

Definition at line 25 of file CompositeRefCandidateT.h.


Constructor & Destructor Documentation

template<typename D>
reco::CompositeRefCandidateT< D >::CompositeRefCandidateT (  )  [inline]

default constructor

Definition at line 27 of file CompositeRefCandidateT.h.

Referenced by reco::CompositeRefCandidateT< D >::clone().

00027 : Candidate() { }

template<typename D>
reco::CompositeRefCandidateT< D >::CompositeRefCandidateT ( 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 CompositeRefCandidateT.h.

00030                                                                                        :
00031       Candidate( q, p4, vtx, pdgId, status, integerCharge ) { }

template<typename D>
reco::CompositeRefCandidateT< D >::CompositeRefCandidateT ( 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 CompositeRefCandidateT.h.

00034                                                                                        :
00035       Candidate( q, p4, vtx, pdgId, status, integerCharge ) { }

template<typename D>
reco::CompositeRefCandidateT< D >::CompositeRefCandidateT ( const Particle p  )  [inline, explicit]

constructor from a particle

Definition at line 37 of file CompositeRefCandidateT.h.

00037 : Candidate( p ) { }

template<typename D>
reco::CompositeRefCandidateT< D >::~CompositeRefCandidateT (  )  [inline, virtual]

destructor

Definition at line 106 of file CompositeRefCandidateT.h.

00106                                                      { 
00107   }


Member Function Documentation

template<typename D>
void reco::CompositeRefCandidateT< D >::addDaughter ( const typename daughters::value_type &  cand  )  [inline]

add a daughter via a reference

Definition at line 96 of file CompositeRefCandidateT.h.

References reco::CompositeRefCandidateT< D >::dau.

Referenced by GenParticleDecaySelector::add(), GenParticlePruner::addDaughterRefs(), TopDecaySubset::fillReferences(), and StDecaySubset::fillRefs().

00096                                                                                                 { 
00097     dau.push_back( cand ); 
00098   }

template<typename D>
void reco::CompositeRefCandidateT< D >::addMother ( const typename mothers::value_type &   ) 

add a daughter via a reference

Referenced by GenParticlePruner::addMotherRefs(), and pat::PATGenCandsFromSimTracksProducer::produce().

template<typename D>
Candidate::iterator reco::CompositeRefCandidateT< D >::begin (  )  [inline, virtual]

first daughter iterator

Implements reco::Candidate.

Definition at line 125 of file CompositeRefCandidateT.h.

00125                                                      { 
00126     return iterator( new iterator_imp_specific ); 
00127   }

template<typename D>
Candidate::const_iterator reco::CompositeRefCandidateT< D >::begin (  )  const [inline, virtual]

first daughter const_iterator

Implements reco::Candidate.

Definition at line 115 of file CompositeRefCandidateT.h.

References reco::CompositeRefCandidateT< D >::dau.

Referenced by StDecaySubset::fourVector().

00115                                                                  { 
00116     return const_iterator( new const_iterator_imp_specific( dau.begin() ) ); 
00117   }

template<typename D>
void reco::CompositeRefCandidateT< D >::clearDaughters (  )  [inline]

clear daughter references

Definition at line 65 of file CompositeRefCandidateT.h.

00065 { dau.clear(); }

template<typename D>
void reco::CompositeRefCandidateT< D >::clearMothers (  )  [inline]

clear mother references

Definition at line 67 of file CompositeRefCandidateT.h.

00067 { mom.clear(); }

template<typename D>
CompositeRefCandidateT< D > * reco::CompositeRefCandidateT< D >::clone ( void   )  const [inline, virtual]

returns a clone of the candidate

Implements reco::Candidate.

Reimplemented in reco::GenParticle.

Definition at line 110 of file CompositeRefCandidateT.h.

References reco::CompositeRefCandidateT< D >::CompositeRefCandidateT().

00110                                                                      { 
00111     return new CompositeRefCandidateT( * this ); 
00112   }

template<typename D>
Candidate * reco::CompositeRefCandidateT< D >::daughter ( size_type  i  )  [inline, virtual]

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

Definition at line 145 of file CompositeRefCandidateT.h.

00145                                                                { 
00146     return 0;
00147   }

template<typename D>
const Candidate * reco::CompositeRefCandidateT< D >::daughter ( size_type  i  )  const [inline, virtual]

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

Definition at line 135 of file CompositeRefCandidateT.h.

References reco::CompositeRefCandidateT< D >::dau, and reco::CompositeRefCandidateT< D >::numberOfDaughters().

Referenced by FBaseSimEvent::addParticles(), GeneratorTau::computeStableDecayProducts(), GeneratorTau::decayToPDGClassification(), invalidateTree(), PartonSelector::produce(), and InputGenJetsParticleSelector::testPartonChildren().

00135                                                                            { 
00136     return ( i < numberOfDaughters() ) ? & * dau[ i ] : 0;
00137   }

template<typename D>
daughters::value_type reco::CompositeRefCandidateT< D >::daughterRef ( size_type  i  )  const [inline]

reference to daughter at given position

Definition at line 69 of file CompositeRefCandidateT.h.

Referenced by GenParticleDecaySelector::add().

00069 { return dau[ i ]; }

template<typename D>
const daughters& reco::CompositeRefCandidateT< D >::daughterRefVector (  )  const [inline]

references to daughtes

Definition at line 71 of file CompositeRefCandidateT.h.

Referenced by GenParticlePruner::flagDaughters(), and GenParticlePruner::produce().

00071 { return dau; }

template<typename D>
Candidate::iterator reco::CompositeRefCandidateT< D >::end (  )  [inline, virtual]

last daughter iterator

Implements reco::Candidate.

Definition at line 130 of file CompositeRefCandidateT.h.

00130                                                    { 
00131     return iterator( new iterator_imp_specific ); 
00132   }    

template<typename D>
Candidate::const_iterator reco::CompositeRefCandidateT< D >::end (  )  const [inline, virtual]

last daughter const_iterator

Implements reco::Candidate.

Definition at line 120 of file CompositeRefCandidateT.h.

References reco::CompositeRefCandidateT< D >::dau.

Referenced by StDecaySubset::fourVector().

00120                                                                { 
00121     return const_iterator( new const_iterator_imp_specific( dau.end() ) ); 
00122   }    

template<typename D>
const Candidate * reco::CompositeRefCandidateT< D >::mother ( size_type  i = 0  )  const [inline, virtual]

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

Definition at line 140 of file CompositeRefCandidateT.h.

References reco::CompositeRefCandidateT< D >::mom, and reco::CompositeRefCandidateT< D >::numberOfMothers().

Referenced by FBaseSimEvent::addParticles(), ResolutionCreator::analyze(), and InputGenJetsParticleSelector::fromResonance().

00140                                                                          { 
00141     return ( i < numberOfMothers() ) ? & * mom[ i ] : 0;
00142   }

template<typename D>
daughters::value_type reco::CompositeRefCandidateT< D >::motherRef ( size_type  i = 0  )  const [inline]

reference to mother at given position

Definition at line 73 of file CompositeRefCandidateT.h.

Referenced by BCToEFilterAlgo::hasBCAncestors().

00073 { return mom[ i ]; }

template<typename D>
const mothers& reco::CompositeRefCandidateT< D >::motherRefVector (  )  const [inline]

references to mothers

Definition at line 75 of file CompositeRefCandidateT.h.

Referenced by GenParticlePruner::flagMothers(), GenParticlesHelper::hasAncestor(), and GenParticlePruner::produce().

00075 { return mom; }

template<typename D>
size_t reco::CompositeRefCandidateT< D >::numberOfDaughters (  )  const [inline, virtual]

number of daughters

Implements reco::Candidate.

Definition at line 150 of file CompositeRefCandidateT.h.

References reco::CompositeRefCandidateT< D >::dau.

Referenced by GenParticleDecaySelector::add(), FBaseSimEvent::addParticles(), GeneratorTau::computeStableDecayProducts(), reco::CompositeRefCandidateT< D >::daughter(), GeneratorTau::decayToPDGClassification(), invalidateTree(), PartonSelector::produce(), InputGenJetsParticleSelector::produce(), and InputGenJetsParticleSelector::testPartonChildren().

00150                                                             { 
00151     return dau.size(); 
00152   }

template<typename D>
size_t reco::CompositeRefCandidateT< D >::numberOfMothers (  )  const [inline, virtual]

number of mothers

Implements reco::Candidate.

Definition at line 155 of file CompositeRefCandidateT.h.

References reco::CompositeRefCandidateT< D >::mom.

Referenced by FBaseSimEvent::addParticles(), ResolutionCreator::analyze(), InputGenJetsParticleSelector::fromResonance(), BCToEFilterAlgo::hasBCAncestors(), and reco::CompositeRefCandidateT< D >::mother().

00155                                                           { 
00156     return mom.size(); 
00157   }

template<typename D>
bool reco::CompositeRefCandidateT< D >::overlap ( const Candidate c2  )  const [inline, private, virtual]

check overlap with another candidate

Implements reco::Candidate.

Reimplemented in reco::GenParticle.

Definition at line 160 of file CompositeRefCandidateT.h.

References Exception.

00160                                                                       {
00161     throw cms::Exception( "Error" ) << "can't check overlap internally for CompositeRefCanddate";
00162   }

template<typename D>
void reco::CompositeRefCandidateT< D >::resetDaughters ( const edm::ProductID id  )  [inline]

set daughters product ID

Definition at line 77 of file CompositeRefCandidateT.h.

Referenced by GenParticleProducer::produce().

00077 { dau = daughters( id ); }

template<typename D>
void reco::CompositeRefCandidateT< D >::resetMothers ( const edm::ProductID id  )  [inline]

set mother product ID

Definition at line 79 of file CompositeRefCandidateT.h.

00079 { mom = mothers( id ); }


Member Data Documentation

template<typename D>
daughters reco::CompositeRefCandidateT< D >::dau [private]

collection of references to daughters

Definition at line 88 of file CompositeRefCandidateT.h.

Referenced by reco::CompositeRefCandidateT< D >::addDaughter(), reco::CompositeRefCandidateT< D >::begin(), reco::CompositeRefCandidateT< edm::RefVector >::clearDaughters(), reco::CompositeRefCandidateT< D >::daughter(), reco::CompositeRefCandidateT< edm::RefVector >::daughterRef(), reco::CompositeRefCandidateT< edm::RefVector >::daughterRefVector(), reco::CompositeRefCandidateT< D >::end(), reco::CompositeRefCandidateT< D >::numberOfDaughters(), and reco::CompositeRefCandidateT< edm::RefVector >::resetDaughters().

template<typename D>
daughters reco::CompositeRefCandidateT< D >::mom [private]

collection of references to mothers

Definition at line 90 of file CompositeRefCandidateT.h.

Referenced by reco::CompositeRefCandidateT< edm::RefVector >::clearMothers(), reco::CompositeRefCandidateT< D >::mother(), reco::CompositeRefCandidateT< edm::RefVector >::motherRef(), reco::CompositeRefCandidateT< edm::RefVector >::motherRefVector(), reco::CompositeRefCandidateT< D >::numberOfMothers(), and reco::CompositeRefCandidateT< edm::RefVector >::resetMothers().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:51:03 2009 for CMSSW by  doxygen 1.5.4