ATLAS Offline Software
Loading...
Searching...
No Matches
RPC_CondCabling::CMAcablingdata Class Reference

#include <CMAcablingdata.h>

Inheritance diagram for RPC_CondCabling::CMAcablingdata:
Collaboration diagram for RPC_CondCabling::CMAcablingdata:

Public Member Functions

 CMAcablingdata (DBline &, int)
virtual ~CMAcablingdata ()=default
std::unique_ptr< EtaCMAgive_eta_cma ()
virtual void Print (std::ostream &, bool) const override
ObjectType tag () const
const std::string & name () const

Private Types

typedef std::list< EtaCMAETAlist

Private Member Functions

void reset_data (void)
bool get_data (DBline &, CMAparameters::parseParams &params)
bool confirm_data (ViewType, const CMAparameters::parseParams &parser)

Private Attributes

bool m_fail {true}
ViewType m_view {ViewType::Eta}
std::string m_covtag {}
ETAlist m_etaCMA
ObjectType m_tag
std::string m_name

Detailed Description

Definition at line 20 of file CMAcablingdata.h.

Member Typedef Documentation

◆ ETAlist

Definition at line 22 of file CMAcablingdata.h.

Constructor & Destructor Documentation

◆ CMAcablingdata()

CMAcablingdata::CMAcablingdata ( DBline & data,
int type )

Definition at line 11 of file CMAcablingdata.cxx.

11 : BaseObject(Logic, "CMA Cabling Data") {
12 (++data)("{");
13 do {
14 CMAparameters::parseParams parser;
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}
@ Logic
Definition BaseObject.h:11
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
@ Eta
Definition RPCdef.h:8
BaseObject(ObjectType, const std::string &)
Definition BaseObject.cxx:7
bool get_data(DBline &, CMAparameters::parseParams &params)

◆ ~CMAcablingdata()

virtual RPC_CondCabling::CMAcablingdata::~CMAcablingdata ( )
virtualdefault

Member Function Documentation

◆ confirm_data()

bool CMAcablingdata::confirm_data ( ViewType side,
const CMAparameters::parseParams & parser )
private

Definition at line 25 of file CMAcablingdata.cxx.

25 {
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}
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
@ Phi
Definition RPCdef.h:8

◆ get_data()

bool CMAcablingdata::get_data ( DBline & data,
CMAparameters::parseParams & params )
private

Definition at line 73 of file CMAcablingdata.cxx.

73 {
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 }
90 m_fail = false;
91 if (!confirm_data(Eta, parser)) m_fail = true;
92 }
93
94 return !m_fail;
95}
bool confirm_data(ViewType, const CMAparameters::parseParams &parser)

◆ give_eta_cma()

std::unique_ptr< EtaCMA > CMAcablingdata::give_eta_cma ( )

Definition at line 97 of file CMAcablingdata.cxx.

97 {
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}

◆ name()

const std::string & BaseObject::name ( ) const
inlineinherited

Definition at line 23 of file BaseObject.h.

23{ return m_name; }
std::string m_name
Definition BaseObject.h:16

◆ Print()

void CMAcablingdata::Print ( std::ostream & stream,
bool detail ) const
overridevirtual

Reimplemented from BaseObject.

Definition at line 106 of file CMAcablingdata.cxx.

106 {
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}

◆ reset_data()

void CMAcablingdata::reset_data ( void )
private

Definition at line 23 of file CMAcablingdata.cxx.

23{ m_fail = true; }

◆ tag()

ObjectType BaseObject::tag ( ) const
inlineinherited

Definition at line 22 of file BaseObject.h.

22{ return m_tag; }
ObjectType m_tag
Definition BaseObject.h:15

Member Data Documentation

◆ m_covtag

std::string RPC_CondCabling::CMAcablingdata::m_covtag {}
private

Definition at line 27 of file CMAcablingdata.h.

27{};

◆ m_etaCMA

ETAlist RPC_CondCabling::CMAcablingdata::m_etaCMA
private

Definition at line 29 of file CMAcablingdata.h.

◆ m_fail

bool RPC_CondCabling::CMAcablingdata::m_fail {true}
private

Definition at line 24 of file CMAcablingdata.h.

24{true};

◆ m_name

std::string BaseObject::m_name
privateinherited

Definition at line 16 of file BaseObject.h.

◆ m_tag

ObjectType BaseObject::m_tag
privateinherited

Definition at line 15 of file BaseObject.h.

◆ m_view

ViewType RPC_CondCabling::CMAcablingdata::m_view {ViewType::Eta}
private

Definition at line 26 of file CMAcablingdata.h.


The documentation for this class was generated from the following files: