CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Private Attributes
HGCalWaferMask Class Reference

#include <HGCalWaferMask.h>

Public Member Functions

 HGCalWaferMask ()=default
 

Static Public Member Functions

static int getRotation (int zside, int type, int rotn)
 
static std::pair< int, int > getTypeMode (const double &xpos, const double &ypos, const double &delX, const double &delY, const double &rin, const double &rout, const int &waferType, const int &mode, const bool &v17, const bool &debug=false)
 
static bool goodCell (int u, int v, int N, int type, int rotn)
 
static bool goodCell (int u, int v, int waferType)
 
static bool goodTypeMode (const double &xpos, const double &ypos, const double &delX, const double &delY, const double &rin, const double &rout, const int &part, const int &rotn, const bool &v17, const bool &debug=false)
 
static bool maskCell (int u, int v, int N, int ncor, int fcor, int corners)
 
static std::array< double, 4 > maskCut (const int &part, const int &place, const double &waferSize, const double &offset, const bool &v17OrLess)
 
static std::vector< std::pair< double, double > > waferXY (const int &part, const int &orient, const int &zside, const double &waferSize, const double &offset, const double &xpos, const double &ypos, const bool &v17)
 
static std::vector< std::pair< double, double > > waferXY (const int &part, const int &placement, const double &wafersize, const double &offset, const double &xpos, const double &ypos, const bool &v17)
 

Static Private Attributes

static constexpr std::array< double, 12 > cos_1 = {{0.5, -0.5, -1.0, -0.5, 0.5, 1.0, 0.5, -0.5, -1.0, -0.5, 0.5, 1.0}}
 
static constexpr double cos_60_ = 0.5
 
static constexpr std::array< double, 12 > sign_1 = {{1.0, -1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0}}
 
static constexpr std::array< double, 12 > sign_2 = {{1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0, 1.0}}
 
static constexpr double sin_60_ = 0.5 * sqrt3_
 
static constexpr double sqrt3_ = 1.732050807568877
 
static constexpr std::array< double, 12 > tan_1
 
static constexpr double tan_60_ = sqrt3_
 

Detailed Description

this class determines the masking of wafers to mimic partial wafers

Date
2019/01/15 00:06:50
Author
Sunanda Banerjee, Fermilab sunan.nosp@m.da.b.nosp@m.anerj.nosp@m.ee@c.nosp@m.ern.c.nosp@m.h

Definition at line 17 of file HGCalWaferMask.h.

Constructor & Destructor Documentation

◆ HGCalWaferMask()

HGCalWaferMask::HGCalWaferMask ( )
default

Member Function Documentation

◆ getRotation()

int HGCalWaferMask::getRotation ( int  zside,
int  type,
int  rotn 
)
static

Definition at line 468 of file HGCalWaferMask.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), HGCalTypes::WaferCorner0, HGCalTypes::WaferCorner1, HGCalTypes::WaferCorner2, HGCalTypes::WaferCorner3, HGCalTypes::WaferCorner4, HGCalTypes::WaferCorner5, HGCalTypes::WaferCornerMax, HGCalTypes::WaferFive, HGCalTypes::WaferFive2, HGCalTypes::WaferFull, HGCalTypes::WaferSemi, HGCalTypes::WaferSemi2, HGCalTypes::WaferThree, and ecaldqm::zside().

Referenced by HGCalGeomParameters::loadSpecParsHexagon8(), and waferXY().

468  {
469  // Needs extension for V17
470  if (rotn >= HGCalTypes::WaferCornerMax)
472  int newrotn(rotn);
473  if ((zside < 0) && (type != HGCalTypes::WaferFull)) {
474  if ((type == HGCalTypes::WaferFive) || (type == HGCalTypes::WaferFive2)) { //WaferFive/WaferFive2
481  newrotn = rot1[rotn];
482  } else if ((type == HGCalTypes::WaferThree) || (type == HGCalTypes::WaferSemi) ||
483  (type == HGCalTypes::WaferSemi2)) { //WaferThree/WaferSemi/WaferSemi2
490  newrotn = rot2[rotn];
491  } else { //WaferHalf/WaferChopTwo/WaferChopTwoM/WaferHalf2
498  newrotn = rot3[rotn];
499  }
500  }
501 #ifdef EDM_ML_DEBUG
502  edm::LogVerbatim("HGCalGeom") << "zside " << zside << " type " << type << " rotn " << rotn << ":" << newrotn;
503 #endif
504  return newrotn;
505 }
Log< level::Info, true > LogVerbatim
static constexpr int32_t WaferFive2
Definition: HGCalTypes.h:44
static constexpr int32_t WaferThree
Definition: HGCalTypes.h:42
int zside(DetId const &)
static constexpr int32_t WaferSemi2
Definition: HGCalTypes.h:41
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
static constexpr int32_t WaferCorner1
Definition: HGCalTypes.h:14
static constexpr int32_t WaferCorner5
Definition: HGCalTypes.h:18
static constexpr int32_t WaferCorner4
Definition: HGCalTypes.h:17
static constexpr int32_t WaferCornerMax
Definition: HGCalTypes.h:77
static constexpr int32_t WaferCorner2
Definition: HGCalTypes.h:15
static constexpr int32_t WaferCorner0
Definition: HGCalTypes.h:13
static constexpr int32_t WaferCorner3
Definition: HGCalTypes.h:16
static constexpr int32_t WaferFive
Definition: HGCalTypes.h:36
static constexpr int32_t WaferSemi
Definition: HGCalTypes.h:40

◆ getTypeMode()

std::pair< int, int > HGCalWaferMask::getTypeMode ( const double &  xpos,
const double &  ypos,
const double &  delX,
const double &  delY,
const double &  rin,
const double &  rout,
const int &  waferType,
const int &  mode,
const bool &  v17,
const bool &  debug = false 
)
static

Definition at line 507 of file HGCalWaferMask.cc.

References edmMakeDummyCfis::base, HGCalTypes::c00, HGCalTypes::c10, HGCalTypes::c22, HGCalTypes::c22O, HGCalTypes::c27, HGCalTypes::c27O, HGCalTypes::c50, HGCalTypes::c61, HGCalTypes::c61O, HGCalTypes::c75, HGCalTypes::c77, HGCalTypes::c77O, HGCalTypes::c88, HGCalTypes::c88O, ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), debug, spr::find(), dqmdumpme::k, HGCalGeomTools::k_allCorners, HGCalGeomTools::k_fiveCorners, HGCalGeomTools::k_fourCorners, HGCalTypes::k_OffsetRotation, HGCalGeomTools::k_threeCorners, HGCalGeomTools::k_twoCorners, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, mathSSE::sqrt(), HGCalTypes::WaferChopTwo, HGCalTypes::WaferChopTwoM, HGCalTypes::WaferCorner0, HGCalTypes::WaferFive, HGCalTypes::WaferFive2, HGCalTypes::WaferFull, HGCalTypes::WaferHalf, HGCalTypes::WaferHalf2, HGCalTypes::WaferOut, HGCalTypes::WaferSemi, HGCalTypes::WaferSemi2, and HGCalTypes::WaferThree.

Referenced by HGCalGeomParameters::loadWaferHexagon8().

516  {
517  // No need to extend this for V17 -- use flat file information only
518  int ncor(0), iok(0);
520  double c22(HGCalTypes::c22), c27(HGCalTypes::c27), c61(HGCalTypes::c61);
521  double c77(HGCalTypes::c77), c88(HGCalTypes::c88);
522  if (v17OrLess) {
523  c22 = HGCalTypes::c22O;
524  c27 = HGCalTypes::c27O;
525  c61 = HGCalTypes::c61O;
526  c77 = HGCalTypes::c77O;
527  c88 = HGCalTypes::c88O;
528  }
529 
530  static constexpr int corners = 6;
531  static constexpr int base = 10;
532  double rin2 = rin * rin;
533  double rout2 = rout * rout;
534  double dx0[corners] = {HGCalTypes::c00 * delX,
535  HGCalTypes::c10 * delX,
536  HGCalTypes::c10 * delX,
537  HGCalTypes::c00 * delX,
538  -HGCalTypes::c10 * delX,
539  -HGCalTypes::c10 * delX};
540  double dy0[corners] = {-HGCalTypes::c10 * delY,
541  -HGCalTypes::c50 * delY,
542  HGCalTypes::c50 * delY,
543  HGCalTypes::c10 * delY,
544  HGCalTypes::c50 * delY,
545  -HGCalTypes::c50 * delY};
546  double xc[corners], yc[corners];
547  for (int k = 0; k < corners; ++k) {
548  xc[k] = xpos + dx0[k];
549  yc[k] = ypos + dy0[k];
550  double rpos2 = (xc[k] * xc[k] + yc[k] * yc[k]);
551  if (rpos2 <= rout2 && rpos2 >= rin2) {
552  ++ncor;
553  iok = iok * base + 1;
554  } else {
555  iok *= base;
556  }
557  }
558  if (debug)
559  edm::LogVerbatim("HGCalGeom") << "I/p: xp " << xpos << " yp " << ypos << " dX " << delX << " dY " << delY << " rin "
560  << rin << " rout " << rout << " wtype " << wType << " mode " << mode << " Corners "
561  << ncor << " iok " << iok;
562 
563  static constexpr int ipat5[corners] = {101111, 110111, 111011, 111101, 111110, 11111};
564  static constexpr int ipat4[corners] = {100111, 110011, 111001, 111100, 11110, 1111};
565  static constexpr int ipat3[corners] = {100011, 110001, 111000, 11100, 1110, 111};
566  static constexpr int ipat2[corners] = {11, 100001, 110000, 11000, 1100, 110};
567  double dx1[corners] = {HGCalTypes::c50 * delX,
568  HGCalTypes::c10 * delX,
569  HGCalTypes::c50 * delX,
570  -HGCalTypes::c50 * delX,
571  -HGCalTypes::c10 * delX,
572  -HGCalTypes::c50 * delX};
573  double dy1[corners] = {-HGCalTypes::c75 * delY,
574  HGCalTypes::c00 * delY,
575  HGCalTypes::c75 * delY,
576  HGCalTypes::c75 * delY,
577  HGCalTypes::c00 * delY,
578  -HGCalTypes::c75 * delY};
579  double dx2[corners] = {HGCalTypes::c50 * delX,
580  -HGCalTypes::c50 * delX,
581  -HGCalTypes::c10 * delX,
582  -HGCalTypes::c50 * delX,
583  HGCalTypes::c50 * delX,
584  HGCalTypes::c10 * delX};
585  double dy2[corners] = {HGCalTypes::c75 * delY,
586  HGCalTypes::c75 * delY,
587  HGCalTypes::c00 * delY,
588  -HGCalTypes::c75 * delY,
589  -HGCalTypes::c75 * delY,
590  HGCalTypes::c00 * delY};
591  double dx3[corners] = {
592  c22 * delX, HGCalTypes::c10 * delX, c77 * delX, -c22 * delX, -HGCalTypes::c10 * delX, -c77 * delX};
593  double dy3[corners] = {-c88 * delY, -c27 * delY, c61 * delY, c88 * delY, c27 * delY, -c61 * delY};
594  double dx4[corners] = {
595  c22 * delX, -c77 * delX, -HGCalTypes::c10 * delX, -c22 * delX, c77 * delX, HGCalTypes::c10 * delX};
596  double dy4[corners] = {c88 * delY, c61 * delY, -c27 * delY, -c88 * delY, -c61 * delY, c27 * delY};
597  double dx5[corners] = {-HGCalTypes::c50 * delX,
598  -HGCalTypes::c10 * delX,
599  -HGCalTypes::c50 * delX,
600  HGCalTypes::c50 * delX,
601  HGCalTypes::c10 * delX,
602  HGCalTypes::c50 * delX};
603  double dy5[corners] = {HGCalTypes::c75 * delY,
604  HGCalTypes::c00 * delY,
605  -HGCalTypes::c75 * delY,
606  -HGCalTypes::c75 * delY,
607  HGCalTypes::c00 * delY,
608  HGCalTypes::c75 * delY};
609  double dx6[corners] = {
610  -c77 * delX, -HGCalTypes::c10 * delX, -c22 * delX, c77 * delX, HGCalTypes::c10 * delX, c22 * delX};
611  double dy6[corners] = {c61 * delY, -c27 * delY, -c88 * delY, -c61 * delY, c27 * delY, c88 * delY};
612  double dx7[corners] = {
613  -c22 * delX, -HGCalTypes::c10 * delX, -c77 * delX, c22 * delX, HGCalTypes::c10 * delX, c77 * delX};
614  double dy7[corners] = {c88 * delY, c27 * delY, -c61 * delY, -c88 * delY, -c27 * delY, c61 * delY};
615  double dx8[corners] = {
616  c77 * delX, HGCalTypes::c10 * delX, c22 * delX, -c77 * delX, -HGCalTypes::c10 * delX, -c22 * delX};
617  double dy8[corners] = {-c61 * delY, c27 * delY, c88 * delY, c61 * delY, -c27 * delY, -c88 * delY};
618  double dx9[corners] = {
619  -c22 * delX, c77 * delX, HGCalTypes::c10 * delX, c22 * delX, -c77 * delX, -HGCalTypes::c10 * delX};
620  double dy9[corners] = {-c88 * delY, -c61 * delY, c27 * delY, c88 * delY, c61 * delY, -c27 * delY};
621 
622  if (ncor == HGCalGeomTools::k_allCorners) {
623  } else if (ncor == HGCalGeomTools::k_fiveCorners) {
624  rotn = static_cast<int>(std::find(ipat5, ipat5 + 6, iok) - ipat5);
626  } else if (ncor == HGCalGeomTools::k_fourCorners) {
627  rotn = static_cast<int>(std::find(ipat4, ipat4 + 6, iok) - ipat4);
629  double rpos12 = ((xpos + dx1[rotn]) * (xpos + dx1[rotn]) + (ypos + dy1[rotn]) * (ypos + dy1[rotn]));
630  double rpos22(0);
631  if (rpos12 <= rout2 && rpos12 >= rin2) {
632  rpos22 = ((xpos + dx2[rotn]) * (xpos + dx2[rotn]) + (ypos + dy2[rotn]) * (ypos + dy2[rotn]));
633  if (rpos22 <= rout2 && rpos22 >= rin2)
635  }
636  if (debug)
637  edm::LogVerbatim("HGCalGeom") << "Test for Chop2 " << std::sqrt(rpos12) << ":" << std::sqrt(rpos22) << " Type "
638  << type;
639  if ((type == HGCalTypes::WaferHalf) && (wType == 0)) {
640  rpos12 = ((xpos + dx3[rotn]) * (xpos + dx3[rotn]) + (ypos + dy3[rotn]) * (ypos + dy3[rotn]));
641  if (rpos12 <= rout2 && rpos12 >= rin2) {
642  rpos22 = ((xpos + dx4[rotn]) * (xpos + dx4[rotn]) + (ypos + dy4[rotn]) * (ypos + dy4[rotn]));
643  if (rpos22 <= rout2 && rpos22 >= rin2)
645  }
646  if (debug)
647  edm::LogVerbatim("HGCalGeom") << "Test for Chop2M " << std::sqrt(rpos12) << ":" << std::sqrt(rpos22) << " Type "
648  << type;
649  }
650  } else if (ncor == HGCalGeomTools::k_threeCorners) {
651  rotn = static_cast<int>(std::find(ipat3, ipat3 + 6, iok) - ipat3);
653  double rpos12 = ((xpos + dx7[rotn]) * (xpos + dx7[rotn]) + (ypos + dy7[rotn]) * (ypos + dy7[rotn]));
654  double rpos22(0);
655  if (rpos12 <= rout2 && rpos12 >= rin2) {
656  rpos22 = ((xpos + dx8[rotn]) * (xpos + dx8[rotn]) + (ypos + dy8[rotn]) * (ypos + dy8[rotn]));
657  if (rpos22 <= rout2 && rpos22 >= rin2)
659  }
660  if (debug)
661  edm::LogVerbatim("HGCalGeom") << "Test for Five2 " << std::sqrt(rpos12) << ":" << std::sqrt(rpos22) << " Type "
662  << type;
663  if ((type == HGCalTypes::WaferThree) && (wType == 0)) {
664  rpos12 = ((xpos + dx1[rotn]) * (xpos + dx1[rotn]) + (ypos + dy1[rotn]) * (ypos + dy1[rotn]));
665  if (rpos12 <= rout2 && rpos12 >= rin2) {
666  rpos22 = ((xpos + dx5[rotn]) * (xpos + dx5[rotn]) + (ypos + dy5[rotn]) * (ypos + dy5[rotn]));
667  if (rpos22 <= rout2 && rpos22 >= rin2)
669  }
670  if (debug)
671  edm::LogVerbatim("HGCalGeom") << "Test for Semi " << std::sqrt(rpos12) << ":" << std::sqrt(rpos22) << " Type "
672  << type;
673  }
674  if ((type == HGCalTypes::WaferThree) && (wType == 0)) {
675  rpos12 = ((xpos + dx3[rotn]) * (xpos + dx3[rotn]) + (ypos + dy3[rotn]) * (ypos + dy3[rotn]));
676  if (rpos12 <= rout2 && rpos12 >= rin2) {
677  rpos22 = ((xpos + dx6[rotn]) * (xpos + dx6[rotn]) + (ypos + dy6[rotn]) * (ypos + dy6[rotn]));
678  if (rpos22 <= rout2 && rpos22 >= rin2)
680  }
681  if (debug)
682  edm::LogVerbatim("HGCalGeom") << "Test for SemiM " << std::sqrt(rpos12) << ":" << std::sqrt(rpos22) << " Type "
683  << type;
684  }
685  } else if (ncor == HGCalGeomTools::k_twoCorners) {
686  rotn = static_cast<int>(std::find(ipat2, ipat2 + 6, iok) - ipat2);
688  double rpos12 = ((xpos + dx7[rotn]) * (xpos + dx7[rotn]) + (ypos + dy7[rotn]) * (ypos + dy7[rotn]));
689  double rpos22(0);
690  if (rpos12 <= rout2 && rpos12 >= rin2) {
691  rpos22 = ((xpos + dx9[rotn]) * (xpos + dx9[rotn]) + (ypos + dy9[rotn]) * (ypos + dy9[rotn]));
692  if (rpos22 <= rout2 && rpos22 >= rin2)
694  else
696  }
697  if (debug)
698  edm::LogVerbatim("HGCalGeom") << "Test for Half2 " << std::sqrt(rpos12) << ":" << std::sqrt(rpos22) << " Type "
699  << type;
700  } else {
702  }
703 
704  if (debug)
705  edm::LogVerbatim("HGCalGeom") << "I/p: xpos " << xpos << " ypos " << ypos << " dX " << delX << " dY " << delY
706  << " rin " << rin << " rout " << rout << " wType " << wType << " mode " << mode
707  << " O/p: ok " << iok << " ncor " << ncor << " type " << type << " rotn " << rotn;
708  return ((mode == 0) ? std::make_pair(ncor, rotn) : std::make_pair(type, (rotn + HGCalTypes::k_OffsetRotation)));
709 }
Log< level::Info, true > LogVerbatim
static constexpr double c27O
Definition: HGCalTypes.h:100
static constexpr int32_t WaferHalf2
Definition: HGCalTypes.h:43
static constexpr int32_t WaferFive2
Definition: HGCalTypes.h:44
static constexpr double c77O
Definition: HGCalTypes.h:108
static constexpr int k_OffsetRotation
Definition: HGCalTypes.h:93
static constexpr int k_fourCorners
static constexpr int32_t WaferOut
Definition: HGCalTypes.h:56
static constexpr int k_twoCorners
static constexpr int32_t WaferThree
Definition: HGCalTypes.h:42
static constexpr double c50
Definition: HGCalTypes.h:103
static constexpr double c88
Definition: HGCalTypes.h:113
static constexpr double c27
Definition: HGCalTypes.h:102
static constexpr double c10
Definition: HGCalTypes.h:114
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
static constexpr int32_t WaferSemi2
Definition: HGCalTypes.h:41
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
static constexpr int32_t WaferHalf
Definition: HGCalTypes.h:39
T sqrt(T t)
Definition: SSEVec.h:23
static constexpr double c22O
Definition: HGCalTypes.h:96
static constexpr int32_t WaferCorner0
Definition: HGCalTypes.h:13
static constexpr double c00
Definition: HGCalTypes.h:95
static constexpr double c88O
Definition: HGCalTypes.h:111
#define debug
Definition: HDRShower.cc:19
static constexpr int k_fiveCorners
static constexpr int32_t WaferChopTwoM
Definition: HGCalTypes.h:38
static constexpr double c77
Definition: HGCalTypes.h:110
static constexpr double c61
Definition: HGCalTypes.h:106
static constexpr double c61O
Definition: HGCalTypes.h:104
static constexpr int k_threeCorners
static constexpr double c75
Definition: HGCalTypes.h:107
static constexpr double c22
Definition: HGCalTypes.h:98
static constexpr int32_t WaferFive
Definition: HGCalTypes.h:36
static constexpr int32_t WaferSemi
Definition: HGCalTypes.h:40
static constexpr int k_allCorners
static constexpr int32_t WaferChopTwo
Definition: HGCalTypes.h:37

