CMS 3D CMS Logo

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  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);
50  StoreManager manager(source);
51  selector_.select(source, evt, es);
52  manager.cloneAndStore(selector_.begin(), selector_.end(), evt);
54  postProcessor_.process(filtered, evt);
55  }
61  PostProcessor postProcessor_;
62 };
63 
64 #endif
Selector
Functor that operates on <T>
Definition: Selector.h:22
init
int init
Definition: HydjetWrapper.h:64
ObjectSelectorProducer::selector_
Selector selector_
Object collection selector.
Definition: ObjectSelectorProducer.h:59
edm::EDGetTokenT< typename Selector::collection >
edm
HLT enums.
Definition: AlignableModifier.h:19
NullPostProcessor.h
ObjectSelectorProducer::produce
void produce(edm::Event &evt, const edm::EventSetup &es) override
process one event
Definition: ObjectSelectorProducer.h:46
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
SelectedOutputCollectionTrait.h
EventSetupInitTrait.h
edm::Handle
Definition: AssociativeIterator.h:50
CustomConfigs.Base
def Base(process)
Definition: CustomConfigs.py:17
ObjectSelectorProducer::~ObjectSelectorProducer
~ObjectSelectorProducer() override
destructor
Definition: ObjectSelectorProducer.h:42
ObjectSelectorProducer::ObjectSelectorProducer
ObjectSelectorProducer(const edm::ParameterSet &cfg)
constructor
Definition: ObjectSelectorProducer.h:33
source
static const std::string source
Definition: EdmProvDump.cc:47
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ObjectSelectorProducer::postProcessor_
PostProcessor postProcessor_
post processor
Definition: ObjectSelectorProducer.h:61
StoreManagerTrait.h
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
filtered
static const TGPicture * filtered(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:100
edm::EventSetup
Definition: EventSetup.h:57
svgfig.template
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
InputTag.h
looper.cfg
cfg
Definition: looper.py:297
ObjectSelectorProducer::srcToken_
edm::EDGetTokenT< typename Selector::collection > srcToken_
source collection label
Definition: ObjectSelectorProducer.h:57
ALCARECOPromptCalibProdSiPixelAli0T_cff.Selector
Selector
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:81
edm::OrphanHandle
Definition: EDProductfwd.h:39
ObjectSelectorProducer
Definition: ObjectSelectorProducer.h:30
ConsumesCollector.h
ParameterSet.h
edm::Event
Definition: Event.h:73
HLTTauReferences_cfi.OutputCollection
OutputCollection
Definition: HLTTauReferences_cfi.py:92