ATLAS Offline Software
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 
7 using 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 
38 void
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
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 {
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 {
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 
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
BaseObject::name
const std::string & name() const
Definition: BaseObject.h:23
SiliconTech::strip
@ strip
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.h
RPCsimuData::operator<<
RPCsimuData & operator<<(MuonSimuTrack &)
Definition: RPCsimuData.cxx:68
calibdata.chamber
chamber
Definition: calibdata.py:32
RPCsimuData::m_eta_digits
DigitList m_eta_digits
Definition: RPCsimuData.h:26
skel.it
it
Definition: skel.GENtoEVGEN.py:396
RPCsimuData::PrintElement
void PrintElement(std::ostream &, std::string, bool) const
Definition: RPCsimuData.cxx:151
detail
Definition: extract_histogram_tag.cxx:14
RPCsimuData::load_data
void load_data(MuonSimuTrack &)
Definition: RPCsimuData.cxx:39
Phi
@ Phi
Definition: RPCdef.h:8
RPCsimuData::eta_digits_list
RPCdata::digitList eta_digits_list(void) const
Definition: RPCsimuData.cxx:82
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
RPCsimuData::m_muon_tracks
MuonList m_muon_tracks
Definition: RPCsimuData.h:25
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
RPCsimuData::RPCsimuData
RPCsimuData()
Definition: RPCsimuData.cxx:9
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
RPCtrigDataObject::set_number
void set_number(int)
Definition: RPCtrigDataObject.cxx:42
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
MuonSimuTrack::track_number
int track_number(void) const
Definition: MuonSimuTrack.h:77
RPCdata
Definition: RPCdata.h:19
RPCsimuData::m_phi_digits
DigitList m_phi_digits
Definition: RPCsimuData.h:27
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:67
RPCsimuData::phi_digits_list
RPCdata::digitList phi_digits_list(void) const
Definition: RPCsimuData.cxx:95
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RPCdata::digitList
std::list< const RPCdigit * > digitList
Definition: RPCdata.h:21
RPCsimuData::~RPCsimuData
~RPCsimuData()
Definition: RPCsimuData.cxx:17
RPCsimuData::operator=
RPCsimuData operator=(const RPCsimuData &)
Definition: RPCsimuData.cxx:25
RPCsimuData
Definition: RPCsimuData.h:19
RPCsimuDigit
Definition: RPCsimuDigit.h:16
Eta
@ Eta
Definition: RPCdef.h:8
MuonSimuTrack
Definition: MuonSimuTrack.h:56