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

#include <WiredOR.h>

Inheritance diagram for RPC_CondCabling::WiredOR:
Collaboration diagram for RPC_CondCabling::WiredOR:

Classes

struct  defineParams
struct  parseParams

Public Types

typedef std::map< int, const RPCchamber *, std::less< int > > RPClink

Public Member Functions

 WiredOR (const parseParams &)
 WiredOR (const WiredOR &)=default
virtual ~WiredOR ()
WiredORoperator= (const WiredOR &)=default
ViewType side () const
int start () const
int stop () const
const ReadoutCheven_read_mul () const
const ReadoutChodd_read_mul () const
const RPClinkRPCread () const
const CMAlistreadoutCMAs () const
const RPCchamberconnected_rpc (int) const
bool check ()
bool setup (SectorLogicSetup &)
void add_cma (const CMAparameters *)
void add_even_read_mul (ReadoutCh &)
void add_odd_read_mul (ReadoutCh &)
int give_max_phi_strips () const
int give_max_eta_strips () const
int RPCacquired () const
void Print (std::ostream &, bool) const
std::string two_obj_error_message (const std::string &, WiredOR *)
std::string error (const std::string &)
int number () const
int station () const
int sector_type () const
std::string error_header () const
std::string no_connection_error (const std::string &, int) const
ObjectType tag () const
const std::string & name () const

Private Types

typedef std::vector< int > ReadoutCh
typedef std::list< const CMAparameters * > CMAlist

Private Member Functions

bool connect (SectorLogicSetup &)

Private Attributes

defineParams m_params {}
ReadoutCh m_even_read_mul
ReadoutCh m_odd_read_mul
RPClink m_RPCread
CMAlist m_readoutCMAs
int m_number {0}
int m_station {0}
int m_sector_type {0}
ObjectType m_tag
std::string m_name

Detailed Description

Definition at line 26 of file WiredOR.h.

Member Typedef Documentation

◆ CMAlist

typedef std::list<const CMAparameters*> RPC_CondCabling::WiredOR::CMAlist
private

Definition at line 51 of file WiredOR.h.

◆ ReadoutCh

typedef std::vector<int> RPC_CondCabling::WiredOR::ReadoutCh
private

Definition at line 50 of file WiredOR.h.

◆ RPClink

typedef std::map<int, const RPCchamber*, std::less<int> > RPC_CondCabling::WiredOR::RPClink

Definition at line 28 of file WiredOR.h.

Constructor & Destructor Documentation

◆ WiredOR() [1/2]

WiredOR::WiredOR ( const parseParams & pars)

Definition at line 14 of file WiredOR.cxx.

14: CablingObject{pars, "WOR"}, m_params{pars} {}
CablingObject(const cablingParameters &, const std::string &)
defineParams m_params
Definition WiredOR.h:48

◆ WiredOR() [2/2]

RPC_CondCabling::WiredOR::WiredOR ( const WiredOR & )
default

◆ ~WiredOR()

WiredOR::~WiredOR ( )
virtualdefault

Member Function Documentation

◆ add_cma()

void WiredOR::add_cma ( const CMAparameters * cma)

Definition at line 58 of file WiredOR.cxx.

58{ m_readoutCMAs.push_back(cma); }

◆ add_even_read_mul()

void WiredOR::add_even_read_mul ( ReadoutCh & mul)

Definition at line 60 of file WiredOR.cxx.

60 {
61 for (int i = 0; i < give_max_phi_strips(); ++i) m_even_read_mul[i] += mul[i];
62}
ReadoutCh m_even_read_mul
Definition WiredOR.h:53
int give_max_phi_strips() const
Definition WiredOR.cxx:34

◆ add_odd_read_mul()

void WiredOR::add_odd_read_mul ( ReadoutCh & mul)

Definition at line 64 of file WiredOR.cxx.

