53 if (ijk_eta !=
m_params.ijk_EtaReadOut) {
55 <<
error(
"==> mismatch of ijk_etaReadout with respect to others RPC");
59 if (ijk_phi !=
m_params.ijk_PhiReadOut) {
61 <<
error(
"==> mismatch of ijk_phiReadout with respect to others RPC");
71 <<
error(
"==> No readout coverage for this chamber!");
75 RPCchamber::CMAlist::const_iterator cma =
m_readoutCMAs.begin();
79 for (
int i = 0; i < channels; ++i) {
82 <<
error(
"==> No readout coverage for the full set of ETA strip!");
87 <<
error(
"==> Pivot plane ETA strips must be read only once!");
92 <<
error(
"==> Confirm plane ETA strips can be read only twice!");
99 <<
error(
"==> Gives input to more than 1 Wired OR pannel!");
106 std::ostringstream disp;
108 << mess << std::endl << *
this;
114 if (strip_number >=
m_params.etaStrips)
return false;
116 local_address = strip_number + 1;
118 int middle =
m_params.etaStrips / 2;
119 int address = strip_number - middle;
120 local_address = (strip_number < middle) ? address : address + 1;
126 if (strip_number >=
m_params.phiStrips)
return false;
127 local_address = strip_number + 1;
135 if (
local_strip(side, strip_number, local_address)) {
139 if (h_barrel ==
Negative) global_address = -global_address;
141 if (h_barrel ==
Negative && global_address > 0)
return false;
142 if (h_barrel ==
Positive && global_address < 0)
return false;
147 if (side == Phi) {
return false; }
155 if (
local_strip(side, strip_number, strip_address)) {
156 int address = abs(strip_address) - 1;
157 int strip_sign = (abs(strip_address)) / strip_address;
159 local_address = (address /
m_params.stripsInEtaCon + 1) * strip_sign;
160 low_eta_strips = address %
m_params.stripsInEtaCon;
161 int left =
m_params.stripsInEtaCon - low_eta_strips - 1;
162 int residual_strips =
residual(side, strip_number);
163 hi_eta_strips = (left <= residual_strips) ? left : residual_strips;
166 if (side == Phi) {
return false; }
175 return (
m_params.etaStrips - 1 - strip_number);
177 int total_strips =
m_params.etaStrips / 2;
178 if (strip_number < total_strips)
181 return m_params.etaStrips - strip_number - 1;
184 if (side == Phi) {
return (
m_params.phiStrips - 1 - strip_number); }
189 int& right_strips)
const {
191 if (
local_connector(side, strip_number, l_address, left_strips, right_strips)) {
195 if (h_barrel ==
Negative) global_address = -global_address;
197 if (h_barrel ==
Negative && global_address > 0)
return false;
198 if (h_barrel ==
Positive && global_address < 0)
return false;
202 if (side == Phi) {
return false; }
212 if (strip_number <=
m_params.etaStrips - 1)
return true;
214 strip_number = (global_address > 0) ? global_address +
m_params.etaStrips / 2 - 1 : global_address +
m_params.etaStrips / 2;
215 if (strip_number <= m_params.etaStrips - 1 && strip_number >= 0)
return true;
218 if (side == Phi) {
return false; }
227 if (local_address <=
m_params.etaConnectors - 1) {
228 strip_number = local_address *
m_params.stripsInEtaCon;
233 (global_address > 0) ? global_address +
m_params.etaConnectors / 2 - 1 : global_address +
m_params.etaConnectors / 2;
234 if (local_address <= m_params.etaConnectors - 1 && local_address >= 0) {
235 strip_number = local_address *
m_params.stripsInEtaCon;
241 if (side == Phi) {
return false; }
251 stream <<
" chamber n. " << std::setw(2) <<
number() <<
" ";
255 stream << std::setw(2) <<
doubletZ() <<
" ";
256 stream <<
" (stat " <<
station() <<
")";
257 stream <<
" : eta -> " << std::setw(2) <<
eta_strips() <<
" ";
259 stream << std::setw(2) << std::setfill(
'0') <<
ijk_etaReadout() << std::setfill(
' ');
260 stream <<
" phi -> " << std::setw(2) <<
phi_strips() <<
" ";
262 stream << std::setw(2) << std::setfill(
'0') <<
ijk_phiReadout() << std::setfill(
' ');
267 stream <<
" It gives input to " <<
m_readoutCMAs.size() <<
" Eta CMA:" << std::endl;
273 stream <<
" Eta Readout multiplicity:" << std::endl;
275 <<
" 1 5 10 15 20 25 30 35 40" << std::endl;
277 <<
" | | | | | | | | |" << std::endl;
281 stream <<
" It gives input to " <<
m_readoutWORs.size() <<
" WiredOR pannel:" << std::endl;
282 RPCchamber::WORlist::const_iterator wor =
m_readoutWORs.begin();
288 stream <<
"========================================"
289 <<
"=======================================" << std::endl;
309 case 'L': sd = (sector % 2) ?
"HV" :
"RO";
break;
311 case 'E': sd = (sector % 2) ?
"HV" :
"RO";
break;
313 case 'R': sd = (sector % 2) ?
"HV" :
"RO";
break;
315 case 'M': sd = (sector % 2) ?
"HV" :
"RO";
break;
317 case 'S': sd = (sector % 2) ?
"RO" :
"HV";
break;
319 case 'F': sd = (sector % 2) ?
"RO" :
"HV";
break;
321 case 'G': sd = (sector % 2) ?
"RO" :
"HV";
break;
326 std::ostringstream out;
328 int physicsSector = (((sector + 1) % 32) / 2 + 1) % 16;
329 if (!physicsSector) physicsSector = 16;
334 out <<
stationName() << etaIdx << side << std::setw(2) << std::setfill(
'0') << physicsSector <<
"-" << sd <<
"-" <<
doubletZ();
336 out <<
stationName() <<
stationEta() << side << std::setw(2) << std::setfill(
'0') << physicsSector <<
"-" << sd <<
"-"
364 return (sector <= 31) ? false :
false;
366 return (sector <= 31) ? false :
false;
371 return (sector <= 31) ? false :
false;
373 return (sector <= 31) ? false :
false;
384 if (
stationName()[1] ==
'O' && (sector == 25 || sector == 26 || sector == 57 || sector == 58)) {
398 if (
stationName()[1] ==
'O' &&
stationName()[3] !=
'8' && (sector == 25 || sector == 26 || sector == 57 || sector == 58)) {
411 default:
return false;
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.
std::string error_header() const
CablingObject(const cablingParameters &, const std::string &)
int eta_connectors() const
RPCchamber(const RPCchamber::chamberParameters ¶ms)
Helper struct to reduce the number of arguments in the constructor.
std::list< const WiredOR * > WORlist
bool global_strip(ViewType, HalfType, int, int &) const
std::list< const EtaCMA * > CMAlist
void set_eta_co_global(int)
const CMAlist & readoutCMAs() const
bool Gconn_2_Lnumber(ViewType, int, int &, int &) const
int ijk_phiReadout() const
int phi_connectors() const
std::string extendedName(int) const
bool global_connector(ViewType, HalfType, int, int &, int &, int &) const
void Print(std::ostream &, bool) const
std::string stationName() const
int strips_in_Phi_Conn() const
int ijk_etaReadout() const
int strips_in_Eta_Conn() const
int phiReadoutPannels() const
void add_wor(const WiredOR *)
bool setup(SectorLogicSetup &)
bool local_strip(ViewType, int, int &) const
void add_cma(const EtaCMA *)
void add_eta_channel(int)
int eta_conn_global() const
const WORlist & readoutWORs() const
const std::string & chamber_name() const
bool local_connector(ViewType, int, int &, int &, int &) const
bool inversion(int) const
bool Gstrip_2_Lnumber(ViewType, int, int &) const
int residual(ViewType, int) const
chamberDefineParams m_params
const ReadoutCh & eta_read_mul() const
std::string error(const std::string &) const
void set_eta_st_global(int)
int eta_strip_global() const
std::vector< int > ReadoutCh