CMS 3D CMS Logo

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

#include <HGCalDDDConstants.h>

Public Member Functions

std::pair< int, int > assignCell (float x, float y, int lay, int subSec, bool reco) const
 
std::array< int, 5 > assignCellHex (float x, float y, int lay, bool reco) const
 
std::array< int, 3 > assignCellTrap (float x, float y, float z, int lay, bool reco) const
 
std::pair< double, double > cellEtaPhiTrap (int type, int irad) const
 
bool cellInLayer (int waferU, int waferV, int cellU, int cellV, int lay, bool reco) const
 
double cellSizeHex (int type) const
 
std::pair< double, double > cellSizeTrap (int type, int irad) const
 
double cellThickness (int layer, int waferU, int waferV) const
 
HGCalTypes::CellType cellType (int type, int waferU, int waferV) const
 
double distFromEdgeHex (double x, double y, double z) const
 
double distFromEdgeTrap (double x, double y, double z) const
 
void etaPhiFromPosition (const double x, const double y, const double z, const int layer, int &ieta, int &iphi, int &type, double &wt) const
 
int firstLayer () const
 
HGCalGeometryMode::GeometryMode geomMode () const
 
int getLayer (double z, bool reco) const
 
int getLayerOffset () const
 
HGCalParameters::hgtrap getModule (unsigned int k, bool hexType, bool reco) const
 
std::vector< HGCalParameters::hgtrapgetModules () const
 
const HGCalParametersgetParameter () const
 
int getPhiBins (int lay) const
 
const std::vector< double > & getRadiusLayer (int layer) const
 
std::pair< int, int > getREtaRange (int lay) const
 
HGCalParameters::hgtrform getTrForm (unsigned int k) const
 
unsigned int getTrFormN () const
 
std::vector< HGCalParameters::hgtrformgetTrForms () const
 
int getTypeHex (int layer, int waferU, int waferV) const
 
int getTypeTrap (int layer) const
 
int getUVMax (int type) const
 
std::pair< double, double > getXY (int layer, double x, double y, bool forwd) const
 
 HGCalDDDConstants (const HGCalParameters *hp, const std::string &name)
 
bool isHalfCell (int waferType, int cell) const
 
bool isValidHex (int lay, int mod, int cell, bool reco) const
 
bool isValidHex8 (int lay, int modU, int modV, int cellU, int cellV, bool fullAndPart=false) const
 
bool isValidHex8 (int lay, int waferU, int waferV, bool fullAndPart=false) const
 
bool isValidTrap (int lay, int ieta, int iphi) const
 
int lastLayer (bool reco) const
 
int layerIndex (int lay, bool reco) const
 
unsigned int layers (bool reco) const
 
unsigned int layersInit (bool reco) const
 
int levelTop (int ind=0) const
 
std::pair< float, float > locateCell (const HGCScintillatorDetId &, bool debug=false) const
 
std::pair< float, float > locateCell (const HGCSiliconDetId &, bool debug=false) const
 
std::pair< float, float > locateCell (int cell, int lay, int type, bool reco) const
 
std::pair< float, float > locateCell (int lay, int waferU, int waferV, int cellU, int cellV, bool reco, bool all, bool debug=false) const
 
std::pair< float, float > locateCellHex (int cell, int wafer, bool reco) const
 
std::pair< float, float > locateCellTrap (int lay, int ieta, int iphi, bool reco) const
 
bool maskCell (const DetId &id, int corners) const
 
int maxCells (bool reco) const
 
int maxCells (int lay, bool reco) const
 
int maxCellUV () const
 
int maxModules () const
 
int maxModulesPerLayer () const
 
int maxRows (int lay, bool reco) const
 
double minSlope () const
 
int modifyUV (int uv, int type1, int type2) const
 
int modules (int lay, bool reco) const
 
int modulesInit (int lay, bool reco) const
 
double mouseBite (bool reco) const
 
int numberCells (bool reco) const
 
std::vector< int > numberCells (int lay, bool reco) const
 
int numberCellsHexagon (int lay, int waferU, int waferV, bool flag) const
 
int numberCellsHexagon (int wafer) const
 
std::pair< double, double > rangeR (double z, bool reco) const
 
std::pair< double, double > rangeRLayer (int lay, bool reco) const
 
std::pair< double, double > rangeZ (bool reco) const
 
std::pair< int, int > rowColumnWafer (const int wafer) const
 
int sectors () const
 
std::pair< int, int > simToReco (int cell, int layer, int mod, bool half) const
 
int tileSiPM (int sipm) const
 
bool tileTrapezoid () const
 
std::pair< int, int > tileType (int layer, int ring, int phi) const
 
unsigned int volumes () const
 
int waferCount (const int type) const
 
int waferFileIndex (unsigned int kk) const
 
std::tuple< int, int, int > waferFileInfo (unsigned int kk) const
 
bool waferFileInfoExist (int kk) const
 
std::tuple< int, int, int > waferFileInfoFromIndex (int kk) const
 
unsigned int waferFileSize () const
 
int waferFromCopy (int copy) const
 
void waferFromPosition (const double x, const double y, const int layer, int &waferU, int &waferV, int &cellU, int &cellV, int &celltype, double &wt, bool debug=false) const
 
void waferFromPosition (const double x, const double y, int &wafer, int &icell, int &celltyp) const
 
bool waferFullInLayer (int wafer, int lay, bool reco) const
 
bool waferHexagon6 () const
 
bool waferHexagon8 () const
 
bool waferInLayer (int wafer, int lay, bool reco) const
 
int waferMax () const
 
int waferMin () const
 
std::pair< double, double > waferParameters (bool reco) const
 
std::pair< double, double > waferPosition (int lay, int waferU, int waferV, bool reco, bool debug=false) const
 
std::pair< double, double > waferPosition (int wafer, bool reco) const
 
int wafers () const
 
int wafers (int layer, int type) const
 
double waferSepar (bool reco) const
 
double waferSize (bool reco) const
 
int waferToCopy (int wafer) const
 
int waferType (DetId const &id, bool fromFile=false) const
 
std::tuple< int, int, int > waferType (HGCSiliconDetId const &id, bool fromFile=false) const
 
int waferType (int layer, int waferU, int waferV, bool fromFile=false) const
 
int waferTypeL (int wafer) const
 
std::pair< int, int > waferTypeRotation (int layer, int waferU, int waferV, bool fromFile=false, bool debug=false) const
 
int waferTypeT (int wafer) const
 
int waferUVMax () const
 
bool waferVirtual (int layer, int waferU, int waferV) const
 
double waferZ (int layer, bool reco) const
 
 ~HGCalDDDConstants ()
 

Private Types

typedef std::array< int, 3 > HGCWaferParam
 
typedef std::array< std::vector< int32_t >, 2 > Simrecovecs
 

Private Member Functions

void cellHex (double xloc, double yloc, int cellType, int &cellU, int &cellV, bool debug=false) const
 
