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> >
183 template<
class Top,
class Bottom,
class Matcher >
186 enable_(iConfig.getParameter<bool>(
"enable")) {
193 produces< BottomFwdPtrCollection > ();
197 template<
class Top,
class Bottom,
class Matcher >
205 std::list< TopFwdPtr > topsList;
207 for (
typename TopFwdPtrCollection::const_iterator ibegin = tops->begin(),
208 iend = tops->end(),
i = ibegin;
i != iend; ++
i ) {
209 topsList.push_back( *
i );
227 iEvent.
getByLabel( inputTagBottom_, bottoms );
268 std::auto_ptr< BottomFwdPtrCollection >
271 LogDebug(
"TopProjection")<<
" Remaining candidates in the bottom collection ------ ";
273 for(
typename BottomFwdPtrCollection::const_iterator
i=bottoms->begin(),
274 iend = bottoms->end(), ibegin =
i;
i != iend; ++
i) {
277 match_.setBottom(bottom);
278 typename std::list< TopFwdPtr >::iterator
found = topsList.end();
280 found = std::find_if( topsList.begin(), topsList.end(), match_ );
284 if( found != topsList.end() ) {
285 LogDebug(
"TopProjection")<<
"X "<<
i-ibegin << **
i;
286 topsList.erase(found);
291 LogDebug(
"TopProjection")<<
"O "<<
i-ibegin << **
i;
292 pBottomFwdPtrOutput->push_back( bottom );
296 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
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::FwdPtr< Top > TopFwdPtr
Ptr< value_type > const & backPtr() const
TopProjector(const edm::ParameterSet &)
static const std::string Top
std::vector< Top > TopCollection
bool isNonnull() const
Checks for non-null.
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)
This checks a slew of possible overlaps for FwdPtr<Candidate> and derivatives.
RefCore const & refCore() const
bool operator()(TopFwdPtr const &top) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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::Handle< std::vector< Bottom > > BottomHandle
edm::Handle< std::vector< Top > > TopHandle
std::vector< BottomFwdPtr > BottomFwdPtrCollection
TopProjectorDeltaROverlap(edm::ParameterSet const &config)