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

#include <RPCchamberdata.h>

Inheritance diagram for RPC_CondCabling::RPCchamberdata:
Collaboration diagram for RPC_CondCabling::RPCchamberdata:

Public Member Functions

 RPCchamberdata (DBline &, int)
virtual ~RPCchamberdata ()=default
std::unique_ptr< RPCchambergive_rpc ()
int station () const
virtual void Print (std::ostream &, bool) const override

Private Types

typedef std::list< RPCchamberRPClist

Private Member Functions

void reset_data ()
bool get_data (DBline &, RPCchamber::chamberParameters &params)
bool confirm_connectors (ViewType, RPCchamber::chamberParameters &params)
bool confirm_ijk (ViewType, RPCchamber::chamberParameters &params)
ObjectType tag () const
const std::string & name () const

Private Attributes

int m_station {0}
bool m_fail {true}
RPClist m_rpc
ObjectType m_tag
std::string m_name

Detailed Description

Definition at line 18 of file RPCchamberdata.h.

Member Typedef Documentation

◆ RPClist

Definition at line 20 of file RPCchamberdata.h.

Constructor & Destructor Documentation

◆ RPCchamberdata()

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

Definition at line 13 of file RPCchamberdata.cxx.

13 : BaseObject(Logic, "RPC Chamber Data") {
14 int chams{0}, stripsInEtaCon{0}, stripsInPhiCon{0};
15
16 reset_data();
17
18 m_fail = false;
19 if (!(data("station") >> m_station)) return;
20 if (!(data("made of") >> chams >> "chamber. Strips in connectors:")) return;
21 if (!(data("eta") >> stripsInEtaCon)) return;
22 if (!(data("phi") >> stripsInPhiCon)) return;
23 assert(stripsInEtaCon !=0);
24 (++data)("{");
25 do {
26 RPCchamber::chamberParameters params{};
27 params.sectorType = type;
28 params.station = m_station;
29 params.stripsInEtaCon = stripsInEtaCon;
30 params.stripsInPhiCon = stripsInPhiCon;
31
32 if (get_data(data, params)) { m_rpc.emplace_back(params); }
33 ++data;
34 } while (!data("}"));
35}
@ Logic
Definition BaseObject.h:11
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
BaseObject(ObjectType, const std::string &)
Definition BaseObject.cxx:7
bool get_data(DBline &, RPCchamber::chamberParameters &params)

◆ ~RPCchamberdata()

virtual RPC_CondCabling::RPCchamberdata::~RPCchamberdata ( )
virtualdefault

Member Function Documentation

◆ confirm_connectors()

bool RPCchamberdata::confirm_connectors ( ViewType side,
RPCchamber::chamberParameters & params )
private

Definition at line 39 of file RPCchamberdata.cxx.

39 {
40 int strips = (side == ViewType::Phi) ? params.phiStrips : params.etaStrips;
41
42 if (side == ViewType::Phi)
43 params.phiConnectors = strips / params.stripsInPhiCon;
44 else
45 params.etaConnectors = strips / params.stripsInEtaCon;
46
47 int connectors = (side == ViewType::Phi) ? params.phiConnectors : params.etaConnectors;
48 int strips_in_conn = (side == ViewType::Phi) ? params.stripsInPhiCon : params.stripsInEtaCon;
49 float str = (float)strips / (float)connectors;
50 std::string view = (side == ViewType::Phi) ? "phi" : "eta";
51
52 std::ostringstream disp;
53
54 if (str > strips_in_conn) {
55 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "RPCchamberdata")
56 << "RPCdata error in configuration for Sector Type " << params.sectorType << ", station " << params.station << ", RPC number "
57 << params.number << std::endl
58 << " " << view << " strips into connectors must be less than " << strips_in_conn << " (instead are " << std::setprecision(2)
59 << str << ")";
60 return false;
61 }
62 if (params.number == 0 && ((params.etaStrips % 2) || params.etaConnectors % 2)) {
63 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "RPCchamberdata")
64 << "RPCdata error in configuration for Sector Type " << params.sectorType << ", station " << params.station << ", RPC number "
65 << params.number << std::endl
66 << " " << view << " strips and/or connectors must be "
67 << "multiple of 2 "
68 << " (eta_strips " << params.etaStrips << ", eta_conn " << params.etaConnectors << ")";
69 return false;
70 }
71 if (strips_in_conn * connectors != strips) {
72 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "RPCchamberdata")
73 << "RPCdata error in configuration for Sector Type " << params.sectorType << ", station " << params.station << ", RPC number "
74 << params.number << std::endl
75 << " strips into " << view << " connectors are " << std::setprecision(2) << str << " instead of " << strips_in_conn;
76 return false;
77 }
78 return true;
79}
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
@ Phi
Definition RPCdef.h:8