int cellHex (double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
 
std::pair< int, float > getIndex (int lay, bool reco) const
 
bool isValidCell (int layindex, int wafer, int cell) const
 
bool isValidCell8 (int lay, int waferU, int waferV, int cellU, int cellV, int type) const
 
int layerFromIndex (int index, bool reco) const
 
int32_t waferIndex (int wafer, int index) const
 
bool waferInLayerTest (int wafer, int lay, bool full) const
 
std::pair< double, double > waferPosition (int waferU, int waferV, bool reco) const
 

Private Attributes

const float dPhiMin = 0.02
 
bool fullAndPart_
 
HGCalGeomTools geomTools_
 
double hexside_
 
const HGCalParametershgpar_
 
const double k_horizontalShift = 1.0
 
Simrecovecs max_modules_layer_
 
int32_t maxWafersPerLayer_
 
HGCalGeometryMode::GeometryMode mode_
 
int32_t modHalf_
 
double rmax_
 
const double sqrt3_
 
std::array< uint32_t, 2 > tot_layers_
 
int32_t tot_wafers_
 
std::unordered_map< int32_t, bool > waferIn_
 
std::map< int, HGCWaferParamwaferLayer_
 
std::array< int, 4 > waferMax_
 

Static Private Attributes

constexpr static double tan30deg_ = 0.5773502693
 

Detailed Description

this class reads the constant section of the numbering xml-files of the high granulairy calorimeter

Date
2014/03/20 00:06:50
Author
Sunanda Banerjee, SINP sunan.nosp@m.da.b.nosp@m.anerj.nosp@m.ee@c.nosp@m.ern.c.nosp@m.h

Definition at line 27 of file HGCalDDDConstants.h.

Member Typedef Documentation

◆ HGCWaferParam

typedef std::array<int, 3> HGCalDDDConstants::HGCWaferParam
private

Definition at line 228 of file HGCalDDDConstants.h.

◆ Simrecovecs

typedef std::array<std::vector<int32_t>, 2> HGCalDDDConstants::Simrecovecs
private

Definition at line 227 of file HGCalDDDConstants.h.

Constructor & Destructor Documentation

◆ HGCalDDDConstants()

HGCalDDDConstants::HGCalDDDConstants ( const HGCalParameters hp,
const std::string &  name 
)

Definition at line 25 of file HGCalDDDConstants.cc.

26  : hgpar_(hp), sqrt3_(std::sqrt(3.0)) {
27  mode_ = hgpar_->mode_;
29 #ifdef EDM_ML_DEBUG
30  edm::LogVerbatim("HGCalGeom") << "Mode " << mode_ << " FullAndPart " << fullAndPart_;
31 #endif
32  if (waferHexagon6() || waferHexagon8()) {
34  hexside_ = 2.0 * rmax_ * tan30deg_;
35 #ifdef EDM_ML_DEBUG
36  edm::LogVerbatim("HGCalGeom") << "rmax_ " << rmax_ << ":" << hexside_ << " CellSize "
39 #endif
40  }
41  // init maps and constants
42  modHalf_ = 0;
44  for (int simreco = 0; simreco < 2; ++simreco) {
45  tot_layers_[simreco] = layersInit((bool)simreco);
46  max_modules_layer_[simreco].resize(tot_layers_[simreco] + 1);
47  for (unsigned int layer = 1; layer <= tot_layers_[simreco]; ++layer) {
48  max_modules_layer_[simreco][layer] = modulesInit(layer, (bool)simreco);
49  if (simreco == 1) {
50  modHalf_ += max_modules_layer_[simreco][layer];
52 #ifdef EDM_ML_DEBUG
53  edm::LogVerbatim("HGCalGeom") << "Layer " << layer << " with " << max_modules_layer_[simreco][layer] << ":"
54  << modHalf_ << " modules in RECO";
55  } else {
56  edm::LogVerbatim("HGCalGeom") << "Layer " << layer << " with " << max_modules_layer_[simreco][layer]
57  << " modules in SIM";
58 #endif
59  }
60  }
61 #ifdef EDM_ML_DEBUG
62  edm::LogVerbatim("HGCalGeom") << "SimReco " << simreco << " with " << tot_layers_[simreco] << " Layers";
63 #endif
64  }
65  tot_wafers_ = wafers();
66 
67 #ifdef EDM_ML_DEBUG
68  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants initialized for " << name << " with " << layers(false) << ":"
69  << layers(true) << " layers, " << wafers() << ":" << 2 * modHalf_
70  << " wafers with maximum " << maxWafersPerLayer_ << " per layer and "
71  << "maximum of " << maxCells(false) << ":" << maxCells(true) << " cells";
72 #endif
73  if (waferHexagon6() || waferHexagon8()) {
74  int wminT(9999999), wmaxT(-9999999), kount1(0), kount2(0);
75  for (unsigned int i = 0; i < getTrFormN(); ++i) {
76  int lay0 = getTrForm(i).lay;
77  int wmin(9999999), wmax(-9999999), kount(0);
78  for (int wafer = 0; wafer < sectors(); ++wafer) {
79  bool waferIn = waferInLayer(wafer, lay0, true);
80  if (waferHexagon8()) {
81  int kndx = HGCalWaferIndex::waferIndex(lay0,
84  waferIn_[kndx] = waferIn;
85  }
86  if (waferIn) {
87  int waferU = ((waferHexagon6()) ? wafer : HGCalWaferIndex::waferU(hgpar_->waferCopy_[wafer]));
88  if (waferU < wmin)
89  wmin = waferU;
90  if (waferU > wmax)
91  wmax = waferU;
92  ++kount;
93  }
94  }
95  if (wminT > wmin)
96  wminT = wmin;
97  if (wmaxT < wmax)
98  wmaxT = wmax;
99  if (kount1 < kount)
100  kount1 = kount;
101  kount2 += kount;
102 #ifdef EDM_ML_DEBUG
103  int lay1 = getIndex(lay0, true).first;
104  edm::LogVerbatim("HGCalGeom") << "Index " << i << " Layer " << lay0 << ":" << lay1 << " Wafer " << wmin << ":"
105  << wmax << ":" << kount;
106 #endif
107  HGCWaferParam a1{{wmin, wmax, kount}};
108  waferLayer_[lay0] = a1;
109  }
110  waferMax_ = std::array<int, 4>{{wminT, wmaxT, kount1, kount2}};
111 #ifdef EDM_ML_DEBUG
112  edm::LogVerbatim("HGCalGeom") << "Overall wafer statistics: " << wminT << ":" << wmaxT << ":" << kount1 << ":"
113  << kount2;
114 #endif
115  }
116 }

References HGCalParameters::cellSize_, funct::cos(), fullAndPart_, getIndex(), getTrForm(), getTrFormN(), HGCalGeometryMode::Hexagon8File, HGCalGeometryMode::Hexagon8Module, hexside_, hgpar_, mps_fire::i, HGCalParameters::k_ScaleFromDDD, HGCalParameters::hgtrform::lay, phase1PixelTopology::layer, layers(), layersInit(), SiStripPI::max, max_modules_layer_, maxCells(), maxWafersPerLayer_, HGCalParameters::mode_, mode_, modHalf_, modulesInit(), Skims_PA_cff::name, rmax_, sectors(), tan30deg_, tot_layers_, tot_wafers_, HGCalParameters::waferCopy_, waferHexagon6(), waferHexagon8(), waferIn_, HGCalWaferIndex::waferIndex(), waferInLayer(), waferLayer_, waferMax_, HGCalParameters::waferR_, wafers(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), cms::cuda::wmax, and cms::cuda::wmin.

◆ ~HGCalDDDConstants()

HGCalDDDConstants::~HGCalDDDConstants ( )

Definition at line 118 of file HGCalDDDConstants.cc.

118 {}

Member Function Documentation

◆ assignCell()

std::pair< int, int > HGCalDDDConstants::assignCell ( float  x,
float  y,
int  lay,
int  subSec,
bool  reco 
) const

Definition at line 120 of file HGCalDDDConstants.cc.

120  {
121  const auto& index = getIndex(lay, reco);
122  if (index.first < 0)
123  return std::make_pair(-1, -1);
124  if (waferHexagon6()) {
125  float xx = (reco) ? x : HGCalParameters::k_ScaleFromDDD * x;
126  float yy = (reco) ? y : HGCalParameters::k_ScaleFromDDD * y;
127 
128  // First the wafer
129  int wafer = cellHex(xx, yy, rmax_, hgpar_->waferPosX_, hgpar_->waferPosY_);
130  if (wafer < 0 || wafer >= (int)(hgpar_->waferTypeT_.size())) {
131  edm::LogWarning("HGCalGeom") << "Wafer no. out of bound for " << wafer << ":" << (hgpar_->waferTypeT_).size()
132  << ":" << (hgpar_->waferPosX_).size() << ":" << (hgpar_->waferPosY_).size()
133  << " ***** ERROR *****";
134  return std::make_pair(-1, -1);
135  } else {
136  // Now the cell
137  std::pair<double, double> xy = getXY(lay, xx, yy, false);
138  xx = xy.first - hgpar_->waferPosX_[wafer];
139  yy = xy.second - hgpar_->waferPosY_[wafer];
140  if (hgpar_->waferTypeT_[wafer] == 1)
141  return std::make_pair(wafer,
142  cellHex(xx,
143  yy,
146  hgpar_->cellFineY_));
147  else
148  return std::make_pair(wafer,
149  cellHex(xx,
150  yy,
153  hgpar_->cellCoarseY_));
154  }
155  } else {
156  return std::make_pair(-1, -1);
157  }
158 }

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, cellHex(), HGCalParameters::cellSize_, getIndex(), getXY(), hgpar_, HGCalParameters::k_ScaleFromDDD, dt_dqm_sourceclient_common_cff::reco, rmax_, findQualityFiles::size, waferHexagon6(), HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferTypeT_, x, geometryCSVtoXML::xx, geometryCSVtoXML::xy, y, and geometryCSVtoXML::yy.

Referenced by HGCNumberingScheme::assignCell(), and HGCalGeometry::getClosestCell().

◆ assignCellHex()

std::array< int, 5 > HGCalDDDConstants::assignCellHex ( float  x,
float  y,
int  lay,
bool  reco 
) const

Definition at line 160 of file HGCalDDDConstants.cc.

160  {
161  int waferU(0), waferV(0), waferType(-1), cellU(0), cellV(0);
162  if (waferHexagon8()) {
163  double xx = (reco) ? HGCalParameters::k_ScaleToDDD * x : x;
164  double yy = (reco) ? HGCalParameters::k_ScaleToDDD * y : y;
165  double wt(1.0);
166  waferFromPosition(xx, yy, lay, waferU, waferV, cellU, cellV, waferType, wt);
167  }
168  return std::array<int, 5>{{waferU, waferV, waferType, cellU, cellV}};
169 }

References HGCalParameters::k_ScaleToDDD, dt_dqm_sourceclient_common_cff::reco, waferFromPosition(), waferHexagon8(), waferType(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), x, geometryCSVtoXML::xx, y, and geometryCSVtoXML::yy.

Referenced by HGCalGeometry::getClosestCell().

◆ assignCellTrap()

std::array< int, 3 > HGCalDDDConstants::assignCellTrap ( float  x,
float  y,
float  z,
int  lay,
bool  reco 
) const

Definition at line 171 of file HGCalDDDConstants.cc.

171  {
172  int irad(-1), iphi(-1), type(-1);
173  const auto& indx = getIndex(layer, reco);
174  if (indx.first < 0)
175  return std::array<int, 3>{{irad, iphi, type}};
176  double xx = (z > 0) ? x : -x;
177  double r = (reco ? std::sqrt(x * x + y * y) : HGCalParameters::k_ScaleFromDDD * std::sqrt(x * x + y * y));
178  double phi = (r == 0. ? 0. : std::atan2(y, xx));
179  if (phi < 0)
180  phi += (2.0 * M_PI);
182  auto ir = std::lower_bound(hgpar_->radiusLayer_[type].begin(), hgpar_->radiusLayer_[type].end(), r);
183  irad = (int)(ir - hgpar_->radiusLayer_[type].begin());
184  irad = std::clamp(irad, hgpar_->iradMinBH_[indx.first], hgpar_->iradMaxBH_[indx.first]);
185  iphi = 1 + (int)(phi / indx.second);
186 #ifdef EDM_ML_DEBUG
187  edm::LogVerbatim("HGCalGeom") << "assignCellTrap Input " << x << ":" << y << ":" << z << ":" << layer << ":" << reco
188  << " x|r " << xx << ":" << r << " phi " << phi << " o/p " << irad << ":" << iphi << ":"
189  << type;
190 #endif
191  return std::array<int, 3>{{irad, iphi, type}};
192 }

References getIndex(), hgpar_, createfilelist::int, LEDCalibrationChannels::iphi, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, HGCalParameters::k_ScaleFromDDD, phase1PixelTopology::layer, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, M_PI, phi, alignCSCRings::r, HGCalParameters::radiusLayer_, HGCalParameters::scintType(), mathSSE::sqrt(), x, geometryCSVtoXML::xx, y, and z.

Referenced by HGCalGeometry::getClosestCell(), and HGCalNumberingScheme::getUnitID().

◆ cellEtaPhiTrap()

std::pair< double, double > HGCalDDDConstants::cellEtaPhiTrap ( int  type,
int  irad 
) const

Definition at line 194 of file HGCalDDDConstants.cc.

194  {
195  double dr(0), df(0);
196  if (tileTrapezoid()) {
197  double r = 0.5 * ((hgpar_->radiusLayer_[type][irad - 1] + hgpar_->radiusLayer_[type][irad]));
198  dr = (hgpar_->radiusLayer_[type][irad] - hgpar_->radiusLayer_[type][irad - 1]);
199  df = r * hgpar_->cellSize_[type];
200  }
201  return std::make_pair(dr, df);
202 }

References HGCalParameters::cellSize_, hgcalPerformanceValidation::df, flavorHistoryFilter_cfi::dr, hgpar_, alignCSCRings::r, HGCalParameters::radiusLayer_, and tileTrapezoid().

◆ cellHex() [1/2]

void HGCalDDDConstants::cellHex ( double  xloc,
double  yloc,
int  cellType,
int &  cellU,
int &  cellV,
bool  debug = false 
) const
private

Definition at line 1467 of file HGCalDDDConstants.cc.

1467  {
1468  int N = (cellType == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1469  double Rc = 2 * rmax_ / (3 * N);
1470  double rc = 0.5 * Rc * sqrt3_;
1471  double v0 = ((xloc / Rc - 1.0) / 1.5);
1472  int cv0 = (v0 > 0) ? (N + (int)(v0 + 0.5)) : (N - (int)(-v0 + 0.5));
1473  double u0 = (0.5 * yloc / rc + 0.5 * cv0);
1474  int cu0 = (u0 > 0) ? (N / 2 + (int)(u0 + 0.5)) : (N / 2 - (int)(-u0 + 0.5));
1475  cu0 = std::max(0, std::min(cu0, 2 * N - 1));
1476  cv0 = std::max(0, std::min(cv0, 2 * N - 1));
1477  if (cv0 - cu0 >= N)
1478  cv0 = cu0 + N - 1;
1479 #ifdef EDM_ML_DEBUG
1480  if (debug)
1481  edm::LogVerbatim("HGCalGeom") << "cellHex: input " << xloc << ":" << yloc << ":" << cellType << " parameter " << rc
1482  << ":" << Rc << " u0 " << u0 << ":" << cu0 << " v0 " << v0 << ":" << cv0;
1483 #endif
1484  bool found(false);
1485  static constexpr int shift[3] = {0, 1, -1};
1486  for (int i1 = 0; i1 < 3; ++i1) {
1487  cellU = cu0 + shift[i1];
1488  for (int i2 = 0; i2 < 3; ++i2) {
1489  cellV = cv0 + shift[i2];
1490  if (((cellV - cellU) < N) && ((cellU - cellV) <= N) && (cellU >= 0) && (cellV >= 0) && (cellU < 2 * N) &&
1491  (cellV < 2 * N)) {
1492  double xc = (1.5 * (cellV - N) + 1.0) * Rc;
1493  double yc = (2 * cellU - cellV - N) * rc;
1494  if ((std::abs(yloc - yc) <= rc) && (std::abs(xloc - xc) <= Rc) &&
1495  ((std::abs(xloc - xc) <= 0.5 * Rc) || (std::abs(yloc - yc) <= sqrt3_ * (Rc - std::abs(xloc - xc))))) {
1496 #ifdef EDM_ML_DEBUG
1497  if (debug)
1498  edm::LogVerbatim("HGCalGeom")
1499  << "cellHex: local " << xc << ":" << yc << " difference " << std::abs(xloc - xc) << ":"
1500  << std::abs(yloc - yc) << ":" << sqrt3_ * (Rc - std::abs(yloc - yc)) << " comparator " << rc << ":"
1501  << Rc << " (u,v) = (" << cellU << "," << cellV << ")";
1502 #endif
1503  found = true;
1504  break;
1505  }
1506  }
1507  }
1508  if (found)
1509  break;
1510  }
1511  if (!found) {
1512  cellU = cu0;
1513  cellV = cv0;
1514  }
1515 }

References funct::abs(), cellType(), debug, newFWLiteAna::found, hgpar_, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, SiStripPI::max, min(), N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, rmax_, edm::shift, sqrt3_, and V0Monitor_cff::v0.

◆ cellHex() [2/2]

int HGCalDDDConstants::cellHex ( double  xx,
double  yy,
const double &  cellR,
const std::vector< double > &  posX,
const std::vector< double > &  posY 
) const
private

Definition at line 1448 of file HGCalDDDConstants.cc.

1449  {
1450  int num(0);
1451  const double tol(0.00001);
1452  double cellY = 2.0 * cellR * tan30deg_;
1453  for (unsigned int k = 0; k < posX.size(); ++k) {
1454  double dx = std::abs(xx - posX[k]);
1455  double dy = std::abs(yy - posY[k]);
1456  if (dx <= (cellR + tol) && dy <= (cellY + tol)) {
1457  double xmax = (dy <= 0.5 * cellY) ? cellR : (cellR - (dy - 0.5 * cellY) / tan30deg_);
1458  if (dx <= (xmax + tol)) {
1459  num = k;
1460  break;
1461  }
1462  }
1463  }
1464  return num;
1465 }

References funct::abs(), PVValHelper::dx, PVValHelper::dy, dqmdumpme::k, EgammaValidation_cff::num, RecoTauValidation_cfi::posX, RecoTauValidation_cfi::posY, tan30deg_, TrackerOfflineValidation_Dqm_cff::xmax, geometryCSVtoXML::xx, and geometryCSVtoXML::yy.

Referenced by assignCell(), and waferFromPosition().

◆ cellInLayer()

bool HGCalDDDConstants::cellInLayer ( int  waferU,
int  waferV,
int  cellU,
int  cellV,
int  lay,
bool  reco 
) const

Definition at line 204 of file HGCalDDDConstants.cc.

204  {
205  const auto& indx = getIndex(lay, true);
206  if (indx.first >= 0) {
207  if (waferHexagon8() || waferHexagon6()) {
208  const auto& xy = ((waferHexagon8()) ? locateCell(lay, waferU, waferV, cellU, cellV, reco, true, false)
209  : locateCell(cellU, lay, waferU, reco));
210  double rpos = sqrt(xy.first * xy.first + xy.second * xy.second);
211  return ((rpos >= hgpar_->rMinLayHex_[indx.first]) && (rpos <= hgpar_->rMaxLayHex_[indx.first]));
212  } else {
213  return true;
214  }
215  } else {
216  return false;
217  }
218 }

References getIndex(), hgpar_, locateCell(), HGCalParameters::rMinLayHex_, mathSSE::sqrt(), waferHexagon6(), waferHexagon8(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), and geometryCSVtoXML::xy.

Referenced by HGCalGeometry::newCell().

◆ cellSizeHex()

double HGCalDDDConstants::cellSizeHex ( int  type) const

Definition at line 233 of file HGCalDDDConstants.cc.

233  {
234  int indx = ((waferHexagon8()) ? ((type >= 1) ? 1 : 0) : ((type == 1) ? 1 : 0));
235  double cell = (tileTrapezoid() ? 0.5 * hgpar_->cellSize_[indx]
237  return cell;
238 }

References HGCalParameters::cellSize_, hgpar_, HGCalParameters::k_ScaleFromDDD, tileTrapezoid(), and waferHexagon8().

Referenced by HGCalGeometryLoader::build().

◆ cellSizeTrap()

std::pair<double, double> HGCalDDDConstants::cellSizeTrap ( int  type,
int  irad 
) const
inline

Definition at line 38 of file HGCalDDDConstants.h.

38  {
39  return std::make_pair(hgpar_->radiusLayer_[type][irad - 1], hgpar_->radiusLayer_[type][irad]);
40  }

References hgpar_, and HGCalParameters::radiusLayer_.

Referenced by HGCalGeometry::get8Corners(), HGCalGeometry::getCorners(), and HGCalGeometry::getNewCorners().

◆ cellThickness()

double HGCalDDDConstants::cellThickness ( int  layer,
int  waferU,
int  waferV 
) const

Definition at line 220 of file HGCalDDDConstants.cc.

220  {
221  double thick(-1);
222  int type = waferType(layer, waferU, waferV, false);
223  if (type >= 0) {
224  if (waferHexagon8()) {
225  thick = 10000.0 * hgpar_->cellThickness_[type]; // cm to micron
226  } else if (waferHexagon6()) {
227  thick = 100.0 * (type + 1); // type = 1,2,3 for 100,200,300 micron
228  }
229  }
230  return thick;
231 }

References HGCalParameters::cellThickness_, hgpar_, phase1PixelTopology::layer, waferHexagon6(), waferHexagon8(), waferType(), HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

Referenced by HGCalTBAnalyzer::analyzeSimHits().

◆ cellType()

HGCalTypes::CellType HGCalDDDConstants::cellType ( int  type,
int  waferU,
int  waferV 
) const

Definition at line 240 of file HGCalDDDConstants.cc.

240  {
241  // type=0: in the middle; 1..6: the edges clocwise from bottom left;
242  // =11..16: the corners clockwise from bottom
243  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
244  if (cellU == 0) {
245  if (cellV == 0)
247  else if (cellV - cellU == N - 1)
249  else
251  } else if (cellV == 0) {
252  if (cellU - cellV == N)
254  else
256  } else if (cellU - cellV == N) {
257  if (cellU == 2 * N - 1)
259  else
261  } else if (cellU == 2 * N - 1) {
262  if (cellV == 2 * N - 1)
264  else
266  } else if (cellV == 2 * N - 1) {
267  if (cellV - cellU == N - 1)
269  else
271  } else if (cellV - cellU == N - 1) {
273  } else if ((cellU > 2 * N - 1) || (cellV > 2 * N - 1) || (cellV >= (cellU + N)) || (cellU > (cellV + N))) {
275  } else {
277  }
278 }

References HGCalTypes::BottomCorner, HGCalTypes::BottomLeftCorner, HGCalTypes::BottomLeftEdge, HGCalTypes::BottomRightCorner, HGCalTypes::BottomRightEdge, HGCalTypes::CentralType, hgpar_, if(), HGCalTypes::LeftEdge, N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, HGCalTypes::RightEdge, HGCalTypes::TopCorner, HGCalTypes::TopLeftCorner, HGCalTypes::TopLeftEdge, HGCalTypes::TopRightCorner, HGCalTypes::TopRightEdge, and HGCalTypes::UndefinedType.

Referenced by cellHex(), and HGCalTopology::neighbors().

◆ distFromEdgeHex()

double HGCalDDDConstants::distFromEdgeHex ( double  x,
double  y,
double  z 
) const

Definition at line 280 of file HGCalDDDConstants.cc.

280  {
281  // Assming the point is within a hexagonal plane of the wafer, calculate
282  // the shortest distance from the edge
283  if (z < 0)
284  x = -x;
285  double dist(0);
286  // Input x, y in Geant4 unit and transformed to CMSSW standard
289  if (waferHexagon8()) {
290  int ll = layerIndex(getLayer(z, false), false);
291  xx -= hgpar_->xLayerHex_[ll];
292  yy -= hgpar_->yLayerHex_[ll];
293  }
294  int sizew = (int)(hgpar_->waferPosX_.size());
295  int wafer = sizew;
296  // Transform to the local coordinate frame of the wafer first
297  for (int k = 0; k < sizew; ++k) {
298  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
299  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
300  if ((dx <= rmax_) && (dy <= hexside_) && ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy)))) {
301  wafer = k;
302  xx -= hgpar_->waferPosX_[k];
303  yy -= hgpar_->waferPosY_[k];
304  break;
305  }
306  }
307  // Look at only one quarter (both x,y are positive)
308  if (wafer < sizew) {
309  if (std::abs(yy) < 0.5 * hexside_) {
310  dist = rmax_ - std::abs(xx);
311  } else {
312  dist = 0.5 * ((rmax_ - std::abs(xx)) - sqrt3_ * (std::abs(yy) - 0.5 * hexside_));
313  }
314  } else {
315  dist = 0;
316  }
318 #ifdef EDM_ML_DEBUG
319  edm::LogVerbatim("HGCalGeom") << "DistFromEdgeHex: Local " << xx << ":" << yy << " wafer " << wafer << " flag "
320  << (wafer < sizew) << " Distance " << rmax_ << ":" << (rmax_ - std::abs(xx)) << ":"
321  << (std::abs(yy) - 0.5 * hexside_) << ":" << 0.5 * hexside_ << ":" << dist;
322 #endif
323  return dist;
324 }

References funct::abs(), PVValHelper::dx, PVValHelper::dy, getLayer(), hexside_, hgpar_, createfilelist::int, dqmdumpme::k, HGCalParameters::k_ScaleFromDDD, HGCalParameters::k_ScaleToDDD, layerIndex(), rmax_, sqrt3_, tan30deg_, waferHexagon8(), HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, x, HGCalParameters::xLayerHex_, geometryCSVtoXML::xx, y, HGCalParameters::yLayerHex_, geometryCSVtoXML::yy, and z.

Referenced by HFNoseSD::isItinFidVolume(), and HGCalSD::isItinFidVolume().

◆ distFromEdgeTrap()

double HGCalDDDConstants::distFromEdgeTrap ( double  x,
double  y,
double  z 
) const

Definition at line 326 of file HGCalDDDConstants.cc.

326  {
327  // Assming the point is within the eta-phi plane of the scintillator tile,
328  // calculate the shortest distance from the edge
329  int lay = getLayer(z, false);
330  double xx = (z < 0) ? -x : x;
331  int indx = layerIndex(lay, false);
332  double r = HGCalParameters::k_ScaleFromDDD * std::sqrt(x * x + y * y);
333  double phi = (r == 0. ? 0. : std::atan2(y, xx));
334  if (phi < 0)
335  phi += (2.0 * M_PI);
336  int type = hgpar_->scintType(lay);
337  double cell = hgpar_->scintCellSize(lay);
338  // Compare with the center of the tile find distances along R and also phi
339  // Take the smaller value
340  auto ir = std::lower_bound(hgpar_->radiusLayer_[type].begin(), hgpar_->radiusLayer_[type].end(), r);
341  int irad = (int)(ir - hgpar_->radiusLayer_[type].begin());
342  irad = std::clamp(irad, hgpar_->iradMinBH_[indx], hgpar_->iradMaxBH_[indx]);
343  int iphi = 1 + (int)(phi / cell);
344  double dphi = std::max(0.0, (0.5 * cell - std::abs(phi - (iphi - 0.5) * cell)));
345  double dist = std::min((r - hgpar_->radiusLayer_[type][irad - 1]), (hgpar_->radiusLayer_[type][irad] - r));
346 #ifdef EDM_ML_DEBUG
347  edm::LogVerbatim("HGCalGeom") << "DistFromEdgeTrap: Global " << x << ":" << y << ":" << z << " Layer " << lay
348  << " Index " << indx << ":" << type << " xx " << xx << " R " << r << ":" << irad << ":"
349  << hgpar_->radiusLayer_[type][irad - 1] << ":" << hgpar_->radiusLayer_[type][irad]
350  << " Phi " << phi << ":" << iphi << ":" << (iphi - 0.5) * cell << " cell " << cell
351  << " Dphi " << dphi << " Dist " << dist << ":" << r * dphi;
352 #endif
353  return HGCalParameters::k_ScaleToDDD * std::min(r * dphi, dist);
354 }

References funct::abs(), getLayer(), hgpar_, createfilelist::int, LEDCalibrationChannels::iphi, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, HGCalParameters::k_ScaleFromDDD, HGCalParameters::k_ScaleToDDD, layerIndex(), pfDeepBoostedJetPreprocessParams_cfi::lower_bound, M_PI, SiStripPI::max, min(), phi, alignCSCRings::r, HGCalParameters::radiusLayer_, HGCalParameters::scintCellSize(), HGCalParameters::scintType(), mathSSE::sqrt(), x, geometryCSVtoXML::xx, y, and z.

Referenced by HGCScintSD::isItinFidVolume().

◆ etaPhiFromPosition()

void HGCalDDDConstants::etaPhiFromPosition ( const double  x,
const double  y,
const double  z,
const int  layer,
int &  ieta,
int &  iphi,
int &  type,
double &  wt 
) const

◆ firstLayer()

int HGCalDDDConstants::firstLayer ( ) const
inline

◆ geomMode()

HGCalGeometryMode::GeometryMode HGCalDDDConstants::geomMode ( ) const
inline

◆ getIndex()

std::pair< int, float > HGCalDDDConstants::getIndex ( int  lay,
bool  reco 
) const
private

Definition at line 1517 of file HGCalDDDConstants.cc.

1517  {
1518  int indx = layerIndex(lay, reco);
1519  if (indx < 0)
1520  return std::make_pair(-1, 0);
1521  float cell(0);
1522  if (waferHexagon6()) {
1523  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1524  } else {
1525  if (waferHexagon8()) {
1526  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1527  } else {
1528  cell = hgpar_->scintCellSize(lay);
1529  }
1530  }
1531  return std::make_pair(indx, cell);
1532 }

References hgpar_, layerIndex(), HGCalParameters::moduleCellR_, HGCalParameters::moduleCellS_, HGCalParameters::scintCellSize(), waferHexagon6(), and waferHexagon8().

Referenced by assignCell(), assignCellTrap(), cellInLayer(), HGCalDDDConstants(), isValidTrap(), locateCell(), locateCellTrap(), maxCells(), maxRows(), modules(), modulesInit(), numberCells(), rangeRLayer(), simToReco(), waferFullInLayer(), waferInLayer(), wafers(), and waferZ().

◆ getLayer()

int HGCalDDDConstants::getLayer ( double  z,
bool  reco 
) const

Definition at line 356 of file HGCalDDDConstants.cc.

356  {
357  // Get the layer # from the gloabl z coordinate
358  unsigned int k = 0;
359  double zz = (reco ? std::abs(z) : HGCalParameters::k_ScaleFromDDD * std::abs(z));
360  const auto& zLayerHex = hgpar_->zLayerHex_;
361  auto itr = std::find_if(zLayerHex.begin() + 1, zLayerHex.end(), [&k, &zz, &zLayerHex](double zLayer) {
362  ++k;
363  return zz < 0.5 * (zLayerHex[k - 1] + zLayerHex[k]);
364  });
365  int lay = (itr == zLayerHex.end()) ? static_cast<int>(zLayerHex.size()) : k;
366  if (waferHexagon6() && reco) {
367  int indx = layerIndex(lay, false);
368  if (indx >= 0)
369  lay = hgpar_->layerGroupO_[indx];
370  } else {
371  lay += (hgpar_->firstLayer_ - 1);
372  }
373  return lay;
374 }

References funct::abs(), HGCalParameters::firstLayer_, hgpar_, dqmdumpme::k, HGCalParameters::k_ScaleFromDDD, HGCalParameters::layerGroupO_, layerIndex(), dt_dqm_sourceclient_common_cff::reco, waferHexagon6(), z, HGCalParameters::zLayerHex_, and geometryCSVtoXML::zz.

Referenced by distFromEdgeHex(), distFromEdgeTrap(), HGCMouseBite::exclude(), and HGCalGeometry::getClosestCell().

◆ getLayerOffset()

int HGCalDDDConstants::getLayerOffset ( ) const
inline

Definition at line 56 of file HGCalDDDConstants.h.

56 { return hgpar_->layerOffset_; }

References hgpar_, and HGCalParameters::layerOffset_.

Referenced by HGCalNumberingScheme::getUnitID().

◆ getModule()

HGCalParameters::hgtrap HGCalDDDConstants::getModule ( unsigned int  k,
bool  hexType,
bool  reco 
) const

Definition at line 376 of file HGCalDDDConstants.cc.

376  {
378  if (hexType) {
379  if (indx >= hgpar_->waferTypeL_.size())
380  edm::LogWarning("HGCalGeom") << "Wafer no. out bound for index " << indx << ":" << (hgpar_->waferTypeL_).size()
381  << ":" << (hgpar_->waferPosX_).size() << ":" << (hgpar_->waferPosY_).size()
382  << " ***** ERROR *****";
383  unsigned int type =
384  ((indx < hgpar_->waferTypeL_.size()) ? hgpar_->waferTypeL_[indx] - 1 : HGCSiliconDetId::HGCalCoarseThick);
385  mytr = hgpar_->getModule(type, reco);
386  } else {
387  mytr = hgpar_->getModule(indx, reco);
388  }
389  return mytr;
390 }

References HGCalParameters::getModule(), HGCSiliconDetId::HGCalCoarseThick, hgpar_, findQualityFiles::size, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, and HGCalParameters::waferTypeL_.

Referenced by HGCalGeometryLoader::build(), and HGCalGeometry::getSummary().

◆ getModules()

std::vector< HGCalParameters::hgtrap > HGCalDDDConstants::getModules ( ) const

Definition at line 392 of file HGCalDDDConstants.cc.

392  {
393  std::vector<HGCalParameters::hgtrap> mytrs;
394  for (unsigned int k = 0; k < hgpar_->moduleLayR_.size(); ++k)
395  mytrs.emplace_back(hgpar_->getModule(k, true));
396  return mytrs;
397 }

References HGCalParameters::getModule(), hgpar_, dqmdumpme::k, and HGCalParameters::moduleLayR_.

◆ getParameter()

const HGCalParameters* HGCalDDDConstants::getParameter ( ) const
inline

◆ getPhiBins()

int HGCalDDDConstants::getPhiBins ( int  lay) const

Definition at line 399 of file HGCalDDDConstants.cc.

399 { return (tileTrapezoid() ? hgpar_->scintCells(lay) : 0); }

References hgpar_, HGCalParameters::scintCells(), and tileTrapezoid().

◆ getRadiusLayer()

const std::vector<double>& HGCalDDDConstants::getRadiusLayer ( int  layer) const
inline

◆ getREtaRange()

std::pair< int, int > HGCalDDDConstants::getREtaRange ( int  lay) const

Definition at line 401 of file HGCalDDDConstants.cc.

401  {
402  int irmin(0), irmax(0);
403  if (tileTrapezoid()) {
404  int indx = layerIndex(lay, false);
405  if ((indx >= 0) && (indx < static_cast<int>(hgpar_->iradMinBH_.size()))) {
406  irmin = hgpar_->iradMinBH_[indx];
407  irmax = hgpar_->iradMaxBH_[indx];
408  }
409  }
410  return std::make_pair(irmin, irmax);
411 }

References hgpar_, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, layerIndex(), and tileTrapezoid().

Referenced by HGCalTriggerGeometryV9Imp2::getModuleFromTriggerCell(), and HGCalTriggerGeometryV9Imp2::getTriggerCellsFromModule().

◆ getTrForm()

HGCalParameters::hgtrform HGCalDDDConstants::getTrForm ( unsigned int  k) const
inline

◆ getTrFormN()

unsigned int HGCalDDDConstants::getTrFormN ( ) const
inline

Definition at line 67 of file HGCalDDDConstants.h.

67 { return hgpar_->trformIndex_.size(); }

References hgpar_, and HGCalParameters::trformIndex_.

Referenced by HGCalGeometryLoader::build(), HGCalGeometry::getSummary(), and HGCalDDDConstants().

◆ getTrForms()

std::vector< HGCalParameters::hgtrform > HGCalDDDConstants::getTrForms ( ) const

Definition at line 413 of file HGCalDDDConstants.cc.

413  {
414  std::vector<HGCalParameters::hgtrform> mytrs;
415  for (unsigned int k = 0; k < hgpar_->trformIndex_.size(); ++k)
416  mytrs.emplace_back(hgpar_->getTrForm(k));
417  return mytrs;
418 }

References HGCalParameters::getTrForm(), hgpar_, dqmdumpme::k, and HGCalParameters::trformIndex_.

Referenced by HGCalTrackCollectionProducer::beginLuminosityBlock().

◆ getTypeHex()

int HGCalDDDConstants::getTypeHex ( int  layer,
int  waferU,
int  waferV 
) const

◆ getTypeTrap()

int HGCalDDDConstants::getTypeTrap ( int  layer) const

Definition at line 420 of file HGCalDDDConstants.cc.

420  {
421  // Get the module type for scinitllator
422  if (tileTrapezoid()) {
423  return hgpar_->scintType(layer);
424  } else {
425  return -1;
426  }
427 }

References hgpar_, phase1PixelTopology::layer, HGCalParameters::scintType(), and tileTrapezoid().

Referenced by HGCalTriggerGeometryV9Imp1::fillInvalidTriggerCells(), HGCalTriggerGeometryV9Imp1::getCellsFromTriggerCell(), and HGCalTriggerGeometryV9Imp1::getNeighborsFromTriggerCell().

◆ getUVMax()

int HGCalDDDConstants::getUVMax ( int  type) const
inline

Definition at line 72 of file HGCalDDDConstants.h.

72 { return ((type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_); }

References hgpar_, HGCalParameters::nCellsCoarse_, and HGCalParameters::nCellsFine_.

Referenced by maskCell(), and HGCalTopology::neighbors().

◆ getXY()

std::pair< double, double > HGCalDDDConstants::getXY ( int  layer,
double  x,
double  y,
bool  forwd 
) const

Definition at line 439 of file HGCalDDDConstants.cc.

439  {
440  int ll = layer - hgpar_->firstLayer_;
441  double x0(x), y0(y);
442  if (ll < static_cast<int>(hgpar_->layerRotV_.size())) {
443  if (forwd) {
444  x0 = x * hgpar_->layerRotV_[ll].first + y * hgpar_->layerRotV_[ll].second;
445  y0 = y * hgpar_->layerRotV_[ll].first - x * hgpar_->layerRotV_[ll].second;
446  } else {
447  x0 = x * hgpar_->layerRotV_[ll].first - y * hgpar_->layerRotV_[ll].second;
448  y0 = y * hgpar_->layerRotV_[ll].first + x * hgpar_->layerRotV_[ll].second;
449  }
450  }
451  return std::make_pair(x0, y0);
452 }

References HGCalParameters::firstLayer_, hgpar_, phase1PixelTopology::layer, HGCalParameters::layerRotV_, x, and y.

Referenced by assignCell(), locateCell(), and waferFromPosition().

◆ isHalfCell()

bool HGCalDDDConstants::isHalfCell ( int  waferType,
int  cell 
) const

Definition at line 454 of file HGCalDDDConstants.cc.

454  {
455  if (waferType < 1 || cell < 0)
456  return false;
457  return waferType == 2 ? hgpar_->cellCoarseHalf_[cell] : hgpar_->cellFineHalf_[cell];
458 }

References HGCalParameters::cellCoarseHalf_, HGCalParameters::cellFineHalf_, hgpar_, and waferType().

◆ isValidCell()

bool HGCalDDDConstants::isValidCell ( int  layindex,
int  wafer,
int  cell 
) const
private

Definition at line 1554 of file HGCalDDDConstants.cc.

1554  {
1555  // Calculate the position of the cell
1556  // Works for options HGCalHexagon/HGCalHexagonFull
1557  double x = hgpar_->waferPosX_[wafer];
1558  double y = hgpar_->waferPosY_[wafer];
1559  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine) {
1560  x += hgpar_->cellFineX_[cell];
1561  y += hgpar_->cellFineY_[cell];
1562  } else {
1563  x += hgpar_->cellCoarseX_[cell];
1564  y += hgpar_->cellCoarseY_[cell];
1565  }
1566  double rr = sqrt(x * x + y * y);
1567  bool result = ((rr >= hgpar_->rMinLayHex_[lay - 1]) && (rr <= hgpar_->rMaxLayHex_[lay - 1]) &&
1568  (wafer < (int)(hgpar_->waferPosX_.size())));
1569 #ifdef EDM_ML_DEBUG
1570  if (!result)
1571  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << wafer << ":" << cell << " Position " << x << ":" << y
1572  << ":" << rr << " Compare Limits " << hgpar_->rMinLayHex_[lay - 1] << ":"
1573  << hgpar_->rMaxLayHex_[lay - 1] << " Flag " << result;
1574 #endif
1575  return result;
1576 }

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, HGCSiliconDetId::HGCalFine, hgpar_, createfilelist::int, mps_fire::result, HGCalParameters::rMaxLayHex_, HGCalParameters::rMinLayHex_, findQualityFiles::rr, mathSSE::sqrt(), HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferTypeT_, x, and y.

Referenced by isValidHex().

◆ isValidCell8()

bool HGCalDDDConstants::isValidCell8 ( int  lay,
int  waferU,
int  waferV,
int  cellU,
int  cellV,
int  type 
) const
private

Definition at line 1578 of file HGCalDDDConstants.cc.

1578  {
1579  float x(0), y(0);
1580  int kndx = cellV * 100 + cellU;
1581  if (type == 0) {
1582  auto ktr = hgpar_->cellFineIndex_.find(kndx);
1583  if (ktr != hgpar_->cellFineIndex_.end()) {
1584  x = hgpar_->cellFineX_[ktr->second];
1585  y = hgpar_->cellFineY_[ktr->second];
1586  }
1587 #ifdef EDM_ML_DEBUG
1588  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
1589  << (ktr != hgpar_->cellFineIndex_.end());
1590 #endif
1591  } else {
1592  auto ktr = hgpar_->cellCoarseIndex_.find(kndx);
1593  if (ktr != hgpar_->cellCoarseIndex_.end()) {
1594  x = hgpar_->cellCoarseX_[ktr->second];
1595  y = hgpar_->cellCoarseY_[ktr->second];
1596  }
1597 #ifdef EDM_ML_DEBUG
1598  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
1599  << (ktr != hgpar_->cellCoarseIndex_.end());
1600 #endif
1601  }
1602  const auto& xy = waferPosition(lay, waferU, waferV, true, false);
1603  x += xy.first;
1604  y += xy.second;
1605 #ifdef EDM_ML_DEBUG
1606  edm::LogVerbatim("HGCalGeom") << "With wafer (" << waferU << "," << waferV << ") " << x << ":" << y;
1607 #endif
1608  double rr = sqrt(x * x + y * y);
1609  int ll = lay - hgpar_->firstLayer_;
1610  bool result = ((rr >= hgpar_->rMinLayHex_[ll]) && (rr <= hgpar_->rMaxLayHex_[ll]));
1611 #ifdef EDM_ML_DEBUG
1612  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << ll << ":" << waferU << ":" << waferV << ":" << cellU << ":"
1613  << cellV << " Position " << x << ":" << y << ":" << rr << " Compare Limits "
1614  << hgpar_->rMinLayHex_[ll] << ":" << hgpar_->rMaxLayHex_[ll] << " Flag " << result;
1615 #endif
1617  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1618  auto partn = waferTypeRotation(lay, waferU, waferV, false, false);
1619  result = HGCalWaferMask::goodCell(cellU, cellV, N, partn.first, partn.second);
1620 #ifdef EDM_ML_DEBUG
1621  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << waferU << ":" << waferV << ":" << cellU << ":" << cellV
1622  << " N " << N << " part " << partn.first << ":" << partn.second << " Result "
1623  << result;
1624 #endif
1625  }
1626  return result;
1627 }

