CMS 3D CMS Logo

SingleElementCollectionSelectorPlusEvent.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_SingleElementCollectionSelectorPlusEvent_h
2 #define RecoAlgos_SingleElementCollectionSelectorPlusEvent_h
3 
20 
21 namespace edm {
22  class Event;
23  class EventSetup;
24 } // namespace edm
25 
26 template <typename InputCollection,
27  typename Selector,
29  typename StoreContainer = typename helper::StoreContainerTrait<OutputCollection>::type,
33  typedef StoreContainer container;
34  typedef typename container::const_iterator const_iterator;
36  : select_(reco::modules::make<Selector>(cfg, iC)) {}
37  const_iterator begin() const { return selected_.begin(); }
38  const_iterator end() const { return selected_.end(); }
40  selected_.clear();
41  for (size_t idx = 0; idx < c->size(); ++idx) {
42  if (select_(edm::Ref<InputCollection>(c, idx), ev)) //(*c)[idx]
44  }
45  }
46 
47 private:
48  StoreContainer selected_;
50  RefAdder addRef_;
51 };
52 
53 #endif
Selector
Functor that operates on <T>
Definition: Selector.h:22
SingleElementCollectionSelectorPlusEvent::select
void select(const edm::Handle< InputCollection > &c, const edm::Event &ev, const edm::EventSetup &)
Definition: SingleElementCollectionSelectorPlusEvent.h:39
SelectionAdderTrait.h
SingleElementCollectionSelectorPlusEvent::begin
const_iterator begin() const
Definition: SingleElementCollectionSelectorPlusEvent.h:37
StoreContainerTrait.h
helper::SelectionAdderTrait
Definition: SelectionAdderTrait.h:80
helper::StoreContainerTrait
Definition: StoreContainerTrait.h:14
modules
Definition: ZHLTMatchFilter.cc:17
edm
HLT enums.
Definition: AlignableModifier.h:19
SingleElementCollectionSelectorPlusEvent::container
StoreContainer container
Definition: SingleElementCollectionSelectorPlusEvent.h:33
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
SelectedOutputCollectionTrait.h
edm::Handle
Definition: AssociativeIterator.h:50
training_settings.idx
idx
Definition: training_settings.py:16
edm::Ref
Definition: AssociativeIterator.h:58
SingleElementCollectionSelectorPlusEvent::const_iterator
container::const_iterator const_iterator
Definition: SingleElementCollectionSelectorPlusEvent.h:34
Event
SingleElementCollectionSelectorPlusEvent::end
const_iterator end() const
Definition: SingleElementCollectionSelectorPlusEvent.h:38
edm::ParameterSet
Definition: ParameterSet.h:36
helper::SelectedOutputCollectionTrait
Definition: SelectedOutputCollectionTrait.h:18
edm::EventSetup
Definition: EventSetup.h:57
SingleElementCollectionSelectorPlusEvent::SingleElementCollectionSelectorPlusEvent
SingleElementCollectionSelectorPlusEvent(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: SingleElementCollectionSelectorPlusEvent.h:35
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
reco::modules::make
S make(const edm::ParameterSet &cfg)
Definition: ParameterAdapter.h:21
looper.cfg
cfg
Definition: looper.py:297
ALCARECOPromptCalibProdSiPixelAli0T_cff.Selector
Selector
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:81
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
SingleElementCollectionSelectorPlusEvent::select_
Selector select_
Definition: SingleElementCollectionSelectorPlusEvent.h:49
SimL1EmulatorRepack_GT2_cff.InputCollection
InputCollection
Definition: SimL1EmulatorRepack_GT2_cff.py:16
SingleElementCollectionSelectorPlusEvent::collection
InputCollection collection
Definition: SingleElementCollectionSelectorPlusEvent.h:32
ParameterAdapter.h
ConsumesCollector.h
EventSetup
SingleElementCollectionSelectorPlusEvent
Definition: SingleElementCollectionSelectorPlusEvent.h:31
edm::Event
Definition: Event.h:73
HLTTauReferences_cfi.OutputCollection
OutputCollection
Definition: HLTTauReferences_cfi.py:92
SingleElementCollectionSelectorPlusEvent::selected_
StoreContainer selected_
Definition: SingleElementCollectionSelectorPlusEvent.h:48
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
SingleElementCollectionSelectorPlusEvent::addRef_
RefAdder addRef_
Definition: SingleElementCollectionSelectorPlusEvent.h:50