◆ goodCell() [1/2]

bool HGCalWaferMask::goodCell ( int  u,
int  v,
int  N,
int  type,
int  rotn 
)
static

Definition at line 110 of file HGCalWaferMask.cc.

References caHitNtupletGeneratorKernels::good, dqmiodumpmetadata::n, MetAnalyzer::u2, findQualityFiles::v, HGCalTypes::WaferChopTwo, HGCalTypes::WaferChopTwoM, HGCalTypes::WaferCorner0, HGCalTypes::WaferCorner1, HGCalTypes::WaferCorner2, HGCalTypes::WaferCorner3, HGCalTypes::WaferCorner4, HGCalTypes::WaferFive, HGCalTypes::WaferFive2, HGCalTypes::WaferFull, HGCalTypes::WaferHalf, HGCalTypes::WaferHalf2, HGCalTypes::WaferSemi, HGCalTypes::WaferSemi2, and HGCalTypes::WaferThree.

Referenced by HGCalDDDConstants::cellInLayer(), HGCalDDDConstants::isValidCell8(), and HGCalDDDConstants::maskCell().

110  {
111  // for V15 and V16
112  bool good(false);
113  int n2 = n / 2;
114  int n4 = n / 4;
115  int n3 = (n + 1) / 3;
116  switch (type) {
117  case (HGCalTypes::WaferFull): { //WaferFull
118  good = true;
119  break;
120  }
121  case (HGCalTypes::WaferFive): { //WaferFive
122  switch (rotn) {
123  case (HGCalTypes::WaferCorner0): {
124  int u2 = u / 2;
125  good = ((v - u2) <= n);
126  break;
127  }
128  case (HGCalTypes::WaferCorner1): {
129  good = ((v + u) < (3 * n));
130  break;
131  }
132  case (HGCalTypes::WaferCorner2): {
133  int v2 = (v + 1) / 2;
134  good = ((u - v2) <= n);
135  break;
136  }
137  case (HGCalTypes::WaferCorner3): {
138  int u2 = (u - 1) / 2;
139  good = (u2 <= v);
140  break;
141  }
142  case (HGCalTypes::WaferCorner4): {
143  good = ((v + u) >= n - 1);
144  break;
145  }
146  default: {
147  int v2 = v / 2;
148  good = (u >= v2);
149  break;
150  }
151  }
152  break;
153  }
154  case (HGCalTypes::WaferChopTwo): { //WaferChopTwo
155  switch (rotn) {
156  case (HGCalTypes::WaferCorner0): {
157  good = (v < (3 * n2));
158  break;
159  }
160  case (HGCalTypes::WaferCorner1): {
161  good = (u < (3 * n2));
162  break;
163  }
164  case (HGCalTypes::WaferCorner2): {
165  good = ((u - v) <= n2);
166  break;
167  }
168  case (HGCalTypes::WaferCorner3): {
169  good = (v >= n2);
170  break;
171  }
172  case (HGCalTypes::WaferCorner4): {
173  good = (u >= n2 - 1);
174  break;
175  }
176  default: {
177  good = ((v - u) < n2);
178  break;
179  }
180  }
181  break;
182  }
183  case (HGCalTypes::WaferChopTwoM): { //WaferChopTwoM
184  switch (rotn) {
185  case (HGCalTypes::WaferCorner0): {
186  good = (v < (5 * n4));
187  break;
188  }
189  case (HGCalTypes::WaferCorner1): {
190  good = (u <= (5 * n4));
191  break;
192  }
193  case (HGCalTypes::WaferCorner2): {
194  good = ((u - v) <= n4);
195  break;
196  }
197  case (HGCalTypes::WaferCorner3): {
198  good = (v >= (3 * n4 - 1));
199  break;
200  }
201  case (HGCalTypes::WaferCorner4): {
202  good = (u >= (3 * n4));
203  break;
204  }
205  default: {
206  good = ((v - u) <= n4);
207  break;
208  }
209  }
210  break;
211  }
212  case (HGCalTypes::WaferHalf): { //WaferHalf
213  switch (rotn) {
214  case (HGCalTypes::WaferCorner0): {
215  good = (v < n);
216  break;
217  }
218  case (HGCalTypes::WaferCorner1): {
219  good = (u <= n);
220  break;
221  }
222  case (HGCalTypes::WaferCorner2): {
223  good = (v >= u);
224  break;
225  }
226  case (HGCalTypes::WaferCorner3): {
227  good = (v >= n - 1);
228  break;
229  }
230  case (HGCalTypes::WaferCorner4): {
231  good = (u >= n);
232  break;
233  }
234  default: {
235  good = (u >= v);
236  break;
237  }
238  }
239  break;
240  }
241  case (HGCalTypes::WaferSemi): { //WaferSemi
242  switch (rotn) {
243  case (HGCalTypes::WaferCorner0): {
244  good = ((u + v) <= (2 * n));
245  break;
246  }
247  case (HGCalTypes::WaferCorner1): {
248  good = ((2 * u - v) <= (n + 1));
249  break;
250  }
251  case (HGCalTypes::WaferCorner2): {
252  good = ((2 * v - u) >= (n - 2));
253  break;
254  }
255  case (HGCalTypes::WaferCorner3): {
256  good = ((u + v) >= (2 * n - 2));
257  break;
258  }
259  case (HGCalTypes::WaferCorner4): {
260  good = ((2 * u - v) >= (n - 1));
261  break;
262  }
263  default: {
264  good = ((2 * v - u) <= n);
265  break;
266  }
267  }
268  break;
269  }
270  case (HGCalTypes::WaferThree): { //WaferThree
271  switch (rotn) {
272  case (HGCalTypes::WaferCorner0): {
273  good = ((v + u) <= n);
274  break;
275  }
276  case (HGCalTypes::WaferCorner1): {
277  good = ((2 * u - v) <= 1);
278  break;
279  }
280  case (HGCalTypes::WaferCorner2): {
281  int u2 = ((u > 0) ? (u / 2) : 0);
282  int uv = v - u2;
283  good = (uv >= (n - 1));
284  break;
285  }
286  case (HGCalTypes::WaferCorner3): {
287  good = ((v + u) >= (3 * n - 2));
288  break;
289  }
290  case (HGCalTypes::WaferCorner4): {
291  int uv = 2 * u - v;
292  good = (uv >= (2 * n - 1));
293  break;
294  }
295  default: {
296  int uv = u - 2 * v;
297  good = (uv >= 0);
298  break;
299  }
300  }
301  break;
302  }
303  case (HGCalTypes::WaferSemi2): { //WaferSemi2
304  switch (rotn) {
305  case (HGCalTypes::WaferCorner0): {
306  good = ((u + v) <= (4 * n3 + 1));
307  break;
308  }
309  case (HGCalTypes::WaferCorner1): {
310  good = ((2 * u - v) <= n2);
311  break;
312  }
313  case (HGCalTypes::WaferCorner2): {
314  int u2 = ((u + 1) / 2);
315  good = ((v - u2) >= (3 * n4 - 1));
316  break;
317  }
318  case (HGCalTypes::WaferCorner3): {
319  good = ((u + v) >= (5 * n2 - 1));
320  break;
321  }
322  case (HGCalTypes::WaferCorner4): {
323  good = ((2 * u - v) >= (3 * n2));
324  break;
325  }
326  default: {
327  int u2 = (u + 1) / 2;
328  good = ((v - u2) < n4);
329  break;
330  }
331  }
332  break;
333  }
334  case (HGCalTypes::WaferFive2): { //WaferFive2
335  switch (rotn) {
336  case (HGCalTypes::WaferCorner0): {
337  good = ((2 * v - u) <= (3 * n2));
338  break;
339  }
340  case (HGCalTypes::WaferCorner1): {
341  good = ((u + v) < (5 * n2));
342  break;
343  }
344  case (HGCalTypes::WaferCorner2): {
345  good = ((2 * u - v) >= (3 * n2));
346  break;
347  }
348  case (HGCalTypes::WaferCorner3): {
349  good = ((2 * v - u) >= n3);
350  break;
351  }
352  case (HGCalTypes::WaferCorner4): {
353  good = ((u + v) > (4 * n3));
354  break;
355  }
356  default: {
357  good = ((2 * u - v) >= n2);
358  break;
359  }
360  }
361  break;
362  }
363  case (HGCalTypes::WaferHalf2): { //WaferHalf2
364  switch (rotn) {
365  case (HGCalTypes::WaferCorner0): {
366  good = (v <= (3 * n4));
367  break;
368  }
369  case (HGCalTypes::WaferCorner1): {
370  good = (u <= (3 * n4));
371  break;
372  }
373  case (HGCalTypes::WaferCorner2): {
374  good = ((v - u) >= n4 - 1);
375  break;
376  }
377  case (HGCalTypes::WaferCorner3): {
378  good = (v >= (5 * n4 - 1));
379  break;
380  }
381  case (HGCalTypes::WaferCorner4): {
382  good = (u >= (5 * n4 - 1));
383  break;
384  }
385  default: {
386  good = ((u - v) >= n4);
387  break;
388  }
389  }
390  break;
391  }
392  }
393 #ifdef EDM_ML_DEBUG
394  edm::LogVerbatim("HGCalGeom") << "u|v " << u << ":" << v << " N " << n << " type " << type << " rot " << rotn
395  << " good " << good;
396 #endif
397  return good;
398 }
Log< level::Info, true > LogVerbatim
static constexpr int32_t WaferHalf2
Definition: HGCalTypes.h:43
static constexpr int32_t WaferFive2
Definition: HGCalTypes.h:44
static constexpr int32_t WaferThree
Definition: HGCalTypes.h:42
static constexpr int32_t WaferSemi2
Definition: HGCalTypes.h:41
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
static constexpr int32_t WaferHalf
Definition: HGCalTypes.h:39
static constexpr int32_t WaferCorner1
Definition: HGCalTypes.h:14
static constexpr int32_t WaferCorner4
Definition: HGCalTypes.h:17
static constexpr int32_t WaferCorner2
Definition: HGCalTypes.h:15
static constexpr int32_t WaferCorner0
Definition: HGCalTypes.h:13
static constexpr int32_t WaferCorner3
Definition: HGCalTypes.h:16
static constexpr int32_t WaferChopTwoM
Definition: HGCalTypes.h:38
static constexpr int32_t WaferFive
Definition: HGCalTypes.h:36
static constexpr int32_t WaferSemi
Definition: HGCalTypes.h:40
static constexpr int32_t WaferChopTwo
Definition: HGCalTypes.h:37

