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