CMS 3D CMS Logo

SingleElementCollectionRefSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_SingleElementCollectionRefSelector_h
2 #define RecoAlgos_SingleElementCollectionRefSelector_h
3 
21 
22 namespace reco {
23  namespace modules {
24  template <typename S>
26  }
27 } // namespace reco
28 namespace edm {
29  class Event;
30  class EventSetup;
31 } // namespace edm
32 
33 template <typename InputType,
34  typename Selector,
35  typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<edm::View<InputType> >::type,
37  typename RefAdder = typename ::helper::SelectionAdderTrait<edm::View<InputType>, StoreContainer>::type>
41  typedef StoreContainer container;
42  typedef Selector selector;
43  typedef typename container::const_iterator const_iterator;
45  : select_(reco::modules::make<Selector>(cfg, iC)) {}
46  const_iterator begin() const { return selected_.begin(); }
47  const_iterator end() const { return selected_.end(); }
49  selected_.clear();
50  for (size_t idx = 0; idx < c->size(); ++idx) {
51  if (select_(c->refAt(idx)))
53  }
54  }
55 
56 private:
59  RefAdder addRef_;
61 };
62 
64 
65 namespace reco {
66  namespace modules {
67  template <typename S>
68  struct SingleElementCollectionRefSelectorEventSetupInit {
69  static void init(S& s, const edm::Event& ev, const edm::EventSetup& es) {
70  typedef typename EventSetupInit<typename S::selector>::type ESI;
71  ESI::init(s.select_, ev, es);
72  }
73  };
74 
75  template <typename I, typename S, typename O, typename C, typename R>
78  };
79  } // namespace modules
80 } // namespace reco
81 
82 #endif
Selector
Functor that operates on <T>
Definition: Selector.h:22
init
int init
Definition: HydjetWrapper.h:64
SelectionAdderTrait.h
StoreContainerTrait.h
SingleElementCollectionRefSelector::collection
InputCollection collection
Definition: SingleElementCollectionRefSelector.h:40
modules
Definition: MuonCleanerBySegments.cc:35
edm
HLT enums.
Definition: AlignableModifier.h:19
SingleElementCollectionRefSelector::addRef_
RefAdder addRef_
Definition: SingleElementCollectionRefSelector.h:59
SingleElementCollectionRefSelector::container
StoreContainer container
Definition: SingleElementCollectionRefSelector.h:41
SingleElementCollectionRefSelector::select_
selector select_
Definition: SingleElementCollectionRefSelector.h:58
reco::modules::EventSetupInit< SingleElementCollectionRefSelector< I, S, O, C, R > >::type
SingleElementCollectionRefSelectorEventSetupInit< SingleElementCollectionRefSelector< I, S, O, C, R > > type
Definition: SingleElementCollectionRefSelector.h:77
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
SelectedOutputCollectionTrait.h
reco::modules::EventSetupInit
Definition: EventSetupInitTrait.h:33
EventSetupInitTrait.h
edm::Handle
Definition: AssociativeIterator.h:50
edm::InputType
InputType
Definition: InputType.h:5
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
SingleElementCollectionRefSelector::InputCollection
edm::View< InputType > InputCollection
Definition: SingleElementCollectionRefSelector.h:39
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Exhume::I
const std::complex< double > I
Definition: I.h:8
Event
edm::View
Definition: CaloClusterFwd.h:14
edm::ParameterSet
Definition: ParameterSet.h:47
SingleElementCollectionRefSelector::select
void select(const edm::Handle< InputCollection > &c, const edm::Event &, const edm::EventSetup &)
Definition: SingleElementCollectionRefSelector.h:48
reco::modules::NoEventSetupInit
take no action (default)
Definition: EventSetupInitTrait.h:19
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
edm::EventSetup
Definition: EventSetup.h:58
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
gen::C
C
Definition: PomwigHadronizer.cc:78
SingleElementCollectionRefSelector::selected_
container selected_
Definition: SingleElementCollectionRefSelector.h:57
SingleElementCollectionRefSelector::SingleElementCollectionRefSelector
SingleElementCollectionRefSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
Definition: SingleElementCollectionRefSelector.h:44
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
reco::modules::SingleElementCollectionRefSelectorEventSetupInit
Definition: SingleElementCollectionRefSelector.h:25
S
Definition: CSCDBL1TPParametersExtended.h:16
SingleElementCollectionRefSelector::end
const_iterator end() const
Definition: SingleElementCollectionRefSelector.h:47
ParameterAdapter.h
ConsumesCollector.h
EventSetup
View.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::Event
Definition: Event.h:73
HLTTauReferences_cfi.OutputCollection
OutputCollection
Definition: HLTTauReferences_cfi.py:92
SingleElementCollectionRefSelector::begin
const_iterator begin() const
Definition: SingleElementCollectionRefSelector.h:46
dttmaxenums::R
Definition: DTTMax.h:29
SingleElementCollectionRefSelector::selector
Selector selector
Definition: SingleElementCollectionRefSelector.h:42
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
SingleElementCollectionRefSelector::const_iterator
container::const_iterator const_iterator
Definition: SingleElementCollectionRefSelector.h:43
reco::modules::SingleElementCollectionRefSelectorEventSetupInit::init
static void init(S &s, const edm::Event &ev, const edm::EventSetup &es)
Definition: SingleElementCollectionRefSelector.h:69
SingleElementCollectionRefSelector
Definition: SingleElementCollectionRefSelector.h:38