◆ goodCell() [2/2]

bool HGCalWaferMask::goodCell ( int  u,
int  v,
int  waferType 
)
static

Definition at line 400 of file HGCalWaferMask.cc.

References HGCalTypes::edgeWaferHDBottom, HGCalTypes::edgeWaferHDFive, HGCalTypes::edgeWaferHDLeft, HGCalTypes::edgeWaferHDRight, HGCalTypes::edgeWaferHDTop, HGCalTypes::edgeWaferLDBottom, HGCalTypes::edgeWaferLDFive, HGCalTypes::edgeWaferLDLeft, HGCalTypes::edgeWaferLDRight, HGCalTypes::edgeWaferLDThree, HGCalTypes::edgeWaferLDTop, caHitNtupletGeneratorKernels::good, findQualityFiles::v, HGCalTypes::WaferFull, HGCalTypes::WaferHDBottom, HGCalTypes::WaferHDFive, HGCalTypes::WaferHDLeft, HGCalTypes::WaferHDRight, HGCalTypes::WaferHDTop, HGCalTypes::WaferLDBottom, HGCalTypes::WaferLDFive, HGCalTypes::WaferLDLeft, HGCalTypes::WaferLDRight, HGCalTypes::WaferLDThree, and HGCalTypes::WaferLDTop.

400  {
401  // for V17
402  bool good(false);
403  switch (waferType) {
404  case (HGCalTypes::WaferFull): { //WaferFull
405  good = true;
406  break;
407  }
408  case (HGCalTypes::WaferLDTop): {
410  break;
411  }
412  case (HGCalTypes::WaferLDBottom): {
415  break;
416  }
417  case (HGCalTypes::WaferLDLeft): {
418  good =
420  break;
421  }
422  case (HGCalTypes::WaferLDRight): {
425  break;
426  }
427  case (HGCalTypes::WaferLDFive): {
428  good =
430  break;
431  }
432  case (HGCalTypes::WaferLDThree): {
435  break;
436  }
437  case (HGCalTypes::WaferHDTop): {
439  break;
440  }
441  case (HGCalTypes::WaferHDBottom): {
444  break;
445  }
446  case (HGCalTypes::WaferHDLeft): {
447  good =
449  break;
450  }
451  case (HGCalTypes::WaferHDRight): {
454  break;
455  }
456  case (HGCalTypes::WaferHDFive): {
457  good =
459  break;
460  }
461  }
462 #ifdef EDM_ML_DEBUG
463  edm::LogVerbatim("HGCalGeom") << "u|v " << u << ":" << v << " WaferType " << waferType << " good " << good;
464 #endif
465  return good;
466 }
static constexpr std::array< int, 3 > edgeWaferHDBottom
Definition: HGCalTypes.h:88
static constexpr std::array< int, 3 > edgeWaferLDFive
Definition: HGCalTypes.h:85
Log< level::Info, true > LogVerbatim
static constexpr std::array< int, 3 > edgeWaferLDLeft
Definition: HGCalTypes.h:83
static constexpr std::array< int, 3 > edgeWaferLDTop
Definition: HGCalTypes.h:81
static constexpr std::array< int, 3 > edgeWaferHDLeft
Definition: HGCalTypes.h:89
static constexpr int32_t WaferLDThree
Definition: HGCalTypes.h:50
static constexpr std::array< int, 3 > edgeWaferLDThree
Definition: HGCalTypes.h:86
static constexpr int32_t WaferHDFive
Definition: HGCalTypes.h:55
static constexpr int32_t WaferHDLeft
Definition: HGCalTypes.h:53
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
static constexpr int32_t WaferLDBottom
Definition: HGCalTypes.h:46
static constexpr int32_t WaferLDRight
Definition: HGCalTypes.h:48
static constexpr int32_t WaferLDFive
Definition: HGCalTypes.h:49
static constexpr int32_t WaferLDLeft
Definition: HGCalTypes.h:47
static constexpr int32_t WaferHDBottom
Definition: HGCalTypes.h:52
static constexpr std::array< int, 3 > edgeWaferHDTop
Definition: HGCalTypes.h:87
static constexpr int32_t WaferHDRight
Definition: HGCalTypes.h:54
static constexpr std::array< int, 3 > edgeWaferLDRight
Definition: HGCalTypes.h:84
static constexpr int32_t WaferLDTop
Definition: HGCalTypes.h:45
static constexpr std::array< int, 3 > edgeWaferHDFive
Definition: HGCalTypes.h:91
static constexpr int32_t WaferHDTop
Definition: HGCalTypes.h:51
static constexpr std::array< int, 3 > edgeWaferHDRight
Definition: HGCalTypes.h:90
static constexpr std::array< int, 3 > edgeWaferLDBottom
Definition: HGCalTypes.h:82

◆ goodTypeMode()

bool HGCalWaferMask::goodTypeMode ( const double &  xpos,
const double &  ypos,
const double &  delX,
const double &  delY,
const double &  rin,
const double &  rout,
const int &  part,
const int &  rotn,
const bool &  v17,
const bool &  debug = false 
)
static

Definition at line 711 of file HGCalWaferMask.cc.

References edmMakeDummyCfis::base, compare_using_db::base2, HGCalTypes::c00, HGCalTypes::c10, HGCalTypes::c22, HGCalTypes::c22O, HGCalTypes::c27, HGCalTypes::c27O, HGCalTypes::c50, HGCalTypes::c61, HGCalTypes::c61O, HGCalTypes::c75, HGCalTypes::c77, HGCalTypes::c77O, HGCalTypes::c88, HGCalTypes::c88O, ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), debug, dqmdumpme::k, convertSQLiteXML::ok, HGCalTypes::WaferChopTwo, HGCalTypes::WaferChopTwoM, HGCalTypes::WaferCornerMax, HGCalTypes::WaferFive, HGCalTypes::WaferFive2, HGCalTypes::WaferHalf, HGCalTypes::WaferHalf2, HGCalTypes::WaferSemi, HGCalTypes::WaferSemi2, HGCalTypes::WaferSizeMax, and HGCalTypes::WaferThree.

Referenced by HGCalGeomParameters::loadWaferHexagon8().

