CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SingleElementCollectionRefSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_SingleElementCollectionRefSelector_h
2 #define RecoAlgos_SingleElementCollectionRefSelector_h
3 
20 namespace reco {
21  namespace modules {
23  }
24 }
25 template<typename InputType, typename Selector,
26  typename OutputCollection = typename ::helper::SelectedOutputCollectionTrait<edm::View<InputType> >::type,
28  typename RefAdder = typename ::helper::SelectionAdderTrait<edm::View<InputType>, StoreContainer>::type>
32  typedef StoreContainer container;
33  typedef Selector selector;
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_(c->refAt(idx))) addRef_(selected_, c, idx);
43  }
44  }
45 private:
48  RefAdder addRef_;
50 };
51 
53 
54 namespace reco {
55  namespace modules {
56  template<typename S>
57  struct SingleElementCollectionRefSelectorEventSetupInit {
58  static void init(S & s, const edm::Event & ev, const edm::EventSetup& es) {
59  typedef typename EventSetupInit<typename S::selector>::type ESI;
60  ESI::init(s.select_, ev, es);
61  }
62  };
63 
64  template<typename I, typename S, typename O, typename C, typename R>
67  };
68  }
69 }
70 
71 #endif
72 
type
Definition: HCALResponse.h:21
SingleElementCollectionRefSelectorEventSetupInit< SingleElementCollectionRefSelector< I, S, O, C, R > > type
InputType
Definition: InputType.h:5
tuple cfg
Definition: looper.py:259
int init
Definition: HydjetWrapper.h:67
S make(const edm::ParameterSet &cfg)
bool ev
take no action (default)
void select(const edm::Handle< InputCollection > &c, const edm::Event &, const edm::EventSetup &)
const std::complex< double > I
Definition: I.h:8
Functor that operates on &lt;T&gt;
Definition: Selector.h:24
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
SingleElementCollectionRefSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
static void init(S &s, const edm::Event &ev, const edm::EventSetup &es)