ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArRawConditions
LArRawConditions
LArConditionsChannelSet.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
15
16
#ifndef LARRAWCONDITIONS_LARCONDITIONSCHANNELSET_H
17
#define LARRAWCONDITIONS_LARCONDITIONSCHANNELSET_H
32
33
#include <vector>
34
35
template
<
class
T>
36
class
LArConditionsChannelSet
37
{
38
public
:
39
41
typedef
unsigned
int
ChannelId
;
42
typedef
typename
std::pair<ChannelId, T>
ChanIdTPair
;
43
typedef
typename
std::vector<ChanIdTPair>
ChannelVector
;
44
typedef
typename
ChannelVector::const_iterator
ConstChannelIt
;
45
typedef
typename
ChannelVector::iterator
ChannelIt
;
46
48
LArConditionsChannelSet
( );
49
51
virtual
~LArConditionsChannelSet
();
52
54
ConstChannelIt
find
(
ChannelId
id
)
const
;
55
57
ConstChannelIt
begin
()
const
;
58
ConstChannelIt
end
()
const
;
59
61
size_t
size
()
const
;
62
63
66
void
insert
(
ChannelId
id
,
const
T& cond);
67
68
private
:
69
70
class
PairSort
71
{
72
public
:
73
bool
operator ()
(
const
ChanIdTPair
&
x
,
const
ChanIdTPair
&
y
)
74
{
75
return
(
x
.first <
y
.first);
76
}
77
bool
operator ()
(
const
ChanIdTPair
&
x
,
const
unsigned
int
&
id
)
78
{
79
return
(
x
.first <
id
);
80
}
81
};
82
83
ChannelVector
m_channelVec
;
84
};
85
86
87
// INLINE FUNCTIONS
88
89
90
template
<
class
T>
91
inline
92
LArConditionsChannelSet<T>::LArConditionsChannelSet
( )
93
{}
94
95
96
template
<
class
T>
97
inline
98
LArConditionsChannelSet<T>::~LArConditionsChannelSet
()
99
{}
100
101
102
template
<
class
T>
103
inline
104
typename
LArConditionsChannelSet<T>::ConstChannelIt
105
LArConditionsChannelSet<T>::find
(
ChannelId
id
)
const
106
{
107
ConstChannelIt
result = std::lower_bound(
m_channelVec
.begin(),
108
m_channelVec
.end(),
109
id
,
110
PairSort
());
111
112
if
(result ==
m_channelVec
.end())
return
(result);
113
if
((*result).first ==
id
) {
114
return
(result);
115
}
else
{
116
return
m_channelVec
.end() ;
117
}
118
}
119
120
121
122
template
<
class
T>
123
inline
124
typename
LArConditionsChannelSet<T>::ConstChannelIt
125
LArConditionsChannelSet<T>::begin
()
const
126
{
127
return
(
m_channelVec
.begin());
128
}
129
130
template
<
class
T>
131
inline
132
typename
LArConditionsChannelSet<T>::ConstChannelIt
133
LArConditionsChannelSet<T>::end
()
const
134
{
135
return
(
m_channelVec
.end());
136
}
137
138
139
140
template
<
class
T>
141
inline
142
size_t
143
LArConditionsChannelSet<T>::size
()
const
144
{
145
return
(
m_channelVec
.size());
146
}
147
148
template
<
class
T>
149
inline
150
void
151
LArConditionsChannelSet<T>::insert
(
ChannelId
id
,
const
T& cond)
152
{
153
m_channelVec
.push_back(
ChanIdTPair
(
id
,cond));
154
std::sort
(
m_channelVec
.begin(),
m_channelVec
.end(),
PairSort
());
155
}
156
157
#endif
// LARRAWCONDITIONS_LARCONDITIONSCHANNELSET_H
y
#define y
x
#define x
LArConditionsChannelSet::PairSort
Definition
LArConditionsChannelSet.h:71
LArConditionsChannelSet::PairSort::operator()
bool operator()(const ChanIdTPair &x, const ChanIdTPair &y)
Definition
LArConditionsChannelSet.h:73
LArConditionsChannelSet::ChannelId
unsigned int ChannelId
Public typedefs.
Definition
LArConditionsChannelSet.h:41
LArConditionsChannelSet::ChannelVector
std::vector< ChanIdTPair > ChannelVector
Definition
LArConditionsChannelSet.h:43
LArConditionsChannelSet::size
size_t size() const
Size of channel set.
Definition
LArConditionsChannelSet.h:143
LArConditionsChannelSet::insert
void insert(ChannelId id, const T &cond)
Insert a new channel id / T pair.
Definition
LArConditionsChannelSet.h:151
LArConditionsChannelSet::find
ConstChannelIt find(ChannelId id) const
Access to a conditions object pair for a given channel id.
Definition
LArConditionsChannelSet.h:105
LArConditionsChannelSet::m_channelVec
ChannelVector m_channelVec
Definition
LArConditionsChannelSet.h:83
LArConditionsChannelSet::begin
ConstChannelIt begin() const
Iterators over channel set.
Definition
LArConditionsChannelSet.h:125
LArConditionsChannelSet::~LArConditionsChannelSet
virtual ~LArConditionsChannelSet()
destructor
Definition
LArConditionsChannelSet.h:98
LArConditionsChannelSet::end
ConstChannelIt end() const
Definition
LArConditionsChannelSet.h:133
LArConditionsChannelSet::LArConditionsChannelSet
LArConditionsChannelSet()
Default constructor.
Definition
LArConditionsChannelSet.h:92
LArConditionsChannelSet::ChannelIt
ChannelVector::iterator ChannelIt
Definition
LArConditionsChannelSet.h:45
LArConditionsChannelSet::ChanIdTPair
std::pair< ChannelId, T > ChanIdTPair
Definition
LArConditionsChannelSet.h:42
LArConditionsChannelSet::ConstChannelIt
ChannelVector::const_iterator ConstChannelIt
Definition
LArConditionsChannelSet.h:44
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition
DVL_algorithms.h:554
Generated on
for ATLAS Offline Software by
1.17.0