720  {
721  // Needs extension for V17 or above
722  double c22(HGCalTypes::c22), c27(HGCalTypes::c27), c61(HGCalTypes::c61);
723  double c77(HGCalTypes::c77), c88(HGCalTypes::c88);
724  if (v17OrLess) {
725  c22 = HGCalTypes::c22O;
726  c27 = HGCalTypes::c27O;
727  c61 = HGCalTypes::c61O;
728  c77 = HGCalTypes::c77O;
729  c88 = HGCalTypes::c88O;
730  }
731 
733  return false;
734  if (rotn < 0 || rotn > HGCalTypes::WaferCornerMax)
735  return false;
736  double rin2 = rin * rin;
737  double rout2 = rout * rout;
738  double rpos2(0);
739  static constexpr int corners = HGCalTypes::WaferCornerMax;
740  static constexpr int corner2 = 2 * HGCalTypes::WaferCornerMax;
741  static constexpr int base = 10;
742  static constexpr int base2 = 100;
743  double dx0[corners] = {HGCalTypes::c00 * delX,
744  HGCalTypes::c10 * delX,
745  HGCalTypes::c10 * delX,
746  HGCalTypes::c00 * delX,
747  -HGCalTypes::c10 * delX,
748  -HGCalTypes::c10 * delX};
749  double dy0[corners] = {-HGCalTypes::c10 * delY,
750  -HGCalTypes::c50 * delY,
751  HGCalTypes::c50 * delY,
752  HGCalTypes::c10 * delY,
753  HGCalTypes::c50 * delY,
754  -HGCalTypes::c50 * delY};
755  double dx1[corners] = {HGCalTypes::c50 * delX,
756  HGCalTypes::c10 * delX,
757  HGCalTypes::c50 * delX,
758  -HGCalTypes::c50 * delX,
759  -HGCalTypes::c10 * delX,
760  -HGCalTypes::c50 * delX};
761  double dy1[corners] = {-HGCalTypes::c75 * delY,
762  HGCalTypes::c00 * delY,
763  HGCalTypes::c75 * delY,
764  HGCalTypes::c75 * delY,
765  HGCalTypes::c00 * delY,
766  -HGCalTypes::c75 * delY};
767  double dx2[corner2] = {c22 * delX,
768  c77 * delX,
769  HGCalTypes::c10 * delX,
770  HGCalTypes::c10 * delX,
771  c77 * delX,
772  c22 * delX,
773  -c22 * delX,
774  -c77 * delX,
775  -HGCalTypes::c10 * delX,
776  -HGCalTypes::c10 * delX,
777  -c77 * delX,
778  -c22 * delX};
779  double dy2[corner2] = {-c88 * delY,
780  -c61 * delY,
781  -c27 * delY,
782  c27 * delY,
783  c61 * delY,
784  c88 * delY,
785  c88 * delY,
786  c61 * delY,
787  c27 * delY,
788  -c27 * delY,
789  -c61 * delY,
790  -c88 * delY};
791  bool ok(true);
792  int ncf(-1);
793  switch (part) {
794  case (HGCalTypes::WaferThree): {
795  static constexpr int nc0[corners] = {450, 150, 201, 312, 423, 534};
796  int nc = nc0[rotn];
797  for (int k1 = 0; k1 < 3; ++k1) {
798  int k = nc % base;
799  double xc1 = xpos + dx0[k];
800  double yc1 = ypos + dy0[k];
801  rpos2 = (xc1 * xc1 + yc1 * yc1);
802  if ((rpos2 > rout2) || (rpos2 < rin2)) {
803  ok = false;
804  ncf = k;
805  break;
806  }
807  nc /= base;
808  }
809  break;
810  }
811  case (HGCalTypes::WaferSemi2): {
812  static constexpr int nc10[corners] = {450, 150, 201, 312, 423, 534};
813  static constexpr int nc11[corners] = {700, 902, 1104, 106, 308, 510};
814  int nc = nc10[rotn];
815  for (int k1 = 0; k1 < 3; ++k1) {
816  int k = nc % base;
817  double xc1 = xpos + dx0[k];
818  double yc1 = ypos + dy0[k];
819  rpos2 = (xc1 * xc1 + yc1 * yc1);
820  if ((rpos2 > rout2) || (rpos2 < rin2)) {
821  ok = false;
822  ncf = k;
823  break;
824  }
825  nc /= base;
826  }
827  nc = nc11[rotn];
828  for (int k1 = 0; k1 < 2; ++k1) {
829  int k = nc % base2;
830  double xc1 = xpos + dx2[k];
831  double yc1 = ypos + dy2[k];
832  rpos2 = (xc1 * xc1 + yc1 * yc1);
833  if ((rpos2 > rout2) || (rpos2 < rin2)) {
834  ok = false;
835  ncf = k + base2;
836  break;
837  }
838  nc /= base2;
839  }
840  break;
841  }
842  case (HGCalTypes::WaferSemi): {
843  static constexpr int nc20[corners] = {450, 150, 201, 312, 423, 534};
844  static constexpr int nc21[corners] = {30, 14, 25, 30, 41, 52};
845  int nc = nc20[rotn];
846  for (int k1 = 0; k1 < 3; ++k1) {
847  int k = nc % base;
848  double xc1 = xpos + dx0[k];
849  double yc1 = ypos + dy0[k];
850  rpos2 = (xc1 * xc1 + yc1 * yc1);
851  if ((rpos2 > rout2) || (rpos2 < rin2)) {
852  ok = false;
853  ncf = k;
854  break;
855  }
856  nc /= base;
857  }
858  nc = nc21[rotn];
859  for (int k1 = 0; k1 < 2; ++k1) {
860  int k = nc % base;
861  double xc1 = xpos + dx1[k];
862  double yc1 = ypos + dy1[k];
863  rpos2 = (xc1 * xc1 + yc1 * yc1);
864  if ((rpos2 > rout2) || (rpos2 < rin2)) {
865  ok = false;
866  ncf = k + base2;
867  break;
868  }
869  nc /= base;
870  }
871  break;
872  }
873  case (HGCalTypes::WaferHalf): {
874  static constexpr int nc3[corners] = {3450, 1450, 2501, 3012, 4123, 5234};
875  int nc = nc3[rotn];
876  for (int k1 = 0; k1 < 4; ++k1) {
877  int k = nc % base;
878  double xc1 = xpos + dx0[k];
879  double yc1 = ypos + dy0[k];
880  rpos2 = (xc1 * xc1 + yc1 * yc1);
881  if ((rpos2 > rout2) || (rpos2 < rin2)) {
882  ok = false;
883  ncf = k;
884  break;
885  }
886  nc /= base;
887  }
888  break;
889  }
890  case (HGCalTypes::WaferChopTwoM): {
891  static constexpr int nc40[corners] = {3450, 1450, 2501, 3012, 4123, 5234};
892  static constexpr int nc41[corners] = {500, 702, 904, 1106, 108, 310};
893  int nc = nc40[rotn];
894  for (int k1 = 0; k1 < 4; ++k1) {
895  int k = nc % base;
896  double xc1 = xpos + dx0[k];
897  double yc1 = ypos + dy0[k];
898  rpos2 = (xc1 * xc1 + yc1 * yc1);
899  if ((rpos2 > rout2) || (rpos2 < rin2)) {
900  ok = false;
901  ncf = k;
902  break;
903  }
904  nc /= base;
905  }
906  nc = nc41[rotn];
907  for (int k1 = 0; k1 < 2; ++k1) {
908  int k = nc % base2;
909  double xc1 = xpos + dx2[k];
910  double yc1 = ypos + dy2[k];
911  rpos2 = (xc1 * xc1 + yc1 * yc1);
912  if ((rpos2 > rout2) || (rpos2 < rin2)) {
913  ok = false;
914  ncf = k + base2;
915  break;
916  }
917  nc /= base2;
918  }
919  break;
920  }
921  case (HGCalTypes::WaferChopTwo): {
922  static constexpr int nc50[corners] = {3450, 1450, 2501, 3012, 4123, 5234};
923  static constexpr int nc51[corners] = {20, 13, 24, 35, 40, 51};
924  int nc = nc50[rotn];
925  for (int k1 = 0; k1 < 4; ++k1) {
926  int k = nc % base;
927  double xc1 = xpos + dx0[k];
928  double yc1 = ypos + dy0[k];
929  rpos2 = (xc1 * xc1 + yc1 * yc1);
930  if ((rpos2 > rout2) || (rpos2 < rin2)) {
931  ok = false;
932  ncf = k;
933  break;
934  }
935  nc /= base;
936  }
937  nc = nc51[rotn];
938  for (int k1 = 0; k1 < 2; ++k1) {
939  int k = nc % base;
940  double xc1 = xpos + dx1[k];
941  double yc1 = ypos + dy1[k];
942  rpos2 = (xc1 * xc1 + yc1 * yc1);
943  if ((rpos2 > rout2) || (rpos2 < rin2)) {
944  ok = false;
945  ncf = k + base2;
946  break;
947  }
948  nc /= base;
949  }
950  break;
951  }
952  case (HGCalTypes::WaferFive): {
953  static constexpr int nc6[corners] = {23450, 13450, 24501, 35012, 40123, 51234};
954  int nc = nc6[rotn];
955  for (int k1 = 0; k1 < 5; ++k1) {
956  int k = nc % base;
957  double xc1 = xpos + dx0[k];
958  double yc1 = ypos + dy0[k];
959  rpos2 = (xc1 * xc1 + yc1 * yc1);
960  if ((rpos2 > rout2) || (rpos2 < rin2)) {
961  ok = false;
962  ncf = k;
963  break;
964  }
965  }
966  break;
967  }
968  case (HGCalTypes::WaferFive2): {
969  static constexpr int nc60[corners] = {450, 150, 201, 312, 423, 534};
970  static constexpr int nc61[corners] = {601, 803, 1005, 7, 209, 411};
971  int nc = nc60[rotn];
972  for (int k1 = 0; k1 < 3; ++k1) {
973  int k = nc % base;
974  double xc1 = xpos + dx0[k];
975  double yc1 = ypos + dy0[k];
976  rpos2 = (xc1 * xc1 + yc1 * yc1);
977  if ((rpos2 > rout2) || (rpos2 < rin2)) {
978  ok = false;
979  ncf = k;
980  break;
981  }
982  nc /= base;
983  }
984  nc = nc61[rotn];
985  for (int k1 = 0; k1 < 2; ++k1) {
986  int k = nc % base2;
987  double xc1 = xpos + dx2[k];
988  double yc1 = ypos + dy2[k];
989  rpos2 = (xc1 * xc1 + yc1 * yc1);
990  if ((rpos2 > rout2) || (rpos2 < rin2)) {
991  ok = false;
992  ncf = k + base2;
993  break;
994  }
995  nc /= base2;
996  }
997  break;
998  }
999  case (HGCalTypes::WaferHalf2): {
1000  static constexpr int nc70[corners] = {45, 50, 1, 12, 23, 34};
1001  static constexpr int nc71[corners] = {611, 801, 1003, 5, 207, 409};
1002  int nc = nc70[rotn];
1003  for (int k1 = 0; k1 < 2; ++k1) {
1004  int k = nc % base;
1005  double xc1 = xpos + dx0[k];
1006  double yc1 = ypos + dy0[k];
1007  rpos2 = (xc1 * xc1 + yc1 * yc1);
1008  if ((rpos2 > rout2) || (rpos2 < rin2)) {
1009  ok = false;
1010  ncf = k;
1011  break;
1012  }
1013  nc /= base;
1014  }
1015  nc = nc71[rotn];
1016  for (int k1 = 0; k1 < 2; ++k1) {
1017  int k = nc % base2;
1018  double xc1 = xpos + dx2[k];
1019  double yc1 = ypos + dy2[k];
1020  rpos2 = (xc1 * xc1 + yc1 * yc1);
1021  if ((rpos2 > rout2) || (rpos2 < rin2)) {
1022  ok = false;
1023  ncf = k + base2;
1024  break;
1025  }
1026  nc /= base2;
1027  }
1028  break;
1029  }
1030  default: {
1031  for (int k = 0; k < corners; ++k) {
1032  double xc1 = xpos + dx0[k];
1033  double yc1 = ypos + dy0[k];
1034  rpos2 = (xc1 * xc1 + yc1 * yc1);
1035  if ((rpos2 > rout2) || (rpos2 < rin2)) {
1036  ok = false;
1037  ncf = k;
1038  break;
1039  }
1040  }
1041  break;
1042  }
1043  }
1044  if (debug || (!ok))
1045  edm::LogVerbatim("HGCalGeom") << "I/p: xpos " << xpos << " ypos " << ypos << " dX " << delX << " dY " << delY
1046  << " rin " << rin << " rout " << rout << " part " << part << " rotn " << rotn
1047  << " Results: ok " << ok << " ncf " << ncf << " rin " << rin2 << " rout " << rout2
1048  << " rpos " << rpos2;
1049  return ok;
1050 }
static constexpr double c27O
Definition: HGCalTypes.h:100
static constexpr int32_t WaferHalf2
Definition: HGCalTypes.h:43
static constexpr int32_t WaferFive2
Definition: HGCalTypes.h:44
static constexpr double c77O
Definition: HGCalTypes.h:108
static constexpr int32_t WaferSizeMax
Definition: HGCalTypes.h:78
static constexpr int32_t WaferThree
Definition: HGCalTypes.h:42
static constexpr double c50
Definition: HGCalTypes.h:103
static constexpr double c88
Definition: HGCalTypes.h:113
static constexpr double c27
Definition: HGCalTypes.h:102
static constexpr double c10
Definition: HGCalTypes.h:114
static constexpr int32_t WaferSemi2
Definition: HGCalTypes.h:41
static constexpr int32_t WaferHalf
Definition: HGCalTypes.h:39
static constexpr double c22O
Definition: HGCalTypes.h:96
static constexpr int32_t WaferCornerMax
Definition: HGCalTypes.h:77
static constexpr double c00
Definition: HGCalTypes.h:95
static constexpr double c88O
Definition: HGCalTypes.h:111
#define debug
Definition: HDRShower.cc:19
static constexpr int32_t WaferChopTwoM
Definition: HGCalTypes.h:38
part
Definition: HCALResponse.h:20
static constexpr double c77
Definition: HGCalTypes.h:110
static constexpr double c61
Definition: HGCalTypes.h:106
static constexpr double c61O
Definition: HGCalTypes.h:104
static constexpr double c75
Definition: HGCalTypes.h:107
static constexpr double c22
Definition: HGCalTypes.h:98
static constexpr int32_t WaferFive
Definition: HGCalTypes.h:36
static constexpr int32_t WaferSemi
Definition: HGCalTypes.h:40
static constexpr int32_t WaferChopTwo
Definition: HGCalTypes.h:37

◆ maskCell()

bool HGCalWaferMask::maskCell ( int  u,
int  v,
int  N,
int  ncor,
int  fcor,
int  corners 
)
static

Definition at line 13 of file HGCalWaferMask.cc.

References HGCalGeomTools::k_fourCorners, HGCalGeomTools::k_threeCorners, ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, dqmiodumpmetadata::n, and findQualityFiles::v.

Referenced by HGCalDDDConstants::maskCell().

13  {
14  /*
15 Masks each cell (or not) according to its wafer and cell position (detId) and to the user needs (corners).
16 Each wafer has k_CornerSize corners which are defined in anti-clockwise order starting from the corner at the top, which is always #0. 'ncor' denotes the number of corners inside the physical region. 'fcor' is the defined to be the first corner that appears inside the detector's physical volume in anti-clockwise order.
17 The argument 'corners' controls the types of wafers the user wants: for instance, corners=3 masks all wafers that have at least 3 corners inside the physical region.
18  */
19  bool mask(false);
20  if (ncor < corners) {
21  mask = true;
22  } else {
23  if (ncor == HGCalGeomTools::k_fourCorners) {
24  switch (fcor) {
25  case (0): {
26  mask = (v >= n);
27  break;
28  }
29  case (1): {
30  mask = (u >= n);
31  break;
32  }
33  case (2): {
34  mask = (u > v);
35  break;
36  }
37  case (3): {
38  mask = (v < n);
39  break;
40  }
41  case (4): {
42  mask = (u < n);
43  break;
44  }
45  default: {
46  mask = (u <= v);
47  break;
48  }
49  }
50  } else {
51  switch (fcor) {
52  case (0): {
53  if (ncor == HGCalGeomTools::k_threeCorners) {
54  mask = !((u > 2 * v) && (v < n));
55  } else {
56  mask = ((u >= n) && (v >= n) && ((u + v) > (3 * n - 2)));
57  }
58  break;
59  }
60  case (1): {
61  if (ncor == HGCalGeomTools::k_threeCorners) {
62  mask = !((u + v) < n);
63  } else {
64  mask = ((u >= n) && (u > v) && ((2 * u - v) > 2 * n));
65  }
66  break;
67  }
68  case (2): {
69  if (ncor == HGCalGeomTools::k_threeCorners) {
70  mask = !((u < n) && (v > u) && (v > (2 * u - 1)));
71  } else {
72  mask = ((u > 2 * v) && (v < n));
73  }
74  break;
75  }
76  case (3): {
77  if (ncor == HGCalGeomTools::k_threeCorners) {
78  mask = !((v >= u) && ((2 * v - u) > (2 * n - 2)));
79  } else {
80  mask = ((u + v) < n);
81  }
82  break;
83  }
84  case (4): {
85  if (ncor == HGCalGeomTools::k_threeCorners) {
86  mask = !((u >= n) && (v >= n) && ((u + v) > (3 * n - 2)));
87  } else {
88  mask = ((u < n) && (v > u) && (v > (2 * u - 1)));
89  }
90  break;
91  }
92  default: {
93  if (ncor == HGCalGeomTools::k_threeCorners) {
94  mask = !((u >= n) && (u > v) && ((2 * u - v) > 2 * n));
95  } else {
96  mask = ((v >= u) && ((2 * v - u) > (2 * n - 2)));
97  }
98  break;
99  }
100  }
101  }
102  }
103 #ifdef EDM_ML_DEBUG
104  edm::LogVerbatim("HGCalGeom") << "Corners: " << ncor << ":" << fcor << " N " << n << " u " << u << " v " << v
105  << " Mask " << mask;
106 #endif
107  return mask;
108 }
Log< level::Info, true > LogVerbatim
static constexpr int k_fourCorners
static constexpr int k_threeCorners

◆ maskCut()

std::array< double, 4 > HGCalWaferMask::maskCut ( const int &  part,
const int &  place,
const double &  waferSize,
const double &  offset,
const bool &  v17OrLess 
)
static

Definition at line 2007 of file HGCalWaferMask.cc.

References funct::abs(), HGCalTypes::c22, HGCalTypes::c22O, HGCalTypes::c271, HGCalTypes::c27O, HGCalTypes::c50, cos_1, hltrates_dqm_sourceclient-live_cfg::offset, sign_1, sign_2, sqrt3_, tan_1, HGCalTypes::WaferHDBottom, HGCalTypes::WaferHDFive, HGCalTypes::WaferHDLeft, HGCalTypes::WaferHDRight, HGCalTypes::WaferHDTop, HGCalTypes::WaferLDBottom, HGCalTypes::WaferLDFive, HGCalTypes::WaferLDLeft, HGCalTypes::WaferLDRight, HGCalTypes::WaferLDThree, and HGCalTypes::WaferLDTop.

Referenced by HGCalCellUV::cellUVFromXY2(), and HGCGuardRingPartial::exclude().

