1 #ifndef PhysicsTools_PatAlgos_plugins_PATCleaner_h 2 #define PhysicsTools_PatAlgos_plugins_PATCleaner_h 40 template<
class PATObjType>
62 template <
class PATObjType>
64 src_(iConfig.getParameter<
edm::InputTag>(
"src")),
74 for (std::vector<std::string>::const_iterator itn = overlapNames.begin(); itn != overlapNames.end(); ++itn) {
78 if (cfg.
empty())
continue;
82 if (algorithm ==
"byDeltaR") {
84 }
else if (algorithm ==
"bySuperClusterSeed") {
87 throw cms::Exception(
"Configuration") <<
"PATCleaner for " <<
src_ <<
": unsupported algorithm '" << algorithm <<
"'\n";
92 produces<std::vector<PATObjType> >();
95 template <
class PATObjType>
104 auto output = std::make_unique<std::vector<PATObjType>>();
108 itov->readInput(iEvent,iSetup);
121 bool badForOverlap =
false;
122 for (
auto& itov : overlapTests_) {
124 bool hasOverlap = itov->fillOverlapsForItem(obj, overlaps);
125 if (hasOverlap && itov->requireNoOverlaps()) {
126 badForOverlap =
true;
129 obj.setOverlaps(itov->name(),
overlaps);
131 if (badForOverlap) {
output->pop_back();
continue; }
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override final
const Selector preselectionCut_
PAT Cleaner module for PAT Objects.
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
std::vector< std::unique_ptr< OverlapTest > > overlapTests_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
pat::helper::OverlapTest OverlapTest
PATCleaner(const edm::ParameterSet &iConfig)
const edm::EDGetTokenT< edm::View< PATObjType > > srcToken_
StringCutObjectSelector< PATObjType > Selector