References HGCalParameters::cellCoarseIndex_, HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineIndex_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, HGCalParameters::firstLayer_, HGCalWaferMask::goodCell(), HGCalGeometryMode::Hexagon8File, HGCalGeometryMode::Hexagon8Module, hgpar_, mode_, N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, mps_fire::result, HGCalParameters::rMaxLayHex_, HGCalParameters::rMinLayHex_, findQualityFiles::rr, mathSSE::sqrt(), waferPosition(), waferTypeRotation(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), x, geometryCSVtoXML::xy, and y.

Referenced by isValidHex8().

◆ isValidHex()

bool HGCalDDDConstants::isValidHex ( int  lay,
int  mod,
int  cell,
bool  reco 
) const

Definition at line 460 of file HGCalDDDConstants.cc.

460  {
461  // Check validity for a layer|wafer|cell of pre-TDR version
462  bool result(false), resultMod(false);
463  int cellmax(0);
464  if (waferHexagon6()) {
465  int32_t copyNumber = hgpar_->waferCopy_[mod];
466  result = ((lay > 0 && lay <= (int)(layers(reco))));
467  if (result) {
468  const int32_t lay_idx = reco ? (lay - 1) * 3 + 1 : lay;
469  const auto& the_modules = hgpar_->copiesInLayers_[lay_idx];
470  auto moditr = the_modules.find(copyNumber);
471  result = resultMod = (moditr != the_modules.end());
472 #ifdef EDM_ML_DEBUG
473  if (!result)
474  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << lay << ":" << lay_idx << " Copy " << copyNumber
475  << ":" << mod << " Flag " << result;
476 #endif
477  if (result) {
478  if (moditr->second >= 0) {
479  if (mod >= (int)(hgpar_->waferTypeT_.size()))
480  edm::LogWarning("HGCalGeom") << "Module no. out of bound for " << mod << " to be compared with "
481  << (hgpar_->waferTypeT_).size() << " ***** ERROR *****";
482  cellmax = ((hgpar_->waferTypeT_[mod] - 1 == HGCSiliconDetId::HGCalFine) ? (int)(hgpar_->cellFineX_.size())
483  : (int)(hgpar_->cellCoarseX_.size()));
484  result = (cell >= 0 && cell <= cellmax);
485  } else {
486  result = isValidCell(lay_idx, mod, cell);
487  }
488  }
489  }
490  }
491 
492 #ifdef EDM_ML_DEBUG
493  if (!result)
494  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << lay << ":"
495  << (lay > 0 && (lay <= (int)(layers(reco)))) << " Module " << mod << ":" << resultMod
496  << " Cell " << cell << ":" << cellmax << ":" << (cell >= 0 && cell <= cellmax) << ":"
497  << maxCells(reco);
498 #endif
499  return result;
500 }

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, HGCalParameters::copiesInLayers_, HGCSiliconDetId::HGCalFine, hgpar_, createfilelist::int, isValidCell(), layers(), maxCells(), mod(), mps_fire::result, findQualityFiles::size, HGCalParameters::waferCopy_, waferHexagon6(), and HGCalParameters::waferTypeT_.

Referenced by HGCNumberingScheme::getUnitID(), and HGCalTopology::valid().

◆ isValidHex8() [1/2]

bool HGCalDDDConstants::isValidHex8 ( int  lay,
int  modU,
int  modV,
int  cellU,
int  cellV,
bool  fullAndPart = false 
) const

Definition at line 545 of file HGCalDDDConstants.cc.