2008  {
2009  double c22(HGCalTypes::c22), c271(HGCalTypes::c271);
2010  if (v17OrLess) {
2011  c22 = HGCalTypes::c22O;
2012  c271 = HGCalTypes::c27O;
2013  }
2014  double delX = 0.5 * waferSize;
2015  double delY = 2 * delX / sqrt3_;
2016  double tresh = std::abs(offset / cos_1[placement]);
2017  std::array<double, 4> criterion;
2018  switch (part) {
2019  case (HGCalTypes::WaferLDTop): {
2020  criterion[0] = -tan_1[placement] * sign_1[placement];
2021  criterion[1] = 1.0 * sign_1[placement];
2022  criterion[2] = 0.0;
2023  criterion[3] = tresh;
2024  break;
2025  }
2026  case (HGCalTypes::WaferLDBottom): {
2027  criterion[0] = tan_1[placement] * sign_1[placement];
2028  criterion[1] = -1.0 * sign_1[placement];
2029  criterion[2] = 0.0;
2030  criterion[3] = tresh;
2031  break;
2032  }
2033  case (HGCalTypes::WaferLDLeft): {
2034  criterion[0] = 1.0 * sign_2[placement];
2035  criterion[1] = tan_1[placement] * sign_2[placement];
2036  criterion[2] = 0.0;
2037  criterion[3] = tresh;
2038  break;
2039  }
2040  case (HGCalTypes::WaferLDRight): {
2041  criterion[0] = -1.0 * sign_2[placement];
2042  criterion[1] = -tan_1[placement] * sign_2[placement];
2043  criterion[2] = 0.0;
2044  criterion[3] = tresh;
2045  break;
2046  }
2047  case (HGCalTypes::WaferLDFive): {
2048  criterion[0] = 1 * sign_2[placement];
2049  criterion[1] = tan_1[placement] * sign_2[placement];
2050  criterion[2] = -((HGCalTypes::c50 * delY) / cos_1[placement]) * sign_2[placement];
2051  criterion[3] = tresh;
2052  break;
2053  }
2054  case (HGCalTypes::WaferLDThree): {
2055  criterion[0] = -1 * sign_2[placement];
2056  criterion[1] = -tan_1[placement] * sign_2[placement];
2057  criterion[2] = ((HGCalTypes::c50 * delY) / cos_1[placement]) * sign_2[placement];
2058  criterion[3] = tresh;
2059  break;
2060  }
2061  case (HGCalTypes::WaferHDTop): {
2062  criterion[0] = -tan_1[placement] * sign_1[placement];
2063  criterion[1] = 1 * sign_1[placement];
2064  criterion[2] = ((c22 * delX) / cos_1[placement]) * sign_2[placement];
2065  criterion[3] = tresh;
2066  break;
2067  }
2068  case (HGCalTypes::WaferHDBottom): {
2069  criterion[0] = tan_1[placement] * sign_1[placement];
2070  criterion[1] = -1 * sign_1[placement];
2071  criterion[2] = -((c22 * delX) / cos_1[placement]) * sign_2[placement];
2072  criterion[3] = tresh;
2073  break;
2074  }
2075  case (HGCalTypes::WaferHDLeft): {
2076  criterion[0] = 1.0 * sign_2[placement];
2077  criterion[1] = tan_1[placement] * sign_2[placement];
2078  criterion[2] = ((c271 * delY) / cos_1[placement]) * sign_2[placement];
2079  criterion[3] = tresh;
2080  break;
2081  }
2082  case (HGCalTypes::WaferHDRight): {
2083  criterion[0] = -1.0 * sign_2[placement];
2084  criterion[1] = -tan_1[placement] * sign_2[placement];
2085  criterion[2] = ((c271 * delY) / cos_1[placement]) * sign_2[placement];
2086  criterion[3] = tresh;
2087  break;
2088  }
2089  case (HGCalTypes::WaferHDFive): {
2090  criterion[0] = 1.0 * sign_2[placement];
2091  criterion[1] = tan_1[placement] * sign_2[placement];
2092  criterion[2] = -((c271 * delY) / cos_1[placement]) * sign_2[placement];
2093  criterion[3] = tresh;
2094  break;
2095  }
2096  }
2097  return criterion;
2098 }
static constexpr double c27O
Definition: HGCalTypes.h:100
static constexpr std::array< double, 12 > sign_2
static constexpr int32_t WaferLDThree
Definition: HGCalTypes.h:50
static constexpr std::array< double, 12 > cos_1
static constexpr double sqrt3_
static constexpr double c50
Definition: HGCalTypes.h:103
static constexpr int32_t WaferHDFive
Definition: HGCalTypes.h:55
static constexpr int32_t WaferHDLeft
Definition: HGCalTypes.h:53
static constexpr int32_t WaferLDBottom
Definition: HGCalTypes.h:46
static constexpr double c22O
Definition: HGCalTypes.h:96
static constexpr std::array< double, 12 > sign_1
static constexpr int32_t WaferLDRight
Definition: HGCalTypes.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr int32_t WaferLDFive
Definition: HGCalTypes.h:49
static constexpr int32_t WaferLDLeft
Definition: HGCalTypes.h:47
static constexpr int32_t WaferHDBottom
Definition: HGCalTypes.h:52
static constexpr double c271
Definition: HGCalTypes.h:101
static constexpr int32_t WaferHDRight
Definition: HGCalTypes.h:54
part
Definition: HCALResponse.h:20
static constexpr int32_t WaferLDTop
Definition: HGCalTypes.h:45
static constexpr double c22
Definition: HGCalTypes.h:98
static constexpr int32_t WaferHDTop
Definition: HGCalTypes.h:51
static constexpr std::array< double, 12 > tan_1

◆ waferXY() [1/2]

std::vector< std::pair< double, double > > HGCalWaferMask::waferXY ( const int &  part,
const int &  orient,
const int &  zside,
const double &  waferSize,
const double &  offset,
const double &  xpos,
const double &  ypos,
const bool &  v17 
)
static

Definition at line 1052 of file HGCalWaferMask.cc.

References HGCalTypes::c00, HGCalTypes::c10, HGCalTypes::c22, HGCalTypes::c22O, HGCalTypes::c27, HGCalTypes::c27O, HGCalTypes::c50, HGCalTypes::c61, HGCalTypes::c61O, HGCalTypes::c75, HGCalTypes::c77, HGCalTypes::c77O, HGCalTypes::c88, HGCalTypes::c88O, cos_60_, PVValHelper::dx, PVValHelper::dy, dqmdumpme::first, getRotation(), mps_fire::i, dqmdumpme::k, np, hltrates_dqm_sourceclient-live_cfg::offset, hgcalPerformanceValidation::orient, edm::second(), sin_60_, tan_60_, HGCalTypes::WaferChopTwo, HGCalTypes::WaferChopTwoM, HGCalTypes::WaferFive, HGCalTypes::WaferFive2, HGCalTypes::WaferFull, HGCalTypes::WaferHalf, HGCalTypes::WaferHalf2, HGCalTypes::WaferSemi, HGCalTypes::WaferSemi2, HGCalTypes::WaferThree, geometryCSVtoXML::xy, and ecaldqm::zside().

Referenced by algorithm(), HGCalTestGuardRing::analyze(), HGCalMouseBiteTester::analyze(), HGCGuardRing::exclude(), DDHGCalWaferP::execute(), DDHGCalPassivePartial::execute(), DDHGCalWaferPartialRotated::execute(), and HGCalPassivePartial::HGCalPassivePartial().

