#include <TopProjectorAlgo.h>
Public Types | |
typedef std::vector< Bottom > | BottomCollection |
typedef edm::Handle < std::vector< Bottom > > | BottomHandle |
typedef edm::Ptr< Bottom > | BottomPtr |
typedef std::vector< Top > | TopCollection |
typedef edm::Handle < std::vector< Top > > | TopHandle |
Public Member Functions | |
BottomCollection | produce (const TopHandle &topHandle, const BottomHandle &bottomHandle, const edm::EventBase &iEvent) |
TopProjectorAlgo (const edm::ParameterSet &) | |
~TopProjectorAlgo () | |
Private Member Functions | |
void | maskAncestors (const reco::CandidatePtrVector &ancestors, std::vector< bool > &masked) const |
void | printAncestors (const reco::CandidatePtrVector &ancestors, const edm::Handle< std::vector< Bottom > > &allPFCandidates) const |
void | processCollection (const edm::Handle< std::vector< Top > > &handle, const edm::Handle< std::vector< Bottom > > &allPFCandidates, std::vector< bool > &masked, const char *objectName, const edm::EventBase &iEvent) const |
void | ptrToAncestor (reco::CandidatePtr candRef, reco::CandidatePtrVector &ancestors, const edm::ProductID &ancestorsID, const edm::EventBase &iEvent) const |
Private Attributes | |
std::string | name_ |
bool | verbose_ |
verbose ? |
Definition at line 36 of file TopProjectorAlgo.h.
typedef std::vector<Bottom> pf2pat::TopProjectorAlgo< Top, Bottom >::BottomCollection |
Definition at line 42 of file TopProjectorAlgo.h.
typedef edm::Handle< std::vector<Bottom> > pf2pat::TopProjectorAlgo< Top, Bottom >::BottomHandle |
Definition at line 43 of file TopProjectorAlgo.h.
typedef edm::Ptr<Bottom> pf2pat::TopProjectorAlgo< Top, Bottom >::BottomPtr |
Definition at line 44 of file TopProjectorAlgo.h.
typedef std::vector<Top> pf2pat::TopProjectorAlgo< Top, Bottom >::TopCollection |
Definition at line 40 of file TopProjectorAlgo.h.
typedef edm::Handle< std::vector<Top> > pf2pat::TopProjectorAlgo< Top, Bottom >::TopHandle |
Definition at line 41 of file TopProjectorAlgo.h.
TopProjectorAlgo::TopProjectorAlgo | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 96 of file TopProjectorAlgo.h.
References edm::ParameterSet::getUntrackedParameter().
{ verbose_ = iConfig.getUntrackedParameter<bool>("verbose",false); name_ = iConfig.getUntrackedParameter<std::string>("name","No Name"); }
pf2pat::TopProjectorAlgo< Top, Bottom >::~TopProjectorAlgo | ( | ) | [inline] |
Definition at line 48 of file TopProjectorAlgo.h.
{};
void TopProjectorAlgo::maskAncestors | ( | const reco::CandidatePtrVector & | ancestors, |
std::vector< bool > & | masked | ||
) | const [private] |
ancestors is a RefToBase vector. For each object in this vector get the index and set the corresponding slot to true in the masked vector
Definition at line 282 of file TopProjectorAlgo.h.
References i, getHLTprescales::index, and edm::PtrVectorBase::size().
void TopProjectorAlgo::printAncestors | ( | const reco::CandidatePtrVector & | ancestors, |
const edm::Handle< std::vector< Bottom > > & | allPFCandidates | ||
) | const [private] |
Definition at line 219 of file TopProjectorAlgo.h.
References gather_cfg::cout, i, edm::PtrVectorBase::id(), getHLTprescales::index, and edm::PtrVectorBase::size().
void TopProjectorAlgo::processCollection | ( | const edm::Handle< std::vector< Top > > & | handle, |
const edm::Handle< std::vector< Bottom > > & | allPFCandidates, | ||
std::vector< bool > & | masked, | ||
const char * | objectName, | ||
const edm::EventBase & | iEvent | ||
) | const [private] |
Definition at line 174 of file TopProjectorAlgo.h.
References gather_cfg::cout, i, edm::PtrVectorBase::id(), iEvent, and benchmark_cfg::topCollection.
{ if( tops.isValid() && bottoms.isValid() ) { const std::vector<Top>& topCollection = *tops; if(verbose_) std::cout<<" processing: "<<objectName <<" size = "<<topCollection.size()<<std::endl; for(unsigned i=0; i<topCollection.size(); i++) { edm::Ptr<Top> ptr( tops, i); reco::CandidatePtr basePtr( ptr ); reco::CandidatePtrVector ancestors; ptrToAncestor( basePtr, ancestors, bottoms.id(), iEvent ); if(verbose_) { /* std::cout<<"\t"<<objectName<<" "<<i */ /* <<" pt,eta,phi = " */ /* <<basePtr->pt()<<"," */ /* <<basePtr->eta()<<"," */ /* <<basePtr->phi()<<std::endl; */ std::cout<<"\t"<<topCollection[i]<<std::endl; printAncestors( ancestors, bottoms ); } maskAncestors( ancestors, masked ); } } }
BottomCollection pf2pat::TopProjectorAlgo< Top, Bottom >::produce | ( | const TopHandle & | topHandle, |
const BottomHandle & | bottomHandle, | ||
const edm::EventBase & | iEvent | ||
) |
void TopProjectorAlgo::ptrToAncestor | ( | reco::CandidatePtr | candRef, |
reco::CandidatePtrVector & | ancestors, | ||
const edm::ProductID & | ancestorsID, | ||
const edm::EventBase & | iEvent | ||
) | const [private] |
fills ancestors with ptrs to the PFCandidates that in one way or another contribute to the candidate pointed to by candPtr
Definition at line 241 of file TopProjectorAlgo.h.
References i, and edm::PtrVector< T >::push_back().
{ unsigned nSources = candPtr->numberOfSourceCandidatePtrs(); /* if(verbose_) { */ /* const Provenance& hereProv = iEvent.getProvenance(candPtr.id()); */ /* cout<<"going down from "<<candPtr.id() */ /* <<"/"<<candPtr.key()<<" #mothers "<<nSources */ /* <<" ancestor id "<<ancestorsID<<endl */ /* <<hereProv.branchDescription()<<endl; */ /* } */ for(unsigned i=0; i<nSources; i++) { CandidatePtr mother = candPtr->sourceCandidatePtr(i); /* if( verbose_ ) { */ /* const Provenance& motherProv = iEvent.getProvenance(mother.id()); */ /* cout<<" mother id "<<mother.id()<<endl */ /* <<motherProv<<endl; */ /* } */ if( mother.id() != ancestorsID ) { // the mother is not yet at lowest level ptrToAncestor( mother, ancestors, ancestorsID, iEvent ); } else { // adding mother to the list of ancestors ancestors.push_back( mother ); } } }
std::string pf2pat::TopProjectorAlgo< Top, Bottom >::name_ [private] |
Definition at line 88 of file TopProjectorAlgo.h.
bool pf2pat::TopProjectorAlgo< Top, Bottom >::verbose_ [private] |
verbose ?
Definition at line 85 of file TopProjectorAlgo.h.