ATLAS Offline Software
Loading...
Searching...
No Matches
CMAparameters.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef CMAPARAMETERS_H
6#define CMAPARAMETERS_H
7
8#include <iostream>
9#include <list>
10#include <memory>
11
16
17class CMAprogram;
18
21
23public:
25 typedef std::list<const CMAparameters*> CMAlist;
26
27public:
28 struct defineParams {
29 defineParams() = default;
30 defineParams(const defineParams&) = default;
33
34 int pivotStation{0};
35 int lowPtStation{0};
37
38 int pivotStartChan{-1}; // RPC strips num giving input to the 1st matrix ch
40 int pivotStopChan{-1}; // RPC strips num giving input to the 1st matrix ch
42
43 int lowPtStartCo{-1};
44 int lowPtStopCo{-1};
45 int lowPtNumCo{-1};
46
47 int highPtStartCo{-1};
48 int highPtStopCo{-1};
49 int highPtNumCo{-1};
50 };
51
53 parseParams() = default;
54 parseParams(const parseParams&) = default;
55 parseParams& operator=(const parseParams&) = default;
57 };
58
59private:
61
62 void showDt(std::ostream&, int layer) const;
63 void showMt(char[][90], int, TrigType, int layer) const;
64
68
69public:
70 static constexpr int pivot_channels = 32;
71 static constexpr int confirm_channels = 64;
72
73protected:
74 std::unique_ptr<CMAidentity> m_id; // Indexes that identifies this matrix
75
76 int m_lowPt_start_st{-1}; // RPC strips num giving input to the 1st matrix ch
77 int m_lowPt_start_ch{-1}; // RPC chamber to which the RPC strip belongs
78 int m_lowPt_stop_st{-1}; // RPC strips num giving input to the Last matrix ch
79 int m_lowPt_stop_ch{-1}; // RPC chamber to which the RPC strip belongs
80
81 int m_highPt_start_st{-1}; // RPC strips num giving input to the 1st matrix ch
82 int m_highPt_start_ch{-1}; // RPC chamber to which the RPC strip belongs
83 int m_highPt_stop_st{-1}; // RPC strips num giving input to the Last matrix ch
84 int m_highPt_stop_ch{-1}; // RPC chamber to which the RPC strip belongs
85
86 int m_active_pivot_chs{0}; // Number of active matrix channels for Pivot side
87 int m_active_lowPt_chs{0}; // Number of active matrix channels for LowPt side
88 int m_active_highPt_chs{0}; // Number of active matrix channels for HiPT side
89
90 int m_pivot_rpc_read{0}; // Number of strips put in wired OR on Pivot plane
91 int m_lowPt_rpc_read{0}; // Number of strips put in wired OR on LowPt plane
92 int m_highPt_rpc_read{0}; // Number of strips put in wired OR on HiPt plane
93
94 unsigned int m_first_pivot_code{0}; // first pivot cabled strip (code)
95 unsigned int m_last_pivot_code{0}; // last pivot cabled strip (code)
96 unsigned int m_first_lowPt_code{0}; // first lowPt cabled strip (code)
97 unsigned int m_last_lowPt_code{0}; // last lowPt cabled strip (code)
98 unsigned int m_first_highPt_code{0}; // first highPt cabled strip (code)
99 unsigned int m_last_highPt_code{0}; // last highPt cabled strip (code)
100
101 int (*m_pivot)[2][pivot_channels]{}; // Channel coding for Pivot input
102 int (*m_lowPt)[2][confirm_channels]{}; // Channel coding for Low Pt input
103 int (*m_highPt)[2][confirm_channels]{}; // Channel coding for High Pt input
104
105 std::unique_ptr<CMAprogram> m_lowPt_program; // Low Pt program
106 std::unique_ptr<CMAprogram> m_highPt_program; // High Pt program
107
109
110 void create_pivot_map(int);
111 void create_lowPt_map(int);
112 void create_highPt_map(int);
113
114 [[nodiscard]] std::string noMoreChannels(const std::string& stat);
115 [[nodiscard]] std::string two_obj_error_message(const std::string&, CMAparameters*);
116 [[nodiscard]] std::string no_confirm_error(int);
117 [[nodiscard]] std::string no_wor_readout(int, int);
118 [[nodiscard]] std::string error(const std::string&);
119
120public:
121 CMAparameters(const parseParams& parse);
123 virtual ~CMAparameters();
124
126 bool operator==(const CMAparameters&) const;
127 bool operator==(const CMAidentity&) const;
129
130 const CMAidentity& id() const;
131 const CMAprogram* lowPt_program() const;
132 const CMAprogram* highPt_program() const;
133
134 int pivot_start_ch() const;
135 int pivot_start_st() const;
136 int pivot_stop_ch() const;
137 int pivot_stop_st() const;
138
139 int lowPt_start_co() const;
140 int lowPt_stop_co() const;
141 int lowPt_number_co() const;
142
143 int highPt_start_co() const;
144 int highPt_stop_co() const;
145 int highPt_number_co() const;
146
147 int lowPt_start_st() const;
148 int lowPt_start_ch() const;
149 int lowPt_stop_st() const;
150 int lowPt_stop_ch() const;
151
152 int highPt_start_st() const;
153 int highPt_start_ch() const;
154 int highPt_stop_st() const;
155 int highPt_stop_ch() const;
156
157 int active_pivot_chs() const;
158 int active_lowPt_chs() const;
159 int active_highPt_chs() const;
160
161 int pivot_station() const;
162 int lowPt_station() const;
163 int highPt_station() const;
164
165 int pivot_rpc_read() const;
166 int lowPt_rpc_read() const;
167 int highPt_rpc_read() const;
168
169 unsigned int first_pivot_code() const;
170 unsigned int last_pivot_code() const;
171 unsigned int first_lowPt_code() const;
172 unsigned int last_lowPt_code() const;
173 unsigned int first_highPt_code() const;
174 unsigned int last_highPt_code() const;
175
177
178 unsigned int first_pivot_channel() const;
179 unsigned int last_pivot_channel() const;
180 unsigned int first_lowPt_channel() const;
181 unsigned int last_lowPt_channel() const;
182 unsigned int first_highPt_channel() const;
183 unsigned int last_highPt_channel() const;
184
185 virtual void Print(std::ostream&, bool) const override;
186 void Print(std::ostream&, bool, int layer) const;
187
188 bool isAtlas() const;
189
190 bool give_connection(int, int, CMAinput&, int&, int&) const;
191 bool get_channel(CMAinput, int, int&, int&) const;
192 bool get_cabling(CMAinput, int, int, int, unsigned int&) const;
193
194 const CMAparameters* test(CMAinput, int) const;
195 CMAinput whichCMAinput(int) const;
196 int whichCMAstation(CMAinput input) const;
197
198 bool correct(L1RPCcabCorrection type, CMAinput it, unsigned int layer, unsigned short int Ch1, unsigned short int Ch2,
199 short int num) const;
200
201 void give_strip_code(unsigned int logic_sector, unsigned short int lh, unsigned short int ijk, unsigned short int Channel,
202 std::list<unsigned int>& StripCodes) const;
203};
204
205template <class X> X& operator<<(X& stream, const CMAparameters& cma) {
206 cma.Print(stream, false);
207 return stream;
208}
209
210#endif
X & operator<<(X &stream, const CMAparameters &cma)
CMAinput
@ LowPt
@ NoInput
@ HighPt
@ Pivot
L1RPCcabCorrection
@ Suppression
@ Swap
@ Inversion
@ NoCorrection
@ Shift
TrigType
CMAinput whichCMAinput(int) const
void give_strip_code(unsigned int logic_sector, unsigned short int lh, unsigned short int ijk, unsigned short int Channel, std::list< unsigned int > &StripCodes) const
int highPt_number_co() const
std::string no_wor_readout(int, int)
unsigned int last_lowPt_channel() const
void showDt(std::ostream &, int layer) const
int pivot_stop_st() const
void reset_highPt_cabling()
int pivot_stop_ch() const
unsigned int first_lowPt_channel() const
int highPt_stop_st() const
void showMt(char[][90], int, TrigType, int layer) const
CMAconfiguration m_conf_type
int pivot_station() const
bool isAtlas() const
static constexpr int confirm_channels
bool get_cabling(CMAinput, int, int, int, unsigned int &) const
int active_highPt_chs() const
int pivot_rpc_read() const
int(* m_lowPt)[2][confirm_channels]
int lowPt_start_co() const
virtual void Print(std::ostream &, bool) const override
bool correct(L1RPCcabCorrection type, CMAinput it, unsigned int layer, unsigned short int Ch1, unsigned short int Ch2, short int num) const
int(* m_pivot)[2][pivot_channels]
CMAparameters & operator=(const CMAparameters &)
int pivot_start_st() const
int highPt_start_st() const
unsigned int m_last_pivot_code
unsigned int m_last_lowPt_code
int highPt_stop_co() const
defineParams m_params
int lowPt_stop_st() const
const CMAidentity & id() const
int lowPt_start_st() const
int lowPt_number_co() const
void reset_lowPt_cabling()
int lowPt_rpc_read() const
unsigned int last_highPt_code() const
void reset_pivot_cabling()
CMAconfiguration conf_type() const
unsigned int m_first_pivot_code
std::string two_obj_error_message(const std::string &, CMAparameters *)
int active_lowPt_chs() const
int lowPt_stop_ch() const
const CMAparameters * test(CMAinput, int) const
int highPt_station() const
unsigned int last_lowPt_code() const
std::string noMoreChannels(const std::string &stat)
int lowPt_station() const
unsigned int first_highPt_code() const
bool get_channel(CMAinput, int, int &, int &) const
unsigned int first_lowPt_code() const
void create_highPt_map(int)
unsigned int m_first_highPt_code
const CMAprogram * lowPt_program() const
virtual ~CMAparameters()
std::unique_ptr< CMAprogram > m_lowPt_program
std::unique_ptr< CMAidentity > m_id
int highPt_stop_ch() const
std::list< const CMAparameters * > CMAlist
int highPt_start_ch() const
unsigned int m_last_highPt_code
int lowPt_start_ch() const
void create_pivot_map(int)
void create_lowPt_map(int)
std::unique_ptr< CMAprogram > m_highPt_program
unsigned int m_first_lowPt_code
unsigned int first_pivot_code() const
bool operator==(const CMAparameters &) const
unsigned int first_highPt_channel() const
int highPt_start_co() const
CMAparameters & operator+=(const CMAparameters &)
int active_pivot_chs() const
int lowPt_stop_co() const
unsigned int last_pivot_channel() const
CMAparameters(const parseParams &parse)
std::string no_confirm_error(int)
int highPt_rpc_read() const
int whichCMAstation(CMAinput input) const
int(* m_highPt)[2][confirm_channels]
int pivot_start_ch() const
static constexpr int pivot_channels
unsigned int first_pivot_channel() const
bool give_connection(int, int, CMAinput &, int &, int &) const
const CMAprogram * highPt_program() const
unsigned int last_highPt_channel() const
unsigned int last_pivot_code() const
CablingObject(const cablingParameters &, const std::string &)
std::map< std::string, std::string > parse(const std::string &list)
int lowPtStopCo
First connector (global-addr) for LowPt confirm.
defineParams(const defineParams &)=default
int lowPtStation
RPC station number giving input to pivot chs.
defineParams(defineParams &&)=default
int highPtNumCo
Last connector (global-addr) for HiPt confirm.
int lowPtStartCo
RPC chamber to which the RPC strip belongs.
int highPtStation
RPC station number giving input to Low Pt ch.
int lowPtNumCo
Last connector (global-addr) for LowPt confirm.
defineParams & operator=(const defineParams &)=default
int pivotStartChan
RPC station number giving input to High Pt ch.
int highPtStartCo
Number of connectors giving input to the matrix.
int highPtStopCo
First connector (global-addr) for HiPt confirm.
int pivotStopChan
RPC chamber to which the RPC strip belongs.
parseParams(parseParams &&)=default
parseParams & operator=(const parseParams &)=default
parseParams(const parseParams &)=default