1059  {
1060  // Good for V15 and V16 versions
1061  std::vector<std::pair<double, double> > xy;
1062  int orient = getRotation(-zside, part, ori);
1063 #ifdef EDM_ML_DEBUG
1064  edm::LogVerbatim("HGCalGeom") << "Part " << part << " zSide " << zside << " Orient " << ori << ":" << orient;
1065 #endif
1066  double c22(HGCalTypes::c22), c27(HGCalTypes::c27), c61(HGCalTypes::c61);
1067  double c77(HGCalTypes::c77), c88(HGCalTypes::c88);
1068  if (v17OrLess) {
1069  c22 = HGCalTypes::c22O;
1070  c27 = HGCalTypes::c27O;
1071  c61 = HGCalTypes::c61O;
1072  c77 = HGCalTypes::c77O;
1073  c88 = HGCalTypes::c88O;
1074  }
1075  /*
1076  The exact contour of partial wafers are obtained by joining points on
1077  the circumference of a full wafer.
1078  Numbering the points along the edges of a hexagonal wafer, starting from
1079  the bottom corner:
1080 
1081  3
1082  15 18
1083  9 8
1084  19 14
1085  4 2
1086  16 23
1087  10 7
1088  20 13
1089  5 1
1090  17 22
1091  11 6
1092  21 12
1093  0
1094 
1095  Depending on the wafer type and orientation index, the corners
1096  are chosen in the variable *np*
1097  */
1098  double delX = 0.5 * waferSize;
1099  double delY = delX / sin_60_;
1100  double dx[48] = {HGCalTypes::c00 * delX,
1101  HGCalTypes::c10 * delX,
1102  HGCalTypes::c10 * delX,
1103  HGCalTypes::c00 * delX,
1104  -HGCalTypes::c10 * delX,
1105  -HGCalTypes::c10 * delX,
1106  HGCalTypes::c50 * delX,
1107  HGCalTypes::c10 * delX,
1108  HGCalTypes::c50 * delX,
1109  -HGCalTypes::c50 * delX,
1110  -HGCalTypes::c10 * delX,
1111  -HGCalTypes::c50 * delX,
1112  c22 * delX,
1113  HGCalTypes::c10 * delX,
1114  c77 * delX,
1115  -c22 * delX,
1116  -HGCalTypes::c10 * delX,
1117  -c77 * delX,
1118  c22 * delX,
1119  -c77 * delX,
1120  -HGCalTypes::c10 * delX,
1121  -c22 * delX,
1122  c77 * delX,
1123  HGCalTypes::c10 * delX,
1124  HGCalTypes::c50 * delX,
1125  HGCalTypes::c10 * delX,
1126  HGCalTypes::c50 * delX,
1127  -HGCalTypes::c50 * delX,
1128  -HGCalTypes::c10 * delX,
1129  -HGCalTypes::c50 * delX,
1130  HGCalTypes::c50 * delX,
1131  HGCalTypes::c10 * delX,
1132  HGCalTypes::c50 * delX,
1133  -HGCalTypes::c50 * delX,
1134  -HGCalTypes::c10 * delX,
1135  -HGCalTypes::c50 * delX,
1136  c22 * delX,
1137  HGCalTypes::c10 * delX,
1138  c77 * delX,
1139  -c22 * delX,
1140  -HGCalTypes::c10 * delX,
1141  -c77 * delX,
1142  c22 * delX,
1143  -c77 * delX,
1144  -HGCalTypes::c10 * delX,
1145  -c22 * delX,
1146  c77 * delX,
1147  HGCalTypes::c10 * delX};
1148  double dy[48] = {-HGCalTypes::c10 * delY,
1149  -HGCalTypes::c50 * delY,
1150  HGCalTypes::c50 * delY,
1151  HGCalTypes::c10 * delY,
1152  HGCalTypes::c50 * delY,
1153  -HGCalTypes::c50 * delY,
1154  -HGCalTypes::c75 * delY,
1155  HGCalTypes::c00 * delY,
1156  HGCalTypes::c75 * delY,
1157  HGCalTypes::c75 * delY,
1158  HGCalTypes::c00 * delY,
1159  -HGCalTypes::c75 * delY,
1160  -c88 * delY,
1161  -c27 * delY,
1162  c61 * delY,
1163  c88 * delY,
1164  c27 * delY,
1165  -c61 * delY,
1166  c88 * delY,
1167  c61 * delY,
1168  -c27 * delY,
1169  -c88 * delY,
1170  -c61 * delY,
1171  c27 * delY,
1172  -HGCalTypes::c75 * delY,
1173  HGCalTypes::c00 * delY,
1174  -HGCalTypes::c75 * delY,
1175  HGCalTypes::c00 * delY,
1176  HGCalTypes::c75 * delY,
1177  HGCalTypes::c75 * delY,
1178  HGCalTypes::c00 * delY,
1179  -HGCalTypes::c75 * delY,
1180  HGCalTypes::c75 * delY,
1181  HGCalTypes::c75 * delY,
1182  HGCalTypes::c00 * delY,
1183  -HGCalTypes::c75 * delY,
1184  -c88 * delY,
1185  -c27 * delY,
1186  c61 * delY,
1187  c88 * delY,
1188  c27 * delY,
1189  -c61 * delY,
1190  c88 * delY,
1191  c61 * delY,
1192  -c27 * delY,
1193  -c88 * delY,
1194  -c61 * delY,
1195  c27 * delY};
1196 
1197  double offsetx[48] = {0.0,
1198  -offset,
1199  -offset,
1200  0.0,
1201  offset,
1202  offset,
1203  -offset * cos_60_,
1204  -offset,
1205  -offset * cos_60_,
1206  offset * cos_60_,
1207  offset,
1208  offset * cos_60_,
1209  -offset * cos_60_,
1210  -offset,
1211  -offset * cos_60_,
1212  offset * cos_60_,
1213  offset,
1214  offset * cos_60_,
1215  -offset * cos_60_,
1216  offset * cos_60_,
1217  offset,
1218  offset * cos_60_,
1219  -offset * cos_60_,
1220  -offset,
1221  0.0,
1222  -offset,
1223  -offset,
1224  0.0,
1225  offset,
1226  offset,
1227  0.0,
1228  offset,
1229  offset,
1230  0.0,
1231  -offset,
1232  -offset,
1233  0.0,
1234  -offset,
1235  -offset,
1236  0.0,
1237  offset,
1238  offset,
1239  0.0,
1240  offset,
1241  offset,
1242  0.0,
1243  -offset,
1244  -offset};
1245  double offsety[48] = {offset / sin_60_,
1246  offset / tan_60_,
1247  -offset / tan_60_,
1248  -offset / sin_60_,
1249  -offset / tan_60_,
1250  offset / tan_60_,
1251  offset * sin_60_,
1252  0.0,
1253  -offset * sin_60_,
1254  -offset * sin_60_,
1255  0.0,
1256  offset * sin_60_,
1257  offset * sin_60_,
1258  0.0,
1259  -offset * sin_60_,
1260  -offset * sin_60_,
1261  0.0,
1262  offset * sin_60_,
1263  -offset * sin_60_,
1264  -offset * sin_60_,
1265  0.0,
1266  offset * sin_60_,
1267  offset * sin_60_,
1268  0.0,
1269  offset / sin_60_,
1270  offset / tan_60_,
1271  -offset / tan_60_,
1272  -offset / sin_60_,
1273  -offset / tan_60_,
1274  -offset / sin_60_,
1275  -offset / tan_60_,
1276  offset / tan_60_,
1277  offset / sin_60_,
1278  offset / tan_60_,
1279  -offset / tan_60_,
1280  offset / tan_60_,
1281  offset / sin_60_,
1282  offset / tan_60_,
1283  -offset / tan_60_,
1284  -offset / sin_60_,
1285  -offset / tan_60_,
1286  offset / tan_60_,
1287  -offset / sin_60_,
1288  -offset / tan_60_,
1289  offset / tan_60_,
1290  offset / sin_60_,
1291  offset / tan_60_,
1292  -offset / tan_60_};
1293 
1294  if (part == HGCalTypes::WaferFull) {
1295  int np[7] = {0, 1, 2, 3, 4, 5, 0};
1296  for (int k = 0; k < 7; ++k)
1297  xy.push_back(std::make_pair((xpos + dx[np[k]] + offsetx[np[k]]), (ypos + dy[np[k]] + offsety[np[k]])));
1298  } else if (part == HGCalTypes::WaferFive) {
1299  int np[6][6] = {{0, 2, 3, 4, 5, 0},
1300  {1, 3, 4, 5, 0, 1},
1301  {2, 4, 5, 0, 1, 2},
1302  {3, 5, 0, 1, 2, 3},
1303  {4, 0, 1, 2, 3, 4},
1304  {5, 1, 2, 3, 4, 5}};
1305  for (int k = 0; k < 6; ++k) {
1306  xy.push_back(std::make_pair((xpos + dx[np[orient][k]] + offsetx[np[orient][k]]),
1307  (ypos + dy[np[orient][k]] + offsety[np[orient][k]])));
1308 #ifdef EDM_ML_DEBUG
1309  edm::LogVerbatim("HGCalGeom") << "WaferFull " << k << " np " << np[orient][k] << " dx "
1310  << dx[np[orient][k]] + offsetx[np[orient][k]] << " dy "
1311  << dy[np[orient][k]] + offsety[np[orient][k]];
1312 #endif
1313  }
1314  } else if (part == HGCalTypes::WaferHalf) {
1315  int np[6][5] = {
1316  {0, 3, 4, 5, 0}, {1, 4, 5, 0, 1}, {2, 5, 0, 1, 2}, {3, 0, 1, 2, 3}, {4, 1, 2, 3, 4}, {5, 2, 3, 4, 5}};
1317  for (int k = 0; k < 5; ++k) {
1318  xy.push_back(std::make_pair((xpos + dx[np[orient][k]] + offsetx[np[orient][k]]),
1319  (ypos + dy[np[orient][k]] + offsety[np[orient][k]])));
1320 #ifdef EDM_ML_DEBUG
1321  edm::LogVerbatim("HGCalGeom") << "WaferHalf " << k << " np " << np[orient][k] << " dx "
1322  << dx[np[orient][k]] + offsetx[np[orient][k]] << " dy "
1323  << dy[np[orient][k]] + offsety[np[orient][k]];
1324 #endif
1325  }
1326  } else if (part == HGCalTypes::WaferThree) {
1327  int np[6][4] = {{0, 4, 5, 0}, {1, 5, 0, 1}, {2, 0, 1, 2}, {3, 1, 2, 3}, {4, 2, 3, 4}, {5, 3, 4, 5}};
1328  for (int k = 0; k < 4; ++k) {
1329  xy.push_back(std::make_pair((xpos + dx[np[orient][k]] + offsetx[np[orient][k]]),
1330  (ypos + dy[np[orient][k]] + offsety[np[orient][k]])));
1331 #ifdef EDM_ML_DEBUG
1332  edm::LogVerbatim("HGCalGeom") << "WaferThree " << k << " np " << np[orient][k] << " dx "
1333  << dx[np[orient][k]] + offsetx[np[orient][k]] << " dy "
1334  << dy[np[orient][k]] + offsety[np[orient][k]];
1335 #endif
1336  }
1337  } else if (part == HGCalTypes::WaferChopTwo) {
1338  int np[6][7] = {{24, 32, 3, 4, 5, 0, 24},
1339  {25, 33, 4, 5, 0, 1, 25},
1340  {26, 34, 5, 0, 1, 2, 26},
1341  {27, 35, 0, 1, 2, 3, 27},
1342  {28, 30, 1, 2, 3, 4, 28},
1343  {29, 31, 2, 3, 4, 5, 29}};
1344  for (int k = 0; k < 7; ++k) {
1345  xy.push_back(std::make_pair((xpos + dx[np[orient][k]] + offsetx[np[orient][k]]),
1346  (ypos + dy[np[orient][k]] + offsety[np[orient][k]])));
1347 #ifdef EDM_ML_DEBUG
1348  edm::LogVerbatim("HGCalGeom") << "WaferChopTwo " << k << " np " << np[orient][k] << " dx "
1349  << dx[np[orient][k]] + offsetx[np[orient][k]] << " dy "
1350  << dy[np[orient][k]] + offsety[np[orient][k]];
1351 #endif
1352  }
1353  } else if (part == HGCalTypes::WaferSemi) {
1354  int np[6][6] = {{6, 9, 4, 5, 0, 6},
1355  {7, 10, 5, 0, 1, 7},
1356  {8, 11, 0, 1, 2, 8},
1357  {9, 6, 1, 2, 3, 9},
1358  {10, 7, 2, 3, 4, 10},
1359  {11, 8, 3, 4, 5, 11}};
1360  for (int k = 0; k < 6; ++k) {
1361  xy.push_back(std::make_pair((xpos + dx[np[orient][k]] + offsetx[np[orient][k]]),
1362  (ypos + dy[np[orient][k]] + offsety[np[orient][k]])));
1363 #ifdef EDM_ML_DEBUG
1364  edm::LogVerbatim("HGCalGeom") << "WaferSemi " << k << " np " << np[orient][k] << " dx "
1365  << dx[np[orient][k]] + offsetx[np[orient][k]] << " dy "
1366  << dy[np[orient][k]] + offsety[np[orient][k]];
1367 #endif
1368  }
1369  } else if (part == HGCalTypes::WaferChopTwoM) {
1370  int np[6][7] = {{36, 42, 3, 4, 5, 0, 36},
1371  {37, 43, 4, 5, 0, 1, 37},
1372  {38, 44, 5, 0, 1, 2, 38},
1373  {39, 45, 0, 1, 2, 3, 39},
1374  {40, 46, 1, 2, 3, 4, 40},
1375  {41, 47, 2, 3, 4, 5, 41}};
1376  for (int k = 0; k < 7; ++k) {
1377  xy.push_back(std::make_pair((xpos + dx[np[orient][k]] + offsetx[np[orient][k]]),
1378  (ypos + dy[np[orient][k]] + offsety[np[orient][k]])));
1379 #ifdef EDM_ML_DEBUG
1380  edm::LogVerbatim("HGCalGeom") << " WaferChopTwoM " << k << " np " << np[orient][k] << " dx "
1381  << dx[np[orient][k]] + offsetx[np[orient][k]] << " dy "
1382  << dy[np[orient][k]] + offsety[np[orient][k]];
1383 #endif
1384  }
1385  } else if (part == HGCalTypes::WaferSemi2) {
1386  int np[6][6] = {{12, 19, 4, 5, 0, 12},
1387  {13, 20, 5, 0, 1, 13},
1388  {14, 21, 0, 1, 2, 14},
1389  {15, 22, 1, 2, 3, 15},
1390  {16, 23, 2, 3, 4, 16},
1391  {17, 18, 3, 4, 5, 17}};
1392  for (int k = 0; k < 6; ++k) {
1393  xy.push_back(std::make_pair((xpos + dx[np[orient][k]] + offsetx[np[orient][k]]),
1394  (ypos + dy[np[orient][k]] + offsety[np[orient][k]])));
1395 #ifdef EDM_ML_DEBUG
1396  edm::LogVerbatim("HGCalGeom") << "WaferSemi2 " << k << " np " << np[orient][k] << " dx "
1397  << dx[np[orient][k]] + offsetx[np[orient][k]] << " dy "
1398  << dy[np[orient][k]] + offsety[np[orient][k]];
1399 #endif
1400  }
1401  } else if (part == HGCalTypes::WaferFive2) {
1402  int np[6][6] = {{22, 15, 4, 5, 0, 22},
1403  {23, 16, 5, 0, 1, 23},
1404  {18, 17, 0, 1, 2, 18},
1405  {19, 12, 1, 2, 3, 19},
1406  {20, 13, 2, 3, 4, 20},
1407  {21, 14, 3, 4, 5, 21}};
1408  for (int k = 0; k < 6; ++k) {
1409  xy.push_back(std::make_pair((xpos + dx[np[orient][k]] + offsetx[np[orient][k]]),
1410  (ypos + dy[np[orient][k]] + offsety[np[orient][k]])));
1411 #ifdef EDM_ML_DEBUG
1412  edm::LogVerbatim("HGCalGeom") << "WaferFive2 " << k << " np " << np[orient][k] << " dx "
1413  << dx[np[orient][k]] + offsetx[np[orient][k]] << " dy "
1414  << dy[np[orient][k]] + offsety[np[orient][k]];
1415 #endif
1416  }
1417  } else if (part == HGCalTypes::WaferHalf2) {
1418  int np[6][5] = {{45, 39, 4, 5, 45},
1419  {46, 40, 5, 0, 46},
1420  {47, 41, 0, 1, 47},
1421  {42, 36, 1, 2, 42},
1422  {43, 37, 2, 3, 43},
1423  {44, 38, 3, 4, 44}};
1424  for (int k = 0; k < 5; ++k) {
1425  xy.push_back(std::make_pair((xpos + dx[np[orient][k]] + offsetx[np[orient][k]]),
1426  (ypos + dy[np[orient][k]] + offsety[np[orient][k]])));
1427 #ifdef EDM_ML_DEBUG
1428  edm::LogVerbatim("HGCalGeom") << "WaferHalf2 " << k << " np " << np[orient][k] << " dx "
1429  << dx[np[orient][k]] + offsetx[np[orient][k]] << " dy "
1430  << dy[np[orient][k]] + offsety[np[orient][k]];
1431 #endif
1432  }
1433  }
1434 #ifdef EDM_ML_DEBUG
1435  edm::LogVerbatim("HGCalGeom") << "I/p: part " << part << " ori " << ori << " zside " << zside << " dX " << delX
1436  << " dY " << delY << " xpos " << xpos << " ypos " << ypos << " O/p having " << xy.size()
1437  << " points:";
1438  std::ostringstream st1;
1439  for (unsigned int i = 0; i < xy.size(); ++i)
1440  st1 << " [" << i << "] " << xy[i].first << ":" << xy[i].second;
1441  edm::LogVerbatim("HGCalGeom") << st1.str();
1442 #endif
1443  return xy;
1444 }
Log< level::Info, true > LogVerbatim
static constexpr double c27O
Definition: HGCalTypes.h:100
static constexpr int32_t WaferHalf2
Definition: HGCalTypes.h:43
static constexpr int32_t WaferFive2
Definition: HGCalTypes.h:44
static constexpr double c77O
Definition: HGCalTypes.h:108
static constexpr int32_t WaferThree
Definition: HGCalTypes.h:42
static constexpr double c50
Definition: HGCalTypes.h:103
static constexpr double c88
Definition: HGCalTypes.h:113
int zside(DetId const &)
static int getRotation(int zside, int type, int rotn)
static constexpr double c27
Definition: HGCalTypes.h:102
static constexpr double c10
Definition: HGCalTypes.h:114
static constexpr double sin_60_
static constexpr int32_t WaferSemi2
Definition: HGCalTypes.h:41
U second(std::pair< T, U > const &p)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
static constexpr int32_t WaferHalf
Definition: HGCalTypes.h:39
int np
Definition: AMPTWrapper.h:43
static constexpr double tan_60_
static constexpr double c22O
Definition: HGCalTypes.h:96
static constexpr double c00
Definition: HGCalTypes.h:95
static constexpr double c88O
Definition: HGCalTypes.h:111
static constexpr int32_t WaferChopTwoM
Definition: HGCalTypes.h:38
part
Definition: HCALResponse.h:20
static constexpr double c77
Definition: HGCalTypes.h:110
static constexpr double c61
Definition: HGCalTypes.h:106
static constexpr double cos_60_
static constexpr double c61O
Definition: HGCalTypes.h:104
static constexpr double c75
Definition: HGCalTypes.h:107
static constexpr double c22
Definition: HGCalTypes.h:98
static constexpr int32_t WaferFive
Definition: HGCalTypes.h:36
static constexpr int32_t WaferSemi
Definition: HGCalTypes.h:40
static constexpr int32_t WaferChopTwo
Definition: HGCalTypes.h:37

◆ waferXY() [2/2]

std::vector< std::pair< double, double > > HGCalWaferMask::waferXY ( const int &  part,
const int &  placement,
const double &  wafersize,
const double &  offset,
const double &  xpos,
const double &  ypos,
const bool &  v17 
)
static

Definition at line 1446 of file HGCalWaferMask.cc.

References HGCalTypes::c00, HGCalTypes::c10, HGCalTypes::c22, HGCalTypes::c221, HGCalTypes::c22O, HGCalTypes::c27, HGCalTypes::c271, HGCalTypes::c27O, HGCalTypes::c50, HGCalTypes::c61, HGCalTypes::c611, HGCalTypes::c61O, HGCalTypes::c75, HGCalTypes::c77, HGCalTypes::c771, HGCalTypes::c77O, HGCalTypes::c88, HGCalTypes::c881, HGCalTypes::c88O, cos_60_, PVValHelper::dx, PVValHelper::dy, dqmdumpme::first, mps_fire::i, dqmdumpme::k, np, hltrates_dqm_sourceclient-live_cfg::offset, edm::second(), sin_60_, tan_60_, HGCalTypes::WaferFull, HGCalTypes::WaferHDBottom, HGCalTypes::WaferHDFive, HGCalTypes::WaferHDLeft, HGCalTypes::WaferHDRight, HGCalTypes::WaferHDTop, HGCalTypes::WaferLDBottom, HGCalTypes::WaferLDFive, HGCalTypes::WaferLDLeft, HGCalTypes::WaferLDRight, HGCalTypes::WaferLDThree, HGCalTypes::WaferLDTop, and geometryCSVtoXML::xy.

1452  {
1453  std::vector<std::pair<double, double> > xy;
1454  // Good for V17 version and uses partial wafer type & placement index
1455 #ifdef EDM_ML_DEBUG
1456  edm::LogVerbatim("HGCalGeom") << "Part " << part << " Placement Index " << place;
1457 #endif
1458  double c22(HGCalTypes::c22), c27(HGCalTypes::c27), c61(HGCalTypes::c61);
1459  double c77(HGCalTypes::c77), c88(HGCalTypes::c88);
1460  double c221(HGCalTypes::c221), c271(HGCalTypes::c271), c611(HGCalTypes::c611);
1461  double c771(HGCalTypes::c771), c881(HGCalTypes::c881);
1462  if (v17OrLess) {
1463  c22 = HGCalTypes::c22O;
1464  c27 = HGCalTypes::c27O;
1465  c61 = HGCalTypes::c61O;
1466  c77 = HGCalTypes::c77O;
1467  c88 = HGCalTypes::c88O;
1468  c221 = c22;
1469  c271 = c27;
1470  c611 = c61;
1471  c771 = c77;
1472  c881 = c88;
1473  }
1474  /*
1475  The exact contour of partial wafers are obtained by joining points on
1476  the circumference of a full wafer.
1477  Numbering the points along the edges of a hexagonal wafer, starting from
1478  the bottom corner:
1479  3
1480  15 18
1481  9 8
1482  19 14
1483  4 2
1484  16 23
1485  10 7
1486  20 13
1487  5 1
1488  17 22
1489  11 6
1490  21 12
1491  0
1492  Depending on the wafer type and placement index, the corners
1493  are chosen in the variable *np*
1494  The points 24-35 are the same as points 12-23 with different offset
1495  */
1496  double delX = 0.5 * waferSize;
1497  double delY = delX / sin_60_;
1498  double dx[60] = {
1499  HGCalTypes::c00 * delX,
1500  HGCalTypes::c10 * delX,
1501  HGCalTypes::c10 * delX,
1502  HGCalTypes::c00 * delX,
1503  -HGCalTypes::c10 * delX,
1504  -HGCalTypes::c10 * delX,
1505  HGCalTypes::c50 * delX,
1506  HGCalTypes::c10 * delX,
1507  HGCalTypes::c50 * delX,
1508  -HGCalTypes::c50 * delX,
1509  -HGCalTypes::c10 * delX,
1510  -HGCalTypes::c50 * delX,
1511  c221 * delX,
1512  HGCalTypes::c10 * delX,
1513  c771 * delX,
1514  -c221 * delX,
1515  -HGCalTypes::c10 * delX,
1516  -c771 * delX,
1517  c221 * delX,
1518  -c771 * delX,
1519  -HGCalTypes::c10 * delX,
1520  -c221 * delX,
1521  c771 * delX,
1522  HGCalTypes::c10 * delX,
1523  c22 * delX,
1524  HGCalTypes::c10 * delX,
1525  c77 * delX,
1526  -c22 * delX,
1527  -HGCalTypes::c10 * delX,
1528  -c77 * delX,
1529  c22 * delX,
1530  -c77 * delX,
1531  -HGCalTypes::c10 * delX,
1532  -c22 * delX,
1533  c77 * delX,
1534  HGCalTypes::c10 * delX,
1535  HGCalTypes::c00 * delX,
1536  HGCalTypes::c10 * delX,
1537  HGCalTypes::c10 * delX,
1538  HGCalTypes::c00 * delX,
1539  -HGCalTypes::c10 * delX,
1540  -HGCalTypes::c10 * delX,
1541  HGCalTypes::c00 * delX,
1542  HGCalTypes::c10 * delX,
1543  HGCalTypes::c10 * delX,
1544  HGCalTypes::c00 * delX,
1545  -HGCalTypes::c10 * delX,
1546  -HGCalTypes::c10 * delX,
1547  HGCalTypes::c00 * delX,
1548  HGCalTypes::c10 * delX,
1549  HGCalTypes::c10 * delX,
1550  HGCalTypes::c00 * delX,
1551  -HGCalTypes::c10 * delX,
1552  -HGCalTypes::c10 * delX,
1553  HGCalTypes::c00 * delX,
1554  HGCalTypes::c10 * delX,
1555  HGCalTypes::c10 * delX,
1556  HGCalTypes::c00 * delX,
1557  -HGCalTypes::c10 * delX,
1558  -HGCalTypes::c10 * delX,
1559  };
1560  double dy[60] = {
1561  -HGCalTypes::c10 * delY,
1562  -HGCalTypes::c50 * delY,
1563  HGCalTypes::c50 * delY,
1564  HGCalTypes::c10 * delY,
1565  HGCalTypes::c50 * delY,
1566  -HGCalTypes::c50 * delY,
1567  -HGCalTypes::c75 * delY,
1568  HGCalTypes::c00 * delY,
1569  HGCalTypes::c75 * delY,
1570  HGCalTypes::c75 * delY,
1571  HGCalTypes::c00 * delY,
1572  -HGCalTypes::c75 * delY,
1573  -c881 * delY,
1574  -c271 * delY,
1575  c611 * delY,
1576  c881 * delY,
1577  c271 * delY,
1578  -c611 * delY,
1579  c881 * delY,
1580  c611 * delY,
1581  -c271 * delY,
1582  -c881 * delY,
1583  -c611 * delY,
1584  c271 * delY,
1585  -c88 * delY,
1586  -c27 * delY,
1587  c61 * delY,
1588  c88 * delY,
1589  c27 * delY,
1590  -c61 * delY,
1591  c88 * delY,
1592  c61 * delY,
1593  -c27 * delY,
1594  -c88 * delY,
1595  -c61 * delY,
1596  c27 * delY,
1597  -HGCalTypes::c10 * delY,
1598  -HGCalTypes::c50 * delY,
1599  HGCalTypes::c50 * delY,
1600  HGCalTypes::c10 * delY,
1601  HGCalTypes::c50 * delY,
1602  -HGCalTypes::c50 * delY,
1603  -HGCalTypes::c10 * delY,
1604  -HGCalTypes::c50 * delY,
1605  HGCalTypes::c50 * delY,
1606  HGCalTypes::c10 * delY,
1607  HGCalTypes::c50 * delY,
1608  -HGCalTypes::c50 * delY,
1609  -HGCalTypes::c10 * delY,
1610  -HGCalTypes::c50 * delY,
1611  HGCalTypes::c50 * delY,
1612  HGCalTypes::c10 * delY,
1613  HGCalTypes::c50 * delY,
1614  -HGCalTypes::c50 * delY,
1615  -HGCalTypes::c10 * delY,
1616  -HGCalTypes::c50 * delY,
1617  HGCalTypes::c50 * delY,
1618  HGCalTypes::c10 * delY,
1619  HGCalTypes::c50 * delY,
1620  -HGCalTypes::c50 * delY,
1621  };
1622 
1623  double offsetx[60] = {0.0,
1624  -offset,
1625  -offset,
1626  0.0,
1627  offset,
1628  offset,
1629  -offset * cos_60_,
1630  -offset,
1631  -offset * cos_60_,
1632  offset * cos_60_,
1633  offset,
1634  offset * cos_60_,
1635  -offset * cos_60_,
1636  -offset,
1637  -offset * cos_60_,
1638  offset * cos_60_,
1639  offset,
1640  offset * cos_60_,
1641  -offset * cos_60_,
1642  offset * cos_60_,
1643  offset,
1644  offset * cos_60_,
1645  -offset * cos_60_,
1646  -offset,
1647  0.0,
1648  -offset,
1649  -offset,
1650  0.0,
1651  offset,
1652  offset,
1653  0.0,
1654  offset,
1655  offset,
1656  0.0,
1657  -offset,
1658  -offset,
1659  -offset,
1660  -offset / cos_60_,
1661  -offset,
1662  offset,
1663  offset / cos_60_,
1664  offset,
1665  offset,
1666  -offset,
1667  -offset / cos_60_,
1668  -offset,
1669  offset,
1670  offset / cos_60_,
1671  -offset * cos_60_,
1672  -offset,
1673  -offset * cos_60_,
1674  offset * cos_60_,
1675  offset,
1676  offset * cos_60_,
1677  offset * cos_60_,
1678  -offset * cos_60_,
1679  -offset,
1680  -offset * cos_60_,
1681  offset * cos_60_,
1682  offset};
1683  double offsety[60] = {offset / sin_60_,
1684  offset / tan_60_,
1685  -offset / tan_60_,
1686  -offset / sin_60_,
1687  -offset / tan_60_,
1688  offset / tan_60_,
1689  offset * sin_60_,
1690  0.0,
1691  -offset * sin_60_,
1692  -offset * sin_60_,
1693  0.0,
1694  offset * sin_60_,
1695  offset * sin_60_,
1696  0.0,
1697  -offset * sin_60_,
1698  -offset * sin_60_,
1699  0.0,
1700  offset * sin_60_,
1701  -offset * sin_60_,
1702  -offset * sin_60_,
1703  0.0,
1704  offset * sin_60_,
1705  offset * sin_60_,
1706  0.0,
1707  offset / sin_60_,
1708  offset / tan_60_,
1709  -offset / tan_60_,
1710  -offset / sin_60_,
1711  -offset / tan_60_,
1712  offset / tan_60_,
1713  -offset / sin_60_,
1714  -offset / tan_60_,
1715  offset / tan_60_,
1716  offset / sin_60_,
1717  offset / tan_60_,
1718  -offset / tan_60_,
1719  offset * tan_60_,
1720  0,
1721  -offset * tan_60_,
1722  -offset * tan_60_,
1723  0,
1724  offset * tan_60_,
1725  offset * tan_60_,
1726  offset * tan_60_,
1727  0,
1728  -offset * tan_60_,
1729  -offset * tan_60_,
1730  0,
1731  offset * sin_60_,
1732  0,
1733  -offset * sin_60_,
1734  -offset * sin_60_,
1735  0,
1736  offset * sin_60_,
1737  offset * sin_60_,
1738  offset * sin_60_,
1739  0,
1740  -offset * sin_60_,
1741  -offset * sin_60_,
1742  0};
1743 
1744  if (part == HGCalTypes::WaferFull) {
1745  int np[7] = {0, 1, 2, 3, 4, 5, 0};
1746  for (int k = 0; k < 7; ++k) {
1747  xy.push_back(std::make_pair((xpos + dx[np[k]] + offsetx[np[k]]), (ypos + dy[np[k]] + offsety[np[k]])));
1748 #ifdef EDM_ML_DEBUG
1749  edm::LogVerbatim("HGCalGeom") << "WaferFull " << k << " np 7 dx " << (dx[np[k]] + offsetx[np[k]]) << " dy "
1750  << (dy[np[k]] + offsety[np[k]]);
1751 #endif
1752  }
1753  } else if (part == HGCalTypes::WaferLDTop) {
1754  int np[12][5] = {{0, 1, 4, 5, 0},
1755  {1, 2, 5, 0, 1},
1756  {2, 3, 0, 1, 2},
1757  {3, 4, 1, 2, 3},
1758  {4, 5, 2, 3, 4},
1759  {5, 0, 3, 4, 5},
1760  {0, 1, 2, 5, 0},
1761  {5, 0, 1, 4, 5},
1762  {4, 5, 0, 3, 4},
1763  {3, 4, 5, 2, 3},
1764  {2, 3, 4, 1, 2},
1765  {1, 2, 3, 0, 1}};
1766  for (int k = 0; k < 5; ++k) {
1767  xy.push_back(std::make_pair((xpos + dx[np[place][k]] + offsetx[np[place][k]]),
1768  (ypos + dy[np[place][k]] + offsety[np[place][k]])));
1769 #ifdef EDM_ML_DEBUG
1770  edm::LogVerbatim("HGCalGeom") << "WaferLDTop " << k << " np " << np[place][k] << " dx "
1771  << dx[np[place][k]] + offsetx[np[place][k]] << " dy "
1772  << dy[np[place][k]] + offsety[np[place][k]];
1773 #endif
1774  }
1775  } else if (part == HGCalTypes::WaferLDBottom) {
1776  int np[12][5] = {{1, 2, 3, 4, 1},
1777  {2, 3, 4, 5, 2},
1778  {3, 4, 5, 0, 3},
1779  {4, 5, 0, 1, 4},
1780  {5, 0, 1, 2, 5},
1781  {0, 1, 2, 3, 0},
1782  {5, 2, 3, 4, 5},
1783  {4, 1, 2, 3, 4},
1784  {3, 0, 1, 2, 3},
1785  {2, 5, 0, 1, 2},
1786  {1, 4, 5, 0, 1},
1787  {0, 3, 4, 5, 0}};
1788  for (int k = 0; k < 5; ++k) {
1789  xy.push_back(std::make_pair((xpos + dx[np[place][k]] + offsetx[np[place][k]]),
1790  (ypos + dy[np[place][k]] + offsety[np[place][k]])));
1791 #ifdef EDM_ML_DEBUG
1792  edm::LogVerbatim("HGCalGeom") << "WaferLDBottom " << k << " np " << np[place][k] << " dx "
1793  << dx[np[place][k]] + offsetx[np[place][k]] << " dy "
1794  << dy[np[place][k]] + offsety[np[place][k]];
1795 #endif
1796  }
1797  } else if (part == HGCalTypes::WaferLDLeft) {
1798  int np[12][6] = {{0, 1, 2, 8, 11, 0},
1799  {1, 2, 3, 9, 6, 1},
1800  {2, 3, 4, 10, 7, 2},
1801  {3, 4, 5, 11, 8, 3},
1802  {4, 5, 0, 6, 9, 4},
1803  {5, 0, 1, 7, 10, 5},
1804  {0, 6, 9, 4, 5, 0},
1805  {5, 11, 8, 3, 4, 5},
1806  {4, 10, 7, 2, 3, 4},
1807  {3, 9, 6, 1, 2, 3},
1808  {2, 8, 11, 0, 1, 2},
1809  {1, 7, 10, 5, 0, 1}};
1810  for (int k = 0; k < 6; ++k) {
1811  xy.push_back(std::make_pair((xpos + dx[np[place][k]] + offsetx[np[place][k]]),
1812  (ypos + dy[np[place][k]] + offsety[np[place][k]])));
1813 #ifdef EDM_ML_DEBUG
1814  edm::LogVerbatim("HGCalGeom") << "WaferLDLeft " << k << " np " << np[place][k] << " dx "
1815  << dx[np[place][k]] + offsetx[np[place][k]] << " dy "
1816  << dy[np[place][k]] + offsety[np[place][k]];
1817 #endif
1818  }
1819  } else if (part == HGCalTypes::WaferLDRight) {
1820  int np[12][6] = {{5, 11, 8, 3, 4, 5},
1821  {0, 6, 9, 4, 5, 0},
1822  {1, 7, 10, 5, 0, 1},
1823  {2, 8, 11, 0, 1, 2},
1824  {3, 9, 6, 1, 2, 3},
1825  {4, 10, 7, 2, 3, 4},
1826  {1, 2, 3, 9, 6, 1},
1827  {0, 1, 2, 8, 11, 0},
1828  {5, 0, 1, 7, 10, 5},
1829  {4, 5, 0, 6, 9, 4},
1830  {3, 4, 5, 11, 8, 3},
1831  {2, 3, 4, 10, 7, 2}};
1832  for (int k = 0; k < 6; ++k) {
1833  xy.push_back(std::make_pair((xpos + dx[np[place][k]] + offsetx[np[place][k]]),
1834  (ypos + dy[np[place][k]] + offsety[np[place][k]])));
1835 #ifdef EDM_ML_DEBUG
1836  edm::LogVerbatim("HGCalGeom") << "WaferLDRight " << k << " np " << np[place][k] << " dx "
1837  << dx[np[place][k]] + offsetx[np[place][k]] << " dy "
1838  << dy[np[place][k]] + offsety[np[place][k]];
1839 #endif
1840  }
1841  } else if (part == HGCalTypes::WaferLDFive) {
1842  int np[12][6] = {{0, 1, 2, 57, 53, 0},
1843  {1, 2, 3, 58, 48, 1},
1844  {2, 3, 4, 59, 49, 2},
1845  {3, 4, 5, 54, 50, 3},
1846  {4, 5, 0, 55, 51, 4},
1847  {5, 0, 1, 56, 52, 5},
1848  {0, 1, 3, 58, 53, 0},
1849  {5, 0, 2, 57, 52, 5},
1850  {4, 5, 1, 56, 51, 4},
1851  {3, 4, 0, 55, 50, 3},
1852  {2, 3, 5, 54, 49, 2},
1853  {1, 2, 4, 59, 48, 1}};
1854  for (int k = 0; k < 6; ++k) {
1855  xy.push_back(std::make_pair((xpos + dx[np[place][k]] + offsetx[np[place][k]]),
1856  (ypos + dy[np[place][k]] + offsety[np[place][k]])));
1857 #ifdef EDM_ML_DEBUG
1858  edm::LogVerbatim("HGCalGeom") << "WaferLDFive " << k << " np " << np[place][k] << " dx "
1859  << dx[np[place][k]] + offsetx[np[place][k]] << " dy "
1860  << dy[np[place][k]] + offsety[np[place][k]];
1861 #endif
1862  }
1863  } else if (part == HGCalTypes::WaferLDThree) {
1864  int np[12][4] = {{41, 45, 4, 41},
1865  {36, 46, 5, 36},
1866  {37, 47, 0, 37},
1867  {38, 42, 1, 38},
1868  {39, 43, 2, 39},
1869  {40, 44, 3, 40},
1870  {43, 2, 39, 43},
1871  {42, 1, 38, 42},
1872  {47, 0, 37, 47},
1873  {46, 5, 36, 46},
1874  {45, 4, 41, 45},
1875  {44, 3, 40, 44}};
1876  for (int k = 0; k < 4; ++k) {
1877  xy.push_back(std::make_pair((xpos + dx[np[place][k]] + offsetx[np[place][k]]),
1878  (ypos + dy[np[place][k]] + offsety[np[place][k]])));
1879 #ifdef EDM_ML_DEBUG
1880  edm::LogVerbatim("HGCalGeom") << "WaferLDThree " << k << " np " << np[place][k] << " dx "
1881  << dx[np[place][k]] + offsetx[np[place][k]] << " dy "
1882  << dy[np[place][k]] + offsety[np[place][k]];
1883 #endif
1884  }
1885  } else if (part == HGCalTypes::WaferHDTop) {
1886  int np[12][5] = {{0, 34, 28, 5, 0},
1887  {1, 35, 29, 0, 1},
1888  {2, 30, 24, 1, 2},
1889  {3, 31, 25, 2, 3},
1890  {4, 32, 26, 3, 4},
1891  {5, 33, 27, 4, 5},
1892  {0, 1, 35, 29, 0},
1893  {5, 0, 34, 28, 5},
1894  {4, 5, 33, 27, 4},
1895  {3, 4, 32, 26, 3},
1896  {2, 3, 31, 25, 2},
1897  {1, 2, 30, 24, 1}};
1898  for (int k = 0; k < 5; ++k) {
1899  xy.push_back(std::make_pair((xpos + dx[np[place][k]] + offsetx[np[place][k]]),
1900  (ypos + dy[np[place][k]] + offsety[np[place][k]])));
1901 #ifdef EDM_ML_DEBUG
1902  edm::LogVerbatim("HGCalGeom") << "WaferHDTop " << k << " np " << np[place][k] << " dx "
1903  << dx[np[place][k]] + offsetx[np[place][k]] << " dy "
1904  << dy[np[place][k]] + offsety[np[place][k]];
1905 #endif
1906  }
1907  } else if (part == HGCalTypes::WaferHDBottom) {
1908  int np[12][7] = {{1, 2, 3, 4, 28, 34, 1},
1909  {2, 3, 4, 5, 29, 35, 2},
1910  {3, 4, 5, 0, 24, 30, 3},
1911  {4, 5, 0, 1, 25, 31, 4},
1912  {5, 0, 1, 2, 26, 32, 5},
1913  {0, 1, 2, 3, 27, 33, 0},
1914  {5, 29, 35, 2, 3, 4, 5},
1915  {4, 28, 34, 1, 2, 3, 4},
1916  {3, 27, 33, 0, 1, 2, 3},
1917  {2, 26, 32, 5, 0, 1, 2},
1918  {1, 25, 31, 4, 5, 0, 1},
1919  {0, 24, 30, 3, 4, 5, 0}};
1920  for (int k = 0; k < 7; ++k) {
1921  xy.push_back(std::make_pair((xpos + dx[np[place][k]] + offsetx[np[place][k]]),
1922  (ypos + dy[np[place][k]] + offsety[np[place][k]])));
1923 #ifdef EDM_ML_DEBUG
1924  edm::LogVerbatim("HGCalGeom") << "WaferHDBottom " << k << " np " << np[place][k] << " dx "
1925  << dx[np[place][k]] + offsetx[np[place][k]] << " dy "
1926  << dy[np[place][k]] + offsety[np[place][k]];
1927 #endif
1928  }
1929  } else if (part == HGCalTypes::WaferHDLeft) {
1930  int np[12][6] = {{0, 1, 2, 14, 21, 0},
1931  {1, 2, 3, 15, 22, 1},
1932  {2, 3, 4, 16, 23, 2},
1933  {3, 4, 5, 17, 18, 3},
1934  {4, 5, 0, 12, 19, 4},
1935  {5, 0, 1, 13, 20, 5},
1936  {0, 12, 19, 4, 5, 0},
1937  {5, 17, 18, 3, 4, 5},
1938  {4, 16, 23, 2, 3, 4},
1939  {3, 15, 22, 1, 2, 3},
1940  {2, 14, 21, 0, 1, 2},
1941  {1, 13, 20, 5, 0, 1}};
1942  for (int k = 0; k < 6; ++k) {
1943  xy.push_back(std::make_pair((xpos + dx[np[place][k]] + offsetx[np[place][k]]),
1944  (ypos + dy[np[place][k]] + offsety[np[place][k]])));
1945 #ifdef EDM_ML_DEBUG
1946  edm::LogVerbatim("HGCalGeom") << "WaferHDLeft " << k << " np " << np[place][k] << " dx "
1947  << dx[np[place][k]] + offsetx[np[place][k]] << " dy "
1948  << dy[np[place][k]] + offsety[np[place][k]];
1949 #endif
1950  }
1951  } else if (part == HGCalTypes::WaferHDRight) {
1952  int np[12][6] = {{5, 17, 18, 3, 4, 5},
1953  {0, 12, 19, 4, 5, 0},
1954  {1, 13, 20, 5, 0, 1},
1955  {2, 14, 21, 0, 1, 2},
1956  {3, 15, 22, 1, 2, 3},
1957  {4, 16, 23, 2, 3, 4},
1958  {1, 2, 3, 15, 22, 1},
1959  {0, 1, 2, 14, 21, 0},
1960  {5, 0, 1, 13, 20, 5},
1961  {4, 5, 0, 12, 19, 4},
1962  {3, 4, 5, 17, 18, 3},
1963  {2, 3, 4, 16, 23, 2}};
1964  for (int k = 0; k < 6; ++k) {
1965  xy.push_back(std::make_pair((xpos + dx[np[place][k]] + offsetx[np[place][k]]),
1966  (ypos + dy[np[place][k]] + offsety[np[place][k]])));
1967 #ifdef EDM_ML_DEBUG
1968  edm::LogVerbatim("HGCalGeom") << "WaferHDRight " << k << " np " << np[place][k] << " dx "
1969  << dx[np[place][k]] + offsetx[np[place][k]] << " dy "
1970  << dy[np[place][k]] + offsety[np[place][k]];
1971 #endif
1972  }
1973  } else if (part == HGCalTypes::WaferHDFive) {
1974  int np[12][6] = {{0, 1, 2, 18, 17, 0},
1975  {1, 2, 3, 19, 12, 1},
1976  {2, 3, 4, 20, 13, 2},
1977  {3, 4, 5, 21, 14, 3},
1978  {4, 5, 0, 22, 15, 4},
1979  {5, 0, 1, 23, 16, 5},
1980  {0, 22, 15, 4, 5, 0},
1981  {5, 21, 14, 3, 4, 5},
1982  {4, 20, 13, 2, 3, 4},
1983  {3, 19, 12, 1, 2, 3},
1984  {2, 18, 17, 0, 1, 2},
1985  {1, 23, 16, 5, 0, 1}};
1986  for (int k = 0; k < 6; ++k) {
1987  xy.push_back(std::make_pair((xpos + dx[np[place][k]] + offsetx[np[place][k]]),
1988  (ypos + dy[np[place][k]] + offsety[np[place][k]])));
1989 #ifdef EDM_ML_DEBUG
1990  edm::LogVerbatim("HGCalGeom") << "WaferHDFive " << k << " np " << np[place][k] << " dx "
1991  << dx[np[place][k]] + offsetx[np[place][k]] << " dy "
1992  << dy[np[place][k]] + offsety[np[place][k]];
1993 #endif
1994  }
1995  }
1996 #ifdef EDM_ML_DEBUG
1997  edm::LogVerbatim("HGCalGeom") << "I/p: part " << part << " place " << place << " dX " << delX << " dY " << delY
1998  << " xpos " << xpos << " ypos " << ypos << " O/p having " << xy.size() << " points:";
1999  std::ostringstream st1;
2000  for (unsigned int i = 0; i < xy.size(); ++i)
2001  st1 << " [" << i << "] " << xy[i].first << ":" << xy[i].second;
2002  edm::LogVerbatim("HGCalGeom") << st1.str();
2003 #endif
2004  return xy;
2005 }
Log< level::Info, true > LogVerbatim
static constexpr double c27O
Definition: HGCalTypes.h:100
static constexpr double c77O
Definition: HGCalTypes.h:108
static constexpr int32_t WaferLDThree
Definition: HGCalTypes.h:50
static constexpr double c50
Definition: HGCalTypes.h:103
static constexpr int32_t WaferHDFive
Definition: HGCalTypes.h:55
static constexpr double c88
Definition: HGCalTypes.h:113
static constexpr double c27
Definition: HGCalTypes.h:102
static constexpr double c10
Definition: HGCalTypes.h:114
static constexpr double sin_60_
static constexpr int32_t WaferHDLeft
Definition: HGCalTypes.h:53
U second(std::pair< T, U > const &p)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
static constexpr int32_t WaferLDBottom
Definition: HGCalTypes.h:46
int np
Definition: AMPTWrapper.h:43
static constexpr double tan_60_
static constexpr double c22O
Definition: HGCalTypes.h:96
static constexpr int32_t WaferLDRight
Definition: HGCalTypes.h:48
static constexpr int32_t WaferLDFive
Definition: HGCalTypes.h:49
static constexpr int32_t WaferLDLeft
Definition: HGCalTypes.h:47
static constexpr double c00
Definition: HGCalTypes.h:95
static constexpr int32_t WaferHDBottom
Definition: HGCalTypes.h:52
static constexpr double c271
Definition: HGCalTypes.h:101
static constexpr double c88O
Definition: HGCalTypes.h:111
static constexpr int32_t WaferHDRight
Definition: HGCalTypes.h:54
part
Definition: HCALResponse.h:20
static constexpr double c611
Definition: HGCalTypes.h:105
static constexpr double c77
Definition: HGCalTypes.h:110
static constexpr double c61
Definition: HGCalTypes.h:106
static constexpr double cos_60_
static constexpr double c61O
Definition: HGCalTypes.h:104
static constexpr double c221
Definition: HGCalTypes.h:97
static constexpr double c881
Definition: HGCalTypes.h:112
static constexpr int32_t WaferLDTop
Definition: HGCalTypes.h:45
static constexpr double c75
Definition: HGCalTypes.h:107
static constexpr double c22
Definition: HGCalTypes.h:98
static constexpr double c771
Definition: HGCalTypes.h:109
static constexpr int32_t WaferHDTop
Definition: HGCalTypes.h:51