545  {
546  // First check validity for a layer|wafer| of post TDR version
547  if (!isValidHex8(layer, modU, modV, fullAndPart))
548  return false;
549  int indx = HGCalWaferIndex::waferIndex(layer, modU, modV);
550  auto itr = hgpar_->typesInLayers_.find(indx);
551  int type = hgpar_->waferTypeL_[itr->second];
552  int N = ((hgpar_->waferTypeL_[itr->second] == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_);
553 #ifdef EDM_ML_DEBUG
554  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:Cell " << cellU << ":" << cellV << ":" << N
555  << " Tests " << (cellU >= 0) << ":" << (cellU < 2 * N) << ":" << (cellV >= 0) << ":"
556  << (cellV < 2 * N) << ":" << ((cellV - cellU) < N) << ":" << ((cellU - cellV) <= N);
557 #endif
558  if ((cellU < 0) || (cellU >= 2 * N) || (cellV < 0) || (cellV >= 2 * N))
559  return false;
560  if (((cellV - cellU) >= N) || ((cellU - cellV) > N))
561  return false;
562 
563  return isValidCell8(layer, modU, modV, cellU, cellV, type);
564 }

References hgpar_, isValidCell8(), isValidHex8(), phase1PixelTopology::layer, N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, HGCalParameters::typesInLayers_, HGCalWaferIndex::waferIndex(), and HGCalParameters::waferTypeL_.

◆ isValidHex8() [2/2]

bool HGCalDDDConstants::isValidHex8 ( int  lay,
int  waferU,
int  waferV,
bool  fullAndPart = false 
) const

Definition at line 502 of file HGCalDDDConstants.cc.

502  {
503  // Check validity for a layer|wafer|cell of post-TDR version
504  int indx = HGCalWaferIndex::waferIndex(layer, modU, modV);
505  auto itr = hgpar_->typesInLayers_.find(indx);
506 #ifdef EDM_ML_DEBUG
507  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferType " << layer << ":" << modU << ":" << modV
508  << ":" << indx << " Test " << (itr != hgpar_->typesInLayers_.end());
509 #endif
510  if (itr == hgpar_->typesInLayers_.end())
511  return false;
512 
513  if (fullAndPart_) {
514  auto ktr = hgpar_->waferInfoMap_.find(indx);
515 #ifdef EDM_ML_DEBUG
516  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferInfoMap " << layer << ":" << modU << ":"
517  << modV << ":" << indx << " Test " << (ktr != hgpar_->waferInfoMap_.end());
518 #endif
519  if (ktr == hgpar_->waferInfoMap_.end())
520  return false;
521  } else {
522  auto jtr = waferIn_.find(indx);
523 #ifdef EDM_ML_DEBUG
524  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferIn " << jtr->first << ":" << jtr->second;
525 #endif
526  if (!(jtr->second))
527  return false;
528  }
529 
530  if (fullAndPart || fullAndPart_) {
531  auto ktr = hgpar_->waferTypes_.find(indx);
532  if (ktr != hgpar_->waferTypes_.end()) {
533  if (hgpar_->waferMaskMode_ > 0) {
534  if (ktr->second.first == HGCalTypes::WaferOut)
535  return false;
536  } else {
537  if (ktr->second.first < HGCalTypes::WaferCornerMin)
538  return false;
539  }
540  }
541  }
542  return true;
543 }

References fullAndPart_, hgpar_, phase1PixelTopology::layer, HGCalParameters::typesInLayers_, HGCalTypes::WaferCornerMin, waferIn_, HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalParameters::waferMaskMode_, HGCalTypes::WaferOut, and HGCalParameters::waferTypes_.

Referenced by HGCalTopology::addHGCSiliconId(), isValidHex8(), HGCalTopology::valid(), and HGCalTopology::validModule().

◆ isValidTrap()

bool HGCalDDDConstants::isValidTrap ( int  lay,
int  ieta,
int  iphi 
) const

Definition at line 566 of file HGCalDDDConstants.cc.

566  {
567  // Check validity for a layer|eta|phi of scintillator
568  const auto& indx = getIndex(layer, true);
569  if (indx.first < 0)
570  return false;
571  return ((irad >= hgpar_->iradMinBH_[indx.first]) && (irad <= hgpar_->iradMaxBH_[indx.first]) && (iphi > 0) &&
572  (iphi <= hgpar_->scintCells(layer)));
573 }

References getIndex(), hgpar_, LEDCalibrationChannels::iphi, HGCalParameters::iradMinBH_, and phase1PixelTopology::layer.

Referenced by HGCalTopology::addHGCSCintillatorId(), and HGCalTopology::valid().

◆ lastLayer()

int HGCalDDDConstants::lastLayer ( bool  reco) const

◆ layerFromIndex()

int HGCalDDDConstants::layerFromIndex ( int  index,
bool  reco 
) const
private

Definition at line 1534 of file HGCalDDDConstants.cc.

1534  {
1535  int ll(-1);
1536  if (waferHexagon6() && reco) {
1537  ll = static_cast<int>(std::find(hgpar_->depthLayerF_.begin(), hgpar_->depthLayerF_.end(), index) -
1538  hgpar_->depthLayerF_.begin());
1539  if (ll == static_cast<int>(hgpar_->depthLayerF_.size()))
1540  ll = -1;
1541  } else {
1542  ll = static_cast<int>(std::find(hgpar_->layerIndex_.begin(), hgpar_->layerIndex_.end(), index) -
1543  hgpar_->layerIndex_.begin());
1544  if (ll == static_cast<int>(hgpar_->layerIndex_.size()))
1545  ll = -1;
1546  }
1547 #ifdef EDM_ML_DEBUG
1548  edm::LogVerbatim("HGCalGeom") << "LayerFromIndex for " << index << ":" << reco << ":" << waferHexagon6() << " is"
1549  << ll << ":" << (ll + hgpar_->firstLayer_);
1550 #endif
1551  return ((ll < 0) ? ll : (ll + hgpar_->firstLayer_));
1552 }

References HGCalParameters::depthLayerF_, spr::find(), HGCalParameters::firstLayer_, hgpar_, HGCalParameters::layerIndex_, and waferHexagon6().

Referenced by waferIndex().

◆ layerIndex()

int HGCalDDDConstants::layerIndex ( int  lay,
bool  reco 
) const

Definition at line 579 of file HGCalDDDConstants.cc.

579  {
580  int ll = lay - hgpar_->firstLayer_;
581  if (ll < 0 || ll >= (int)(hgpar_->layerIndex_.size()))
582  return -1;
583  if (waferHexagon6()) {
584  if (reco && ll >= (int)(hgpar_->depthIndex_.size()))
585  return -1;
586  return (reco ? hgpar_->depthLayerF_[ll] : hgpar_->layerIndex_[ll]);
587  } else {
588  return (hgpar_->layerIndex_[ll]);
589  }
590 }

References HGCalParameters::depthIndex_, HGCalParameters::depthLayerF_, HGCalParameters::firstLayer_, hgpar_, HGCalParameters::layerIndex_, and waferHexagon6().

Referenced by HGCalGeometryLoader::build(), distFromEdgeHex(), distFromEdgeTrap(), getIndex(), getLayer(), getREtaRange(), and HGCalGeometry::getSummary().

◆ layers()

unsigned int HGCalDDDConstants::layers ( bool  reco) const

◆ layersInit()

unsigned int HGCalDDDConstants::layersInit ( bool  reco) const

Definition at line 592 of file HGCalDDDConstants.cc.

592  {
593  return (reco ? hgpar_->depthIndex_.size() : hgpar_->layerIndex_.size());
594 }

References HGCalParameters::depthIndex_, hgpar_, and HGCalParameters::layerIndex_.

Referenced by HGCalDDDConstants().

◆ levelTop()

int HGCalDDDConstants::levelTop ( int  ind = 0) const
inline

◆ locateCell() [1/4]

std::pair< float, float > HGCalDDDConstants::locateCell ( const HGCScintillatorDetId id,
bool  debug = false 
) const

Definition at line 704 of file HGCalDDDConstants.cc.

704  {
705  int lay(id.layer()), iphi(id.iphi()), ir(id.iradiusAbs());
706  double phi = (iphi - 0.5) * hgpar_->scintCellSize(lay);
707  int type = (id.type() > 0) ? 1 : 0;
708  double r = (((ir + 1) < static_cast<int>(hgpar_->radiusLayer_[type].size()))
709  ? (0.5 * (hgpar_->radiusLayer_[type][ir] + hgpar_->radiusLayer_[type][ir - 1]))
710  : (1.5 * hgpar_->radiusLayer_[type][ir] - 0.5 * hgpar_->radiusLayer_[type][ir - 1]));
711  if (debug)
712  edm::LogVerbatim("HGCalGeom") << "LocateCell lay:ir:iphi:type " << lay << ":" << ir << ":" << iphi << ":" << type
713  << " r:phi " << r << ":" << convertRadToDeg(phi) << " x:y "
714  << (r * cos(phi) * id.zside()) << ":" << (r * sin(phi));
715  return std::make_pair(r * cos(phi) * id.zside(), r * sin(phi));
716 }

References angle_units::operators::convertRadToDeg(), funct::cos(), debug, hgpar_, LEDCalibrationChannels::iphi, phase1PixelTopology::layer, phi, alignCSCRings::r, HGCalParameters::radiusLayer_, HGCalParameters::scintCellSize(), funct::sin(), and ecaldqm::zside().

◆ locateCell() [2/4]

std::pair< float, float > HGCalDDDConstants::locateCell ( const HGCSiliconDetId id,
bool  debug = false 
) const

Definition at line 679 of file HGCalDDDConstants.cc.

679  {
680  int lay(id.layer());
681  double r = 0.5 * (hgpar_->waferSize_ + hgpar_->sensorSeparation_);
682  double R = 2.0 * r / sqrt3_;
683  int ncells = (id.type() == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
684  int n2 = ncells / 2;
685  auto xyoff = geomTools_.shiftXY(hgpar_->layerCenter_[lay - 1], (2.0 * r));
686  double xpos = xyoff.first + ((-2 * id.waferU() + id.waferV()) * r);
687  double ypos = xyoff.second + (1.5 * id.waferV() * R);
688  if (debug)
689  edm::LogVerbatim("HGCalGeom") << "LocateCell " << id << " Lay " << lay << " r:R " << r << ":" << R << " N "
690  << ncells << ":" << n2 << " Off " << xyoff.first << ":" << xyoff.second << " Pos "
691  << xpos << ":" << ypos;
692  double R1 = hgpar_->waferSize_ / (3.0 * ncells);
693  double r1 = 0.5 * R1 * sqrt3_;
694  xpos += ((1.5 * (id.cellV() - ncells) + 1.0) * R1);
695  ypos += ((id.cellU() - 0.5 * id.cellV() - n2) * 2 * r1);
696  if (debug)
697  edm::LogVerbatim("HGCalGeom") << "LocateCell r1:R1 " << r1 << ":" << R1 << " dx:dy "
698  << ((1.5 * (id.cellV() - ncells) + 1.0) * R1) << ":"
699  << ((id.cellU() - 0.5 * id.cellV() - n2) * 2 * r1) << " Pos " << xpos << ":" << ypos;
700  std::pair<double, double> xy = getXY(id.layer(), xpos, ypos, true);
701  return std::make_pair(xy.first * id.zside(), xy.second);
702 }

References debug, geomTools_, getXY(), hgpar_, phase1PixelTopology::layer, HGCalParameters::layerCenter_, callgraph::n2, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, dttmaxenums::R, alignCSCRings::r, diffTwoXMLs::r1, HGCalParameters::sensorSeparation_, HGCalGeomTools::shiftXY(), sqrt3_, HGCalParameters::waferSize_, and geometryCSVtoXML::xy.

◆ locateCell() [3/4]

std::pair< float, float > HGCalDDDConstants::locateCell ( int  cell,
int  lay,
int  type,
bool  reco 
) const

Definition at line 596 of file HGCalDDDConstants.cc.

596  {
597  // type refers to wafer # for hexagon cell
598  float x(999999.), y(999999.);
599  const auto& index = getIndex(lay, reco);
600  int i = index.first;
601  if (i < 0)
602  return std::make_pair(x, y);
603  if (waferHexagon6()) {
604  x = hgpar_->waferPosX_[type];
605  y = hgpar_->waferPosY_[type];
606 #ifdef EDM_ML_DEBUG
607  float x0(x), y0(y);
608 #endif
610  x += hgpar_->cellFineX_[cell];
611  y += hgpar_->cellFineY_[cell];
612  } else {
613  x += hgpar_->cellCoarseX_[cell];
614  y += hgpar_->cellCoarseY_[cell];
615  }
616 #ifdef EDM_ML_DEBUG
617  edm::LogVerbatim("HGCalGeom") << "LocateCell (Wafer) " << x0 << ":" << y0 << " Final " << x << ":" << y;
618 #endif
619  if (!reco) {
622  }
623  }
624  return getXY(lay, x, y, true);
625 }

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, getIndex(), getXY(), HGCSiliconDetId::HGCalFine, hgpar_, mps_fire::i, HGCalParameters::k_ScaleToDDD, waferHexagon6(), HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferTypeT_, x, and y.

Referenced by HGCalSimHitValidation::analyzeHits(), HGCalTBAnalyzer::analyzeSimHits(), cellInLayer(), HFNoseNumberingScheme::checkPosition(), HGCalNumberingScheme::checkPosition(), HGCalGeometry::get8Corners(), HGCalGeometry::getCorners(), HGCNumberingScheme::getLocalCoords(), HGCalGeometry::getNewCorners(), and HGCalGeometry::getPosition().

◆ locateCell() [4/4]

std::pair< float, float > HGCalDDDConstants::locateCell ( int  lay,
int  waferU,
int  waferV,
int  cellU,
int  cellV,
bool  reco,
bool  all,
bool  debug = false 
) const

Definition at line 627 of file HGCalDDDConstants.cc.

628  {
629  float x(0), y(0);
630  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
631  auto itr = hgpar_->typesInLayers_.find(indx);
632  int type = ((itr == hgpar_->typesInLayers_.end()) ? 2 : hgpar_->waferTypeL_[itr->second]);
633 #ifdef EDM_ML_DEBUG
634  if (debug) {
635  edm::LogVerbatim("HGCalGeom") << "LocateCell " << lay << ":" << waferU << ":" << waferV << ":" << indx << ":"
636  << (itr == hgpar_->typesInLayers_.end()) << ":" << type;
637  }
638 #endif
639  int kndx = cellV * 100 + cellU;
640  if (type == 0) {
641  auto ktr = hgpar_->cellFineIndex_.find(kndx);
642  if (ktr != hgpar_->cellFineIndex_.end()) {
643  x = hgpar_->cellFineX_[ktr->second];
644  y = hgpar_->cellFineY_[ktr->second];
645  }
646 #ifdef EDM_ML_DEBUG
647  if (debug)
648  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
649  << (ktr != hgpar_->cellFineIndex_.end());
650 #endif
651  } else {
652  auto ktr = hgpar_->cellCoarseIndex_.find(kndx);
653  if (ktr != hgpar_->cellCoarseIndex_.end()) {
654  x = hgpar_->cellCoarseX_[ktr->second];
655  y = hgpar_->cellCoarseY_[ktr->second];
656  }
657 #ifdef EDM_ML_DEBUG
658  if (debug)
659  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
660  << (ktr != hgpar_->cellCoarseIndex_.end());
661 #endif
662  }
663  if (!reco) {
666  }
667  if (all) {
668  const auto& xy = waferPosition(lay, waferU, waferV, reco, debug);
669  x += xy.first;
670  y += xy.second;
671 #ifdef EDM_ML_DEBUG
672  if (debug)
673  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << ":" << xy.first << ":" << xy.second;
674 #endif
675  }
676  return getXY(lay, x, y, true);
677 }

References python.cmstools::all(), HGCalParameters::cellCoarseIndex_, HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineIndex_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, debug, getXY(), hgpar_, HGCalParameters::k_ScaleToDDD, HGCalParameters::typesInLayers_, HGCalWaferIndex::waferIndex(), waferPosition(), HGCalParameters::waferTypeL_, HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), x, geometryCSVtoXML::xy, and y.

◆ locateCellHex()

std::pair< float, float > HGCalDDDConstants::locateCellHex ( int  cell,
int  wafer,
bool  reco 
) const

◆ locateCellTrap()

std::pair< float, float > HGCalDDDConstants::locateCellTrap ( int  lay,
int  ieta,
int  iphi,
bool  reco 
) const

Definition at line 734 of file HGCalDDDConstants.cc.

734  {
735  float x(0), y(0);
736  const auto& indx = getIndex(lay, reco);
737  if (indx.first >= 0) {
738  int ir = std::abs(irad);
739  int type = hgpar_->scintType(lay);
740  double phi = (iphi - 0.5) * indx.second;
741  double z = hgpar_->zLayerHex_[indx.first];
742  double r = 0.5 * (hgpar_->radiusLayer_[type][ir - 1] + hgpar_->radiusLayer_[type][ir]);
743  std::pair<double, double> range = rangeR(z, true);
744 #ifdef EDM_ML_DEBUG
745  edm::LogVerbatim("HGCalGeom") << "locateCellTrap:: Input " << lay << ":" << irad << ":" << iphi << ":" << reco
746  << " IR " << ir << ":" << hgpar_->iradMinBH_[indx.first] << ":"
747  << hgpar_->iradMaxBH_[indx.first] << " Type " << type << " Z " << indx.first << ":"
748  << z << " phi " << phi << " R " << r << ":" << range.first << ":" << range.second;
749 #endif
751  r = std::max(range.first, std::min(r, range.second));
752  x = r * std::cos(phi);
753  y = r * std::sin(phi);
754  if (irad < 0)
755  x = -x;
756  }
757  if (!reco) {
760  }
761  return std::make_pair(x, y);
762 }

References funct::abs(), funct::cos(), getIndex(), hgpar_, LEDCalibrationChannels::iphi, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, HGCalParameters::k_ScaleToDDD, SiStripPI::max, min(), mode_, phi, alignCSCRings::r, HGCalParameters::radiusLayer_, FastTimerService_cff::range, rangeR(), HGCalParameters::scintType(), funct::sin(), HGCalGeometryMode::TrapezoidFile, HGCalGeometryMode::TrapezoidModule, x, y, z, and HGCalParameters::zLayerHex_.

Referenced by HGCalSimHitValidation::analyzeHits(), HGCalGeometryLoader::build(), and HGCalNumberingScheme::checkPosition().

◆ maskCell()

bool HGCalDDDConstants::maskCell ( const DetId id,
int  corners 
) const

Definition at line 764 of file HGCalDDDConstants.cc.

764  {
765  bool mask(false);
766  if (corners > 2 && corners <= (int)(HGCalParameters::k_CornerSize)) {
767  if (waferHexagon8()) {
768  int N(0), layer(0), waferU(0), waferV(0), u(0), v(0);
769  if (detId.det() == DetId::Forward) {
770  HFNoseDetId id(detId);
771  N = getUVMax(id.type());
772  layer = id.layer();
773  waferU = id.waferU();
774  waferV = id.waferV();
775  u = id.cellU();
776  v = id.cellV();
777  } else {
778  HGCSiliconDetId id(detId);
779  N = getUVMax(id.type());
780  layer = id.layer();
781  waferU = id.waferU();
782  waferV = id.waferV();
783  u = id.cellU();
784  v = id.cellV();
785  }
787  auto itr = hgpar_->waferTypes_.find(wl);
788 #ifdef EDM_ML_DEBUG
789  edm::LogVerbatim("HGCalGeom") << "MaskCell: Layer " << layer << " Wafer " << waferU << ":" << waferV << " Index "
790  << wl << ":" << (itr != hgpar_->waferTypes_.end());
791 #endif
792  if (itr != hgpar_->waferTypes_.end()) {
793  if ((itr->second).second <= HGCalWaferMask::k_OffsetRotation)
794  mask = HGCalWaferMask::maskCell(u, v, N, (itr->second).first, (itr->second).second, corners);
795  else
796  mask = !(HGCalWaferMask::goodCell(
797  u, v, N, (itr->second).first, ((itr->second).second - HGCalWaferMask::k_OffsetRotation)));
798  }
799  }
800  }
801  return mask;
802 }

References DetId::det(), DetId::Forward, getUVMax(), HGCalWaferMask::goodCell(), hgpar_, triggerObjects_cff::id, HGCalParameters::k_CornerSize, HGCalWaferMask::k_OffsetRotation, phase1PixelTopology::layer, HGCalWaferMask::maskCell(), N, edm::second(), findQualityFiles::v, waferHexagon8(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferTypes_, HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), and LaserClient_cfi::wl.

Referenced by hgcal::RecHitTools::maskCell(), HGCalTopology::maskCell(), HFNoseSD::setDetUnitId(), HGCalSD::setDetUnitId(), and HGCalTopology::valid().

◆ maxCells() [1/2]

int HGCalDDDConstants::maxCells ( bool  reco) const

Definition at line 804 of file HGCalDDDConstants.cc.

804  {
805  int cells(0);
806  for (unsigned int i = 0; i < layers(reco); ++i) {
807  int lay = reco ? hgpar_->depth_[i] : hgpar_->layer_[i];
808  if (cells < maxCells(lay, reco))
809  cells = maxCells(lay, reco);
810  }
811  return cells;
812 }

