ATLAS Offline Software
WiredORdata.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 
8 
9 #include <iomanip>
10 
11 using namespace RPC_CondCabling;
12 
14  reset_data();
15  if (!(data("station") >> m_station)) return;
16 
17  m_fail = false;
18 
19  (++data)("{");
20  do {
21  WiredOR::parseParams parse_params;
22  parse_params.sectorType = type;
23  parse_params.station = m_station;
24  parse_params.number = -1;
25  if (get_data(data, parse_params)) { m_wor.emplace_back(parse_params); }
26  ++data;
27  } while (!data("}"));
28 }
29 WiredORdata::~WiredORdata() = default;
30 void WiredORdata::reset_data() { m_fail = true; }
31 
33  if (parse_params.start > parse_params.stop) {
34  std::ostringstream display;
35  REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "WiredORdata")
36  << "WORdata error in configuration for Sector Type " << parse_params.sectorType << ", station " << parse_params.station
37  << ", WOR number " << parse_params.number << std::endl
38  << " start RPC chamber (" << parse_params.start << ") is greater than "
39  << "stop RPC chamber (" << parse_params.stop << ")";
40  return false;
41  }
42  return true;
43 }
44 
46  reset_data();
47  if (data("hard wired phi chamber") >> parse_params.number >> parse_params.start >> "-" >> parse_params.stop) {
48  m_fail = false;
49  if (!confirm_boundary(parse_params)) m_fail = true;
50  }
51 
52  return !m_fail;
53 }
54 
55 std::unique_ptr<WiredOR> WiredORdata::give_wor(void) {
56  if (!m_wor.empty()) {
57  std::unique_ptr<WiredOR> Wor = std::make_unique<WiredOR>(m_wor.front());
58  m_wor.pop_front();
59  return Wor;
60  }
61  return nullptr;
62 }
63 
64 void WiredORdata::Print(std::ostream& stream, bool detail) const {
65  stream << "Wired OR data of station n. " << m_station;
66  // stream << " belonging to sector type " << parse_params.sectorType << std::endl;
67  stream << "It contains " << m_wor.size();
68  stream << " Wired ORs:" << std::endl;
69  for (const WiredOR& it : m_wor) stream << ShowRequest<WiredOR>(it, detail);
70 }
71 
72 std::ostream& operator<<(std::ostream& stream, WiredORdata& data) {
73  data.Print(stream, false);
74  return stream;
75 }
RPC_CondCabling::WiredORdata::reset_data
void reset_data()
Definition: WiredORdata.cxx:30
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
RPC_CondCabling::WiredORdata::m_fail
bool m_fail
Definition: WiredORdata.h:21
RPC_CondCabling::operator<<
X & operator<<(X &stream, CMAcablingdata &data)
Definition: CMAcablingdata.h:44
RPC_CondCabling::WiredOR::defineParams::start
int start
strip type put in wired OR
Definition: WiredOR.h:37
RPC_CondCabling::WiredORdata::~WiredORdata
virtual ~WiredORdata()
WiredORdata.h
skel.it
it
Definition: skel.GENtoEVGEN.py:396
RPC_CondCabling::WiredOR::defineParams::stop
int stop
first RPC chamber to which wired strips belong
Definition: WiredOR.h:38
detail
Definition: extract_histogram_tag.cxx:14
RPC_CondCabling::WiredORdata::give_wor
std::unique_ptr< WiredOR > give_wor(void)
Definition: WiredORdata.cxx:55
RPC_CondCabling
Definition: CMAcablingdata.h:18
Logic
@ Logic
Definition: BaseObject.h:11
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
RPC_CondCabling::WiredORdata::get_data
bool get_data(DBline &, WiredOR::parseParams &)
Definition: WiredORdata.cxx:45
RPC_CondCabling::WiredORdata::m_wor
WORlist m_wor
Definition: WiredORdata.h:23
RPC_CondCabling::WiredORdata
Definition: WiredORdata.h:17
RPC_CondCabling::WiredORdata::Print
virtual void Print(std::ostream &, bool) const override
Definition: WiredORdata.cxx:64
pyroot.display
display
Definition: pyroot.py:44
REPORT_MESSAGE_WITH_CONTEXT
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:345
BaseObject
Definition: BaseObject.h:13
errorcheck.h
Helpers for checking error return status codes and reporting errors.
RPC_CondCabling::WiredOR
Definition: WiredOR.h:26
RPC_CondCabling::WiredORdata::WiredORdata
WiredORdata(DBline &, int)
Definition: WiredORdata.cxx:13
DBline
Definition: dbline.h:255
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
RPC_CondCabling::WiredORdata::m_station
int m_station
Definition: WiredORdata.h:22
RPC_CondCabling::WiredORdata::confirm_boundary
bool confirm_boundary(WiredOR::parseParams &) const
Definition: WiredORdata.cxx:32
RPC_CondCabling::WiredOR::parseParams
Definition: WiredOR.h:40