1 #ifndef PhysicsTools_PatAlgos_plugins_PATCleaner_h
2 #define PhysicsTools_PatAlgos_plugins_PATCleaner_h
36 #include <boost/ptr_container/ptr_vector.hpp>
40 template<
class PATObjType>
63 template <
class PATObjType>
65 src_(iConfig.getParameter<edm::InputTag>(
"src")),
66 preselectionCut_(iConfig.getParameter<std::string>(
"preselection")),
67 finalCut_(iConfig.getParameter<std::string>(
"finalCut"))
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 std::auto_ptr< std::vector<PATObjType> >
output(
new std::vector<PATObjType>());
107 for (boost::ptr_vector<OverlapTest>::iterator itov = overlapTests_.begin(), edov = overlapTests_.end(); itov != edov; ++itov) {
108 itov->readInput(iEvent,iSetup);
113 if (!preselectionCut_(*it))
continue;
117 output->push_back(*it);
118 PATObjType &
obj = output->back();
121 bool badForOverlap =
false;
122 for (boost::ptr_vector<OverlapTest>::iterator itov = overlapTests_.begin(), edov = overlapTests_.end(); itov != edov; ++itov) {
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; }
134 if (!finalCut_(obj)) output->pop_back();
T getParameter(std::string const &) const
< trclass="colgroup">< tdclass="colgroup"colspan=5 > Ecal cluster collections</td ></tr >< tr >< td >< ahref="classreco_1_1BasicCluster.html"> reco::BasicCluster</a ></td >< td >< ahref="DataFormats_EgammaReco.html"> reco::BasicClusterCollection</a ></td >< td >< ahref="#"> hybridSuperClusters</a ></td >< tdclass="description"> Basic clusters reconstructed with hybrid algorithm(barrel only)</td >< td >S.Rahatlou</td ></tr >< tr >< td >< a href
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
boost::ptr_vector< OverlapTest > overlapTests_
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
PAT Cleaner module for PAT Objects.
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Selector preselectionCut_
pat::helper::OverlapTest OverlapTest
PATCleaner(const edm::ParameterSet &iConfig)
StringCutObjectSelector< PATObjType > Selector