References cells, HGCalParameters::depth_, hgpar_, mps_fire::i, HGCalParameters::layer_, and layers().

Referenced by HGCalDDDConstants(), HGCalTopology::HGCalTopology(), and isValidHex().

◆ maxCells() [2/2]

int HGCalDDDConstants::maxCells ( int  lay,
bool  reco 
) const

Definition at line 814 of file HGCalDDDConstants.cc.

814  {
815  const auto& index = getIndex(lay, reco);
816  if (index.first < 0)
817  return 0;
818  if (waferHexagon6()) {
819  unsigned int cells(0);
820  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
821  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
822  unsigned int cell = (hgpar_->waferTypeT_[k] - 1 == HGCSiliconDetId::HGCalFine) ? (hgpar_->cellFineX_.size())
823  : (hgpar_->cellCoarseX_.size());
824  if (cell > cells)
825  cells = cell;
826  }
827  }
828  return (int)(cells);
829  } else if (waferHexagon8()) {
830  int cells(0);
831  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
832  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
836  : hgpar_->waferTypeL_[itr->second]);
838  cells = std::max(cells, 3 * N * N);
839  }
840  }
841  return cells;
842  } else if (tileTrapezoid()) {
843  return hgpar_->scintCells(index.first + hgpar_->firstLayer_);
844  } else {
845  return 0;
846  }
847 }

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, cells, HGCalParameters::defineFull_, HGCalParameters::firstLayer_, getIndex(), HGCSiliconDetId::HGCalCoarseThick, HGCSiliconDetId::HGCalFine, hgpar_, dqmdumpme::k, SiStripPI::max, N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, HGCalParameters::scintCells(), tileTrapezoid(), HGCalParameters::typesInLayers_, HGCalParameters::waferCopy_, waferHexagon6(), waferHexagon8(), HGCalWaferIndex::waferIndex(), waferInLayerTest(), HGCalParameters::waferTypeL_, HGCalParameters::waferTypeT_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

◆ maxCellUV()

int HGCalDDDConstants::maxCellUV ( ) const
inline

Definition at line 91 of file HGCalDDDConstants.h.

91 { return (tileTrapezoid() ? hgpar_->nCellsFine_ : 2 * hgpar_->nCellsFine_); }

References hgpar_, HGCalParameters::nCellsFine_, and tileTrapezoid().

Referenced by HGCalTopology::HGCalTopology().

◆ maxModules()

int HGCalDDDConstants::maxModules ( ) const
inline

Definition at line 94 of file HGCalDDDConstants.h.

94 { return modHalf_; }

References modHalf_.

◆ maxModulesPerLayer()

int HGCalDDDConstants::maxModulesPerLayer ( ) const
inline

Definition at line 95 of file HGCalDDDConstants.h.

95 { return maxWafersPerLayer_; }

References maxWafersPerLayer_.

◆ maxRows()

int HGCalDDDConstants::maxRows ( int  lay,
bool  reco 
) const

Definition at line 849 of file HGCalDDDConstants.cc.

849  {
850  int kymax(0);
851  const auto& index = getIndex(lay, reco);
852  int i = index.first;
853  if (i < 0)
854  return kymax;
855  if (waferHexagon6()) {
856  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
858  int ky = ((hgpar_->waferCopy_[k]) / 100) % 100;
859  if (ky > kymax)
860  kymax = ky;
861  }
862  }
863  } else if (waferHexagon8()) {
864  kymax = 1 + 2 * hgpar_->waferUVMaxLayer_[index.first];
865  }
866  return kymax;
867 }

References HGCalParameters::defineFull_, getIndex(), hgpar_, mps_fire::i, dqmdumpme::k, HGCalParameters::waferCopy_, waferHexagon6(), waferHexagon8(), waferInLayerTest(), and HGCalParameters::waferUVMaxLayer_.

◆ minSlope()

double HGCalDDDConstants::minSlope ( ) const
inline

Definition at line 97 of file HGCalDDDConstants.h.

97 { return hgpar_->slopeMin_[0]; }

References hgpar_, and HGCalParameters::slopeMin_.

Referenced by HGCScintSD::update(), HGCalSD::update(), HFNoseSD::update(), and HGCSD::update().

◆ modifyUV()

int HGCalDDDConstants::modifyUV ( int  uv,
int  type1,
int  type2 
) const

Definition at line 869 of file HGCalDDDConstants.cc.

869  {
870  // Modify u/v for transition of type1 to type2
871  return (((type1 == type2) || (type1 * type2 != 0)) ? uv : ((type1 == 0) ? (2 * uv + 1) / 3 : (3 * uv) / 2));
872 }

Referenced by HGCalTopology::neighbors().

◆ modules()

int HGCalDDDConstants::modules ( int  lay,
bool  reco 
) const

Definition at line 874 of file HGCalDDDConstants.cc.

874  {
875  if (getIndex(lay, reco).first < 0)
876  return 0;
877  else
878  return max_modules_layer_[(int)reco][lay];
879 }

References first, getIndex(), createfilelist::int, and max_modules_layer_.

Referenced by wafers().

◆ modulesInit()

int HGCalDDDConstants::modulesInit ( int  lay,
bool  reco 
) const

Definition at line 881 of file HGCalDDDConstants.cc.

881  {
882  int nmod(0);
883  const auto& index = getIndex(lay, reco);
884  if (index.first < 0)
885  return nmod;
886  if (!tileTrapezoid()) {
887  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
888  if (waferInLayerTest(k, index.first, hgpar_->defineFull_))
889  ++nmod;
890  }
891  } else {
892  nmod = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
893  }
894  return nmod;
895 }

References HGCalParameters::defineFull_, HGCalParameters::firstModule_, getIndex(), hgpar_, dqmdumpme::k, HGCalParameters::lastModule_, tileTrapezoid(), waferInLayerTest(), and HGCalParameters::waferPosX_.

Referenced by HGCalDDDConstants().

◆ mouseBite()

double HGCalDDDConstants::mouseBite ( bool  reco) const

◆ numberCells() [1/2]

int HGCalDDDConstants::numberCells ( bool  reco) const

Definition at line 901 of file HGCalDDDConstants.cc.

901  {
902  int cells(0);
903  unsigned int nlayer = (reco) ? hgpar_->depth_.size() : hgpar_->layer_.size();
904  for (unsigned k = 0; k < nlayer; ++k) {
905  std::vector<int> ncells = numberCells(((reco) ? hgpar_->depth_[k] : hgpar_->layer_[k]), reco);
906  cells = std::accumulate(ncells.begin(), ncells.end(), cells);
907  }
908  return cells;
909 }

References cells, HGCalParameters::depth_, hgpar_, dqmdumpme::k, HGCalParameters::layer_, and dt_dqm_sourceclient_common_cff::reco.

Referenced by HGCalTopology::allGeomModules().

◆ numberCells() [2/2]

std::vector< int > HGCalDDDConstants::numberCells ( int  lay,
bool  reco 
) const

Definition at line 911 of file HGCalDDDConstants.cc.

911  {
912  const auto& index = getIndex(lay, reco);
913  int i = index.first;
914  std::vector<int> ncell;
915  if (i >= 0) {
916  if (waferHexagon6()) {
917  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
919  unsigned int cell = (hgpar_->waferTypeT_[k] - 1 == HGCSiliconDetId::HGCalFine)
920  ? (hgpar_->cellFineX_.size())
921  : (hgpar_->cellCoarseX_.size());
922  ncell.emplace_back((int)(cell));
923  }
924  }
925  } else if (tileTrapezoid()) {
926  int nphi = hgpar_->scintCells(lay);
927  for (int k = hgpar_->firstModule_[i]; k <= hgpar_->lastModule_[i]; ++k)
928  ncell.emplace_back(nphi);
929  } else {
930  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
931  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
932  int cell = numberCellsHexagon(lay,
935  true);
936  ncell.emplace_back(cell);
937  }
938  }
939  }
940  }
941  return ncell;
942 }

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, HGCalParameters::defineFull_, HGCalParameters::firstModule_, getIndex(), HGCSiliconDetId::HGCalFine, hgpar_, mps_fire::i, dqmdumpme::k, nphi, numberCellsHexagon(), HGCalParameters::scintCells(), tileTrapezoid(), HGCalParameters::waferCopy_, waferHexagon6(), waferInLayerTest(), HGCalParameters::waferTypeT_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

◆ numberCellsHexagon() [1/2]

int HGCalDDDConstants::numberCellsHexagon ( int  lay,
int  waferU,
int  waferV,
bool  flag 
) const

◆ numberCellsHexagon() [2/2]

int HGCalDDDConstants::numberCellsHexagon ( int  wafer) const

Definition at line 944 of file HGCalDDDConstants.cc.

944  {
945  if (wafer >= 0 && wafer < (int)(hgpar_->waferTypeT_.size())) {
946  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine)
947  return (int)(hgpar_->cellFineX_.size());
948  else
949  return (int)(hgpar_->cellCoarseX_.size());
950  } else {
951  return 0;
952  }
953 }

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, HGCSiliconDetId::HGCalFine, hgpar_, and HGCalParameters::waferTypeT_.

Referenced by HGCalGeometry::newCell(), numberCells(), and HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

◆ rangeR()

std::pair< double, double > HGCalDDDConstants::rangeR ( double  z,
bool  reco 
) const

Definition at line 966 of file HGCalDDDConstants.cc.

966  {
967  double rmin(0), rmax(0), zz(0);
968  if (hgpar_->detectorType_ > 0) {
969  zz = (reco ? std::abs(z) : HGCalParameters::k_ScaleFromDDD * std::abs(z));
970  if (hgpar_->detectorType_ <= 2) {
972  } else {
973  rmin = HGCalGeomTools::radius(
975  }
976  if ((hgpar_->detectorType_ == 2) && (zz >= hgpar_->zLayerHex_[hgpar_->firstMixedLayer_ - 1])) {
977  rmax = HGCalGeomTools::radius(
979  } else {
981  }
982  }
983  if (!reco) {
986  }
987 #ifdef EDM_ML_DEBUG
988  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << z << ":" << zz << " R " << rmin << ":" << rmax;
989 #endif
990  return std::make_pair(rmin, rmax);
991 }

References funct::abs(), HGCalParameters::detectorType_, HGCalParameters::firstLayer_, HGCalParameters::firstMixedLayer_, hgpar_, HGCalParameters::k_ScaleFromDDD, HGCalParameters::k_ScaleToDDD, HGCalGeomTools::radius(), HGCalParameters::radiusMixBoundary_, HGCalParameters::rMaxFront_, HGCalParameters::rMinFront_, HGCalParameters::slopeMin_, HGCalParameters::slopeTop_, z, HGCalParameters::zFrontMin_, HGCalParameters::zFrontTop_, HGCalParameters::zLayerHex_, and geometryCSVtoXML::zz.

Referenced by ticl::SeedingRegionByTracks::buildFirstLayers(), HFNoseNumberingScheme::checkPosition(), HGCalNumberingScheme::checkPosition(), HGCDigitizer::checkPosition(), locateCellTrap(), and HGCalGeometry::neighborZ().

◆ rangeRLayer()

std::pair< double, double > HGCalDDDConstants::rangeRLayer ( int  lay,
bool  reco 
) const

Definition at line 993 of file HGCalDDDConstants.cc.

993  {
994  double rmin(0), rmax(0);
995  const auto& index = getIndex(lay, reco);
996  if (index.first >= 0 && index.first < static_cast<int>(hgpar_->rMinLayHex_.size())) {
997  rmin = hgpar_->rMinLayHex_[index.first];
998  rmax = hgpar_->rMaxLayHex_[index.first];
999  }
1000  if (!reco) {
1003  }
1004 #ifdef EDM_ML_DEBUG
1005  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << lay << ":" << index.first << " R " << rmin << ":"
1006  << rmax;
1007 #endif
1008  return std::make_pair(rmin, rmax);
1009 }

References getIndex(), hgpar_, HGCalParameters::k_ScaleToDDD, HGCalParameters::rMaxLayHex_, and HGCalParameters::rMinLayHex_.

◆ rangeZ()

std::pair< double, double > HGCalDDDConstants::rangeZ ( bool  reco) const

Definition at line 1011 of file HGCalDDDConstants.cc.

1011  {
1012  double zmin = (hgpar_->zLayerHex_[0] - hgpar_->waferThick_);
1013  double zmax = (hgpar_->zLayerHex_[hgpar_->zLayerHex_.size() - 1] + hgpar_->waferThick_);
1014 #ifdef EDM_ML_DEBUG
1015  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeZ: " << zmin << ":" << zmax << ":" << hgpar_->waferThick_;
1016 #endif
1017  if (!reco) {
1020  }
1021  return std::make_pair(zmin, zmax);
1022 }

References hgpar_, HGCalParameters::k_ScaleToDDD, HGCalParameters::waferThick_, HGCalParameters::zLayerHex_, SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

Referenced by HFNoseNumberingScheme::checkPosition(), HGCalNumberingScheme::checkPosition(), and HGCDigitizer::checkPosition().

◆ rowColumnWafer()

std::pair< int, int > HGCalDDDConstants::rowColumnWafer ( const int  wafer) const

Definition at line 1024 of file HGCalDDDConstants.cc.

1024  {
1025  int row(0), col(0);
1026  if (wafer < (int)(hgpar_->waferCopy_.size())) {
1027  int copy = hgpar_->waferCopy_[wafer];
1030  ;
1031  }
1032  return std::make_pair(row, col);
1033 }

References cuy::col, filterCSVwithJSON::copy, HGCalTypes::getUnpackedU(), HGCalTypes::getUnpackedV(), hgpar_, and HGCalParameters::waferCopy_.

◆ sectors()

int HGCalDDDConstants::sectors ( ) const
inline

◆ simToReco()

std::pair< int, int > HGCalDDDConstants::simToReco ( int  cell,
int  layer,
int  mod,
bool  half 
) const

Definition at line 1035 of file HGCalDDDConstants.cc.

1035  {
1036  if (!waferHexagon6()) {
1037  return std::make_pair(cell, lay);
1038  } else {
1039  const auto& index = getIndex(lay, false);
1040  int i = index.first;
1041  if (i < 0) {
1042  edm::LogWarning("HGCalGeom") << "Wrong Layer # " << lay << " not in the list ***** ERROR *****";
1043  return std::make_pair(-1, -1);
1044  }
1045  if (mod >= (int)(hgpar_->waferTypeL_).size()) {
1046  edm::LogWarning("HGCalGeom") << "Invalid Wafer # " << mod << "should be < " << (hgpar_->waferTypeL_).size()
1047  << " ***** ERROR *****";
1048  return std::make_pair(-1, -1);
1049  }
1050  int depth(-1);
1051  int kx = cell;
1052  int type = hgpar_->waferTypeL_[mod];
1053  if (type == 1) {
1054  depth = hgpar_->layerGroup_[i];
1055  } else if (type == 2) {
1056  depth = hgpar_->layerGroupM_[i];
1057  } else {
1058  depth = hgpar_->layerGroupO_[i];
1059  }
1060  return std::make_pair(kx, depth);
1061  }
1062 }

References LEDCalibrationChannels::depth, getIndex(), hgpar_, mps_fire::i, HGCalParameters::layerGroup_, HGCalParameters::layerGroupM_, HGCalParameters::layerGroupO_, mod(), findQualityFiles::size, waferHexagon6(), and HGCalParameters::waferTypeL_.

Referenced by HGCalTimingAnalyzer::analyzeSimHits(), HGCalTBAnalyzer::analyzeSimHits(), CaloParticleDebugger::fillSimHits(), and CaloTruthAccumulator::fillSimHits().

◆ tileSiPM()

int HGCalDDDConstants::tileSiPM ( int  sipm) const
inline

Definition at line 112 of file HGCalDDDConstants.h.

112 { return ((sipm > 0) ? HGCalTypes::SiPMSmall : HGCalTypes::SiPMLarge); }

References HGCalTypes::SiPMLarge, and HGCalTypes::SiPMSmall.

Referenced by HGCalNumberingScheme::getUnitID().

◆ tileTrapezoid()

bool HGCalDDDConstants::tileTrapezoid ( ) const
inline

◆ tileType()

std::pair<int, int> HGCalDDDConstants::tileType ( int  layer,
int  ring,
int  phi 
) const
inline

Definition at line 117 of file HGCalDDDConstants.h.

117  {
118  int indx = HGCalTileIndex::tileIndex(layer, ring, phi);
119  int type(-1), sipm(-1);
120  auto itr = hgpar_->tileInfoMap_.find(indx);
121  if (itr != hgpar_->tileInfoMap_.end()) {
122  type = 1 + (itr->second).type;
123  sipm = ((itr->second).sipm == HGCalTypes::SiPMLarge) ? 0 : 1;
124  }
125  return std::make_pair(type, sipm);
126  }

References hgpar_, phase1PixelTopology::layer, phi, relativeConstraints::ring, HGCalTypes::SiPMLarge, HGCalTileIndex::tileIndex(), and HGCalParameters::tileInfoMap_.

Referenced by HGCalGeometryLoader::build(), HGCalTopology::encode(), HGCalNumberingScheme::getUnitID(), and HGCalGeometry::newCell().

◆ volumes()

unsigned int HGCalDDDConstants::volumes ( ) const
inline

Definition at line 127 of file HGCalDDDConstants.h.

127 { return hgpar_->moduleLayR_.size(); }

References hgpar_, and HGCalParameters::moduleLayR_.

Referenced by HGCalGeometryLoader::build().

◆ waferCount()

int HGCalDDDConstants::waferCount ( const int  type) const
inline

Definition at line 149 of file HGCalDDDConstants.h.

149 { return ((type == 0) ? waferMax_[2] : waferMax_[3]); }

References waferMax_.

◆ waferFileIndex()

int HGCalDDDConstants::waferFileIndex ( unsigned int  kk) const
inline

Definition at line 156 of file HGCalDDDConstants.h.

156  {
157  if (kk < hgpar_->waferInfoMap_.size()) {
158  auto itr = hgpar_->waferInfoMap_.begin();
159  std::advance(itr, kk);
160  return itr->first;
161  } else
162  return 0;
163  }

References hgpar_, GetRecoTauVFromDQM_MC_cff::kk, and HGCalParameters::waferInfoMap_.

◆ waferFileInfo()

std::tuple<int, int, int> HGCalDDDConstants::waferFileInfo ( unsigned int  kk) const
inline

Definition at line 164 of file HGCalDDDConstants.h.

164  {
165  if (kk < hgpar_->waferInfoMap_.size()) {
166  auto itr = hgpar_->waferInfoMap_.begin();
167  std::advance(itr, kk);
168  return std::make_tuple(itr->second.type, itr->second.part, itr->second.orient);
169  } else
170  return std::make_tuple(0, 0, 0);
171  }

References hgpar_, GetRecoTauVFromDQM_MC_cff::kk, and HGCalParameters::waferInfoMap_.

◆ waferFileInfoExist()

bool HGCalDDDConstants::waferFileInfoExist ( int  kk) const
inline

Definition at line 179 of file HGCalDDDConstants.h.

179 { return (hgpar_->waferInfoMap_.find(kk) != hgpar_->waferInfoMap_.end()); }

References hgpar_, GetRecoTauVFromDQM_MC_cff::kk, and HGCalParameters::waferInfoMap_.

◆ waferFileInfoFromIndex()

std::tuple<int, int, int> HGCalDDDConstants::waferFileInfoFromIndex ( int  kk) const
inline

Definition at line 172 of file HGCalDDDConstants.h.

172  {
173  auto itr = hgpar_->waferInfoMap_.find(kk);
174  if (itr != hgpar_->waferInfoMap_.end()) {
175  return std::make_tuple(itr->second.type, itr->second.part, itr->second.orient);
176  } else
177  return std::make_tuple(0, 0, 0);
178  }

References hgpar_, GetRecoTauVFromDQM_MC_cff::kk, and HGCalParameters::waferInfoMap_.

◆ waferFileSize()

unsigned int HGCalDDDConstants::waferFileSize ( ) const
inline

Definition at line 155 of file HGCalDDDConstants.h.

155 { return hgpar_->waferInfoMap_.size(); }

References hgpar_, and HGCalParameters::waferInfoMap_.

Referenced by waferType(), and waferTypeRotation().

◆ waferFromCopy()

int HGCalDDDConstants::waferFromCopy ( int  copy) const

Definition at line 1064 of file HGCalDDDConstants.cc.

1064  {
1065  const int ncopies = hgpar_->waferCopy_.size();
1066  int wafer(ncopies);
1067  bool result(false);
1068  for (int k = 0; k < ncopies; ++k) {
1069  if (copy == hgpar_->waferCopy_[k]) {
1070  wafer = k;
1071  result = true;
1072  break;
1073  }
1074  }
1075  if (!result) {
1076  wafer = -1;
1077 #ifdef EDM_ML_DEBUG
1078  edm::LogVerbatim("HGCalGeom") << "Cannot find " << copy << " in a list of " << ncopies << " members";
1079  for (int k = 0; k < ncopies; ++k)
1080  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << hgpar_->waferCopy_[k];
1081 #endif
1082  }
1083 #ifdef EDM_ML_DEBUG
1084  edm::LogVerbatim("HGCalGeom") << "WaferFromCopy " << copy << ":" << wafer << ":" << result;
1085 #endif
1086  return wafer;
1087 }

References filterCSVwithJSON::copy, hgpar_, dqmdumpme::k, mps_fire::result, and HGCalParameters::waferCopy_.

Referenced by HGCNumberingScheme::getUnitID().

◆ waferFromPosition() [1/2]

void HGCalDDDConstants::waferFromPosition ( const double  x,
const double  y,
const int  layer,
int &  waferU,
int &  waferV,
int &  cellU,
int &  cellV,
int &  celltype,
double &  wt,
bool  debug = false 
) const

Definition at line 1131 of file HGCalDDDConstants.cc.

1140  {
1141  waferU = waferV = 1 + hgpar_->waferUVMax_;
1142  cellU = cellV = celltype = 0;
1143  if ((hgpar_->xLayerHex_.empty()) || (hgpar_->yLayerHex_.empty()))
1144  return;
1145  int ll = layer - hgpar_->firstLayer_;
1146  std::pair<double, double> xy =
1148  double xx = xy.first - hgpar_->xLayerHex_[ll];
1149  double yy = xy.second - hgpar_->yLayerHex_[ll];
1150  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1151  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1152  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1153  if (dx <= rmax_ && dy <= hexside_) {
1154  if ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy))) {
1160  } else {
1162  celltype = ((itr == hgpar_->typesInLayers_.end()) ? HGCSiliconDetId::HGCalCoarseThick
1163  : hgpar_->waferTypeL_[itr->second]);
1164  }
1165 #ifdef EDM_ML_DEBUG
1166  if (debug)
1167  edm::LogVerbatim("HGCalGeom") << "WaferFromPosition:: Input " << layer << ":" << ll << ":"
1168  << hgpar_->firstLayer_ << ":" << x << ":" << y << ":" << hgpar_->xLayerHex_[ll]
1169  << ":" << hgpar_->yLayerHex_[ll] << ":" << xx << ":" << yy << " compared with "
1170  << hgpar_->waferPosX_[k] << ":" << hgpar_->waferPosY_[k] << " difference " << dx
1171  << ":" << dy << ":" << dx * tan30deg_ << ":" << (hexside_ - dy)
1172  << " comparator " << rmax_ << ":" << hexside_ << " wafer " << waferU << ":"
1173  << waferV << ":" << celltype;
1174 #endif
1175  xx -= hgpar_->waferPosX_[k];
1176  yy -= hgpar_->waferPosY_[k];
1177  break;
1178  }
1179  }
1180  }
1181  if ((std::abs(waferU) <= hgpar_->waferUVMax_) && (celltype >= 0)) {
1182  cellHex(xx, yy, celltype, cellU, cellV, debug);
1183  wt = ((celltype < 2) ? (hgpar_->cellThickness_[celltype] / hgpar_->waferThick_) : 1.0);
1184  } else {
1185  cellU = cellV = 2 * hgpar_->nCellsFine_;
1186  wt = 1.0;
1187  celltype = -1;
1188  }
1189 #ifdef EDM_ML_DEBUG
1190  if (celltype < 0) {
1193  edm::LogVerbatim("HGCalGeom") << "waferFromPosition: Bad type for X " << x << ":" << x1 << ":" << xx << " Y " << y
1194  << ":" << y1 << ":" << yy << " Wafer " << waferU << ":" << waferV << " Cell " << cellU
1195  << ":" << cellV;
1196  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1197  double dx = std::abs(x1 - hgpar_->waferPosX_[k]);
1198  double dy = std::abs(y1 - hgpar_->waferPosY_[k]);
1199  edm::LogVerbatim("HGCalGeom") << "Wafer [" << k << "] Position (" << hgpar_->waferPosX_[k] << ", "
1200  << hgpar_->waferPosY_[k] << ") difference " << dx << ":" << dy << ":"
1201  << dx * tan30deg_ << ":" << hexside_ - dy << " Paramerers " << rmax_ << ":"
1202  << hexside_;
1203  }
1204  }
1205 #endif
1206 }

