ATLAS Offline Software
Loading...
Searching...
No Matches
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
11using 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}
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
55std::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
64void 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
72std::ostream& operator<<(std::ostream& stream, WiredORdata& data) {
73 data.Print(stream, false);
74 return stream;
75}
@ Logic
Definition BaseObject.h:11
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
BaseObject(ObjectType, const std::string &)
Definition BaseObject.cxx:7
bool get_data(DBline &, WiredOR::parseParams &)
virtual void Print(std::ostream &, bool) const override
bool confirm_boundary(WiredOR::parseParams &) const
std::unique_ptr< WiredOR > give_wor(void)
X & operator<<(X &stream, CMAcablingdata &data)
int stop
first RPC chamber to which wired strips belong
Definition WiredOR.h:38
int start
strip type put in wired OR
Definition WiredOR.h:37