|
|
Go to the documentation of this file. 1 #ifndef CommonTools_ParticleFlow_TopProjector_
2 #define CommonTools_ParticleFlow_TopProjector_
40 template <
class Top,
class Bottom>
70 for (
unsigned isource = 0; isource < top->numberOfSourceCandidatePtrs(); ++isource) {
83 for (
unsigned isource = 0; isource < (*bottom_)->numberOfSourceCandidatePtrs(); ++isource) {
86 if ((topFwdGood && bottomSrcGood && bottomSrcPtr.
refCore() == top.
ptr().
refCore() &&
105 template <
class Top,
class Bottom>
129 const Top& oTop = *top;
130 float topEta = oTop.eta();
131 float topPhi = oTop.phi();
143 template <
class Top,
class Bottom,
class Matcher = TopProjectorFwdPtrOverlap<Top, Bottom>>
179 template <
class Top,
class Bottom,
class Matcher>
182 enable_(iConfig.getParameter<
bool>(
"enable")),
183 name_(iConfig.getUntrackedParameter<
std::
string>(
"name",
"No Name")),
188 produces<BottomFwdPtrCollection>();
191 template <
class Top,
class Bottom,
class Matcher>
194 psD.
add<
bool>(
"enable");
196 psD.
add<
double>(
"deltaR");
201 psD.
add<
bool>(
"matchByPtrDirect",
false)->setComment(
"fast check by ptr() only");
202 desc.addWithDefaultLabel(psD);
205 template <
class Top,
class Bottom,
class Matcher>
210 auto const& tops =
iEvent.get(tokenTop_);
211 std::list<TopFwdPtr> topsList;
213 for (
auto const& top : tops) {
214 topsList.push_back(top);
219 auto const& bottoms =
iEvent.get(tokenBottom_);
225 LogDebug(
"TopProjection") <<
" Remaining candidates in the bottom collection ------ ";
228 for (
auto const& bottom : bottoms) {
230 match_.setBottom(bottom);
231 auto found = topsList.end();
233 found = std::find_if(topsList.begin(), topsList.end(), match_);
237 if (
found != topsList.end()) {
238 LogDebug(
"TopProjection") <<
"X " << iB << *bottom;
239 topsList.erase(
found);
244 LogDebug(
"TopProjection") <<
"O " << iB << *bottom;
245 pBottomFwdPtrOutput->push_back(bottom);
std::vector< Top > TopCollection
ParameterDescriptionBase * add(U const &iLabel, T const &value)
This checks a slew of possible overlaps for FwdPtr<Candidate> and derivatives.
BottomFwdPtr const * bottom_
TopProjectorDeltaROverlap(edm::ParameterSet const &config)
const std::string name_
name of the top projection
RefCore const & refCore() const
std::vector< BottomFwdPtr > BottomFwdPtrCollection
bool operator()(TopFwdPtr const &top) const
Ptr< value_type > const & ptr() const
edm::FwdPtr< Bottom > BottomFwdPtr
TopProjectorDeltaROverlap()
const Bottom * bottomCPtr_
void setBottom(BottomFwdPtr const &bottom)
const bool enable_
enable? if not, all candidates in the bottom collection are copied to the output collection
std::vector< Bottom > BottomCollection
edm::FwdPtr< Bottom > BottomFwdPtr
static const std::string Top
bool operator()(TopFwdPtr const &top) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::vector< TopFwdPtr > TopFwdPtrCollection
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const bool matchByPtrDirect_
TopProjectorFwdPtrOverlap(edm::ParameterSet const &iConfig)
Matcher match_
Matching method.
edm::FwdPtr< Top > TopFwdPtr
BottomFwdPtr const * bottom_
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::FwdPtr< Top > TopFwdPtr
const edm::EDGetTokenT< BottomFwdPtrCollection > tokenBottom_
input tag for the masked collection.
void setBottom(BottomFwdPtr const &bottom)
edm::FwdPtr< Top > TopFwdPtr
const edm::EDGetTokenT< TopFwdPtrCollection > tokenTop_
input tag for the top (masking) collection
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::FwdPtr< Bottom > BottomFwdPtr
This checks matching based on delta R.
TopProjectorFwdPtrOverlap()