CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ObjectSelectorProducer.h
Go to the documentation of this file.
1 #ifndef CommonTools_UtilAlgos_ObjectSelectorProducer_h
2 #define CommonTools_UtilAlgos_ObjectSelectorProducer_h
3 
12 #include <utility>
13 #include <vector>
14 #include <memory>
15 #include <algorithm>
16 
24 template <typename Selector,
25  typename OutputCollection,
26  typename PostProcessor,
27  typename StoreManager,
28  typename Base,
29  typename Init>
30 class ObjectSelectorProducer : public Base {
31 public:
34  : Base(cfg),
35  srcToken_(
36  this->template consumes<typename Selector::collection>(cfg.template getParameter<edm::InputTag>("src"))),
37  selectorInit_(this->consumesCollector()),
38  selector_(cfg, this->consumesCollector()),
39  postProcessor_(cfg, this->consumesCollector()) {
40  postProcessor_.init(*this);
41  }
44 
45 private:
47  void produce(edm::Event& evt, const edm::EventSetup& es) override {
48  selectorInit_.init(selector_, evt, es);
50  evt.getByToken(srcToken_, source);
51  StoreManager manager(source);
52  selector_.select(source, evt, es);
53  manager.cloneAndStore(selector_.begin(), selector_.end(), evt);
55  postProcessor_.process(filtered, evt);
56  }
63  PostProcessor postProcessor_;
64 };
65 
66 #endif
ObjectSelectorProducer(const edm::ParameterSet &cfg)
constructor
PostProcessor postProcessor_
post processor
tuple cfg
Definition: looper.py:296
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< typename Selector::collection > srcToken_
source collection label
static const TGPicture * filtered(bool iBackgroundIsBlack)
Functor that operates on &lt;T&gt;
Definition: Selector.h:22
void produce(edm::Event &evt, const edm::EventSetup &es) override
process one event
~ObjectSelectorProducer() override
destructor
static std::string const source
Definition: EdmProvDump.cc:46
def template
Definition: svgfig.py:521
Init selectorInit_
Object collection selector.