Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
RecoCaloTools
MetaCollections
interface
CaloRecHitMetaCollectionV.h
Go to the documentation of this file.
1
#ifndef RECOCALOTOOLS_METACOLLECTIONS_CALORECHITMETACOLLECTIONV_H
2
#define RECOCALOTOOLS_METACOLLECTIONS_CALORECHITMETACOLLECTIONV_H 1
3
4
#include "
DataFormats/CaloRecHit/interface/CaloRecHit.h
"
5
#include <iterator>
6
7
8
16
class
CaloRecHitMetaCollectionV
{
17
public
:
18
class
Iterator
{
19
public
:
20
typedef
std::random_access_iterator_tag
iterator_category
;
21
typedef
const
CaloRecHit
&
value_type
;
22
typedef
int
difference_type
;
23
typedef
const
CaloRecHit
&
reference
;
24
typedef
const
CaloRecHit
*
pointer
;
25
typedef
int
offset_type
;
26
27
Iterator
() :
collection_
(0),
offset_
(0) { }
28
Iterator
(
const
Iterator
& it) :
collection_
(it.
collection_
),
offset_
(it.
offset_
) { }
29
Iterator
(
const
CaloRecHitMetaCollectionV
*
col
,
offset_type
pos) :
collection_
(col),
offset_
(pos) { }
30
Iterator
&
operator=
(
const
Iterator
& it) {
collection_
=it.
collection_
;
offset_
=it.
offset_
;
return
(*
this
); }
31
33
reference
operator*
()
const
;
35
pointer
operator->
()
const
;
36
38
bool
operator==
(
const
Iterator
& it)
const
;
40
bool
operator!=
(
const
Iterator
& it)
const
;
41
43
Iterator
&
operator++
();
45
Iterator
operator++
(
int
);
47
Iterator
&
operator--
();
49
Iterator
operator--
(
int
);
50
51
// Random-access iterator requirements
52
reference
operator[]
(
const
difference_type
n
)
const
;
53
Iterator
&
operator+=
(
const
difference_type
n
);
54
Iterator
operator+
(
const
difference_type
n
)
const
;
55
Iterator
&
operator-=
(
const
difference_type
n
);
56
Iterator
operator-
(
const
difference_type
n
)
const
;
57
bool
operator<
(
const
Iterator
&
i
)
const
;
58
59
private
:
60
const
CaloRecHitMetaCollectionV
*
collection_
;
61
offset_type
offset_
;
62
};
63
//
64
// add virtual descructor
65
//
66
virtual
~CaloRecHitMetaCollectionV
() {}
67
typedef
Iterator
const_iterator
;
68
70
virtual
const_iterator
find
(
const
DetId
&
id
)
const
;
71
73
const_iterator
begin
()
const
{
return
const_iterator
(
this
,0); }
75
const_iterator
end
()
const
{
return
const_iterator
(
this
,(
const_iterator::offset_type
)(
size_
)); }
77
unsigned
int
size
()
const
{
return
size_
; }
78
80
virtual
const
CaloRecHit
*
at
(
const_iterator::offset_type
i
)
const
= 0;
81
82
protected
:
83
CaloRecHitMetaCollectionV
();
84
unsigned
int
size_
;
// must be updated by derived classes
85
};
86
87
#endif
CaloRecHitMetaCollectionV
Definition:
CaloRecHitMetaCollectionV.h:16
CaloRecHitMetaCollectionV::find
virtual const_iterator find(const DetId &id) const
find by id (default version is very slow unsorted find)
Definition:
CaloRecHitMetaCollectionV.cc:6
CaloRecHitMetaCollectionV::Iterator::difference_type
int difference_type
Definition:
CaloRecHitMetaCollectionV.h:22
CaloRecHitMetaCollectionV::Iterator::iterator_category
std::random_access_iterator_tag iterator_category
Definition:
CaloRecHitMetaCollectionV.h:20
i
int i
Definition:
DBlmapReader.cc:9
CaloRecHitMetaCollectionV::Iterator::operator+=
Iterator & operator+=(const difference_type n)
Definition:
CaloRecHitMetaCollectionV.cc:57
CaloRecHitMetaCollectionV::Iterator::operator->
pointer operator->() const
pointer operator
Definition:
CaloRecHitMetaCollectionV.cc:17
CaloRecHitMetaCollectionV::Iterator::operator=
Iterator & operator=(const Iterator &it)
Definition:
CaloRecHitMetaCollectionV.h:30
CaloRecHitMetaCollectionV::Iterator::operator==
bool operator==(const Iterator &it) const
comparison operator
Definition:
CaloRecHitMetaCollectionV.cc:22
CaloRecHitMetaCollectionV::Iterator::value_type
const CaloRecHit & value_type
Definition:
CaloRecHitMetaCollectionV.h:21
CaloRecHitMetaCollectionV::Iterator::operator-
Iterator operator-(const difference_type n) const
Definition:
CaloRecHitMetaCollectionV.cc:71
CaloRecHitMetaCollectionV::Iterator::Iterator
Iterator(const Iterator &it)
Definition:
CaloRecHitMetaCollectionV.h:28
CaloRecHitMetaCollectionV::Iterator::operator--
Iterator & operator--()
Reverse-advance the iterator.
Definition:
CaloRecHitMetaCollectionV.cc:41
CaloRecHitMetaCollectionV::Iterator
Definition:
CaloRecHitMetaCollectionV.h:18
CaloRecHitMetaCollectionV::Iterator::pointer
const CaloRecHit * pointer
Definition:
CaloRecHitMetaCollectionV.h:24
CaloRecHitMetaCollectionV::Iterator::operator-=
Iterator & operator-=(const difference_type n)
Definition:
CaloRecHitMetaCollectionV.cc:66
CaloRecHitMetaCollectionV::const_iterator
Iterator const_iterator
Definition:
CaloRecHitMetaCollectionV.h:67
CaloRecHitMetaCollectionV::begin
const_iterator begin() const
get the starting iterator
Definition:
CaloRecHitMetaCollectionV.h:73
CaloRecHitMetaCollectionV::Iterator::operator[]
reference operator[](const difference_type n) const
Definition:
CaloRecHitMetaCollectionV.cc:53
CaloRecHitMetaCollectionV::Iterator::operator*
reference operator*() const
dereference operator
Definition:
CaloRecHitMetaCollectionV.cc:13
CaloRecHitMetaCollectionV::~CaloRecHitMetaCollectionV
virtual ~CaloRecHitMetaCollectionV()
Definition:
CaloRecHitMetaCollectionV.h:66
CaloRecHitMetaCollectionV::Iterator::offset_
offset_type offset_
Definition:
CaloRecHitMetaCollectionV.h:61
CaloRecHitMetaCollectionV::Iterator::operator!=
bool operator!=(const Iterator &it) const
comparison operator
Definition:
CaloRecHitMetaCollectionV.cc:26
CaloRecHit
Definition:
CaloRecHit.h:12
CaloRecHitMetaCollectionV::end
const_iterator end() const
get the ending iterator
Definition:
CaloRecHitMetaCollectionV.h:75
CaloRecHitMetaCollectionV::at
virtual const CaloRecHit * at(const_iterator::offset_type i) const =0
get an item by index
CaloRecHitMetaCollectionV::Iterator::Iterator
Iterator(const CaloRecHitMetaCollectionV *col, offset_type pos)
Definition:
CaloRecHitMetaCollectionV.h:29
CaloRecHitMetaCollectionV::Iterator::Iterator
Iterator()
Definition:
CaloRecHitMetaCollectionV.h:27
CaloRecHitMetaCollectionV::Iterator::collection_
const CaloRecHitMetaCollectionV * collection_
Definition:
CaloRecHitMetaCollectionV.h:60
DetId
Definition:
DetId.h:18
CaloRecHitMetaCollectionV::Iterator::operator++
Iterator & operator++()
Advance the iterator.
Definition:
CaloRecHitMetaCollectionV.cc:30
CaloRecHitMetaCollectionV::CaloRecHitMetaCollectionV
CaloRecHitMetaCollectionV()
Definition:
CaloRecHitMetaCollectionV.cc:3
CaloRecHitMetaCollectionV::Iterator::offset_type
int offset_type
Definition:
CaloRecHitMetaCollectionV.h:25
n
int n
Definition:
DTDataIntegrityTask.cc:31
CaloRecHitMetaCollectionV::size
unsigned int size() const
get the size of the collection
Definition:
CaloRecHitMetaCollectionV.h:77
CaloRecHitMetaCollectionV::Iterator::operator+
Iterator operator+(const difference_type n) const
Definition:
CaloRecHitMetaCollectionV.cc:62
CaloRecHitMetaCollectionV::Iterator::reference
const CaloRecHit & reference
Definition:
CaloRecHitMetaCollectionV.h:23
CaloRecHit.h
CaloRecHitMetaCollectionV::size_
unsigned int size_
Definition:
CaloRecHitMetaCollectionV.h:84
cuy.col
int col
Definition:
cuy.py:1008
CaloRecHitMetaCollectionV::Iterator::operator<
bool operator<(const Iterator &i) const
Definition:
CaloRecHitMetaCollectionV.cc:75
Generated for CMSSW Reference Manual by
1.8.5