References funct::abs(), cellHex(), HGCalParameters::cellThickness_, debug, PVValHelper::dx, PVValHelper::dy, HGCalParameters::firstLayer_, HGCalWaferType::getType(), getXY(), HGCalGeometryMode::Hexagon8File, HGCalGeometryMode::Hexagon8Module, hexside_, HGCSiliconDetId::HGCalCoarseThick, hgpar_, dqmdumpme::k, HGCalParameters::k_ScaleFromDDD, phase1PixelTopology::layer, mode_, HGCalParameters::nCellsFine_, rmax_, tan30deg_, HGCalParameters::typesInLayers_, HGCalParameters::waferCopy_, HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferThick_, HGCalParameters::waferTypeL_, HGCalWaferIndex::waferU(), HGCalParameters::waferUVMax_, HGCalWaferIndex::waferV(), x, testProducerWithPsetDescEmpty_cfi::x1, HGCalParameters::xLayerHex_, geometryCSVtoXML::xx, geometryCSVtoXML::xy, y, testProducerWithPsetDescEmpty_cfi::y1, HGCalParameters::yLayerHex_, and geometryCSVtoXML::yy.

◆ waferFromPosition() [2/2]

void HGCalDDDConstants::waferFromPosition ( const double  x,
const double  y,
int &  wafer,
int &  icell,
int &  celltyp 
) const

Definition at line 1089 of file HGCalDDDConstants.cc.

1089  {
1090  // Input x, y in Geant4 unit and transformed to CMSSW standard
1093  int size_ = static_cast<int>(hgpar_->waferCopy_.size());
1094  wafer = size_;
1095  for (int k = 0; k < size_; ++k) {
1096  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1097  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1098  if (dx <= rmax_ && dy <= hexside_) {
1099  if ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy))) {
1100  wafer = k;
1101  celltyp = hgpar_->waferTypeT_[k];
1102  xx -= hgpar_->waferPosX_[k];
1103  yy -= hgpar_->waferPosY_[k];
1104  break;
1105  }
1106  }
1107  }
1108  if (wafer < size_) {
1109  if (celltyp - 1 == HGCSiliconDetId::HGCalFine)
1110  icell = cellHex(
1112  else
1113  icell = cellHex(xx,
1114  yy,
1117  hgpar_->cellCoarseY_);
1118  } else {
1119  wafer = -1;
1120 #ifdef EDM_ML_DEBUG
1121  edm::LogWarning("HGCalGeom") << "Cannot get wafer type corresponding to " << x << ":" << y << " " << xx << ":"
1122  << yy;
1123 #endif
1124  }
1125 #ifdef EDM_ML_DEBUG
1126  edm::LogVerbatim("HGCalGeom") << "Position " << x << ":" << y << " Wafer " << wafer << ":" << size_ << " XX " << xx
1127  << ":" << yy << " Cell " << icell << " Type " << celltyp;
1128 #endif
1129 }

References funct::abs(), HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, cellHex(), HGCalParameters::cellSize_, PVValHelper::dx, PVValHelper::dy, hexside_, HGCSiliconDetId::HGCalFine, hgpar_, dqmdumpme::k, HGCalParameters::k_ScaleFromDDD, rmax_, tan30deg_, HGCalParameters::waferCopy_, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferTypeT_, x, geometryCSVtoXML::xx, y, and geometryCSVtoXML::yy.

Referenced by assignCellHex(), HFNoseNumberingScheme::checkPosition(), HGCalNumberingScheme::checkPosition(), HFNoseNumberingScheme::getUnitID(), HGCNumberingScheme::getUnitID(), and HGCalNumberingScheme::getUnitID().

◆ waferFullInLayer()

bool HGCalDDDConstants::waferFullInLayer ( int  wafer,
int  lay,
bool  reco 
) const

Definition at line 1215 of file HGCalDDDConstants.cc.

1215  {
1216  const auto& indx = getIndex(lay, reco);
1217  if (indx.first < 0)
1218  return false;
1219  return waferInLayerTest(wafer, indx.first, false);
1220 }

References getIndex(), and waferInLayerTest().

◆ waferHexagon6()

bool HGCalDDDConstants::waferHexagon6 ( ) const
inline

◆ waferHexagon8()

bool HGCalDDDConstants::waferHexagon8 ( ) const
inline

◆ waferIndex()

int32_t HGCalDDDConstants::waferIndex ( int  wafer,
int  index 
) const
private

Definition at line 1629 of file HGCalDDDConstants.cc.

1629  {
1630  int layer = layerFromIndex(index, true);
1634 #ifdef EDM_ML_DEBUG
1635  edm::LogVerbatim("HGCalGeom") << "WaferIndex for " << wafer << ":" << index << " (" << layer << ":" << waferU << ":"
1636  << waferV << ") " << indx;
1637 #endif
1638  return indx;
1639 }

References hgpar_, phase1PixelTopology::layer, layerFromIndex(), HGCalParameters::waferCopy_, HGCalWaferIndex::waferIndex(), HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

Referenced by waferInLayerTest().

◆ waferInLayer()

bool HGCalDDDConstants::waferInLayer ( int  wafer,
int  lay,
bool  reco 
) const

Definition at line 1208 of file HGCalDDDConstants.cc.

1208  {
1209  const auto& indx = getIndex(lay, reco);
1210  if (indx.first < 0)
1211  return false;
1212  return waferInLayerTest(wafer, indx.first, hgpar_->defineFull_);
1213 }

References HGCalParameters::defineFull_, getIndex(), hgpar_, and waferInLayerTest().

Referenced by HGCalGeometryLoader::build(), HGCalGeometry::getSummary(), and HGCalDDDConstants().

◆ waferInLayerTest()

bool HGCalDDDConstants::waferInLayerTest ( int  wafer,
int  lay,
bool  full 
) const
private

Definition at line 1641 of file HGCalDDDConstants.cc.

1641  {
1642  bool in = (waferHexagon6()) ? true : false;
1643  if (!in) {
1644  double xpos = hgpar_->waferPosX_[wafer] + hgpar_->xLayerHex_[lay];
1645  double ypos = hgpar_->waferPosY_[wafer] + hgpar_->yLayerHex_[lay];
1646  std::pair<int, int> corner = HGCalGeomTools::waferCorner(
1647  xpos, ypos, rmax_, hexside_, hgpar_->rMinLayHex_[lay], hgpar_->rMaxLayHex_[lay], in);
1648  in = (full ? (corner.first > 0) : (corner.first == (int)(HGCalParameters::k_CornerSize)));
1649  if (in && fullAndPart_) {
1650  int indx = waferIndex(wafer, lay);
1651  in = (hgpar_->waferInfoMap_.find(indx) != hgpar_->waferInfoMap_.end());
1652 #ifdef EDM_ML_DEBUG
1653  if (!in)
1654  edm::LogVerbatim("HGCalGeom") << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " index " << indx
1655  << "( " << HGCalWaferIndex::waferLayer(indx) << ", "
1656  << HGCalWaferIndex::waferU(indx) << ", " << HGCalWaferIndex::waferV(indx)
1657  << ") in " << in;
1658 #endif
1659  }
1660 #ifdef EDM_ML_DEBUG
1661  edm::LogVerbatim("HGCalGeom") << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " R-limits "
1662  << hgpar_->rMinLayHex_[lay] << ":" << hgpar_->rMaxLayHex_[lay] << " Corners "
1663  << corner.first << ":" << corner.second << " In " << in;
1664 #endif
1665  }
1666  return in;
1667 }

References TCMET_cfi::corner, full, fullAndPart_, hexside_, hgpar_, recoMuon::in, HGCalParameters::k_CornerSize, rmax_, HGCalParameters::rMaxLayHex_, HGCalParameters::rMinLayHex_, HGCalGeomTools::waferCorner(), waferHexagon6(), waferIndex(), HGCalParameters::waferInfoMap_, HGCalWaferIndex::waferLayer(), HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), HGCalParameters::xLayerHex_, and HGCalParameters::yLayerHex_.

Referenced by maxCells(), maxRows(), modulesInit(), numberCells(), waferFullInLayer(), and waferInLayer().

◆ waferMax()

int HGCalDDDConstants::waferMax ( ) const
inline

Definition at line 150 of file HGCalDDDConstants.h.

150 { return waferMax_[1]; }

References waferMax_.

Referenced by HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

◆ waferMin()

int HGCalDDDConstants::waferMin ( ) const
inline

Definition at line 151 of file HGCalDDDConstants.h.

151 { return waferMax_[0]; }

References waferMax_.

Referenced by HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

◆ waferParameters()

std::pair< double, double > HGCalDDDConstants::waferParameters ( bool  reco) const

Definition at line 1222 of file HGCalDDDConstants.cc.

1222  {
1223  if (reco)
1224  return std::make_pair(rmax_, hexside_);
1225  else
1227 }

References hexside_, HGCalParameters::k_ScaleToDDD, and rmax_.

◆ waferPosition() [1/3]

std::pair< double, double > HGCalDDDConstants::waferPosition ( int  lay,
int  waferU,
int  waferV,
bool  reco,
bool  debug = false 
) const

Definition at line 1242 of file HGCalDDDConstants.cc.

1243  {
1244  int ll = lay - hgpar_->firstLayer_;
1245  double x = hgpar_->xLayerHex_[ll];
1246  double y = hgpar_->yLayerHex_[ll];
1247 #ifdef EDM_ML_DEBUG
1248  if (debug)
1249  edm::LogVerbatim("HGCalGeom") << "Layer " << lay << ":" << ll << " Shift " << hgpar_->xLayerHex_[ll] << ":"
1250  << hgpar_->yLayerHex_[ll];
1251 #endif
1252  if (!reco) {
1255  }
1256 
1257  const auto& xy = waferPosition(waferU, waferV, reco);
1258  x += xy.first;
1259  y += xy.second;
1260 #ifdef EDM_ML_DEBUG
1261  if (debug)
1262  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << ":" << xy.first << ":" << xy.second;
1263 #endif
1264  return std::make_pair(x, y);
1265 }

References debug, HGCalParameters::firstLayer_, hgpar_, HGCalParameters::k_ScaleToDDD, waferPosition(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), x, HGCalParameters::xLayerHex_, geometryCSVtoXML::xy, y, and HGCalParameters::yLayerHex_.

◆ waferPosition() [2/3]

std::pair< double, double > HGCalDDDConstants::waferPosition ( int  wafer,
bool  reco 
) const

Definition at line 1229 of file HGCalDDDConstants.cc.

1229  {
1230  double xx(0), yy(0);
1231  if (wafer >= 0 && wafer < (int)(hgpar_->waferPosX_.size())) {
1232  xx = hgpar_->waferPosX_[wafer];
1233  yy = hgpar_->waferPosY_[wafer];
1234  }
1235  if (!reco) {
1238  }
1239  return std::make_pair(xx, yy);
1240 }

References hgpar_, HGCalParameters::k_ScaleToDDD, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, geometryCSVtoXML::xx, and geometryCSVtoXML::yy.

Referenced by HGCalGeometryLoader::build(), HGCMouseBite::exclude(), isValidCell8(), locateCell(), and waferPosition().

◆ waferPosition() [3/3]

std::pair< double, double > HGCalDDDConstants::waferPosition ( int  waferU,
int  waferV,
bool  reco 
) const
private

Definition at line 1669 of file HGCalDDDConstants.cc.

1669  {
1670  double xx(0), yy(0);
1671  int indx = HGCalWaferIndex::waferIndex(0, waferU, waferV);
1672  auto itr = hgpar_->wafersInLayers_.find(indx);
1673  if (itr != hgpar_->wafersInLayers_.end()) {
1674  xx = hgpar_->waferPosX_[itr->second];
1675  yy = hgpar_->waferPosY_[itr->second];
1676  }
1677  if (!reco) {
1680  }
1681  return std::make_pair(xx, yy);
1682 }

References hgpar_, HGCalParameters::k_ScaleToDDD, HGCalWaferIndex::waferIndex(), HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::wafersInLayers_, HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), geometryCSVtoXML::xx, and geometryCSVtoXML::yy.

◆ wafers() [1/2]

int HGCalDDDConstants::wafers ( ) const

Definition at line 1420 of file HGCalDDDConstants.cc.

1420  {
1421  int wafer(0);
1422  if (!tileTrapezoid()) {
1423  for (unsigned int i = 0; i < layers(true); ++i) {
1424  int lay = hgpar_->depth_[i];
1425  wafer += modules(lay, true);
1426  }
1427  } else {
1428  wafer = (int)(hgpar_->moduleLayR_.size());
1429  }
1430  return wafer;
1431 }

References HGCalParameters::depth_, hgpar_, mps_fire::i, createfilelist::int, layers(), HGCalParameters::moduleLayR_, modules(), and tileTrapezoid().

Referenced by HGCalTopology::allGeomModules(), and HGCalDDDConstants().