Member Data Documentation

◆ cos_1

constexpr std::array<double, 12> HGCalWaferMask::cos_1 = {{0.5, -0.5, -1.0, -0.5, 0.5, 1.0, 0.5, -0.5, -1.0, -0.5, 0.5, 1.0}}
staticprivate

Definition at line 82 of file HGCalWaferMask.h.

Referenced by maskCut().

◆ cos_60_

constexpr double HGCalWaferMask::cos_60_ = 0.5
staticprivate

Definition at line 78 of file HGCalWaferMask.h.

Referenced by waferXY().

◆ sign_1

constexpr std::array<double, 12> HGCalWaferMask::sign_1 = {{1.0, -1.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0}}
staticprivate

Definition at line 83 of file HGCalWaferMask.h.

Referenced by maskCut().

◆ sign_2

constexpr std::array<double, 12> HGCalWaferMask::sign_2 = {{1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0, 1.0}}
staticprivate

Definition at line 84 of file HGCalWaferMask.h.

Referenced by maskCut().

◆ sin_60_

constexpr double HGCalWaferMask::sin_60_ = 0.5 * sqrt3_
staticprivate

Definition at line 77 of file HGCalWaferMask.h.

Referenced by waferXY().

◆ sqrt3_

constexpr double HGCalWaferMask::sqrt3_ = 1.732050807568877
staticprivate

Definition at line 76 of file HGCalWaferMask.h.

Referenced by maskCut().

◆ tan_1

constexpr std::array<double, 12> HGCalWaferMask::tan_1
staticprivate
Initial value:
= {
{-sqrt3_, sqrt3_, 0.0, -sqrt3_, sqrt3_, 0.0, sqrt3_, -sqrt3_, 0.0, sqrt3_, -sqrt3_, 0.0}}

Definition at line 80 of file HGCalWaferMask.h.

Referenced by maskCut().

◆ tan_60_

constexpr double HGCalWaferMask::tan_60_ = sqrt3_
staticprivate

Definition at line 79 of file HGCalWaferMask.h.

Referenced by waferXY().