CMS 3D CMS Logo

MasterCollectionHelper.h
Go to the documentation of this file.
1 #ifndef CommonTools_UtilAlgos_MasterCollectionHelper_h
2 #define CommonTools_UtilAlgos_MasterCollectionHelper_h
3 /* \class helper::MasterCollection<C>
4  *
5  * differentiate index addressing in case of edm::View
6  * since a View retrieving a collection of reference
7  * would have referece indices (key()) pointing to the master
8  * collection different from reference position into the view
9  *
10  * \author Luca Lista, INFN
11  *
12  * \version $Id: MasterCollectionHelper.h,v 1.1 2009/03/03 13:07:26 llista Exp $
13  *
14  */
19 
20 namespace helper {
21  template<typename C1>
25  handle_(handle) { }
26  size_t size() const { return handle_->size(); }
27  size_t index(size_t i) const { return i; }
28  const edm::Handle<C1> & get() const { return handle_; }
29  ref_type getRef(size_t idx) const { return ref_type(get(), idx); }
30  template<typename R>
31  R getConcreteRef(size_t idx) const { return getRef(idx); }
32  private:
34  };
35 
36  template<typename T>
37  struct MasterCollection<edm::View<T> > {
40  handle_(handle) {
41  if(!handle_->empty()) {
42  ref_ = edm::makeRefToBaseProdFrom(handle_->refAt(0), event);
43  }
44  }
45  size_t size() const {
46  if (ref_.isNull()) return 0;
47  return ref_->size();
48  }
49  size_t index(size_t i) const {
50  return handle_->refAt(i).key();
51  }
52  const edm::RefToBaseProd<T> & get() const { return ref_; }
53  ref_type getRef(size_t idx) const { return ref_type(get(), idx); }
54  template<typename R>
55  R getConcreteRef(size_t idx) const { return getRef(idx).template castTo<R>(); }
56  private:
59  };
60 
61 }
62 
63 #endif
64 
Definition: helper.py:1
ref_type getRef(size_t idx) const
R getConcreteRef(size_t idx) const
MasterCollection(const edm::Handle< edm::View< T > > &handle, edm::Event const &event)
size_t index(size_t i) const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
RefToBaseProd< T > makeRefToBaseProdFrom(RefToBase< T > const &iRef, Event const &iEvent)
HLT enums.
MasterCollection(const edm::Handle< C1 > &handle, edm::Event const &event)
Definition: event.py:1