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>
110 :
deltaR2_(config.getParameter<double>(
"deltaR")),
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");
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;
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
TopProjector< PFCandidate, PileUpPFCandidate > TPPFCandidatesOnPileUpPFCandidates
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Ptr< value_type > const & ptr() 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
Ptr< value_type > const & backPtr() const
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)
bool operator()(TopFwdPtr const &top) const
const edm::EDGetTokenT< BottomFwdPtrCollection > tokenBottom_
input tag for the masked collection.
Matcher match_
Matching method.
void setBottom(BottomFwdPtr const &bottom)
RefCore const & refCore() const
TopProjector< PFJet, PFCandidate > TPPFJetsOnPFCandidates
bool get(ProductID const &oid, Handle< PROD > &result) const
This checks a slew of possible overlaps for FwdPtr<Candidate> and derivatives.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool operator()(TopFwdPtr const &top) const
bool isNonnull() const
Checks for non-null.
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
TopProjectorFwdPtrOverlap(edm::ParameterSet const &iConfig)
This checks matching based on delta R.
tuple config
parse the configuration file
edm::FwdPtr< Top > TopFwdPtr
TopProjectorFwdPtrOverlap()
TopProjector< PFTau, PFJet > TPPFTausOnPFJets
TopProjectorDeltaROverlap()
BottomFwdPtr const * bottom_
const bool matchByPtrDirect_
TopProjector< PileUpPFCandidate, PFCandidate > TPPileUpPFCandidatesOnPFCandidates
std::vector< BottomFwdPtr > BottomFwdPtrCollection
TopProjectorDeltaROverlap(edm::ParameterSet const &config)