1 #ifndef PhysicsTools_PFCandProducer_TopProjector_
2 #define PhysicsTools_PFCandProducer_TopProjector_
41 template <
class Top,
class Bottom>
68 for (
unsigned isource = 0; isource < top->numberOfSourceCandidatePtrs(); ++isource ) {
80 for (
unsigned isource = 0; isource < (*bottom_)->numberOfSourceCandidatePtrs(); ++isource ) {
83 if ( (topFwdGood && bottomSrcGood && bottomSrcPtr.
refCore() == top.
ptr().
refCore() && bottomSrcPtr.
key() == top.
ptr().
key() )||
103 template <
class Top,
class Bottom>
112 deltaR2_( config.getParameter<double>(
"deltaR") ),
124 const Top& oTop = *top;
float topEta = oTop.eta();
float topPhi = oTop.phi();
136 template<
class Top,
class Bottom,
class Matcher = TopProjectorFwdPtrOverlap<Top,Bottom> >
185 template<
class Top,
class Bottom,
class Matcher >
188 enable_(iConfig.getParameter<bool>(
"enable")) {
197 produces< BottomFwdPtrCollection > ();
201 template<
class Top,
class Bottom,
class Matcher >
209 std::list< TopFwdPtr > topsList;
211 for (
typename TopFwdPtrCollection::const_iterator ibegin = tops->begin(),
212 iend = tops->end(),
i = ibegin;
i != iend; ++
i ) {
213 topsList.push_back( *
i );
272 std::auto_ptr< BottomFwdPtrCollection >
275 LogDebug(
"TopProjection")<<
" Remaining candidates in the bottom collection ------ ";
277 for(
typename BottomFwdPtrCollection::const_iterator
i=bottoms->begin(),
278 iend = bottoms->end(), ibegin =
i;
i != iend; ++
i) {
281 match_.setBottom(bottom);
282 typename std::list< TopFwdPtr >::iterator
found = topsList.end();
284 found = std::find_if( topsList.begin(), topsList.end(), match_ );
288 if( found != topsList.end() ) {
289 LogDebug(
"TopProjection")<<
"X "<<
i-ibegin << **
i;
290 topsList.erase(found);
295 LogDebug(
"TopProjection")<<
"O "<<
i-ibegin << **
i;
296 pBottomFwdPtrOutput->push_back( bottom );
300 iEvent.
put( pBottomFwdPtrOutput );
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void produce(edm::Event &, const edm::EventSetup &)
Ptr< value_type > const & ptr() const
edm::Handle< BottomFwdPtrCollection > BottomFwdPtrHandle
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::FwdPtr< Bottom > BottomFwdPtr
std::vector< TopFwdPtr > TopFwdPtrCollection
const Bottom * bottomCPtr_
edm::Ptr< Bottom > BottomPtr
BottomFwdPtr const * bottom_
std::vector< Bottom > BottomCollection
void setBottom(BottomFwdPtr const &bottom)
edm::Handle< TopFwdPtrCollection > TopFwdPtrHandle
edm::EDGetTokenT< BottomFwdPtrCollection > tokenBottom_
edm::FwdPtr< Top > TopFwdPtr
Ptr< value_type > const & backPtr() const
TopProjector(const edm::ParameterSet &)
static const std::string Top
std::vector< Top > TopCollection
edm::FwdPtr< Top > TopFwdPtr
edm::FwdPtr< Bottom > BottomFwdPtr
edm::FwdPtr< Bottom > BottomFwdPtr
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool operator()(TopFwdPtr const &top) const
Matcher match_
Matching method.
void setBottom(BottomFwdPtr const &bottom)
RefCore const & refCore() const
This checks a slew of possible overlaps for FwdPtr<Candidate> and derivatives.
bool operator()(TopFwdPtr const &top) const
bool isNonnull() const
Checks for non-null.
bool enable_
enable? if not, all candidates in the bottom collection are copied to the output collection ...
TopProjectorFwdPtrOverlap(edm::ParameterSet const &iConfig)
This checks matching based on delta R.
edm::InputTag inputTagBottom_
input tag for the masked collection.
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
edm::Ref< BottomCollection > BottomRef
std::string name_
name of the top projection
edm::FwdPtr< Top > TopFwdPtr
TopProjectorFwdPtrOverlap()
edm::InputTag inputTagTop_
input tag for the top (masking) collection
TopProjectorDeltaROverlap()
BottomFwdPtr const * bottom_
edm::EDGetTokenT< TopFwdPtrCollection > tokenTop_
edm::Handle< std::vector< Bottom > > BottomHandle
edm::Handle< std::vector< Top > > TopHandle
std::vector< BottomFwdPtr > BottomFwdPtrCollection
TopProjectorDeltaROverlap(edm::ParameterSet const &config)