◆ wafers() [2/2]

int HGCalDDDConstants::wafers ( int  layer,
int  type 
) const

Definition at line 1433 of file HGCalDDDConstants.cc.

1433  {
1434  int wafer(0);
1435  if (!tileTrapezoid()) {
1436  auto itr = waferLayer_.find(layer);
1437  if (itr != waferLayer_.end()) {
1438  unsigned ity = (type > 0 && type <= 2) ? type : 0;
1439  wafer = (itr->second)[ity];
1440  }
1441  } else {
1442  const auto& index = getIndex(layer, true);
1443  wafer = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
1444  }
1445  return wafer;
1446 }

References HGCalParameters::firstModule_, getIndex(), hgpar_, HGCalParameters::lastModule_, phase1PixelTopology::layer, tileTrapezoid(), and waferLayer_.

◆ waferSepar()

double HGCalDDDConstants::waferSepar ( bool  reco) const
inline

◆ waferSize()

double HGCalDDDConstants::waferSize ( bool  reco) const
inline

◆ waferToCopy()

int HGCalDDDConstants::waferToCopy ( int  wafer) const
inline

Definition at line 188 of file HGCalDDDConstants.h.

188  {
189  return ((wafer >= 0) && (wafer < (int)(hgpar_->waferCopy_.size()))) ? hgpar_->waferCopy_[wafer]
190  : (int)(hgpar_->waferCopy_.size());
191  }

References hgpar_, and HGCalParameters::waferCopy_.

◆ waferType() [1/3]

int HGCalDDDConstants::waferType ( DetId const &  id,
bool  fromFile = false 
) const

Definition at line 1267 of file HGCalDDDConstants.cc.

1267  {
1268  int type(1);
1269  if (waferHexagon8()) {
1270  if (fromFile && (waferFileSize() > 0)) {
1271  int layer(0), waferU(0), waferV(0);
1272  if (id.det() != DetId::Forward) {
1273  HGCSiliconDetId hid(id);
1274  layer = hid.layer();
1275  waferU = hid.waferU();
1276  waferV = hid.waferV();
1277  } else {
1278  HFNoseDetId hid(id);
1279  layer = hid.layer();
1280  waferU = hid.waferU();
1281  waferV = hid.waferV();
1282  }
1284  if (itr != hgpar_->waferInfoMap_.end())
1285  type = (itr->second).type;
1286  } else {
1287  type = ((id.det() != DetId::Forward) ? HGCSiliconDetId(id).type() : HFNoseDetId(id).type());
1288  }
1289  } else if (waferHexagon6()) {
1290  type = waferTypeL(HGCalDetId(id).wafer()) - 1;
1291  }
1292  return type;
1293 }

References DetId::Forward, hgpar_, HFNoseDetId::layer(), HGCSiliconDetId::layer(), phase1PixelTopology::layer, HFNoseDetId::type(), HGCSiliconDetId::type(), waferFileSize(), waferHexagon6(), waferHexagon8(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, waferTypeL(), HGCalWaferIndex::waferU(), HFNoseDetId::waferU(), HGCSiliconDetId::waferU(), HGCalWaferIndex::waferV(), HGCSiliconDetId::waferV(), and HFNoseDetId::waferV().

Referenced by assignCellHex(), cellThickness(), HGCalNumberingScheme::getUnitID(), isHalfCell(), HGCalUncalibRecHitRecWeightsAlgo< HGCDataFrame >::makeRecHit(), and HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

◆ waferType() [2/3]

std::tuple< int, int, int > HGCalDDDConstants::waferType ( HGCSiliconDetId const &  id,
bool  fromFile = false 
) const

Definition at line 1314 of file HGCalDDDConstants.cc.

1314  {
1315  const auto& index = HGCalWaferIndex::waferIndex(id.layer(), id.waferU(), id.waferV());
1316  int type(-1), part(-1), orient(-1);
1317  if (fromFile && (waferFileSize() > 0)) {
1318  auto itr = hgpar_->waferInfoMap_.find(index);
1319  if (itr != hgpar_->waferInfoMap_.end()) {
1320  type = (itr->second).type;
1321  part = (itr->second).part;
1322  orient = (itr->second).orient;
1323  }
1324  } else {
1325  auto ktr = hgpar_->typesInLayers_.find(index);
1326  if (ktr != hgpar_->typesInLayers_.end())
1327  type = hgpar_->waferTypeL_[ktr->second];
1328  auto itr = hgpar_->waferTypes_.find(index);
1329  if (itr != hgpar_->waferTypes_.end()) {
1330  if ((itr->second).second < HGCalWaferMask::k_OffsetRotation) {
1331  orient = (itr->second).second;
1332  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1334  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1336  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1338  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1340  }
1341  } else {
1342  part = (itr->second).first;
1343  orient = ((itr->second).second - HGCalWaferMask::k_OffsetRotation);
1344  }
1345  } else {
1347  orient = 0;
1348  }
1349  }
1350  return std::make_tuple(type, part, orient);
1351 }

References first, hgpar_, HGCalGeomTools::k_allCorners, HGCalGeomTools::k_fiveCorners, HGCalGeomTools::k_fourCorners, HGCalWaferMask::k_OffsetRotation, HGCalGeomTools::k_threeCorners, phase1PixelTopology::layer, hgcalPerformanceValidation::orient, edm::second(), HGCalParameters::typesInLayers_, waferFileSize(), HGCalTypes::WaferFive, HGCalTypes::WaferFull, HGCalTypes::WaferHalf, HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalTypes::WaferThree, HGCalParameters::waferTypeL_, HGCalParameters::waferTypes_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

◆ waferType() [3/3]

int HGCalDDDConstants::waferType ( int  layer,
int  waferU,
int  waferV,
bool  fromFile = false 
) const

Definition at line 1295 of file HGCalDDDConstants.cc.

1295  {
1297  if (waferHexagon8()) {
1298  if (fromFile && (waferFileSize() > 0)) {
1300  if (itr != hgpar_->waferInfoMap_.end())
1301  type = (itr->second).type;
1302  } else {
1304  if (itr != hgpar_->typesInLayers_.end())
1305  type = hgpar_->waferTypeL_[itr->second];
1306  }
1307  } else if (waferHexagon6()) {
1308  if ((waferU >= 0) && (waferU < (int)(hgpar_->waferTypeL_.size())))
1309  type = (hgpar_->waferTypeL_[waferU] - 1);
1310  }
1311  return type;
1312 }

References HGCSiliconDetId::HGCalCoarseThick, hgpar_, createfilelist::int, phase1PixelTopology::layer, HGCalParameters::typesInLayers_, waferFileSize(), waferHexagon6(), waferHexagon8(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalParameters::waferTypeL_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

◆ waferTypeL()

int HGCalDDDConstants::waferTypeL ( int  wafer) const
inline

Definition at line 197 of file HGCalDDDConstants.h.

197  {
198  return ((wafer >= 0) && (wafer < (int)(hgpar_->waferTypeL_.size()))) ? hgpar_->waferTypeL_[wafer] : 0;
199  }

References hgpar_, and HGCalParameters::waferTypeL_.

Referenced by HGCalTBAnalyzer::analyzeRecHits(), HGCalTriggerTools::sensorCellThicknessV8(), PFRecHitQTestThresholdInThicknessNormalizedMIPs::test(), and waferType().

◆ waferTypeRotation()

std::pair< int, int > HGCalDDDConstants::waferTypeRotation ( int  layer,
int  waferU,
int  waferV,
bool  fromFile = false,
bool  debug = false 
) const

Definition at line 1353 of file HGCalDDDConstants.cc.

1354  {
1355  int type(HGCalTypes::WaferOut), rotn(0);
1357  bool withinList(true);
1358  if (fromFile && (waferFileSize() > 0)) {
1359  auto itr = hgpar_->waferInfoMap_.find(wl);
1360  withinList = (itr != hgpar_->waferInfoMap_.end());
1361  if (withinList) {
1362  type = (itr->second).part;
1363  rotn = (itr->second).orient;
1364  }
1365  } else {
1366  auto itr = hgpar_->waferTypes_.find(wl);
1367  if (waferHexagon8()) {
1368  withinList = (itr != hgpar_->waferTypes_.end());
1369  if (withinList) {
1370  if ((itr->second).second < HGCalWaferMask::k_OffsetRotation) {
1371  rotn = (itr->second).second;
1372  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1374  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1376  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1378  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1380  }
1381  } else {
1382  type = (itr->second).first;
1383  rotn = ((itr->second).second - HGCalWaferMask::k_OffsetRotation);
1384  }
1385  } else {
1387  rotn = HGCalTypes::WaferCorner0;
1388  }
1389  }
1390  }
1391 #ifdef EDM_ML_DEBUG
1392  if (debug)
1393  edm::LogVerbatim("HGCalGeom") << "waferTypeRotation: Layer " << layer << " Wafer " << waferU << ":" << waferV
1394  << " Index " << std::hex << wl << std::dec << ":" << withinList << " Type " << type
1395  << " Rotation " << rotn;
1396 #endif
1397  return std::make_pair(type, rotn);
1398 }

References debug, TauDecayModes::dec, first, hgpar_, HGCalGeomTools::k_allCorners, HGCalGeomTools::k_fiveCorners, HGCalGeomTools::k_fourCorners, HGCalWaferMask::k_OffsetRotation, HGCalGeomTools::k_threeCorners, phase1PixelTopology::layer, hgcalPerformanceValidation::orient, edm::second(), HGCalTypes::WaferCorner0, waferFileSize(), HGCalTypes::WaferFive, HGCalTypes::WaferFull, HGCalTypes::WaferHalf, waferHexagon8(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalTypes::WaferOut, HGCalTypes::WaferThree, HGCalParameters::waferTypes_, HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), and LaserClient_cfi::wl.

Referenced by isValidCell8().

◆ waferTypeT()

int HGCalDDDConstants::waferTypeT ( int  wafer) const
inline

Definition at line 193 of file HGCalDDDConstants.h.

193  {
194  return ((wafer >= 0) && (wafer < (int)(hgpar_->waferTypeT_.size()))) ? hgpar_->waferTypeT_[wafer] : 0;
195  }

References hgpar_, and HGCalParameters::waferTypeT_.

Referenced by HGCalGeometryLoader::build(), HGCalTriggerGeometryHexLayerBasedImp1::detIdWaferType(), and HGCalGeometry::getClosestCell().

◆ waferUVMax()

int HGCalDDDConstants::waferUVMax ( ) const
inline

Definition at line 205 of file HGCalDDDConstants.h.

205 { return hgpar_->waferUVMax_; }

References hgpar_, and HGCalParameters::waferUVMax_.

Referenced by HGCalTopology::HGCalTopology().

◆ waferVirtual()

bool HGCalDDDConstants::waferVirtual ( int  layer,
int  waferU,
int  waferV 
) const

Definition at line 1400 of file HGCalDDDConstants.cc.

1400  {
1401  bool type(false);
1402  if (waferHexagon8()) {
1404  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1405  } else if (waferHexagon6()) {
1406  int wl = HGCalWaferIndex::waferIndex(layer, waferU, 0, true);
1407  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1408  }
1409  return type;
1410 }

References hgpar_, phase1PixelTopology::layer, waferHexagon6(), waferHexagon8(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferTypes_, HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), and LaserClient_cfi::wl.

◆ waferZ()

double HGCalDDDConstants::waferZ ( int  layer,
bool  reco 
) const

Member Data Documentation

◆ dPhiMin

const float HGCalDDDConstants::dPhiMin = 0.02
private

Definition at line 226 of file HGCalDDDConstants.h.

◆ fullAndPart_

bool HGCalDDDConstants::fullAndPart_
private

Definition at line 234 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), isValidHex8(), and waferInLayerTest().

◆ geomTools_

HGCalGeomTools HGCalDDDConstants::geomTools_
private

Definition at line 224 of file HGCalDDDConstants.h.

Referenced by locateCell().

◆ hexside_

double HGCalDDDConstants::hexside_
private

◆ hgpar_

const HGCalParameters* HGCalDDDConstants::hgpar_
private

◆ k_horizontalShift

const double HGCalDDDConstants::k_horizontalShift = 1.0
private

Definition at line 225 of file HGCalDDDConstants.h.

◆ max_modules_layer_

Simrecovecs HGCalDDDConstants::max_modules_layer_
private

Definition at line 237 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and modules().

◆ maxWafersPerLayer_

int32_t HGCalDDDConstants::maxWafersPerLayer_
private

Definition at line 238 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and maxModulesPerLayer().

◆ mode_

HGCalGeometryMode::GeometryMode HGCalDDDConstants::mode_
private

◆ modHalf_

int32_t HGCalDDDConstants::modHalf_
private

Definition at line 235 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and maxModules().

◆ rmax_

double HGCalDDDConstants::rmax_
private

◆ sqrt3_

const double HGCalDDDConstants::sqrt3_
private

Definition at line 231 of file HGCalDDDConstants.h.

Referenced by cellHex(), distFromEdgeHex(), and locateCell().

◆ tan30deg_

constexpr static double HGCalDDDConstants::tan30deg_ = 0.5773502693
staticconstexprprivate

◆ tot_layers_

std::array<uint32_t, 2> HGCalDDDConstants::tot_layers_
private

Definition at line 236 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), lastLayer(), and layers().

◆ tot_wafers_

int32_t HGCalDDDConstants::tot_wafers_
private

Definition at line 235 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants().

◆ waferIn_

std::unordered_map<int32_t, bool> HGCalDDDConstants::waferIn_
private

Definition at line 241 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and isValidHex8().

◆ waferLayer_

std::map<int, HGCWaferParam> HGCalDDDConstants::waferLayer_
private

Definition at line 239 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and wafers().

◆ waferMax_

std::array<int, 4> HGCalDDDConstants::waferMax_
private

Definition at line 240 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), waferCount(), waferMax(), and waferMin().

