ATLAS Offline Software
Loading...
Searching...
No Matches
CMAcablingdata.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
9using namespace RPC_CondCabling;
10
12 (++data)("{");
13 do {
15 parser.sectorType = type;
16 if (get_data(data, parser)) {
17 if (m_view == ViewType::Eta) { m_etaCMA.emplace_back(parser); }
18 }
19 ++data;
20 } while (!data("}"));
21}
22
24
26 unsigned int div = 247;
27 std::string view = (side == ViewType::Phi) ? "phi" : "eta";
28
29 std::ostringstream disp;
30
31 bool have_low_Pt_input = (parser.lowPtNumCo != -1);
32 bool have_high_Pt_input = (parser.highPtNumCo != -1);
33
34 if (side == Eta) {
35 if (parser.lowPtStartCo >= parser.lowPtStopCo && have_low_Pt_input) {
36 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "CMAcablingdata")
37 << "CMA cabling error in CONF data for Sector Type " << parser.sectorType << ", " << view
38 << " CMA at eta = " << parser.etaIndex << ", phi = " << parser.phiIndex << std::endl
39 << " start position for low Pt cabling (" << parser.lowPtStartCo << ") is greater than stop position ("
40 << parser.lowPtStopCo;
41 return false;
42 }
43 if (parser.lowPtStopCo - parser.lowPtStartCo + 1 != parser.lowPtNumCo && have_low_Pt_input) {
44 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "CMAcablingdata")
45 << "CMA cabling error in CONF data for Sector Type " << parser.sectorType << ", " << view
46 << " CMA at eta = " << parser.etaIndex << ", phi = " << parser.phiIndex << std::endl
47 << " cabling inconsistence for low Pt <" << parser.lowPtNumCo << ", " << parser.lowPtStartCo << " " << (char)div << " "
48 << parser.lowPtStopCo << ">";
49 return false;
50 }
51
52 if (parser.highPtStartCo >= parser.highPtStopCo && have_high_Pt_input) {
53 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "CMAcablingdata")
54 << "CMA cabling error in CONF data for Sector Type " << parser.sectorType << ", " << view
55 << " CMA at eta = " << parser.etaIndex << ", phi = " << parser.phiIndex << std::endl
56 << " start position for high Pt cabling (" << parser.highPtStartCo << ") is greater than stop position ("
57 << parser.highPtStopCo;
58 return false;
59 }
60 if (parser.highPtStopCo - parser.highPtStartCo + 1 != parser.highPtNumCo && have_high_Pt_input) {
61 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "CMAcablingdata")
62 << "CMA cabling error in CONF data for Sector Type " << parser.sectorType << ", " << view
63 << " CMA at eta = " << parser.etaIndex << ", phi = " << parser.phiIndex << std::endl
64 << " cabling inconsistence for high Pt <" << parser.highPtNumCo << ", " << parser.highPtStartCo << " " << (char)div << " "
65 << parser.highPtStopCo << ">";
66 return false;
67 }
68 }
69
70 return true;
71}
72
74 reset_data();
75
76 if (data("eta matrix") >> "eta" >> parser.etaIndex >> "phi" >> parser.phiIndex >> ":" >> "low Pt" >> parser.lowPtNumCo >> "," >>
77 parser.lowPtStartCo >> "-" >> parser.lowPtStopCo >> "high Pt" >> parser.highPtNumCo >> "," >> parser.highPtStartCo >> "-" >>
78 parser.highPtStopCo) {
79 if (parser.lowPtNumCo == 0) {
80 parser.lowPtNumCo = -1;
81 parser.lowPtStartCo = -1;
82 parser.lowPtStopCo = -1;
83 }
84 if (parser.highPtNumCo == 0) {
85 parser.highPtNumCo = -1;
86 parser.highPtStartCo = -1;
87 parser.highPtStopCo = -1;
88 }
89 m_view = parser.view = ViewType::Eta;
90 m_fail = false;
91 if (!confirm_data(Eta, parser)) m_fail = true;
92 }
93
94 return !m_fail;
95}
96
97std::unique_ptr<EtaCMA> CMAcablingdata::give_eta_cma() {
98 if (!m_etaCMA.empty()) {
99 std::unique_ptr<EtaCMA> CMA = std::make_unique<EtaCMA>(m_etaCMA.front());
100 m_etaCMA.pop_front();
101 return CMA;
102 }
103 return nullptr;
104}
105
106void CMAcablingdata::Print(std::ostream& stream, bool detail) const {
107 stream << "CMA cabling data ";
108
109 stream << "It contains " << m_etaCMA.size();
110 stream << " eta CMAs:" << std::endl;
111 ETAlist::const_iterator ei;
112 for (ei = m_etaCMA.begin(); ei != m_etaCMA.end(); ++ei) stream << ShowRequest<EtaCMA>(*ei, detail);
113}
@ 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
ViewType
Definition RPCdef.h:8
@ Phi
Definition RPCdef.h:8
@ Eta
Definition RPCdef.h:8
BaseObject(ObjectType, const std::string &)
Definition BaseObject.cxx:7
std::unique_ptr< EtaCMA > give_eta_cma()
bool confirm_data(ViewType, const CMAparameters::parseParams &parser)
bool get_data(DBline &, CMAparameters::parseParams &params)
virtual void Print(std::ostream &, bool) const override