64 {
65 for (int i = 0; i < give_max_phi_strips(); ++i) m_odd_read_mul[i] += mul[i];
66}
ReadoutCh m_odd_read_mul
Definition WiredOR.h:54

◆ check()

bool WiredOR::check ( )

Definition at line 83 of file WiredOR.cxx.

83 {
84 WiredOR::CMAlist::const_iterator cma = m_readoutCMAs.begin();
85 const CMAinput IO = (*cma)->whichCMAinput(station());
86
88 for (int i = 0; i < ch; ++i) {
89 if (!m_even_read_mul[i]) {
90 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "WiredOR")
91 << error("==> No readout coverage for the full set of even PHI strip!");
92 return false;
93 }
94 if (!m_odd_read_mul[i]) {
95 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "WiredOR")
96 << error("==> No readout coverage for the full set of odd PHI strip!");
97 return false;
98 }
99 if (m_even_read_mul[i] > 1 && IO == Pivot) {
100 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "WiredOR")
101 << error("==> Pivot plane even PHI strips must be read only once!");
102 return false;
103 }
104 if (m_odd_read_mul[i] > 1 && IO == Pivot) {
105 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "WiredOR")
106 << error("==> Pivot plane odd PHI strips must be read only once!");
107 return false;
108 }
109 if (m_even_read_mul[i] > 2) {
110 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "WiredOR") <<
111 error("==> Confirm plane even PHI strips can be read only 3 times!");
112 return false;
113 }
114 if (m_odd_read_mul[i] > 1 && IO == Pivot) {
115 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "WiredOR") <<
116 error("==> Confirm plane odd PHI strips can be read only 3 times");
117 return false;
118 }
119 }
120
121 return true;
122}
CMAinput
@ Pivot
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
@ Eta
Definition RPCdef.h:8
int station() const
std::string error(const std::string &)
Definition WiredOR.cxx:172
int give_max_eta_strips() const
Definition WiredOR.cxx:41

◆ connect()

bool WiredOR::connect ( SectorLogicSetup & setup)
private

Definition at line 18 of file WiredOR.cxx.

18 {
19 // Check if RPC chambers exist
20 for (int i = m_params.start; i <= m_params.stop; ++i) {
21 RPCchamber* rpc = setup.find_chamber(station(), i);
22
23 if (rpc) {
24 rpc->add_wor(this);
25 m_RPCread.insert(RPClink::value_type(i, rpc));
26 } else {
27 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "WiredOR") << no_connection_error("RPC", i);
28 return false;
29 }
30 }
31 return true;
32}
std::string no_connection_error(const std::string &, int) const
void add_wor(const WiredOR *)
bool setup(SectorLogicSetup &)
Definition WiredOR.cxx:68

◆ connected_rpc()

const RPCchamber * WiredOR::connected_rpc ( int ord) const

Definition at line 48 of file WiredOR.cxx.

48 {
49 RPClink::const_iterator rpcs = m_RPCread.begin();
50 while (rpcs != m_RPCread.end()) {
51 if (!ord) return (*rpcs).second;
52 --ord;
53 ++rpcs;
54 }
55 return nullptr;
56}

◆ error()

std::string WiredOR::error ( const std::string & msg)
nodiscard

Definition at line 172 of file WiredOR.cxx.

172 {
173 std::ostringstream disp;
174 disp << error_header() << msg << std::endl << *this;
175 return disp.str();
176}
std::string error_header() const
MsgStream & msg
Definition testRead.cxx:32

◆ error_header()

std::string CablingObject::error_header ( ) const
nodiscardinherited

Definition at line 22 of file CablingObject.cxx.

22 {
23 std::ostringstream disp;
24 disp << "Error in Sector Type " << m_sector_type;
25 if (m_station > 0) disp << ", station " << m_station;
26 disp << ":" << std::endl;
27 return disp.str();
28}

◆ even_read_mul()

const WiredOR::ReadoutCh & WiredOR::even_read_mul ( ) const

Definition at line 181 of file WiredOR.cxx.