HGCalGeomTools::k_allCorners
static constexpr int k_allCorners
Definition: HGCalGeomTools.h:13
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
DDAxes::y
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
HGCalDDDConstants::tot_wafers_
int32_t tot_wafers_
Definition: HGCalDDDConstants.h:235
HGCalParameters::cellCoarseHalf_
std::vector< bool > cellCoarseHalf_
Definition: HGCalParameters.h:127
HGCalGeomTools::waferCorner
static std::pair< int32_t, int32_t > waferCorner(double xpos, double ypos, double r, double R, double rMin, double rMax, bool oldBug=false)
Definition: HGCalGeomTools.cc:287
cms::cuda::wmax
__host__ __device__ V V wmax
Definition: HistoContainer.h:85
V0Monitor_cff.v0
v0
Definition: V0Monitor_cff.py:7
HGCalParameters::nSectors_
int nSectors_
Definition: HGCalParameters.h:74
mps_fire.i
i
Definition: mps_fire.py:428
geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
HGCalGeometryMode::TrapezoidFile
Definition: HGCalGeometryMode.h:33
HGCalDDDConstants::tan30deg_
constexpr static double tan30deg_
Definition: HGCalDDDConstants.h:230
HGCalParameters::moduleCellS_
std::vector< double > moduleCellS_
Definition: HGCalParameters.h:82
HGCalParameters::firstLayer_
int firstLayer_
Definition: HGCalParameters.h:173
HGCalDDDConstants::getXY
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
Definition: HGCalDDDConstants.cc:439
HGCalDDDConstants::waferFromPosition
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
Definition: HGCalDDDConstants.cc:1089
HGCalDDDConstants::maxWafersPerLayer_
int32_t maxWafersPerLayer_
Definition: HGCalDDDConstants.h:238
HGCalWaferMask::goodCell
static bool goodCell(int u, int v, int N, int type, int rotn)
Definition: HGCalWaferMask.cc:108
HGCalDDDConstants::cellHex
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
Definition: HGCalDDDConstants.cc:1448
HGCalDDDConstants::sqrt3_
const double sqrt3_
Definition: HGCalDDDConstants.h:231
HGCalDDDConstants::modulesInit
int modulesInit(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:881
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
HGCalParameters::zLayerHex_
std::vector< double > zLayerHex_
Definition: HGCalParameters.h:112
HGCalDDDConstants::waferIn_
std::unordered_map< int32_t, bool > waferIn_
Definition: HGCalDDDConstants.h:241
HGCalDDDConstants::isValidCell
bool isValidCell(int layindex, int wafer, int cell) const
Definition: HGCalDDDConstants.cc:1554
LaserClient_cfi.wl
wl
Definition: LaserClient_cfi.py:46
HGCalParameters::moduleCellR_
std::vector< double > moduleCellR_
Definition: HGCalParameters.h:89
HGCalParameters::zFrontMin_
std::vector< double > zFrontMin_
Definition: HGCalParameters.h:139
HGCalParameters::getModule
hgtrap getModule(unsigned int k, bool reco) const
Definition: HGCalParameters.cc:35
min
T min(T a, T b)
Definition: MathUtil.h:58
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
findQualityFiles.rr
string rr
Definition: findQualityFiles.py:185
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
HGCalParameters::rMaxLayHex_
std::vector< double > rMaxLayHex_
Definition: HGCalParameters.h:114
HGCalParameters::cellFineY_
std::vector< double > cellFineY_
Definition: HGCalParameters.h:121
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
cuy.col
col
Definition: cuy.py:1009
HGCalParameters::k_CornerSize
static constexpr uint32_t k_CornerSize
Definition: HGCalParameters.h:44
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
HGCalTypes::WaferOut
Definition: HGCalTypes.h:79
HGCalWaferIndex::waferU
int32_t waferU(const int32_t index)
Definition: HGCalWaferIndex.cc:27
HGCalDDDConstants::waferHexagon8
bool waferHexagon8() const
Definition: HGCalDDDConstants.h:143
HGCalParameters::slopeTop_
std::vector< double > slopeTop_
Definition: HGCalParameters.h:169
HGCalParameters::layerIndex_
std::vector< int > layerIndex_
Definition: HGCalParameters.h:104
HGCalWaferIndex::waferIndex
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
Definition: HGCalWaferIndex.cc:4
HGCalTypes::WaferFive
Definition: HGCalTypes.h:59
if
if(0==first)
Definition: CAHitNtupletGeneratorKernelsImpl.h:58
cells
const caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple cms::cuda::AtomicPairCounter const GPUCACell *__restrict__ cells
Definition: CAHitNtupletGeneratorKernelsImpl.h:43
HGCalParameters::yLayerHex_
std::vector< double > yLayerHex_
Definition: HGCalParameters.h:111
HGCalParameters::scintCellSize
double scintCellSize(const int layer) const
Definition: HGCalParameters.h:67
HGCalTypes::CellType::TopLeftEdge
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
HGCalParameters::nCellsCoarse_
int nCellsCoarse_
Definition: HGCalParameters.h:143
HGCalParameters::wafersInLayers_
wafer_map wafersInLayers_
Definition: HGCalParameters.h:179
HGCalParameters::waferSize_
double waferSize_
Definition: HGCalParameters.h:144
HGCalTypes::WaferCornerMin
static constexpr int32_t WaferCornerMin
Definition: HGCalTypes.h:90
HGCalGeomTools::shiftXY
std::pair< double, double > shiftXY(int waferPosition, double waferSize) const
Definition: HGCalGeomTools.cc:234
full
Definition: GenABIO.cc:168
DDAxes::x
HGCalGeometryMode::Hexagon8Module
Definition: HGCalGeometryMode.h:34
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
findQualityFiles.v
v
Definition: findQualityFiles.py:179
HGCalParameters::moduleLayR_
std::vector< int > moduleLayR_
Definition: HGCalParameters.h:83
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
HGCalParameters::waferUVMaxLayer_
std::vector< int > waferUVMaxLayer_
Definition: HGCalParameters.h:149
HFNoseDetId
Definition: HFNoseDetId.h:22
HGCalParameters::iradMaxBH_
std::vector< int > iradMaxBH_
Definition: HGCalParameters.h:165
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
HGCalTypes::CellType::TopRightEdge
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
HGCalTypes::CellType::UndefinedType
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
HGCalTileIndex::tileIndex
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
Definition: HGCalTileIndex.cc:4
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
HGCalTypes::SiPMLarge
Definition: HGCalTypes.h:107
HGCalDDDConstants::max_modules_layer_
Simrecovecs max_modules_layer_
Definition: HGCalDDDConstants.h:237
HGCSiliconDetId::HGCalCoarseThick
Definition: HGCSiliconDetId.h:24
HGCalDDDConstants::geomTools_
HGCalGeomTools geomTools_
Definition: HGCalDDDConstants.h:224
HGCalParameters::waferPosY_
std::vector< double > waferPosY_
Definition: HGCalParameters.h:119
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
HGCalDDDConstants::layerFromIndex
int layerFromIndex(int index, bool reco) const
Definition: HGCalDDDConstants.cc:1534
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
HGCalParameters::sensorSeparation_
double sensorSeparation_
Definition: HGCalParameters.h:146
HGCalDDDConstants::waferTypeRotation
std::pair< int, int > waferTypeRotation(int layer, int waferU, int waferV, bool fromFile=false, bool debug=false) const
Definition: HGCalDDDConstants.cc:1353
HGCalDDDConstants::isValidHex8
bool isValidHex8(int lay, int waferU, int waferV, bool fullAndPart=false) const
Definition: HGCalDDDConstants.cc:502
nphi
const int nphi
Definition: CMTRawAnalyzer.h:424
HGCalTypes::CellType::BottomCorner
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
HGCalDDDConstants::waferType
int waferType(DetId const &id, bool fromFile=false) const
Definition: HGCalDDDConstants.cc:1267
HGCalDDDConstants::waferHexagon6
bool waferHexagon6() const
Definition: HGCalDDDConstants.h:140
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
debug
#define debug
Definition: HDRShower.cc:19
part
part
Definition: HCALResponse.h:20
HGCalGeometryMode::Trapezoid
Definition: HGCalGeometryMode.h:31
HGCalParameters::trformIndex_
std::vector< uint32_t > trformIndex_
Definition: HGCalParameters.h:90
HGCalDDDConstants::isValidCell8
bool isValidCell8(int lay, int waferU, int waferV, int cellU, int cellV, int type) const
Definition: HGCalDDDConstants.cc:1578
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
HGCalDDDConstants::mode_
HGCalGeometryMode::GeometryMode mode_
Definition: HGCalDDDConstants.h:233
trackingPlots.hp
hp
Definition: trackingPlots.py:1231
HGCalParameters::radiusLayer_
std::vector< double > radiusLayer_[2]
Definition: HGCalParameters.h:163
HGCalParameters::cellFineHalf_
std::vector< bool > cellFineHalf_
Definition: HGCalParameters.h:123
HGCalDDDConstants::maxCells
int maxCells(bool reco) const
Definition: HGCalDDDConstants.cc:804
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
HGCalParameters::layerGroup_
std::vector< int > layerGroup_
Definition: HGCalParameters.h:105
HGCalParameters::layerRotV_
std::vector< std::pair< double, double > > layerRotV_
Definition: HGCalParameters.h:185
HGCalParameters::radiusMixBoundary_
std::vector< double > radiusMixBoundary_
Definition: HGCalParameters.h:159
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HGCalParameters::waferPosX_
std::vector< double > waferPosX_
Definition: HGCalParameters.h:118
HGCalDDDConstants::waferInLayer
bool waferInLayer(int wafer, int lay, bool reco) const
Definition: HGCalDDDConstants.cc:1208
HGCalParameters::waferUVMax_
int waferUVMax_
Definition: HGCalParameters.h:148
DDAxes::z
HGCalDDDConstants::layerIndex
int layerIndex(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:579
N
#define N
Definition: blowfish.cc:9
HGCalTypes::WaferFull
Definition: HGCalTypes.h:58
HGCalWaferIndex::waferV
int32_t waferV(const int32_t index)
Definition: HGCalWaferIndex.cc:32
HGCalParameters::rMinLayHex_
std::vector< double > rMinLayHex_
Definition: HGCalParameters.h:113
RecoTauValidation_cfi.posX
posX
Definition: RecoTauValidation_cfi.py:287
HGCalWaferType::getType
int getType(double xpos, double ypos, double zpos)
Definition: HGCalWaferType.cc:36
HGCalDDDConstants::waferFileSize
unsigned int waferFileSize() const
Definition: HGCalDDDConstants.h:155
HGCalDDDConstants::wafers
int wafers() const
Definition: HGCalDDDConstants.cc:1420
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition: GetRecoTauVFromDQM_MC_cff.py:84
HGCalParameters::typesInLayers_
wafer_map typesInLayers_
Definition: HGCalParameters.h:180
HGCalParameters::getTrForm
hgtrform getTrForm(unsigned int k) const
Definition: HGCalParameters.cc:108
dqmdumpme.k
k
Definition: dqmdumpme.py:60
callgraph.n2
n2
Definition: callgraph.py:50
HGCalParameters::waferCopy_
std::vector< int > waferCopy_
Definition: HGCalParameters.h:115
HGCalDDDConstants::rangeR
std::pair< double, double > rangeR(double z, bool reco) const
Definition: HGCalDDDConstants.cc:966
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
HGCalParameters::iradMinBH_
std::vector< int > iradMinBH_
Definition: HGCalParameters.h:164
geometryCSVtoXML.xy
xy
Definition: geometryCSVtoXML.py:19
HGCalTypes::getUnpackedU
static int32_t getUnpackedU(int id)
Definition: HGCalTypes.cc:16
HGCSiliconDetId::HGCalFine
Definition: HGCSiliconDetId.h:24
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
HGCalParameters::cellSize_
std::vector< double > cellSize_
Definition: HGCalParameters.h:75
HGCalDDDConstants::tileTrapezoid
bool tileTrapezoid() const
Definition: HGCalDDDConstants.h:113
HGCalParameters::mouseBite_
double mouseBite_
Definition: HGCalParameters.h:147
HGCalParameters::nCellsFine_
int nCellsFine_
Definition: HGCalParameters.h:142
HGCalParameters::firstModule_
std::vector< int > firstModule_
Definition: HGCalParameters.h:167
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
HGCalDDDConstants::hexside_
double hexside_
Definition: HGCalDDDConstants.h:232
HFNoseDetId::type
int type() const
get the type
Definition: HFNoseDetId.h:50
HGCalDDDConstants::waferLayer_
std::map< int, HGCWaferParam > waferLayer_
Definition: HGCalDDDConstants.h:239
HGCalDDDConstants::modHalf_
int32_t modHalf_
Definition: HGCalDDDConstants.h:235
HGCalDDDConstants::numberCells
int numberCells(bool reco) const
Definition: HGCalDDDConstants.cc:901
HGCalParameters::depth_
std::vector< int > depth_
Definition: HGCalParameters.h:107
HGCalGeometryMode::TrapezoidModule
Definition: HGCalGeometryMode.h:35
HGCalParameters::rMaxFront_
std::vector< double > rMaxFront_
Definition: HGCalParameters.h:171
geometryCSVtoXML.yy
yy
Definition: geometryCSVtoXML.py:19
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
HGCalParameters::cellFineIndex_
wafer_map cellFineIndex_
Definition: HGCalParameters.h:122
HGCalDDDConstants::getIndex
std::pair< int, float > getIndex(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:1517
HGCalParameters::mode_
HGCalGeometryMode::GeometryMode mode_
Definition: HGCalParameters.h:137
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
HGCalParameters::cellCoarseY_
std::vector< double > cellCoarseY_
Definition: HGCalParameters.h:125
HGCalGeometryMode::Hexagon8Full
Definition: HGCalGeometryMode.h:30
recoMuon::in
Definition: RecoMuonEnumerators.h:6
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
HGCalTypes::getUnpackedV
static int32_t getUnpackedV(int id)
Definition: HGCalTypes.cc:22
HGCalWaferMask::k_OffsetRotation
static constexpr int k_OffsetRotation
Definition: HGCalWaferMask.h:37
HGCalDDDConstants::layers
unsigned int layers(bool reco) const
Definition: HGCalDDDConstants.cc:577
HGCalParameters::scintType
int scintType(const int layer) const
Definition: HGCalParameters.h:68
createfilelist.int
int
Definition: createfilelist.py:10
cms::cuda::wmin
__host__ __device__ V wmin
Definition: HistoContainer.h:85
HGCalParameters::scintCells
int scintCells(const int layer) const
Definition: HGCalParameters.h:66
HGCalParameters::layerGroupO_
std::vector< int > layerGroupO_
Definition: HGCalParameters.h:129
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
HGCalTypes::CellType::TopLeftCorner
HGCalTypes::CellType::LeftEdge
PVValHelper::dy
Definition: PVValidationHelpers.h:50
HGCalParameters::layerGroupM_
std::vector< int > layerGroupM_
Definition: HGCalParameters.h:128
HGCalDDDConstants::sectors
int sectors() const
Definition: HGCalDDDConstants.h:110
HGCalParameters::waferR_
double waferR_
Definition: HGCalParameters.h:134
HGCalDDDConstants::getUVMax
int getUVMax(int type) const
Definition: HGCalDDDConstants.h:72
HGCalGeomTools::k_fiveCorners
static constexpr int k_fiveCorners
Definition: HGCalGeomTools.h:14
HGCalParameters::layerOffset_
int layerOffset_
Definition: HGCalParameters.h:175
HGCalTypes::WaferHalf
Definition: HGCalTypes.h:62
HGCalParameters::waferThick_
double waferThick_
Definition: HGCalParameters.h:145
HGCalDDDConstants::rmax_
double rmax_
Definition: HGCalDDDConstants.h:232
HGCalParameters::hgtrform::lay
int lay
Definition: HGCalParameters.h:53
HGCalTypes::CellType::TopCorner
HGCalDDDConstants::getTrForm
HGCalParameters::hgtrform getTrForm(unsigned int k) const
Definition: HGCalDDDConstants.h:66
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:33
HGCalGeometryMode::Hexagon
Definition: HGCalGeometryMode.h:27
HGCalParameters::k_ScaleFromDDD
static constexpr double k_ScaleFromDDD
Definition: HGCalParameters.h:36
HGCalParameters::waferTypeT_
std::vector< int > waferTypeT_
Definition: HGCalParameters.h:117
HGCalDDDConstants::waferMax_
std::array< int, 4 > waferMax_
Definition: HGCalDDDConstants.h:240
HGCalTypes::CellType::BottomRightCorner
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HGCalDDDConstants::tot_layers_
std::array< uint32_t, 2 > tot_layers_
Definition: HGCalDDDConstants.h:236
HGCalDDDConstants::numberCellsHexagon
int numberCellsHexagon(int wafer) const
Definition: HGCalDDDConstants.cc:944
HGCalParameters
Definition: HGCalParameters.h:14
HGCalParameters::k_ScaleToDDD
static constexpr double k_ScaleToDDD
Definition: HGCalParameters.h:37
DDAxes::phi
HGCalDetId
Definition: HGCalDetId.h:8
HGCalWaferIndex::waferLayer
int32_t waferLayer(const int32_t index)
Definition: HGCalWaferIndex.cc:23
HGCalGeomTools::radius
static void radius(double zf, double zb, std::vector< double > const &zFront1, std::vector< double > const &rFront1, std::vector< double > const &slope1, std::vector< double > const &zFront2, std::vector< double > const &rFront2, std::vector< double > const &slope2, int flag, std::vector< double > &zz, std::vector< double > &rin, std::vector< double > &rout)
Definition: HGCalGeomTools.cc:12
HGCalGeometryMode::HexagonFull
Definition: HGCalGeometryMode.h:28
HGCalParameters::detectorType_
int detectorType_
Definition: HGCalParameters.h:72
HGCalDDDConstants::cellType
HGCalTypes::CellType cellType(int type, int waferU, int waferV) const
Definition: HGCalDDDConstants.cc:240
std
Definition: JetResolutionObject.h:76
HGCalParameters::waferMaskMode_
int waferMaskMode_
Definition: HGCalParameters.h:182
HGCalTypes::CellType::BottomLeftCorner
HGCalParameters::waferInfoMap_
waferInfo_map waferInfoMap_
Definition: HGCalParameters.h:184
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
hgcalPerformanceValidation.df
df
Definition: hgcalPerformanceValidation.py:733
HGCalParameters::slopeMin_
std::vector< double > slopeMin_
Definition: HGCalParameters.h:138
HGCalParameters::depthIndex_
std::vector< int > depthIndex_
Definition: HGCalParameters.h:108
hgcalPerformanceValidation.orient
orient
Definition: hgcalPerformanceValidation.py:733
HGCalParameters::defineFull_
bool defineFull_
Definition: HGCalParameters.h:150
HGCalParameters::xLayerHex_
std::vector< double > xLayerHex_
Definition: HGCalParameters.h:110
HGCalTypes::CellType::RightEdge
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
HGCalParameters::waferTypes_
waferT_map waferTypes_
Definition: HGCalParameters.h:181
HGCalTypes::CellType::BottomRightEdge
HGCalDDDConstants::waferPosition
std::pair< double, double > waferPosition(int wafer, bool reco) const
Definition: HGCalDDDConstants.cc:1229
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
dt_dqm_sourceclient_common_cff.reco
reco
Definition: dt_dqm_sourceclient_common_cff.py:111
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
HGCalParameters::layerCenter_
std::vector< int > layerCenter_
Definition: HGCalParameters.h:178
HGCalParameters::rMinFront_
std::vector< double > rMinFront_
Definition: HGCalParameters.h:140
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
HGCalGeometryMode::Hexagon8File
Definition: HGCalGeometryMode.h:32
HGCalParameters::lastModule_
std::vector< int > lastModule_
Definition: HGCalParameters.h:168
HGCalDDDConstants::modules
int modules(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:874
HGCSiliconDetId::type
int type() const
get the type
Definition: HGCSiliconDetId.h:51
HGCalParameters::cellFineX_
std::vector< double > cellFineX_
Definition: HGCalParameters.h:120
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
TCMET_cfi.corner
corner
Definition: TCMET_cfi.py:34
HGCalParameters::cellThickness_
std::vector< double > cellThickness_
Definition: HGCalParameters.h:152
HGCalTypes::WaferThree
Definition: HGCalTypes.h:65
HGCalParameters::firstMixedLayer_
int firstMixedLayer_
Definition: HGCalParameters.h:174
HGCalDDDConstants::getLayer
int getLayer(double z, bool reco) const
Definition: HGCalDDDConstants.cc:356
HGCalTypes::CellType::CentralType
HGCalGeometryMode::Hexagon8
Definition: HGCalGeometryMode.h:29
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
HGCalDDDConstants::waferTypeL
int waferTypeL(int wafer) const
Definition: HGCalDDDConstants.h:197
HGCalParameters::waferTypeL_
std::vector< int > waferTypeL_
Definition: HGCalParameters.h:116
HGCalParameters::cellCoarseX_
std::vector< double > cellCoarseX_
Definition: HGCalParameters.h:124
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGCalParameters::layer_
std::vector< int > layer_
Definition: HGCalParameters.h:103
HGCalDDDConstants::getTrFormN
unsigned int getTrFormN() const
Definition: HGCalDDDConstants.h:67
HGCalDDDConstants::fullAndPart_
bool fullAndPart_
Definition: HGCalDDDConstants.h:234
HGCalDDDConstants::layersInit
unsigned int layersInit(bool reco) const
Definition: HGCalDDDConstants.cc:592
HGCalDDDConstants::locateCell
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
Definition: HGCalDDDConstants.cc:596
HGCalParameters::cellCoarseIndex_
wafer_map cellCoarseIndex_
Definition: HGCalParameters.h:126
DetId::Forward
Definition: DetId.h:30
HGCalParameters::depthLayerF_
std::vector< int > depthLayerF_
Definition: HGCalParameters.h:109
HGCalDDDConstants::waferIndex
int32_t waferIndex(int wafer, int index) const
Definition: HGCalDDDConstants.cc:1629
HGCalParameters::zFrontTop_
std::vector< double > zFrontTop_
Definition: HGCalParameters.h:170
HGCalParameters::hgtrap
Definition: HGCalParameters.h:47
edm::Log
Definition: MessageLogger.h:70
dttmaxenums::R
Definition: DTTMax.h:29
HGCalTypes::SiPMSmall
Definition: HGCalTypes.h:107
TauDecayModes.dec
dec
Definition: TauDecayModes.py:142
HGCalParameters::levelT_
std::vector< int > levelT_
Definition: HGCalParameters.h:135
HGCalGeomTools::k_fourCorners
static constexpr int k_fourCorners
Definition: HGCalGeomTools.h:15
PVValHelper::dx
Definition: PVValidationHelpers.h:49
HGCalDDDConstants::hgpar_
const HGCalParameters * hgpar_
Definition: HGCalDDDConstants.h:229
HGCalWaferMask::maskCell
static bool maskCell(int u, int v, int N, int ncor, int fcor, int corners)
Definition: HGCalWaferMask.cc:11
HGCalTypes::CellType::BottomLeftEdge
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
RecoTauValidation_cfi.posY
posY
Definition: RecoTauValidation_cfi.py:288
HGCalDDDConstants::HGCWaferParam
std::array< int, 3 > HGCWaferParam
Definition: HGCalDDDConstants.h:228
HGCalDDDConstants::waferInLayerTest
bool waferInLayerTest(int wafer, int lay, bool full) const
Definition: HGCalDDDConstants.cc:1641
HGCalGeomTools::k_threeCorners
static constexpr int k_threeCorners
Definition: HGCalGeomTools.h:16
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117
HGCalTypes::CellType::TopRightCorner
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
HGCalParameters::tileInfoMap_
tileInfo_map tileInfoMap_
Definition: HGCalParameters.h:186
HGCalTypes::WaferCorner0
Definition: HGCalTypes.h:30
HGCalParameters::copiesInLayers_
layer_map copiesInLayers_
Definition: HGCalParameters.h:141