ATLAS Offline Software
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 
6 
7 using namespace std;
8 
10  RPCdata("RPCrawData")
11 {
12  m_eta_digits.clear();
13  m_phi_digits.clear();
14 }
15 
17  RPCdata(data),
18  m_eta_digits(data.eta_digits()),
19  m_phi_digits(data.phi_digits())
20 {
21 }
22 
24 {
25  m_eta_digits.clear();
26  m_phi_digits.clear();
27 }
28 
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*
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*
76 {
77  return this->load_data(rpc_digit);
78 }
79 
82 {
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 
95 {
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 
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
RPCrawData::operator<<
const RPCrawDigit * operator<<(RPCrawDigit &)
Definition: RPCrawData.cxx:75
SiliconTech::strip
@ strip
RPCrawData::PrintElement
void PrintElement(std::ostream &, std::string, bool) const
Definition: RPCrawData.cxx:150
RPCrawData::m_phi_digits
DigitList m_phi_digits
Definition: RPCrawData.h:24
calibdata.chamber
chamber
Definition: calibdata.py:32
skel.it
it
Definition: skel.GENtoEVGEN.py:423
detail
Definition: extract_histogram_tag.cxx:14
Phi
@ Phi
Definition: RPCdef.h:8
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
RPCrawData::m_eta_digits
DigitList m_eta_digits
Definition: RPCrawData.h:23
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
RPCrawData::eta_digits_list
RPCdata::digitList eta_digits_list(void) const
Definition: RPCrawData.cxx:81
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
BaseObject::name
std::string name() const
Definition: BaseObject.h:23
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
RPCrawData
Definition: RPCrawData.h:18
RPCrawData::operator=
RPCrawData operator=(const RPCrawData &)
Definition: RPCrawData.cxx:30
RPCdata
Definition: RPCdata.h:19
RPCrawData.h
RPCdigit
Definition: RPCdigit.h:16
RPCrawData::how_many
virtual int how_many(int type, int sector, int station, int layer, int chamber, int strip) const
Definition: RPCrawData.cxx:107
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:64
RPCrawDigit
Definition: RPCrawDigit.h:15
RPCrawData::~RPCrawData
~RPCrawData()
Definition: RPCrawData.cxx:23
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RPCdata::digitList
std::list< const RPCdigit * > digitList
Definition: RPCdata.h:21
RPCrawData::load_data
const RPCrawDigit * load_data(RPCrawDigit &)
Definition: RPCrawData.cxx:43
Eta
@ Eta
Definition: RPCdef.h:8
RPCrawData::RPCrawData
RPCrawData()
Definition: RPCrawData.cxx:9
RPCrawData::phi_digits_list
RPCdata::digitList phi_digits_list(void) const
Definition: RPCrawData.cxx:94