ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
xAOD
xAODCaloRings
Root
RingSet_v1.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <iostream>
6
7
// Local include(s).
8
#include "
xAODCaloRings/versions/RingSet_v1.h
"
9
10
// EDM include(s).
11
#include "
xAODCore/AuxStoreAccessorMacros.h
"
12
13
namespace
{
14
16
std::ostream&
operator<<
( std::ostream& out,
const
std::vector< float >&
vec
)
17
{
18
// A little prefix:
19
out
<<
"["
;
20
// Print the contents:
21
for
(
size_t
i = 0;
i
<
vec
.size(); ++
i
) {
22
out
<<
vec
[
i
];
23
if
( i <
vec
.size() - 1 ) {
24
out
<<
", "
;
25
}
26
}
27
// A little postfix:
28
out
<<
"]"
;
29
// Return the stream:
30
return
out
;
31
}
32
33
}
// private namespace
34
35
namespace
xAOD
{
36
37
// Instantiate the needed accessors:
38
static
const
SG::AuxElement::Accessor< std::vector<float> >
accRingsE
(
"ringsE"
);
39
static
const
SG::AuxElement::ConstAccessor< std::vector<float> >
40
constAccRingsE
(
"ringsE"
);
41
42
// @name RingSet_v1 accessors:
43
//==============================================================================
44
float
&
RingSet_v1::at
(
const
unsigned
int
i) {
45
return
accRingsE
( *this ).at(i);
46
}
47
48
//==============================================================================
49
float
&
RingSet_v1::operator []
(
const
unsigned
int
i) {
50
return
accRingsE
( *
this
)[i];
51
}
52
53
float
RingSet_v1::at
(
const
unsigned
int
i)
const
{
54
return
constAccRingsE
( *this ).at(i);
55
}
56
57
//==============================================================================
58
float
RingSet_v1::operator []
(
const
unsigned
int
i)
const
{
59
return
constAccRingsE
( *
this
)[i];
60
}
61
62
//==============================================================================
63
AUXSTORE_OBJECT_SETTER_AND_GETTER
(
RingSet_v1
,
64
std::vector<float>,
65
ringsE,
66
setRingsE)
67
68
// @name RingSet_v1 rings interation:
69
//==============================================================================
70
unsigned
RingSet_v1::size
()
const
{
71
return
(
constAccRingsE
.isAvailable( *
this
) )?
72
constAccRingsE
( *this ).size() : 0;
73
}
74
75
//==============================================================================
76
void
RingSet_v1::clear
() {
77
return
accRingsE
( *this ).clear();
78
}
79
80
//==============================================================================
81
void
RingSet_v1::addRing
(
float
r
) {
82
return
accRingsE
( *this ).push_back(
r
);
83
}
84
85
//==============================================================================
86
RingSet_v1::iterator
RingSet_v1::begin
() {
87
return
(
accRingsE
.isAvailable( *
this
) )?
88
accRingsE
( *this ).begin() :
RingSet_v1::iterator
();
89
}
90
91
//==============================================================================
92
RingSet_v1::iterator
RingSet_v1::end
() {
93
return
(
accRingsE
.isAvailable( *
this
) )?
94
accRingsE
( *this ).end() :
RingSet_v1::iterator
();
95
}
96
97
//==============================================================================
98
RingSet_v1::const_iterator
RingSet_v1::begin
()
const
{
99
return
(
constAccRingsE
.isAvailable( *
this
) )?
100
constAccRingsE
( *this ).begin() :
RingSet_v1::const_iterator
();
101
}
102
103
//==============================================================================
104
RingSet_v1::const_iterator
RingSet_v1::end
()
const
{
105
return
(
constAccRingsE
.isAvailable( *
this
) )?
106
constAccRingsE
( *this ).end() :
RingSet_v1::const_iterator
();
107
}
108
109
//==============================================================================
110
void
RingSet_v1::copyTo
(std::vector<float> &
vec
)
const
{
111
const
std::vector<float> &
ringsE
=
constAccRingsE
( *
this
);
112
vec
.insert(
vec
.end(),
ringsE
.begin(),
ringsE
.end());
113
}
114
115
116
//==============================================================================
117
void
RingSet_v1::print
( std::ostream &stream )
const
{
118
const
std::vector<float> &
ringsE
=
constAccRingsE
( *
this
);
119
stream <<
ringsE
<< std::endl;
120
}
121
122
//==============================================================================
123
RingSet_v1
&
RingSet_v1::operator=
(
const
RingSet_v1
& cl_rings ){
124
if
(
this
!= &cl_rings){
// protect against invalid self-assignment
125
if
(!this->container() && !this->hasStore() ) {
126
makePrivateStore();
127
}
128
this->SG::AuxElement::operator=( cl_rings );
129
}
130
// by convention, always return *this
131
return
*
this
;
132
}
133
134
}
// End of namespace xAOD
AuxStoreAccessorMacros.h
AUXSTORE_OBJECT_SETTER_AND_GETTER
#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of complex auxiliary properties.
Definition
AuxStoreAccessorMacros.h:88
vec
std::vector< size_t > vec
Definition
CombinationsGeneratorTest.cxx:9
RingSet_v1.h
operator<<
std::ostream & operator<<(std::ostream &lhs, const TestGaudiProperty &rhs)
Definition
TestGaudiProperty.cxx:69
xAOD::RingSet_v1
Class holding a set of rings.
Definition
RingSet_v1.h:31
xAOD::RingSet_v1::addRing
void addRing(float r)
add ring to RingSet
Definition
RingSet_v1.cxx:81
xAOD::RingSet_v1::RingSet_v1
RingSet_v1()
Default empty constructor.
Definition
RingSet_v1.h:148
xAOD::RingSet_v1::const_iterator
std::vector< float >::const_iterator const_iterator
const Iterator to rings Et
Definition
RingSet_v1.h:39
xAOD::RingSet_v1::begin
iterator begin()
ring begin() iterator
Definition
RingSet_v1.cxx:86
xAOD::RingSet_v1::operator=
RingSet_v1 & operator=(const RingSet_v1 &clrings)
Assignment Operator.
Definition
RingSet_v1.cxx:123
xAOD::RingSet_v1::operator[]
float & operator[](const unsigned int i)
Get/set ring Et at ith position.
Definition
RingSet_v1.cxx:49
xAOD::RingSet_v1::end
iterator end()
ring end() iterator
Definition
RingSet_v1.cxx:92
xAOD::RingSet_v1::size
unsigned size() const
Get rings size.
xAOD::RingSet_v1::copyTo
void copyTo(std::vector< float > &vec) const
Copy ringset to std::vector end:
Definition
RingSet_v1.cxx:110
xAOD::RingSet_v1::ringsE
const std::vector< float > & ringsE() const
Get rings holden by RingSet.
xAOD::RingSet_v1::clear
void clear()
clear rings
xAOD::RingSet_v1::at
float & at(const unsigned int i)
Get/set ring Et at ith position.
Definition
RingSet_v1.cxx:44
xAOD::RingSet_v1::iterator
std::vector< float >::iterator iterator
Definition
RingSet_v1.h:37
xAOD::RingSet_v1::print
void print(std::ostream &stream) const
Definition
RingSet_v1.cxx:117
r
int r
Definition
globals.cxx:22
lumiFormat.i
int i
Definition
lumiFormat.py:85
python.AthDsoLogger.out
out
Definition
AthDsoLogger.py:70
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition
ICaloAffectedTool.h:24
xAOD::accRingsE
static const SG::AuxElement::Accessor< std::vector< float > > accRingsE("ringsE")
xAOD::constAccRingsE
static const SG::AuxElement::ConstAccessor< std::vector< float > > constAccRingsE("ringsE")
Generated on
for ATLAS Offline Software by
1.17.0