◆ confirm_ijk()

bool RPCchamberdata::confirm_ijk ( ViewType side,
RPCchamber::chamberParameters & params )
private

Definition at line 81 of file RPCchamberdata.cxx.

81 {
82 int ijk = (side == ViewType::Phi) ? params.ijk_PhiReadOut : params.ijk_EtaReadOut;
83 std::string view = (side == ViewType::Phi) ? "phi" : "eta";
84
85 std::ostringstream disp;
86
87 if (ijk != 1 && ijk != 10) {
88 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "RPCchamberdata")
89 << "RPCdata error in configuration for Sector Type " << params.sectorType << ", station " << params.station << ", RPC number "
90 << params.number << std::endl
91 << " " << view << " ijk readout must be 01 or 10; "
92 << " on the contrary it is " << std::setw(2) << std::setfill('0') << ijk << std::setfill(' ');
93 return false;
94 }
95
96 return true;
97}

◆ get_data()

bool RPCchamberdata::get_data ( DBline & data,
RPCchamber::chamberParameters & params )
private

Definition at line 99 of file RPCchamberdata.cxx.

99 {
100 reset_data();
101 if (data("cham") >> params.number >> params.chamberName >> params.stationEta >> params.doubletR >> params.doubletZ >>
102 params.phiReadOutPanels >> "Eview" >> params.etaStrips >> params.ijk_EtaReadOut >> "Pview" >> params.phiStrips >>
103 params.ijk_PhiReadOut) {
104 m_fail = false;
106 if (!confirm_ijk(ViewType::Eta, params) || !confirm_ijk(ViewType::Phi, params)) m_fail = true;
107 }
108
109 return !m_fail;
110}
@ Eta
Definition RPCdef.h:8
bool confirm_connectors(ViewType, RPCchamber::chamberParameters &params)
bool confirm_ijk(ViewType, RPCchamber::chamberParameters &params)

◆ give_rpc()

std::unique_ptr< RPCchamber > RPCchamberdata::give_rpc ( )

Definition at line 112 of file RPCchamberdata.cxx.

112 {
113 if (!m_rpc.empty()) {
114 std::unique_ptr<RPCchamber> cham = std::make_unique<RPCchamber>(m_rpc.front());
115 m_rpc.pop_front();
116 return cham;
117 }
118 return nullptr;
119}

◆ 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 RPCchamberdata::Print ( std::ostream & stream,
bool detail ) const
overridevirtual

Reimplemented from BaseObject.

Definition at line 121 of file RPCchamberdata.cxx.

121 {
122 // stream << "RPC data of station n. " << params.station;
123 // stream << " belonging to sector type " << params.sectorType << std::endl;
124 stream << "It contains " << m_rpc.size();
125 stream << " RPC chambers:" << std::endl;
126 std::list<RPCchamber>::const_iterator it;
127 for (it = m_rpc.begin(); it != m_rpc.end(); ++it) stream << ShowRequest<RPCchamber>(*it, detail);
128}

◆ reset_data()

void RPCchamberdata::reset_data ( )
private

Definition at line 37 of file RPCchamberdata.cxx.

37{ m_fail = true; }

◆ station()

int RPC_CondCabling::RPCchamberdata::station ( ) const
inline

Definition at line 37 of file RPCchamberdata.h.

37{ return m_station; }

◆ 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_fail

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

Definition at line 22 of file RPCchamberdata.h.

22{true};

◆ m_name

std::string BaseObject::m_name
privateinherited

Definition at line 16 of file BaseObject.h.

◆ m_rpc

RPClist RPC_CondCabling::RPCchamberdata::m_rpc
private

Definition at line 24 of file RPCchamberdata.h.

◆ m_station

int RPC_CondCabling::RPCchamberdata::m_station {0}
private

Definition at line 21 of file RPCchamberdata.h.

21{0};

◆ m_tag

ObjectType BaseObject::m_tag
privateinherited

Definition at line 15 of file BaseObject.h.


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