1 #ifndef DataFormats_EventHypothesis_interface_EventHypothesisLooper_h 2 #define DataFormats_EventHypothesis_interface_EventHypothesisLooper_h 8 namespace pat {
namespace eventhypothesis {
31 "You can't convert a " <<
typeid(*ptr).name() <<
" to a " <<
typeid(
T).
name() <<
"\n" <<
32 "note: you can use c++filt command to convert the above in human readable types.\n";
63 const T *
get()
const {
return ptr_.get(iter_->second.get()); }
78 size_t index()
const {
return num_; }
80 size_t size()
const {
if (total_ < 0) realSize();
return total_; }
94 operator bool()
const ;
99 template<
typename T2>
bool operator<=(const Looper<T2> &
other)
const {
return iter_ <=
other.iter_; }
101 template<
typename T2>
bool operator<(const Looper<T2> &
other)
const {
return iter_ <
other.iter_; }
109 void realSize()
const ;
110 bool assertOk()
const;
161 ++
num_;
return *
this;
171 if (
num_ < 0)
return *
this;
177 --
num_;
return *
this;
187 std::advance(
this, delta);
197 std::advance(
this, item);
200 std::advance(
this, item);
230 for (; it !=
eh_.
end(); ++it) {
Looper & reset(int item=0)
const T * get(const reco::Candidate *ptr)
Looper & operator++()
iteration
bool isTypeOk() const
test if the type is correct
const T * operator->() const
Accessor as if it was a const_iterator on a list of T.
bool typeOk(const reco::Candidate *ptr)
bool typeOk(const reco::Candidate *ptr)
const CandRefType & ref() const
EDM Ref to pointed particle.
bool operator!=(const Looper< T2 > &other) const
Looper & operator--()
iteration
Looper(const EventHypothesis &eh, const ParticleFilter &filter)
bool operator==(const Looper< T2 > &other) const
returns true if loopers point to the same record
size_t globalIndex()
Index of this item in the full EventHypothesis.
boost::shared_ptr< const ParticleFilter > ParticleFilterPtr
const reco::Candidate & cand() const
C++ reference to pointed particle.
const_iterator end() const
void operator()(void const *) const
const std::string & role() const
Role of pointed item.
size_t index() const
Index of this item among those in the loop.
const T & operator*() const
Accessor as if it was a const_iterator on a list of T.
void doPtr(const reco::Candidate *ptr)
EventHypothesis::const_iterator const_iterator
vector_type::const_iterator const_iterator
bool operator>=(const Looper< T2 > &other) const
Looper & skip(int delta)
skip (might be slow)
Looper< reco::Candidate > CandLooper
const ParticleFilterPtr filter_
const EventHypothesis & eh_
void reset(double vett[256])
const_iterator begin() const
bool operator>(const Looper< T2 > &other) const
size_t size() const
Number of particles in the loop.