181{ return m_even_read_mul; }

◆ give_max_eta_strips()

int WiredOR::give_max_eta_strips ( ) const

Definition at line 41 of file WiredOR.cxx.

41 {
42 if (m_params.side != ViewType::Eta) return 0;
43 int max{0};
44 for (const auto& it : m_RPCread) { max = std::max(max, it.second->eta_strips()); }
45 return max;
46}
#define max(a, b)
Definition cfImp.cxx:41

◆ give_max_phi_strips()

int WiredOR::give_max_phi_strips ( ) const

Definition at line 34 of file WiredOR.cxx.

34 {
35 if (m_params.side != ViewType::Phi) return 0;
36 int max{0};
37 for (const auto& it : m_RPCread) { max = std::max(it.second->phi_strips(), max); }
38 return max;
39}
@ Phi
Definition RPCdef.h:8

◆ 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

◆ no_connection_error()

std::string CablingObject::no_connection_error ( const std::string & conn_name,
int num ) const
nodiscardinherited

Definition at line 30 of file CablingObject.cxx.

30 {
31 std::ostringstream disp;
32 disp << error_header() << name() << " n. " << number() << " is supposed to receive input from " << conn_name << " n. " << num << " which doesn't exist!";
33 return disp.str();
34}
const std::string & name() const
Definition BaseObject.h:23
int number() const

◆ number()

int CablingObject::number ( ) const
inherited

Definition at line 12 of file CablingObject.cxx.

12{ return m_number; }

◆ odd_read_mul()

const WiredOR::ReadoutCh & WiredOR::odd_read_mul ( ) const

Definition at line 182 of file WiredOR.cxx.

182{ return m_odd_read_mul; }

◆ operator=()

WiredOR & RPC_CondCabling::WiredOR::operator= ( const WiredOR & )
default

◆ Print()

void WiredOR::Print ( std::ostream & stream,
bool detail ) const
virtual

Reimplemented from BaseObject.

Definition at line 124 of file WiredOR.cxx.

124 {
125 stream << " wired OR n. " << std::setw(2) << number();
126 stream << " (stat " << station() << ")";
127 stream << " connects RPC chamber n. " << std::setw(2) << start();
128 stream << " to RPC chamber n. " << std::setw(2) << stop() << std::endl;
129
130 if (detail) {
131 stream << " It reads " << RPCacquired() << " RPC phi pannel:" << std::endl;
132 RPClink::const_iterator rpc = m_RPCread.begin();
133 while (rpc != m_RPCread.end()) {
134 stream << *(*rpc).second;
135 ++rpc;
136 }
137
138 stream << " It gives input to " << m_readoutCMAs.size() << " Phi CMA:" << std::endl;
139 CMAlist::const_iterator cma = m_readoutCMAs.begin();
140 while (cma != m_readoutCMAs.end()) {
141 stream << *(*cma);
142 ++cma;
143 }
144 int ch = give_max_phi_strips();
145 stream << " Phi even sector readout multiplicity:" << std::endl;
146 stream << "1 5 10 15 20 25 30 35 40 "
147 << "45 50 55 60 65 70 75" << std::endl;
148 stream << "| | | | | | | | | "
149 << "| | | | | | |" << std::endl;
150 for (int i = 0; i < ch; ++i) stream << m_even_read_mul[i];
151 stream << std::endl;
152 stream << " Phi odd sector readout multiplicity:" << std::endl;
153 stream << "1 5 10 15 20 25 30 35 40 "
154 << "45 50 55 60 65 70 75" << std::endl;
155 stream << "| | | | | | | | | "
156 << "| | | | | | |" << std::endl;
157 for (int i = 0; i < ch; ++i) stream << m_odd_read_mul[i];
158 stream << std::endl;
159 stream << "========================================"
160 << "=======================================" << std::endl;
161 }
162}
int RPCacquired() const
Definition WiredOR.h:89

◆ readoutCMAs()

