|
|
Go to the documentation of this file. 1 #ifndef PhysicsTools_PFCandProducer_TopProjector_
2 #define PhysicsTools_PFCandProducer_TopProjector_
40 template <
class Top,
class Bottom>
67 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() &&
101 template <
class Top,
class Bottom>
125 const Top& oTop = *top;
126 float topEta = oTop.eta();
127 float topPhi = oTop.phi();
139 template <
class Top,
class Bottom,
class Matcher = TopProjectorFwdPtrOverlap<Top, Bottom> >
181 template <
class Top,
class Bottom,
class Matcher>
183 : match_(iConfig), enable_(iConfig.getParameter<
bool>(
"enable")) {
192 produces<BottomFwdPtrCollection>();
195 template <
class Top,
class Bottom,
class Matcher>
201 iEvent.getByToken(tokenTop_, tops);
202 std::list<TopFwdPtr> topsList;
204 for (
typename TopFwdPtrCollection::const_iterator ibegin = tops->begin(), iend = tops->end(),
i = ibegin;
i != iend;
206 topsList.push_back(*
i);
220 iEvent.getByToken(tokenBottom_, bottoms);
260 LogDebug(
"TopProjection") <<
" Remaining candidates in the bottom collection ------ ";
262 for (
typename BottomFwdPtrCollection::const_iterator
i = bottoms->begin(), iend = bottoms->end(), ibegin =
i;
266 match_.setBottom(bottom);
267 typename std::list<TopFwdPtr>::iterator
found = topsList.end();
269 found = std::find_if(topsList.begin(), topsList.end(), match_);
273 if (
found != topsList.end()) {
274 LogDebug(
"TopProjection") <<
"X " <<
i - ibegin << **
i;
275 topsList.erase(
found);
280 LogDebug(
"TopProjection") <<
"O " <<
i - ibegin << **
i;
281 pBottomFwdPtrOutput->push_back(bottom);
std::vector< Top > TopCollection
std::string name_
name of the top projection
edm::InputTag inputTagTop_
input tag for the top (masking) collection
edm::Handle< BottomFwdPtrCollection > BottomFwdPtrHandle
This checks a slew of possible overlaps for FwdPtr<Candidate> and derivatives.
BottomFwdPtr const * bottom_
TopProjectorDeltaROverlap(edm::ParameterSet const &config)
bool enable_
enable? if not, all candidates in the bottom collection are copied to the output collection
RefCore const & refCore() const
std::vector< BottomFwdPtr > BottomFwdPtrCollection
edm::Handle< std::vector< Bottom > > BottomHandle
edm::Handle< std::vector< Top > > TopHandle
bool operator()(TopFwdPtr const &top) const
T getUntrackedParameter(std::string const &, T const &) const
Ptr< value_type > const & ptr() const
edm::FwdPtr< Bottom > BottomFwdPtr
TopProjectorDeltaROverlap()
const Bottom * bottomCPtr_
void setBottom(BottomFwdPtr const &bottom)
edm::InputTag inputTagBottom_
input tag for the masked collection.
std::vector< Bottom > BottomCollection
edm::FwdPtr< Bottom > BottomFwdPtr
static const std::string Top
bool operator()(TopFwdPtr const &top) const
std::vector< TopFwdPtr > TopFwdPtrCollection
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
edm::Ptr< Bottom > BottomPtr
TopProjectorFwdPtrOverlap(edm::ParameterSet const &iConfig)
Matcher match_
Matching method.
edm::FwdPtr< Top > TopFwdPtr
T getParameter(std::string const &) const
BottomFwdPtr const * bottom_
edm::EDGetTokenT< TopFwdPtrCollection > tokenTop_
void produce(edm::Event &, const edm::EventSetup &) override
bool isNonnull() const
Checks for non-null.
Ptr< value_type > const & backPtr() const
TopProjector(const edm::ParameterSet &)
edm::EDGetTokenT< BottomFwdPtrCollection > tokenBottom_
edm::Ref< BottomCollection > BottomRef
edm::FwdPtr< Top > TopFwdPtr
void setBottom(BottomFwdPtr const &bottom)
edm::FwdPtr< Top > TopFwdPtr
edm::FwdPtr< Bottom > BottomFwdPtr
This checks matching based on delta R.
TopProjectorFwdPtrOverlap()
edm::Handle< TopFwdPtrCollection > TopFwdPtrHandle