37 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() &&
102 template <
class Top,
class Bottom>
126 const Top& oTop = *top;
127 float topEta = oTop.eta();
128 float topPhi = oTop.phi();
140 template <
class Top,
class Bottom,
class Matcher = TopProjectorFwdPtrOverlap<Top, Bottom>>
176 template <
class Top,
class Bottom,
class Matcher>
179 enable_(iConfig.getParameter<
bool>(
"enable")),
180 name_(iConfig.getUntrackedParameter<
std::
string>(
"name",
"No Name")),
185 produces<BottomFwdPtrCollection>();
188 template <
class Top,
class Bottom,
class Matcher>
191 psD.
add<
bool>(
"enable");
193 psD.
add<
double>(
"deltaR");
198 psD.
add<
bool>(
"matchByPtrDirect",
false)->setComment(
"fast check by ptr() only");
199 desc.addWithDefaultLabel(psD);
202 template <
class Top,
class Bottom,
class Matcher>
207 auto const& tops =
iEvent.get(tokenTop_);
208 std::list<TopFwdPtr> topsList;
210 for (
auto const& top : tops) {
211 topsList.push_back(top);
216 auto const& bottoms =
iEvent.get(tokenBottom_);
222 LogDebug(
"TopProjection") <<
" Remaining candidates in the bottom collection ------ ";
225 for (
auto const& bottom : bottoms) {
227 match_.setBottom(bottom);
228 auto found = topsList.end();
230 found = std::find_if(topsList.begin(), topsList.end(), match_);
234 if (
found != topsList.end()) {
235 LogDebug(
"TopProjection") <<
"X " << iB << *bottom;
236 topsList.erase(
found);
241 LogDebug(
"TopProjection") <<
"O " << iB << *bottom;
242 pBottomFwdPtrOutput->push_back(bottom);
251 using namespace reco;
TopProjector< PFCandidate, PileUpPFCandidate > TPPFCandidatesOnPileUpPFCandidates
bool operator()(TopFwdPtr const &top) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
const bool enable_
enable? if not, all candidates in the bottom collection are copied to the output collection ...
edm::FwdPtr< Bottom > BottomFwdPtr
#define DEFINE_FWK_MODULE(type)
std::vector< TopFwdPtr > TopFwdPtrCollection
const Bottom * bottomCPtr_
BottomFwdPtr const * bottom_
TopProjector< IsolatedPFCandidate, PFCandidate > TPIsolatedPFCandidatesOnPFCandidates
std::vector< Bottom > BottomCollection
void setBottom(BottomFwdPtr const &bottom)
~TopProjector() override=default
TopProjector< PFCandidate, PFCandidate > TPPFCandidatesOnPFCandidates
edm::FwdPtr< Top > TopFwdPtr
const std::string name_
name of the top projection
TopProjector(const edm::ParameterSet &)
static const std::string Top
std::vector< Top > TopCollection
void produce(edm::Event &, const edm::EventSetup &) override
edm::FwdPtr< Top > TopFwdPtr
edm::FwdPtr< Bottom > BottomFwdPtr
TopProjector< PFTau, PFJet, TopProjectorDeltaROverlap< PFTau, PFJet > > TPPFTausOnPFJetsDeltaR
edm::FwdPtr< Bottom > BottomFwdPtr
const edm::EDGetTokenT< TopFwdPtrCollection > tokenTop_
input tag for the top (masking) collection
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< BottomFwdPtrCollection > tokenBottom_
input tag for the masked collection.
bool isNonnull() const
Checks for non-null.
Matcher match_
Matching method.
void setBottom(BottomFwdPtr const &bottom)
TopProjector< PFJet, PFCandidate > TPPFJetsOnPFCandidates
This checks a slew of possible overlaps for FwdPtr<Candidate> and derivatives.
Ptr< value_type > const & backPtr() const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
TopProjectorFwdPtrOverlap(edm::ParameterSet const &iConfig)
This checks matching based on delta R.
RefCore const & refCore() const
edm::FwdPtr< Top > TopFwdPtr
bool operator()(TopFwdPtr const &top) const
TopProjectorFwdPtrOverlap()
TopProjector< PFTau, PFJet > TPPFTausOnPFJets
TopProjectorDeltaROverlap()
Ptr< value_type > const & ptr() const
virtual CandidatePtr sourceCandidatePtr(size_type i) const
BottomFwdPtr const * bottom_
const bool matchByPtrDirect_
TopProjector< PileUpPFCandidate, PFCandidate > TPPileUpPFCandidatesOnPFCandidates
std::vector< BottomFwdPtr > BottomFwdPtrCollection
TopProjectorDeltaROverlap(edm::ParameterSet const &config)