ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1CaloCalibConditions
src
L1CaloRxCoolChannelId.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 "
TrigT1CaloCalibConditions/L1CaloRxCoolChannelId.h
"
6
7
#include <sstream>
8
#include <iostream>
9
16
17
//==============================================================================
18
// constructor
19
//==============================================================================
23
L1CaloRxCoolChannelId::L1CaloRxCoolChannelId
()
24
:
m_id
(0),
25
m_bOutputIsSet
(false),
26
m_outputConn
(0),
27
m_outputPair
(0)
28
{
29
}
30
31
//==============================================================================
32
// constructor
33
//==============================================================================
37
L1CaloRxCoolChannelId::L1CaloRxCoolChannelId
(
unsigned
int
crate
,
38
unsigned
int
module
,
39
unsigned
int
inputConn
,
40
unsigned
int
inputPair
)
41
:
m_id
(0),
42
m_bOutputIsSet
(false),
43
m_outputConn
(0),
44
m_outputPair
(0)
45
{
46
this->
setId
(crate,
module
,
inputConn
,
inputPair
);
47
}
48
49
L1CaloRxCoolChannelId::L1CaloRxCoolChannelId
(
unsigned
int
crate
,
unsigned
int
module
,
unsigned
int
inputConn
,
unsigned
int
inputPair
,
unsigned
int
outputConn
,
unsigned
int
outputPair
):
m_id
(0),
50
m_bOutputIsSet
(false),
51
m_outputConn
(0),
52
m_outputPair
(0)
53
{
54
this->
setId
(crate,
module
,
inputConn
,
inputPair
);
55
this->
outputAttributes
(outputConn,
outputPair
);
56
}
57
58
//==============================================================================
59
// constructor
60
//==============================================================================
64
L1CaloRxCoolChannelId::L1CaloRxCoolChannelId
(
unsigned
int
id
)
65
:
m_id
(
id
),
66
m_bOutputIsSet
(false),
67
m_outputConn
(0),
68
m_outputPair
(0)
69
{
70
}
71
72
//==============================================================================
73
// copy constructor
74
//==============================================================================
78
L1CaloRxCoolChannelId::L1CaloRxCoolChannelId
(
const
L1CaloRxCoolChannelId
&
id
)
79
:
m_id
(
id
.
m_id
),
80
m_bOutputIsSet
(
id
.
m_bOutputIsSet
),
81
m_outputConn
(
id
.
m_outputConn
),
82
m_outputPair
(
id
.
m_outputPair
)
83
{
84
}
85
86
//==============================================================================
87
// setId
88
//==============================================================================
92
void
93
L1CaloRxCoolChannelId::setId
(
unsigned
int
crate
,
94
unsigned
int
module
,
95
unsigned
int
inputConn
,
96
unsigned
int
inputPair
)
97
{
98
99
m_id
=
inputPair
+
inputConn
*16 +
module
* 64 +
crate
*1024;
100
}
101
102
103
bool
L1CaloRxCoolChannelId::operator<
(
const
L1CaloRxCoolChannelId
&
id
)
const
{
104
return
m_id
<
id
.m_id;
105
}
106
107
bool
L1CaloRxCoolChannelId::operator==
(
const
L1CaloRxCoolChannelId
&
id
)
const
{
108
return
m_id
==
id
.m_id;
109
}
110
111
112
void
L1CaloRxCoolChannelId::outputAttributes
(
unsigned
int
conn,
unsigned
int
pair
) {
113
if
(
m_bOutputIsSet
) {
114
std::cout<<
"Output attributes are already set for this channel: "
<<this->
id
()<<
". They cannot be modified"
<<std::endl;
115
return
;
116
}
117
m_outputConn
= conn;
118
m_outputPair
=
pair
;
119
m_bOutputIsSet
=
true
;
120
}
121
122
unsigned
int
L1CaloRxCoolChannelId::outputConn
()
const
{
123
if
(!
m_bOutputIsSet
) {
124
std::cout<<
"outputConn has not been set for channel "
<< this->
id
() <<
". You should not call this method."
<<std::endl;
125
}
126
return
m_outputConn
;
127
}
128
129
unsigned
int
L1CaloRxCoolChannelId::outputPair
()
const
{
130
if
(!
m_bOutputIsSet
) {
131
std::cout<<
"outputPair has not been set for channel "
<< this->
id
() <<
". You should not call this method."
<<std::endl;
132
}
133
return
m_outputPair
;
134
}
135
136
std::ostream&
operator<<
(std::ostream& output,
const
L1CaloRxCoolChannelId
&
r
) {
137
output <<
"rxChannelId: 0x"
<< std::hex <<
r
.id() << std::dec <<
", crate: "
<<
r
.crate()<<
", module: "
<<
r
.module()<<
", inputConn: "
<<
r
.inputConn()<<
", inputPair: "
<<
r
.inputPair()<<
" ( outputConn: "
<<
r
.outputConn()<<
", outputPair: "
<<
r
.outputPair()<<
")"
;
138
return
output;
139
}
operator<<
std::ostream & operator<<(std::ostream &output, const L1CaloRxCoolChannelId &r)
Definition
L1CaloRxCoolChannelId.cxx:136
L1CaloRxCoolChannelId.h
L1CaloRxCoolChannelId::m_id
unsigned int m_id
Definition
L1CaloRxCoolChannelId.h:45
L1CaloRxCoolChannelId::outputPair
unsigned int outputPair() const
Definition
L1CaloRxCoolChannelId.cxx:129
L1CaloRxCoolChannelId::operator<
bool operator<(const L1CaloRxCoolChannelId &id) const
Definition
L1CaloRxCoolChannelId.cxx:103
L1CaloRxCoolChannelId::id
unsigned int id() const
Definition
L1CaloRxCoolChannelId.h:27
L1CaloRxCoolChannelId::outputAttributes
void outputAttributes(unsigned int conn, unsigned int pair)
Definition
L1CaloRxCoolChannelId.cxx:112
L1CaloRxCoolChannelId::operator==
bool operator==(const L1CaloRxCoolChannelId &id) const
Definition
L1CaloRxCoolChannelId.cxx:107
L1CaloRxCoolChannelId::module
unsigned int module() const
Definition
L1CaloRxCoolChannelId.h:23
L1CaloRxCoolChannelId::m_bOutputIsSet
bool m_bOutputIsSet
Definition
L1CaloRxCoolChannelId.h:47
L1CaloRxCoolChannelId::inputConn
unsigned int inputConn() const
Definition
L1CaloRxCoolChannelId.h:24
L1CaloRxCoolChannelId::m_outputConn
unsigned int m_outputConn
Definition
L1CaloRxCoolChannelId.h:48
L1CaloRxCoolChannelId::inputPair
unsigned int inputPair() const
Definition
L1CaloRxCoolChannelId.h:25
L1CaloRxCoolChannelId::outputConn
unsigned int outputConn() const
Definition
L1CaloRxCoolChannelId.cxx:122
L1CaloRxCoolChannelId::setId
void setId(unsigned int crate, unsigned int module, unsigned int inputConn, unsigned int inputPair)
Set the CoolChannelId value from its component fields.
Definition
L1CaloRxCoolChannelId.cxx:93
L1CaloRxCoolChannelId::crate
unsigned int crate() const
Definition
L1CaloRxCoolChannelId.h:22
L1CaloRxCoolChannelId::L1CaloRxCoolChannelId
L1CaloRxCoolChannelId()
Create a L1CaloRxCoolChannelId from the integer ID field.
Definition
L1CaloRxCoolChannelId.cxx:23
L1CaloRxCoolChannelId::m_outputPair
unsigned int m_outputPair
Definition
L1CaloRxCoolChannelId.h:49
pair
STL class.
r
int r
Definition
globals.cxx:22
Generated on
for ATLAS Offline Software by
1.17.0