19 #ifdef CSC_RENDER_PLUGIN
56 float eta_min = sign *
Eta(r_min, z);
57 float eta_max = sign *
Eta(r_max, z);
58 float x_min =
EtaToX(eta_min);
59 float x_max =
EtaToX(eta_max);
71 float y_min =
PhiToY(phi_min);
72 float y_max =
PhiToY(phi_max);
76 float xboxmin = (x_min < x_max ? x_min : x_max);
77 float xboxmax = (x_max > x_min ? x_max : x_min);
78 float yboxmin = (y_min < y_max ? y_min : y_max);
79 float yboxmax = (y_max > y_min ? y_max : y_min);
94 for (
unsigned int x = x1;
x < x2;
x++) {
95 for (
unsigned int y = y1; y < y2; y++) {
99 std::vector<unsigned int>
v;
150 unsigned int chamber)
const {
185 if (
boxes[
i].adr == adr) {
216 if (station == 1 && ring == 1)
218 if (station == 1 && ring == 2)
220 if (station == 1 && ring == 3)
222 if (station == 2 && ring == 1)
224 if (station == 2 && ring == 2)
226 if (station == 3 && ring == 1)
228 if (station == 3 && ring == 2)
230 if (station == 4 && ring == 1)
232 if (station == 4 && ring == 2)
244 if (station == 1 && ring == 1)
246 if (station == 1 && ring == 2)
248 if (station == 1 && ring == 3)
250 if (station == 2 && ring == 1)
252 if (station == 2 && ring == 2)
254 if (station == 3 && ring == 1)
256 if (station == 3 && ring == 2)
258 if (station == 4 && ring == 1)
260 if (station == 4 && ring == 2)
272 if (station == 1 && ring == 1)
274 if (station == 1 && ring == 2)
276 if (station == 1 && ring == 3)
278 if (station == 2 && ring == 1)
280 if (station == 2 && ring == 2)
282 if (station == 3 && ring == 1)
284 if (station == 3 && ring == 2)
286 if (station == 4 && ring == 1)
288 if (station == 4 && ring == 2)
339 if (
boxes[i].adr == mask) {
357 if (
boxes[i].adr == mask) {
375 const unsigned int px,
376 const unsigned int py,
392 if (r > 0.0 || z > 0.0) {
393 float sin_theta = r /
sqrt(r * r + z * z);
394 float cos_theta = z /
sqrt(r * r + z * z);
395 return -
log(sin_theta / (cos_theta + 1));
410 float eta_min = -2.5;
412 float a = (x_max - x_min) / (eta_max - eta_min);
413 float b = (eta_max * x_min - eta_min * x_max) / (eta_max - eta_min);
424 float y_max = 2.0 * 3.14159;
426 float phi_max = 2.0 * 3.14159;
427 float a = (y_max - y_min) / (phi_max - phi_min);
428 float b = (phi_max * y_min - phi_min * y_max) / (phi_max - phi_min);
441 if (station == 1 && ring == 1)
442 z_csc = (5834.5 + 6101.5) / 2.0;
443 if (station == 1 && ring == 2)
444 z_csc = (6790.0 + 7064.3) / 2.0;
445 if (station == 1 && ring == 3)
448 z_csc = (8098.0 + 8346.0) / 2.0;
450 z_csc = (9414.8 + 9166.8) / 2.0;
467 if (station == 1 && ring == 1) {
474 if (station == 1 && ring == 2) {
483 if (station == 1 && ring == 3) {
492 if (station == 2 && ring == 1) {
501 if (station == 3 && ring == 1) {
510 if (station == 4 && ring == 1) {
519 if ((station == 2 || station == 3 || station == 4) && ring == 2) {
545 if (station == 1 && ring == 1) {
552 if (station == 1 && ring == 2) {
561 if (station == 1 && ring == 3) {
570 if (station == 2 && ring == 1) {
579 if (station == 3 && ring == 1) {
588 if (station == 4 && ring == 1) {
597 if ((station == 2 || station == 3 || station == 4) && ring == 2) {
628 0.0 + 2.0 * 3.14159 / ((float)(n_chambers)) * ((
float)(chamber - 1) + (
float)(cfeb - 1) / (
float)(n_cfeb));
647 phi_max_cfeb = 0.0 + 2.0 * 3.14159 / (float)n_chambers * ((
float)(chamber - 1) + (
float)(cfeb) / (
float)n_cfeb);
659 std::vector<std::string> tokens;
669 unsigned int num = 0;
672 if (stringToNumber<unsigned int>(num, token,
std::dec)) {
static void splitString(const std::string &str, const std::string &delim, std::vector< std::string > &results)
Split string according to delimiter.
constexpr int32_t ceil(float num)
const bool AddressFromString(const std::string &str_address, Address &adr) const
Construct address from string.
unsigned int partitions_y
static std::vector< std::string > checklist log
PartitionMap::iterator PartitionMapIterator
const float Area(const unsigned int station) const
Calculate station area in eta/phi space.
const bool NextAddressBox(unsigned int &i, const AddressBox *&box, const Address &mask) const
Address box iterator by mask.
const float Z(const int station, const int ring) const
Get Z parameter (used in address eta/phi calculation)
unsigned int partitions_x
void PrintAddress(const Address &adr) const
Prints address for debugging.
const float RMinHV(const int station, const int ring, const int n_hv) const
Get R min parameter (used in address eta/phi calculation)
Area covered by Address in eta/phy space.
const unsigned int NumberOfRings(const unsigned int station) const
Returns the number of rings for the given station.
Detector(const unsigned int p_partitions_x=0, const unsigned int p_partitions_y=0)
Constructor.
const float EtaToX(const float eta) const
Transform eta coordinate to local canvas coordinate.
const bool NextAddressBoxByPartition(unsigned int &i, const unsigned int px, const unsigned int py, AddressBox *&box)
Address box iterator by partition.
#define PARTITION_INDEX(x, y)
const unsigned int NumberOfChamberCFEBs(const unsigned int station, const unsigned int ring) const
Returns the number of CFEBs per Chamber on given Station/Ring.
const bool NextAddress(unsigned int &i, const Address *&adr, const Address &mask) const
Address iterator by mask.
static void trimString(std::string &str)
Trim string.
const unsigned int NumberOfChamberHVs(const unsigned int station, const unsigned int ring) const
Returns the number of HVs per Chamber on given Station/Ring.
const float PhiMinCFEB(const int station, const int ring, const int chamber, const int cfeb) const
Get Min phi boundary for particular CFEB.
const float Eta(const float r, const float z) const
const float PhiToY(const float phi) const
Transform phi coordinate to local canvas coordinate.
unsigned int GlobalChamberIndex(unsigned int side, unsigned int station, unsigned int ring, unsigned int chamber) const
Return global chamber index on his geometric location.
const unsigned int NumberOfChambers(const unsigned int station, const unsigned int ring) const
Returns the number of chambers for the given station and ring.
Structure to store detector addresses of any granularity: from whole detector to the single HV elemen...
tuple size
Write out results.
const float PhiMaxCFEB(const int station, const int ring, const int chamber, const int cfeb) const
Get Max phi boundary for particular CFEB.
const float RMaxHV(const int station, const int ring, const int n_hv) const
Get R max parameter (used in address eta/phi calculation)