ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
TrigT1RPClogic
src
RPCrawData.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigT1RPClogic/RPCrawData.h
"
6
7
using namespace
std
;
8
9
RPCrawData::RPCrawData
() :
10
RPCdata
(
"RPCrawData"
)
11
{
12
m_eta_digits
.clear();
13
m_phi_digits
.clear();
14
}
15
16
RPCrawData::RPCrawData
(
const
RPCrawData
& data) :
17
RPCdata
(data),
18
m_eta_digits
(data.
eta_digits
()),
19
m_phi_digits
(data.
phi_digits
())
20
{
21
}
22
23
RPCrawData::~RPCrawData
()
24
{
25
m_eta_digits
.clear();
26
m_phi_digits
.clear();
27
}
28
29
RPCrawData
30
RPCrawData::operator=
(
const
RPCrawData
& data)
31
{
32
m_eta_digits
.clear();
33
m_phi_digits
.clear();
34
35
m_eta_digits
= data.eta_digits();
36
m_phi_digits
= data.phi_digits();
37
38
return
*
this
;
39
}
40
41
42
const
RPCrawDigit
*
43
RPCrawData::load_data
(
RPCrawDigit
& digit)
44
{
45
digit.set_data(*
this
);
46
if
(digit.decoding().view() == Eta)
47
{
48
RPCrawData::DigitList::const_iterator dig =
m_eta_digits
.begin();
49
while
(dig !=
m_eta_digits
.end())
50
{
51
if
(*dig ==
static_cast<
RPCdigit
&
>
(digit))
return
&(*dig);
52
++dig;
53
}
54
digit.set_number(
m_eta_digits
.size()+1);
55
m_eta_digits
.push_back(digit);
56
return
&
m_eta_digits
.back();
57
}
58
else
if
(digit.decoding().view() == Phi)
59
{
60
RPCrawData::DigitList::const_iterator dig =
m_phi_digits
.begin();
61
while
(dig !=
m_phi_digits
.end())
62
{
63
if
(*dig ==
static_cast<
RPCdigit
&
>
(digit))
return
&(*dig);
64
++dig;
65
}
66
digit.set_number(
m_phi_digits
.size()+1);
67
m_phi_digits
.push_back(digit);
68
return
&
m_phi_digits
.back();
69
}
70
return
0;
71
}
72
73
74
const
RPCrawDigit
*
75
RPCrawData::operator<<
(
RPCrawDigit
& rpc_digit)
76
{
77
return
this->
load_data
(rpc_digit);
78
}
79
80
RPCdata::digitList
81
RPCrawData::eta_digits_list
(
void
)
const
82
{
83
digitList
list;
84
DigitList::const_iterator it =
m_eta_digits
.begin();
85
while
(it !=
m_eta_digits
.end())
86
{
87
list.push_back(&(*it));
88
++it;
89
}
90
return
list;
91
}
92
93
RPCdata::digitList
94
RPCrawData::phi_digits_list
(
void
)
const
95
{
96
digitList
list;
97
DigitList::const_iterator it =
m_phi_digits
.begin();
98
while
(it !=
m_phi_digits
.end())
99
{
100
list.push_back(&(*it));
101
++it;
102
}
103
return
list;
104
}
105
106
int
107
RPCrawData::how_many
(
int
type
,
int
sector,
int
station,
int
layer,
int
chamber,
108
int
strip
)
const
109
{
110
int
size
= 0;
111
112
if
(
type
< 0 ||
type
== 1)
113
{
114
DigitList::const_iterator it =
m_phi_digits
.begin();
115
while
(it !=
m_phi_digits
.end())
116
{
117
if
( (sector < 0 || sector == (*it).decoding().logic_sector()) &&
118
(station < 0 || station == (*it).decoding().lvl1_station()) &&
119
(layer < 0 || layer == (*it).decoding().rpc_layer() ) &&
120
(chamber < 0 || chamber == (*it).decoding().rpc_z_index() ) &&
121
(
strip
< 0 ||
strip
== (*it).decoding().strip_number()) )
122
{
123
++
size
;
124
}
125
++it;
126
}
127
}
128
129
if
(
type
< 0 ||
type
== 2)
130
{
131
DigitList::const_iterator it =
m_eta_digits
.begin();
132
while
(it !=
m_eta_digits
.end())
133
{
134
if
( (sector < 0 || sector == (*it).decoding().logic_sector()) &&
135
(station < 0 || station == (*it).decoding().lvl1_station()) &&
136
(layer < 0 || layer == (*it).decoding().rpc_layer() ) &&
137
(chamber < 0 || chamber == (*it).decoding().rpc_z_index() ) &&
138
(
strip
< 0 ||
strip
== (*it).decoding().strip_number()) )
139
{
140
++
size
;
141
}
142
++it;
143
}
144
}
145
146
return
size
;
147
}
148
149
void
150
RPCrawData::PrintElement
(ostream& stream,std::string element,
bool
detail
)
const
151
{
152
bool
all = (element ==
name
() || element ==
""
)?
true
:
false
;
153
bool
nEtaDig =
m_eta_digits
.size();
154
bool
nPhiDig =
m_phi_digits
.size();
155
bool
printed =
false
;
156
157
if
(nEtaDig && (element == (*
m_eta_digits
.begin()).name() || all))
158
{
159
printed =
true
;
160
DigitList::const_iterator it =
m_eta_digits
.begin();
161
while
(it !=
m_eta_digits
.end())
162
{
163
it->Print(stream,
detail
);
164
++it;
165
}
166
}
167
168
if
(nPhiDig && (element == (*
m_phi_digits
.begin()).name() || all))
169
{
170
printed =
true
;
171
DigitList::const_iterator it =
m_phi_digits
.begin();
172
while
(it !=
m_phi_digits
.end())
173
{
174
it->Print(stream,
detail
);
175
++it;
176
}
177
}
178
179
if
(!printed)
180
{
181
if
( element ==
""
) element =
"digits"
;
182
stream <<
name
() <<
" contains no "
<< element <<
"!"
<< endl;
183
}
184
}
185
SiliconTech::strip
@ strip
Definition
FPGATrackSimTypes.h:25
RPCrawData.h
size
size_t size() const
Number of registered mappings.
BaseObject::name
const std::string & name() const
Definition
BaseObject.h:23
RPCdata::digitList
std::list< const RPCdigit * > digitList
Definition
RPCdata.h:21
RPCdata::RPCdata
RPCdata(const std::string &)
Definition
RPCdata.cxx:8
RPCdigit
Definition
RPCdigit.h:16
RPCrawData
Definition
RPCrawData.h:18
RPCrawData::phi_digits_list
RPCdata::digitList phi_digits_list(void) const
Definition
RPCrawData.cxx:94
RPCrawData::operator=
RPCrawData operator=(const RPCrawData &)
Definition
RPCrawData.cxx:30
RPCrawData::RPCrawData
RPCrawData()
Definition
RPCrawData.cxx:9
RPCrawData::m_phi_digits
DigitList m_phi_digits
Definition
RPCrawData.h:24
RPCrawData::m_eta_digits
DigitList m_eta_digits
Definition
RPCrawData.h:23
RPCrawData::load_data
const RPCrawDigit * load_data(RPCrawDigit &)
Definition
RPCrawData.cxx:43
RPCrawData::~RPCrawData
~RPCrawData()
Definition
RPCrawData.cxx:23
RPCrawData::eta_digits
const DigitList & eta_digits(void) const
Definition
RPCrawData.h:37
RPCrawData::operator<<
const RPCrawDigit * operator<<(RPCrawDigit &)
Definition
RPCrawData.cxx:75
RPCrawData::how_many
virtual int how_many(int type, int sector, int station, int layer, int chamber, int strip) const
Definition
RPCrawData.cxx:107
RPCrawData::eta_digits_list
RPCdata::digitList eta_digits_list(void) const
Definition
RPCrawData.cxx:81
RPCrawData::PrintElement
void PrintElement(std::ostream &, std::string, bool) const
Definition
RPCrawData.cxx:150
RPCrawData::phi_digits
const DigitList & phi_digits(void) const
Definition
RPCrawData.h:38
RPCrawDigit
Definition
RPCrawDigit.h:15
detail
Definition
extract_histogram_tag.cxx:14
std
STL namespace.
type
Generated on
for ATLAS Offline Software by
1.17.0