ATLAS Offline Software
Loading...
Searching...
No Matches
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
6
7using namespace std;
8
10 RPCdata("RPCsimuData")
11{
12 m_muon_tracks.clear();
13 m_eta_digits.clear();
14 m_phi_digits.clear();
15}
16
18{
19 m_muon_tracks.clear();
20 m_eta_digits.clear();
21 m_phi_digits.clear();
22}
23
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
38void
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
51void
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
69{
70 this->load_data(muon_track);
71 return *this;
72}
73
76{
77 this->load_data(rpc_digit);
78 return *this;
79}
80
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
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
107int
108RPCsimuData::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
150void
151RPCsimuData::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
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
const std::string & name() const
Definition BaseObject.h:23
int track_number(void) const
std::list< const RPCdigit * > digitList
Definition RPCdata.h:21
RPCdata(const std::string &)
Definition RPCdata.cxx:8
void load_data(MuonSimuTrack &)
virtual int how_many(int type, int sector, int station, int layer, int chamber, int strip) const
RPCsimuData operator=(const RPCsimuData &)
DigitList m_phi_digits
Definition RPCsimuData.h:27
MuonList m_muon_tracks
Definition RPCsimuData.h:25
RPCdata::digitList phi_digits_list(void) const
void PrintElement(std::ostream &, std::string, bool) const
RPCsimuData & operator<<(MuonSimuTrack &)
RPCdata::digitList eta_digits_list(void) const
DigitList m_eta_digits
Definition RPCsimuData.h:26
STL namespace.