CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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  >
31 class ObjectSelectorProducer : public Base {
32 public:
35  Base(cfg),
36  srcToken_( this-> template consumes<typename Selector::collection>(cfg.template getParameter<edm::InputTag>("src"))),
37  selector_(cfg, this->consumesCollector()),
38  postProcessor_(cfg, this->consumesCollector()) {
39  postProcessor_.init(* this);
40  }
43 
44 private:
46  void produce(edm::Event& evt, const edm::EventSetup& es) override {
47  Init::init(selector_, evt, es);
48  using namespace std;
51  StoreManager manager(source);
52  selector_.select(source, evt, es);
53  manager.cloneAndStore(selector_.begin(), selector_.end(), evt);
55  postProcessor_.process(filtered, evt);
56  }
62  PostProcessor postProcessor_;
63 };
64 
65 
66 #endif
ObjectSelectorProducer(const edm::ParameterSet &cfg)
constructor
PostProcessor postProcessor_
post processor
tuple cfg
Definition: looper.py:293
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
int init
Definition: HydjetWrapper.h:67
edm::EDGetTokenT< typename Selector::collection > srcToken_
source collection label
static const TGPicture * filtered(bool iBackgroundIsBlack)
Selector selector_
Object collection selector.
Functor that operates on &lt;T&gt;
Definition: Selector.h:24
void produce(edm::Event &evt, const edm::EventSetup &es) override
process one event
virtual ~ObjectSelectorProducer()
destructor
static std::string const source
Definition: EdmProvDump.cc:42
def template
Definition: svgfig.py:520