This checks a slew of possible overlaps for FwdPtr<Candidate> and derivatives. More...
#include <TopProjector.h>
Public Types | |
typedef edm::FwdPtr< Bottom > | BottomFwdPtr |
typedef edm::FwdPtr< Top > | TopFwdPtr |
Public Member Functions | |
bool | operator() (TopFwdPtr const &top) const |
void | setBottom (BottomFwdPtr const &bottom) |
TopProjectorFwdPtrOverlap () | |
TopProjectorFwdPtrOverlap (edm::ParameterSet const &iConfig) | |
Protected Attributes | |
BottomFwdPtr const * | bottom_ |
This checks a slew of possible overlaps for FwdPtr<Candidate> and derivatives.
Definition at line 42 of file TopProjector.h.
typedef edm::FwdPtr<Bottom> TopProjectorFwdPtrOverlap< Top, Bottom >::BottomFwdPtr |
Definition at line 46 of file TopProjector.h.
typedef edm::FwdPtr<Top> TopProjectorFwdPtrOverlap< Top, Bottom >::TopFwdPtr |
Definition at line 45 of file TopProjector.h.
TopProjectorFwdPtrOverlap< Top, Bottom >::TopProjectorFwdPtrOverlap | ( | ) | [inline, explicit] |
Definition at line 49 of file TopProjector.h.
References TopProjectorFwdPtrOverlap< Top, Bottom >::bottom_.
{bottom_ = 0;}
TopProjectorFwdPtrOverlap< Top, Bottom >::TopProjectorFwdPtrOverlap | ( | edm::ParameterSet const & | iConfig | ) | [inline, explicit] |
Definition at line 51 of file TopProjector.h.
References TopProjectorFwdPtrOverlap< Top, Bottom >::bottom_.
{ bottom_ = 0;}
bool TopProjectorFwdPtrOverlap< Top, Bottom >::operator() | ( | TopFwdPtr const & | top | ) | const [inline] |
Definition at line 55 of file TopProjector.h.
References edm::FwdPtr< T >::backPtr(), TopProjectorFwdPtrOverlap< Top, Bottom >::bottom_, edm::Ptr< T >::isAvailable(), edm::Ptr< T >::isNonnull(), edm::Ptr< T >::key(), edm::FwdPtr< T >::ptr(), and edm::Ptr< T >::refCore().
{ bool topFwdGood = top.ptr().isNonnull() && top.ptr().isAvailable(); bool topBckGood = top.backPtr().isNonnull() && top.backPtr().isAvailable(); bool bottomFwdGood = bottom_->ptr().isNonnull() && bottom_->ptr().isAvailable(); bool bottomBckGood = bottom_->backPtr().isNonnull() && bottom_->backPtr().isAvailable(); bool matched = (topFwdGood && bottomFwdGood && top.ptr().refCore() == bottom_->ptr().refCore() && top.ptr().key() == bottom_->ptr().key()) || (topFwdGood && bottomBckGood && top.ptr().refCore() == bottom_->backPtr().refCore() && top.ptr().key() == bottom_->backPtr().key()) || (topBckGood && bottomFwdGood && top.backPtr().refCore() == bottom_->ptr().refCore() && top.backPtr().key() == bottom_->ptr().key()) || (topBckGood && bottomBckGood && top.backPtr().refCore() == bottom_->backPtr().refCore() && top.backPtr().key() == bottom_->backPtr().key()) ; if ( !matched ) { for ( unsigned isource = 0; isource < top->numberOfSourceCandidatePtrs(); ++isource ) { reco::CandidatePtr const & topSrcPtr = top->sourceCandidatePtr(isource); bool topSrcGood = topSrcPtr.isNonnull() && topSrcPtr.isAvailable(); if ( (topSrcGood && bottomFwdGood && topSrcPtr.refCore() == bottom_->ptr().refCore() && topSrcPtr.key() == bottom_->ptr().key())|| (topSrcGood && bottomBckGood && topSrcPtr.refCore() == bottom_->backPtr().refCore() && topSrcPtr.key() == bottom_->backPtr().key()) ) { matched = true; break; } } } if ( !matched ) { for ( unsigned isource = 0; isource < (*bottom_)->numberOfSourceCandidatePtrs(); ++isource ) { reco::CandidatePtr const & bottomSrcPtr = (*bottom_)->sourceCandidatePtr(isource); bool bottomSrcGood = bottomSrcPtr.isNonnull() && bottomSrcPtr.isAvailable(); if ( (topFwdGood && bottomSrcGood && bottomSrcPtr.refCore() == top.ptr().refCore() && bottomSrcPtr.key() == top.ptr().key() )|| (topBckGood && bottomSrcGood && bottomSrcPtr.refCore() == top.backPtr().refCore() && bottomSrcPtr.key() == top.backPtr().key() ) ) { matched = true; break; } } } return matched; }
void TopProjectorFwdPtrOverlap< Top, Bottom >::setBottom | ( | BottomFwdPtr const & | bottom | ) | [inline] |
Definition at line 53 of file TopProjector.h.
References TopProjectorFwdPtrOverlap< Top, Bottom >::bottom_.
{ bottom_ = ⊥ }
BottomFwdPtr const* TopProjectorFwdPtrOverlap< Top, Bottom >::bottom_ [protected] |
Definition at line 97 of file TopProjector.h.
Referenced by TopProjectorFwdPtrOverlap< Top, Bottom >::operator()(), TopProjectorFwdPtrOverlap< Top, Bottom >::setBottom(), and TopProjectorFwdPtrOverlap< Top, Bottom >::TopProjectorFwdPtrOverlap().