const WiredOR::CMAlist & WiredOR::readoutCMAs ( ) const

Definition at line 184 of file WiredOR.cxx.

184{ return m_readoutCMAs; }

◆ RPCacquired()

int RPC_CondCabling::WiredOR::RPCacquired ( ) const
inline

Definition at line 89 of file WiredOR.h.

89{ return m_RPCread.size(); }

◆ RPCread()

const WiredOR::RPClink & WiredOR::RPCread ( ) const

Definition at line 183 of file WiredOR.cxx.

183{ return m_RPCread; }

◆ sector_type()

int CablingObject::sector_type ( ) const
inherited

Definition at line 14 of file CablingObject.cxx.

14{ return m_sector_type; }

◆ setup()

bool WiredOR::setup ( SectorLogicSetup & setup)

Definition at line 68 of file WiredOR.cxx.

68 {
69 WiredOR* prev = setup.previousWOR(*this);
70 if (prev && !(start() == prev->stop() + 1)) {
71 REPORT_MESSAGE_WITH_CONTEXT(MSG::ERROR, "WiredOR") << two_obj_error_message("boundary inconsistence", prev);
72 return false;
73 }
74
75 if (!connect(setup)) return false;
76
78 m_even_read_mul.assign(ch, 0);
79 m_odd_read_mul.assign(ch, 0);
80 return true;
81}
WiredOR(const parseParams &)
Definition WiredOR.cxx:14
std::string two_obj_error_message(const std::string &, WiredOR *)
Definition WiredOR.cxx:164
bool connect(SectorLogicSetup &)
Definition WiredOR.cxx:18

◆ side()

ViewType WiredOR::side ( ) const

Definition at line 178 of file WiredOR.cxx.

178{ return m_params.side; }

◆ start()

int WiredOR::start ( ) const

Definition at line 179 of file WiredOR.cxx.

179{ return m_params.start; }

◆ station()

int CablingObject::station ( ) const
inherited

Definition at line 13 of file CablingObject.cxx.

13{ return m_station; }

◆ stop()

int WiredOR::stop ( ) const

Definition at line 180 of file WiredOR.cxx.

180{ return m_params.stop; }

◆ 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

◆ two_obj_error_message()

std::string WiredOR::two_obj_error_message ( const std::string & msg,
WiredOR * wor )
nodiscard

Definition at line 164 of file WiredOR.cxx.

164 {
165 std::ostringstream disp;
166 disp << error_header()
167 << " " << msg << " between " << name() << " n. " << number() << " and " << wor->name() << " n. " << wor->number() << std::endl
168 << *this << *wor;
169 return disp.str();
170}

Member Data Documentation

◆ m_even_read_mul

ReadoutCh RPC_CondCabling::WiredOR::m_even_read_mul
private

Definition at line 53 of file WiredOR.h.

◆ m_name

std::string BaseObject::m_name
privateinherited

Definition at line 16 of file BaseObject.h.

◆ m_number

int CablingObject::m_number {0}
privateinherited

Definition at line 12 of file CablingObject.h.

12{0};

◆ m_odd_read_mul

ReadoutCh RPC_CondCabling::WiredOR::m_odd_read_mul
private

Definition at line 54 of file WiredOR.h.

◆ m_params

defineParams RPC_CondCabling::WiredOR::m_params {}
private

Definition at line 48 of file WiredOR.h.

48{};

◆ m_readoutCMAs

CMAlist RPC_CondCabling::WiredOR::m_readoutCMAs
private

Definition at line 57 of file WiredOR.h.

◆ m_RPCread

RPClink RPC_CondCabling::WiredOR::m_RPCread
private

Definition at line 56 of file WiredOR.h.

◆ m_sector_type

int CablingObject::m_sector_type {0}
privateinherited

Definition at line 14 of file CablingObject.h.

14{0};

◆ m_station

int CablingObject::m_station {0}
privateinherited

Definition at line 13 of file CablingObject.h.

13{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: