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
 
 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 227 of file HGCalDDDConstants.h.

◆ Simrecovecs

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

Definition at line 226 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  xx -= hgpar_->waferPosX_[wafer];
138  yy -= hgpar_->waferPosY_[wafer];
139  if (hgpar_->waferTypeT_[wafer] == 1)
140  return std::make_pair(wafer,
141  cellHex(xx,
142  yy,
145  hgpar_->cellFineY_));
146  else
147  return std::make_pair(wafer,
148  cellHex(xx,
149  yy,
152  hgpar_->cellCoarseY_));
153  }
154  } else {
155  return std::make_pair(-1, -1);
156  }
157 }

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, cellHex(), HGCalParameters::cellSize_, getIndex(), hgpar_, HGCalParameters::k_ScaleFromDDD, dt_dqm_sourceclient_common_cff::reco, rmax_, findQualityFiles::size, waferHexagon6(), HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferTypeT_, x, geometryCSVtoXML::xx, 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 159 of file HGCalDDDConstants.cc.

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

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 170 of file HGCalDDDConstants.cc.

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

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 193 of file HGCalDDDConstants.cc.

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

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 1445 of file HGCalDDDConstants.cc.

1445  {
1446  int N = (cellType == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1447  double Rc = 2 * rmax_ / (3 * N);
1448  double rc = 0.5 * Rc * sqrt3_;
1449  double v0 = ((xloc / Rc - 1.0) / 1.5);
1450  int cv0 = (v0 > 0) ? (N + (int)(v0 + 0.5)) : (N - (int)(-v0 + 0.5));
1451  double u0 = (0.5 * yloc / rc + 0.5 * cv0);
1452  int cu0 = (u0 > 0) ? (N / 2 + (int)(u0 + 0.5)) : (N / 2 - (int)(-u0 + 0.5));
1453  cu0 = std::max(0, std::min(cu0, 2 * N - 1));
1454  cv0 = std::max(0, std::min(cv0, 2 * N - 1));
1455  if (cv0 - cu0 >= N)
1456  cv0 = cu0 + N - 1;
1457 #ifdef EDM_ML_DEBUG
1458  if (debug)
1459  edm::LogVerbatim("HGCalGeom") << "cellHex: input " << xloc << ":" << yloc << ":" << cellType << " parameter " << rc
1460  << ":" << Rc << " u0 " << u0 << ":" << cu0 << " v0 " << v0 << ":" << cv0;
1461 #endif
1462  bool found(false);
1463  static constexpr int shift[3] = {0, 1, -1};
1464  for (int i1 = 0; i1 < 3; ++i1) {
1465  cellU = cu0 + shift[i1];
1466  for (int i2 = 0; i2 < 3; ++i2) {
1467  cellV = cv0 + shift[i2];
1468  if (((cellV - cellU) < N) && ((cellU - cellV) <= N) && (cellU >= 0) && (cellV >= 0) && (cellU < 2 * N) &&
1469  (cellV < 2 * N)) {
1470  double xc = (1.5 * (cellV - N) + 1.0) * Rc;
1471  double yc = (2 * cellU - cellV - N) * rc;
1472  if ((std::abs(yloc - yc) <= rc) && (std::abs(xloc - xc) <= Rc) &&
1473  ((std::abs(xloc - xc) <= 0.5 * Rc) || (std::abs(yloc - yc) <= sqrt3_ * (Rc - std::abs(xloc - xc))))) {
1474 #ifdef EDM_ML_DEBUG
1475  if (debug)
1476  edm::LogVerbatim("HGCalGeom")
1477  << "cellHex: local " << xc << ":" << yc << " difference " << std::abs(xloc - xc) << ":"
1478  << std::abs(yloc - yc) << ":" << sqrt3_ * (Rc - std::abs(yloc - yc)) << " comparator " << rc << ":"
1479  << Rc << " (u,v) = (" << cellU << "," << cellV << ")";
1480 #endif
1481  found = true;
1482  break;
1483  }
1484  }
1485  }
1486  if (found)
1487  break;
1488  }
1489  if (!found) {
1490  cellU = cu0;
1491  cellV = cv0;
1492  }
1493 }

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 1426 of file HGCalDDDConstants.cc.

1427  {
1428  int num(0);
1429  const double tol(0.00001);
1430  double cellY = 2.0 * cellR * tan30deg_;
1431  for (unsigned int k = 0; k < posX.size(); ++k) {
1432  double dx = std::abs(xx - posX[k]);
1433  double dy = std::abs(yy - posY[k]);
1434  if (dx <= (cellR + tol) && dy <= (cellY + tol)) {
1435  double xmax = (dy <= 0.5 * cellY) ? cellR : (cellR - (dy - 0.5 * cellY) / tan30deg_);
1436  if (dx <= (xmax + tol)) {
1437  num = k;
1438  break;
1439  }
1440  }
1441  }
1442  return num;
1443 }

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 203 of file HGCalDDDConstants.cc.

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

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 232 of file HGCalDDDConstants.cc.

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

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 219 of file HGCalDDDConstants.cc.

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

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 239 of file HGCalDDDConstants.cc.

239  {
240  // type=0: in the middle; 1..6: the edges clocwise from bottom left;
241  // =11..16: the corners clockwise from bottom
242  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
243  if (cellU == 0) {
244  if (cellV == 0)
246  else if (cellV - cellU == N - 1)
248  else
250  } else if (cellV == 0) {
251  if (cellU - cellV == N)
253  else
255  } else if (cellU - cellV == N) {
256  if (cellU == 2 * N - 1)
258  else
260  } else if (cellU == 2 * N - 1) {
261  if (cellV == 2 * N - 1)
263  else
265  } else if (cellV == 2 * N - 1) {
266  if (cellV - cellU == N - 1)
268  else
270  } else if (cellV - cellU == N - 1) {
272  } else if ((cellU > 2 * N - 1) || (cellV > 2 * N - 1) || (cellV >= (cellU + N)) || (cellU > (cellV + N))) {
274  } else {
276  }
277 }

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 279 of file HGCalDDDConstants.cc.

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

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 325 of file HGCalDDDConstants.cc.

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

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 1495 of file HGCalDDDConstants.cc.

1495  {
1496  int indx = layerIndex(lay, reco);
1497  if (indx < 0)
1498  return std::make_pair(-1, 0);
1499  float cell(0);
1500  if (waferHexagon6()) {
1501  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1502  } else {
1503  if (waferHexagon8()) {
1504  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1505  } else {
1506  cell = hgpar_->scintCellSize(lay);
1507  }
1508  }
1509  return std::make_pair(indx, cell);
1510 }

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 355 of file HGCalDDDConstants.cc.

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

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 375 of file HGCalDDDConstants.cc.

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

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 391 of file HGCalDDDConstants.cc.

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

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 398 of file HGCalDDDConstants.cc.

398 { 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 400 of file HGCalDDDConstants.cc.

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

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 412 of file HGCalDDDConstants.cc.

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

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 419 of file HGCalDDDConstants.cc.

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

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 71 of file HGCalDDDConstants.h.

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

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

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

◆ isHalfCell()

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

Definition at line 438 of file HGCalDDDConstants.cc.

438  {
439  if (waferType < 1 || cell < 0)
440  return false;
441  return waferType == 2 ? hgpar_->cellCoarseHalf_[cell] : hgpar_->cellFineHalf_[cell];
442 }

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

◆ isValidCell()

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

Definition at line 1532 of file HGCalDDDConstants.cc.

1532  {
1533  // Calculate the position of the cell
1534  // Works for options HGCalHexagon/HGCalHexagonFull
1535  double x = hgpar_->waferPosX_[wafer];
1536  double y = hgpar_->waferPosY_[wafer];
1537  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine) {
1538  x += hgpar_->cellFineX_[cell];
1539  y += hgpar_->cellFineY_[cell];
1540  } else {
1541  x += hgpar_->cellCoarseX_[cell];
1542  y += hgpar_->cellCoarseY_[cell];
1543  }
1544  double rr = sqrt(x * x + y * y);
1545  bool result = ((rr >= hgpar_->rMinLayHex_[lay - 1]) && (rr <= hgpar_->rMaxLayHex_[lay - 1]) &&
1546  (wafer < (int)(hgpar_->waferPosX_.size())));
1547 #ifdef EDM_ML_DEBUG
1548  if (!result)
1549  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << wafer << ":" << cell << " Position " << x << ":" << y
1550  << ":" << rr << " Compare Limits " << hgpar_->rMinLayHex_[lay - 1] << ":"
1551  << hgpar_->rMaxLayHex_[lay - 1] << " Flag " << result;
1552 #endif
1553  return result;
1554 }

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 1556 of file HGCalDDDConstants.cc.

1556  {
1557  float x(0), y(0);
1558  int kndx = cellV * 100 + cellU;
1559  if (type == 0) {
1560  auto ktr = hgpar_->cellFineIndex_.find(kndx);
1561  if (ktr != hgpar_->cellFineIndex_.end()) {
1562  x = hgpar_->cellFineX_[ktr->second];
1563  y = hgpar_->cellFineY_[ktr->second];
1564  }
1565 #ifdef EDM_ML_DEBUG
1566  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
1567  << (ktr != hgpar_->cellFineIndex_.end());
1568 #endif
1569  } else {
1570  auto ktr = hgpar_->cellCoarseIndex_.find(kndx);
1571  if (ktr != hgpar_->cellCoarseIndex_.end()) {
1572  x = hgpar_->cellCoarseX_[ktr->second];
1573  y = hgpar_->cellCoarseY_[ktr->second];
1574  }
1575 #ifdef EDM_ML_DEBUG
1576  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
1577  << (ktr != hgpar_->cellCoarseIndex_.end());
1578 #endif
1579  }
1580  const auto& xy = waferPosition(lay, waferU, waferV, true, false);
1581  x += xy.first;
1582  y += xy.second;
1583 #ifdef EDM_ML_DEBUG
1584  edm::LogVerbatim("HGCalGeom") << "With wafer (" << waferU << "," << waferV << ") " << x << ":" << y;
1585 #endif
1586  double rr = sqrt(x * x + y * y);
1587  int ll = lay - hgpar_->firstLayer_;
1588  bool result = ((rr >= hgpar_->rMinLayHex_[ll]) && (rr <= hgpar_->rMaxLayHex_[ll]));
1589 #ifdef EDM_ML_DEBUG
1590  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << ll << ":" << waferU << ":" << waferV << ":" << cellU << ":"
1591  << cellV << " Position " << x << ":" << y << ":" << rr << " Compare Limits "
1592  << hgpar_->rMinLayHex_[ll] << ":" << hgpar_->rMaxLayHex_[ll] << " Flag " << result;
1593 #endif
1595  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1596  auto partn = waferTypeRotation(lay, waferU, waferV, false, false);
1597  result = HGCalWaferMask::goodCell(cellU, cellV, N, partn.first, partn.second);
1598  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << waferU << ":" << waferV << ":" << cellU << ":" << cellV
1599  << " N " << N << " part " << partn.first << ":" << partn.second << " Result "
1600  << result;
1601  }
1602  return result;
1603 }

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 444 of file HGCalDDDConstants.cc.

444  {
445  // Check validity for a layer|wafer|cell of pre-TDR version
446  bool result(false), resultMod(false);
447  int cellmax(0);
448  if (waferHexagon6()) {
449  int32_t copyNumber = hgpar_->waferCopy_[mod];
450  result = ((lay > 0 && lay <= (int)(layers(reco))));
451  if (result) {
452  const int32_t lay_idx = reco ? (lay - 1) * 3 + 1 : lay;
453  const auto& the_modules = hgpar_->copiesInLayers_[lay_idx];
454  auto moditr = the_modules.find(copyNumber);
455  result = resultMod = (moditr != the_modules.end());
456 #ifdef EDM_ML_DEBUG
457  if (!result)
458  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << lay << ":" << lay_idx << " Copy " << copyNumber
459  << ":" << mod << " Flag " << result;
460 #endif
461  if (result) {
462  if (moditr->second >= 0) {
463  if (mod >= (int)(hgpar_->waferTypeT_.size()))
464  edm::LogWarning("HGCalGeom") << "Module no. out of bound for " << mod << " to be compared with "
465  << (hgpar_->waferTypeT_).size() << " ***** ERROR *****";
466  cellmax = ((hgpar_->waferTypeT_[mod] - 1 == HGCSiliconDetId::HGCalFine) ? (int)(hgpar_->cellFineX_.size())
467  : (int)(hgpar_->cellCoarseX_.size()));
468  result = (cell >= 0 && cell <= cellmax);
469  } else {
470  result = isValidCell(lay_idx, mod, cell);
471  }
472  }
473  }
474  }
475 
476 #ifdef EDM_ML_DEBUG
477  if (!result)
478  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << lay << ":"
479  << (lay > 0 && (lay <= (int)(layers(reco)))) << " Module " << mod << ":" << resultMod
480  << " Cell " << cell << ":" << cellmax << ":" << (cell >= 0 && cell <= cellmax) << ":"
481  << maxCells(reco);
482 #endif
483  return result;
484 }

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 529 of file HGCalDDDConstants.cc.

529  {
530  // First check validity for a layer|wafer| of post TDR version
531  if (!isValidHex8(layer, modU, modV, fullAndPart))
532  return false;
533  int indx = HGCalWaferIndex::waferIndex(layer, modU, modV);
534  auto itr = hgpar_->typesInLayers_.find(indx);
535  int type = hgpar_->waferTypeL_[itr->second];
536  int N = ((hgpar_->waferTypeL_[itr->second] == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_);
537 #ifdef EDM_ML_DEBUG
538  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:Cell " << cellU << ":" << cellV << ":" << N
539  << " Tests " << (cellU >= 0) << ":" << (cellU < 2 * N) << ":" << (cellV >= 0) << ":"
540  << (cellV < 2 * N) << ":" << ((cellV - cellU) < N) << ":" << ((cellU - cellV) <= N);
541 #endif
542  if ((cellU < 0) || (cellU >= 2 * N) || (cellV < 0) || (cellV >= 2 * N))
543  return false;
544  if (((cellV - cellU) >= N) || ((cellU - cellV) > N))
545  return false;
546 
547  return isValidCell8(layer, modU, modV, cellU, cellV, type);
548 }

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 486 of file HGCalDDDConstants.cc.

486  {
487  // Check validity for a layer|wafer|cell of post-TDR version
488  int indx = HGCalWaferIndex::waferIndex(layer, modU, modV);
489  auto itr = hgpar_->typesInLayers_.find(indx);
490 #ifdef EDM_ML_DEBUG
491  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferType " << layer << ":" << modU << ":" << modV
492  << ":" << indx << " Test " << (itr != hgpar_->typesInLayers_.end());
493 #endif
494  if (itr == hgpar_->typesInLayers_.end())
495  return false;
496 
497  if (fullAndPart_) {
498  auto ktr = hgpar_->waferInfoMap_.find(indx);
499 #ifdef EDM_ML_DEBUG
500  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferInfoMap " << layer << ":" << modU << ":"
501  << modV << ":" << indx << " Test " << (ktr != hgpar_->waferInfoMap_.end());
502 #endif
503  if (ktr == hgpar_->waferInfoMap_.end())
504  return false;
505  } else {
506  auto jtr = waferIn_.find(indx);
507 #ifdef EDM_ML_DEBUG
508  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferIn " << jtr->first << ":" << jtr->second;
509 #endif
510  if (!(jtr->second))
511  return false;
512  }
513 
514  if (fullAndPart || fullAndPart_) {
515  auto ktr = hgpar_->waferTypes_.find(indx);
516  if (ktr != hgpar_->waferTypes_.end()) {
517  if (hgpar_->waferMaskMode_ > 0) {
518  if (ktr->second.first == HGCalTypes::WaferOut)
519  return false;
520  } else {
521  if (ktr->second.first < HGCalTypes::WaferCornerMin)
522  return false;
523  }
524  }
525  }
526  return true;
527 }

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 550 of file HGCalDDDConstants.cc.

550  {
551  // Check validity for a layer|eta|phi of scintillator
552  const auto& indx = getIndex(layer, true);
553  if (indx.first < 0)
554  return false;
555  return ((irad >= hgpar_->iradMinBH_[indx.first]) && (irad <= hgpar_->iradMaxBH_[indx.first]) && (iphi > 0) &&
556  (iphi <= hgpar_->scintCells(layer)));
557 }

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 1512 of file HGCalDDDConstants.cc.

1512  {
1513  int ll(-1);
1514  if (waferHexagon6() && reco) {
1515  ll = static_cast<int>(std::find(hgpar_->depthLayerF_.begin(), hgpar_->depthLayerF_.end(), index) -
1516  hgpar_->depthLayerF_.begin());
1517  if (ll == static_cast<int>(hgpar_->depthLayerF_.size()))
1518  ll = -1;
1519  } else {
1520  ll = static_cast<int>(std::find(hgpar_->layerIndex_.begin(), hgpar_->layerIndex_.end(), index) -
1521  hgpar_->layerIndex_.begin());
1522  if (ll == static_cast<int>(hgpar_->layerIndex_.size()))
1523  ll = -1;
1524  }
1525 #ifdef EDM_ML_DEBUG
1526  edm::LogVerbatim("HGCalGeom") << "LayerFromIndex for " << index << ":" << reco << ":" << waferHexagon6() << " is"
1527  << ll << ":" << (ll + hgpar_->firstLayer_);
1528 #endif
1529  return ((ll < 0) ? ll : (ll + hgpar_->firstLayer_));
1530 }

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 563 of file HGCalDDDConstants.cc.

563  {
564  int ll = lay - hgpar_->firstLayer_;
565  if (ll < 0 || ll >= (int)(hgpar_->layerIndex_.size()))
566  return -1;
567  if (waferHexagon6()) {
568  if (reco && ll >= (int)(hgpar_->depthIndex_.size()))
569  return -1;
570  return (reco ? hgpar_->depthLayerF_[ll] : hgpar_->layerIndex_[ll]);
571  } else {
572  return (hgpar_->layerIndex_[ll]);
573  }
574 }

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 576 of file HGCalDDDConstants.cc.

576  {
577  return (reco ? hgpar_->depthIndex_.size() : hgpar_->layerIndex_.size());
578 }

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 687 of file HGCalDDDConstants.cc.

687  {
688  int lay(id.layer()), iphi(id.iphi()), ir(id.iradiusAbs());
689  double phi = (iphi - 0.5) * hgpar_->scintCellSize(lay);
690  int type = (id.type() > 0) ? 1 : 0;
691  double r = (((ir + 1) < static_cast<int>(hgpar_->radiusLayer_[type].size()))
692  ? (0.5 * (hgpar_->radiusLayer_[type][ir] + hgpar_->radiusLayer_[type][ir - 1]))
693  : (1.5 * hgpar_->radiusLayer_[type][ir] - 0.5 * hgpar_->radiusLayer_[type][ir - 1]));
694  if (debug)
695  edm::LogVerbatim("HGCalGeom") << "LocateCell lay:ir:iphi:type " << lay << ":" << ir << ":" << iphi << ":" << type
696  << " r:phi " << r << ":" << convertRadToDeg(phi) << " x:y "
697  << (r * cos(phi) * id.zside()) << ":" << (r * sin(phi));
698  return std::make_pair(r * cos(phi) * id.zside(), r * sin(phi));
699 }

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 663 of file HGCalDDDConstants.cc.

663  {
664  int lay(id.layer());
665  double r = 0.5 * (hgpar_->waferSize_ + hgpar_->sensorSeparation_);
666  double R = 2.0 * r / sqrt3_;
667  int ncells = (id.type() == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
668  int n2 = ncells / 2;
669  auto xyoff = geomTools_.shiftXY(hgpar_->layerCenter_[lay - 1], (2.0 * r));
670  double xpos = xyoff.first + ((-2 * id.waferU() + id.waferV()) * r);
671  double ypos = xyoff.second + (1.5 * id.waferV() * R);
672  if (debug)
673  edm::LogVerbatim("HGCalGeom") << "LocateCell " << id << " Lay " << lay << " r:R " << r << ":" << R << " N "
674  << ncells << ":" << n2 << " Off " << xyoff.first << ":" << xyoff.second << " Pos "
675  << xpos << ":" << ypos;
676  double R1 = hgpar_->waferSize_ / (3.0 * ncells);
677  double r1 = 0.5 * R1 * sqrt3_;
678  xpos += ((1.5 * (id.cellV() - ncells) + 1.0) * R1);
679  ypos += ((id.cellU() - 0.5 * id.cellV() - n2) * 2 * r1);
680  if (debug)
681  edm::LogVerbatim("HGCalGeom") << "LocateCell r1:R1 " << r1 << ":" << R1 << " dx:dy "
682  << ((1.5 * (id.cellV() - ncells) + 1.0) * R1) << ":"
683  << ((id.cellU() - 0.5 * id.cellV() - n2) * 2 * r1) << " Pos " << xpos << ":" << ypos;
684  return std::make_pair(xpos * id.zside(), ypos);
685 }

References debug, geomTools_, hgpar_, phase1PixelTopology::layer, HGCalParameters::layerCenter_, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, dttmaxenums::R, alignCSCRings::r, diffTwoXMLs::r1, HGCalParameters::sensorSeparation_, HGCalGeomTools::shiftXY(), sqrt3_, HGCalParameters::waferSize_, and ecaldqm::zside().

◆ locateCell() [3/4]

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

Definition at line 580 of file HGCalDDDConstants.cc.

580  {
581  // type refers to wafer # for hexagon cell
582  float x(999999.), y(999999.);
583  const auto& index = getIndex(lay, reco);
584  int i = index.first;
585  if (i < 0)
586  return std::make_pair(x, y);
587  if (waferHexagon6()) {
588  x = hgpar_->waferPosX_[type];
589  y = hgpar_->waferPosY_[type];
590 #ifdef EDM_ML_DEBUG
591  float x0(x), y0(y);
592 #endif
594  x += hgpar_->cellFineX_[cell];
595  y += hgpar_->cellFineY_[cell];
596  } else {
597  x += hgpar_->cellCoarseX_[cell];
598  y += hgpar_->cellCoarseY_[cell];
599  }
600 #ifdef EDM_ML_DEBUG
601  edm::LogVerbatim("HGCalGeom") << "LocateCell (Wafer) " << x0 << ":" << y0 << " Final " << x << ":" << y;
602 #endif
603  if (!reco) {
606  }
607  }
608  return std::make_pair(x, y);
609 }

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, getIndex(), 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 611 of file HGCalDDDConstants.cc.

612  {
613  float x(0), y(0);
614  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
615  auto itr = hgpar_->typesInLayers_.find(indx);
616  int type = ((itr == hgpar_->typesInLayers_.end()) ? 2 : hgpar_->waferTypeL_[itr->second]);
617 #ifdef EDM_ML_DEBUG
618  if (debug) {
619  edm::LogVerbatim("HGCalGeom") << "LocateCell " << lay << ":" << waferU << ":" << waferV << ":" << indx << ":"
620  << (itr == hgpar_->typesInLayers_.end()) << ":" << type;
621  }
622 #endif
623  int kndx = cellV * 100 + cellU;
624  if (type == 0) {
625  auto ktr = hgpar_->cellFineIndex_.find(kndx);
626  if (ktr != hgpar_->cellFineIndex_.end()) {
627  x = hgpar_->cellFineX_[ktr->second];
628  y = hgpar_->cellFineY_[ktr->second];
629  }
630 #ifdef EDM_ML_DEBUG
631  if (debug)
632  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
633  << (ktr != hgpar_->cellFineIndex_.end());
634 #endif
635  } else {
636  auto ktr = hgpar_->cellCoarseIndex_.find(kndx);
637  if (ktr != hgpar_->cellCoarseIndex_.end()) {
638  x = hgpar_->cellCoarseX_[ktr->second];
639  y = hgpar_->cellCoarseY_[ktr->second];
640  }
641 #ifdef EDM_ML_DEBUG
642  if (debug)
643  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
644  << (ktr != hgpar_->cellCoarseIndex_.end());
645 #endif
646  }
647  if (!reco) {
650  }
651  if (all) {
652  const auto& xy = waferPosition(lay, waferU, waferV, reco, debug);
653  x += xy.first;
654  y += xy.second;
655 #ifdef EDM_ML_DEBUG
656  if (debug)
657  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << ":" << xy.first << ":" << xy.second;
658 #endif
659  }
660  return std::make_pair(x, y);
661 }

References python.cmstools::all(), HGCalParameters::cellCoarseIndex_, HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineIndex_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, debug, 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 717 of file HGCalDDDConstants.cc.

717  {
718  float x(0), y(0);
719  const auto& indx = getIndex(lay, reco);
720  if (indx.first >= 0) {
721  int ir = std::abs(irad);
722  int type = hgpar_->scintType(lay);
723  double phi = (iphi - 0.5) * indx.second;
724  double z = hgpar_->zLayerHex_[indx.first];
725  double r = 0.5 * (hgpar_->radiusLayer_[type][ir - 1] + hgpar_->radiusLayer_[type][ir]);
726  std::pair<double, double> range = rangeR(z, true);
727 #ifdef EDM_ML_DEBUG
728  edm::LogVerbatim("HGCalGeom") << "locateCellTrap:: Input " << lay << ":" << irad << ":" << iphi << ":" << reco
729  << " IR " << ir << ":" << hgpar_->iradMinBH_[indx.first] << ":"
730  << hgpar_->iradMaxBH_[indx.first] << " Type " << type << " Z " << indx.first << ":"
731  << z << " phi " << phi << " R " << r << ":" << range.first << ":" << range.second;
732 #endif
734  r = std::max(range.first, std::min(r, range.second));
735  x = r * std::cos(phi);
736  y = r * std::sin(phi);
737  if (irad < 0)
738  x = -x;
739  }
740  if (!reco) {
743  }
744  return std::make_pair(x, y);
745 }

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 747 of file HGCalDDDConstants.cc.

747  {
748  bool mask(false);
749  if (corners > 2 && corners <= (int)(HGCalParameters::k_CornerSize)) {
750  if (waferHexagon8()) {
751  int N(0), layer(0), waferU(0), waferV(0), u(0), v(0);
752  if (detId.det() == DetId::Forward) {
753  HFNoseDetId id(detId);
754  N = getUVMax(id.type());
755  layer = id.layer();
756  waferU = id.waferU();
757  waferV = id.waferV();
758  u = id.cellU();
759  v = id.cellV();
760  } else {
761  HGCSiliconDetId id(detId);
762  N = getUVMax(id.type());
763  layer = id.layer();
764  waferU = id.waferU();
765  waferV = id.waferV();
766  u = id.cellU();
767  v = id.cellV();
768  }
770  auto itr = hgpar_->waferTypes_.find(wl);
771 #ifdef EDM_ML_DEBUG
772  edm::LogVerbatim("HGCalGeom") << "MaskCell: Layer " << layer << " Wafer " << waferU << ":" << waferV << " Index "
773  << wl << ":" << (itr != hgpar_->waferTypes_.end());
774 #endif
775  if (itr != hgpar_->waferTypes_.end()) {
776  if ((itr->second).second <= HGCalWaferMask::k_OffsetRotation)
777  mask = HGCalWaferMask::maskCell(u, v, N, (itr->second).first, (itr->second).second, corners);
778  else
779  mask = !(HGCalWaferMask::goodCell(
780  u, v, N, (itr->second).first, ((itr->second).second - HGCalWaferMask::k_OffsetRotation)));
781  }
782  }
783  }
784  return mask;
785 }

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 787 of file HGCalDDDConstants.cc.

787  {
788  int cells(0);
789  for (unsigned int i = 0; i < layers(reco); ++i) {
790  int lay = reco ? hgpar_->depth_[i] : hgpar_->layer_[i];
791  if (cells < maxCells(lay, reco))
792  cells = maxCells(lay, reco);
793  }
794  return cells;
795 }

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 797 of file HGCalDDDConstants.cc.

797  {
798  const auto& index = getIndex(lay, reco);
799  if (index.first < 0)
800  return 0;
801  if (waferHexagon6()) {
802  unsigned int cells(0);
803  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
804  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
805  unsigned int cell = (hgpar_->waferTypeT_[k] - 1 == HGCSiliconDetId::HGCalFine) ? (hgpar_->cellFineX_.size())
806  : (hgpar_->cellCoarseX_.size());
807  if (cell > cells)
808  cells = cell;
809  }
810  }
811  return (int)(cells);
812  } else if (waferHexagon8()) {
813  int cells(0);
814  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
815  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
819  : hgpar_->waferTypeL_[itr->second]);
821  cells = std::max(cells, 3 * N * N);
822  }
823  }
824  return cells;
825  } else if (tileTrapezoid()) {
826  return hgpar_->scintCells(index.first + hgpar_->firstLayer_);
827  } else {
828  return 0;
829  }
830 }

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 90 of file HGCalDDDConstants.h.

90 { 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 93 of file HGCalDDDConstants.h.

93 { return modHalf_; }

References modHalf_.

◆ maxModulesPerLayer()

int HGCalDDDConstants::maxModulesPerLayer ( ) const
inline

Definition at line 94 of file HGCalDDDConstants.h.

94 { return maxWafersPerLayer_; }

References maxWafersPerLayer_.

◆ maxRows()

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

Definition at line 832 of file HGCalDDDConstants.cc.

832  {
833  int kymax(0);
834  const auto& index = getIndex(lay, reco);
835  int i = index.first;
836  if (i < 0)
837  return kymax;
838  if (waferHexagon6()) {
839  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
841  int ky = ((hgpar_->waferCopy_[k]) / 100) % 100;
842  if (ky > kymax)
843  kymax = ky;
844  }
845  }
846  } else if (waferHexagon8()) {
847  kymax = 1 + 2 * hgpar_->waferUVMaxLayer_[index.first];
848  }
849  return kymax;
850 }

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 96 of file HGCalDDDConstants.h.

96 { 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 852 of file HGCalDDDConstants.cc.

852  {
853  // Modify u/v for transition of type1 to type2
854  return (((type1 == type2) || (type1 * type2 != 0)) ? uv : ((type1 == 0) ? (2 * uv + 1) / 3 : (3 * uv) / 2));
855 }

Referenced by HGCalTopology::neighbors().

◆ modules()

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

Definition at line 857 of file HGCalDDDConstants.cc.

857  {
858  if (getIndex(lay, reco).first < 0)
859  return 0;
860  else
861  return max_modules_layer_[(int)reco][lay];
862 }

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

Referenced by wafers().

◆ modulesInit()

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

Definition at line 864 of file HGCalDDDConstants.cc.

864  {
865  int nmod(0);
866  const auto& index = getIndex(lay, reco);
867  if (index.first < 0)
868  return nmod;
869  if (!tileTrapezoid()) {
870  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
871  if (waferInLayerTest(k, index.first, hgpar_->defineFull_))
872  ++nmod;
873  }
874  } else {
875  nmod = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
876  }
877  return nmod;
878 }

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 884 of file HGCalDDDConstants.cc.

884  {
885  int cells(0);
886  unsigned int nlayer = (reco) ? hgpar_->depth_.size() : hgpar_->layer_.size();
887  for (unsigned k = 0; k < nlayer; ++k) {
888  std::vector<int> ncells = numberCells(((reco) ? hgpar_->depth_[k] : hgpar_->layer_[k]), reco);
889  cells = std::accumulate(ncells.begin(), ncells.end(), cells);
890  }
891  return cells;
892 }

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 894 of file HGCalDDDConstants.cc.

894  {
895  const auto& index = getIndex(lay, reco);
896  int i = index.first;
897  std::vector<int> ncell;
898  if (i >= 0) {
899  if (waferHexagon6()) {
900  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
902  unsigned int cell = (hgpar_->waferTypeT_[k] - 1 == HGCSiliconDetId::HGCalFine)
903  ? (hgpar_->cellFineX_.size())
904  : (hgpar_->cellCoarseX_.size());
905  ncell.emplace_back((int)(cell));
906  }
907  }
908  } else if (tileTrapezoid()) {
909  int nphi = hgpar_->scintCells(lay);
910  for (int k = hgpar_->firstModule_[i]; k <= hgpar_->lastModule_[i]; ++k)
911  ncell.emplace_back(nphi);
912  } else {
913  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
914  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
915  int cell = numberCellsHexagon(lay,
918  true);
919  ncell.emplace_back(cell);
920  }
921  }
922  }
923  }
924  return ncell;
925 }

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 927 of file HGCalDDDConstants.cc.

927  {
928  if (wafer >= 0 && wafer < (int)(hgpar_->waferTypeT_.size())) {
929  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine)
930  return (int)(hgpar_->cellFineX_.size());
931  else
932  return (int)(hgpar_->cellCoarseX_.size());
933  } else {
934  return 0;
935  }
936 }

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 949 of file HGCalDDDConstants.cc.

949  {
950  double rmin(0), rmax(0), zz(0);
951  if (hgpar_->detectorType_ > 0) {
952  zz = (reco ? std::abs(z) : HGCalParameters::k_ScaleFromDDD * std::abs(z));
953  if (hgpar_->detectorType_ <= 2) {
955  } else {
956  rmin = HGCalGeomTools::radius(
958  }
959  if ((hgpar_->detectorType_ == 2) && (zz >= hgpar_->zLayerHex_[hgpar_->firstMixedLayer_ - 1])) {
960  rmax = HGCalGeomTools::radius(
962  } else {
964  }
965  }
966  if (!reco) {
969  }
970 #ifdef EDM_ML_DEBUG
971  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << z << ":" << zz << " R " << rmin << ":" << rmax;
972 #endif
973  return std::make_pair(rmin, rmax);
974 }

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 976 of file HGCalDDDConstants.cc.

976  {
977  double rmin(0), rmax(0);
978  const auto& index = getIndex(lay, reco);
979  if (index.first >= 0 && index.first < static_cast<int>(hgpar_->rMinLayHex_.size())) {
980  rmin = hgpar_->rMinLayHex_[index.first];
981  rmax = hgpar_->rMaxLayHex_[index.first];
982  }
983  if (!reco) {
986  }
987 #ifdef EDM_ML_DEBUG
988  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << lay << ":" << index.first << " R " << rmin << ":"
989  << rmax;
990 #endif
991  return std::make_pair(rmin, rmax);
992 }

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

◆ rangeZ()

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

Definition at line 994 of file HGCalDDDConstants.cc.

994  {
995  double zmin = (hgpar_->zLayerHex_[0] - hgpar_->waferThick_);
996  double zmax = (hgpar_->zLayerHex_[hgpar_->zLayerHex_.size() - 1] + hgpar_->waferThick_);
997 #ifdef EDM_ML_DEBUG
998  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeZ: " << zmin << ":" << zmax << ":" << hgpar_->waferThick_;
999 #endif
1000  if (!reco) {
1003  }
1004  return std::make_pair(zmin, zmax);
1005 }

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 1007 of file HGCalDDDConstants.cc.

1007  {
1008  int row(0), col(0);
1009  if (wafer < (int)(hgpar_->waferCopy_.size())) {
1010  int copy = hgpar_->waferCopy_[wafer];
1013  ;
1014  }
1015  return std::make_pair(row, col);
1016 }

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 1018 of file HGCalDDDConstants.cc.

1018  {
1019  if (!waferHexagon6()) {
1020  return std::make_pair(cell, lay);
1021  } else {
1022  const auto& index = getIndex(lay, false);
1023  int i = index.first;
1024  if (i < 0) {
1025  edm::LogWarning("HGCalGeom") << "Wrong Layer # " << lay << " not in the list ***** ERROR *****";
1026  return std::make_pair(-1, -1);
1027  }
1028  if (mod >= (int)(hgpar_->waferTypeL_).size()) {
1029  edm::LogWarning("HGCalGeom") << "Invalid Wafer # " << mod << "should be < " << (hgpar_->waferTypeL_).size()
1030  << " ***** ERROR *****";
1031  return std::make_pair(-1, -1);
1032  }
1033  int depth(-1);
1034  int kx = cell;
1035  int type = hgpar_->waferTypeL_[mod];
1036  if (type == 1) {
1037  depth = hgpar_->layerGroup_[i];
1038  } else if (type == 2) {
1039  depth = hgpar_->layerGroupM_[i];
1040  } else {
1041  depth = hgpar_->layerGroupO_[i];
1042  }
1043  return std::make_pair(kx, depth);
1044  }
1045 }

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 111 of file HGCalDDDConstants.h.

111 { 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 116 of file HGCalDDDConstants.h.

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

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 126 of file HGCalDDDConstants.h.

126 { 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 148 of file HGCalDDDConstants.h.

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

References waferMax_.

◆ waferFileIndex()

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

Definition at line 155 of file HGCalDDDConstants.h.

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

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 163 of file HGCalDDDConstants.h.

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

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

◆ waferFileInfoExist()

bool HGCalDDDConstants::waferFileInfoExist ( int  kk) const
inline

Definition at line 178 of file HGCalDDDConstants.h.

178 { 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 171 of file HGCalDDDConstants.h.

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

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

◆ waferFileSize()

unsigned int HGCalDDDConstants::waferFileSize ( ) const
inline

Definition at line 154 of file HGCalDDDConstants.h.

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

References hgpar_, and HGCalParameters::waferInfoMap_.

Referenced by waferType(), and waferTypeRotation().

◆ waferFromCopy()

int HGCalDDDConstants::waferFromCopy ( int  copy) const

Definition at line 1047 of file HGCalDDDConstants.cc.

1047  {
1048  const int ncopies = hgpar_->waferCopy_.size();
1049  int wafer(ncopies);
1050  bool result(false);
1051  for (int k = 0; k < ncopies; ++k) {
1052  if (copy == hgpar_->waferCopy_[k]) {
1053  wafer = k;
1054  result = true;
1055  break;
1056  }
1057  }
1058  if (!result) {
1059  wafer = -1;
1060 #ifdef EDM_ML_DEBUG
1061  edm::LogVerbatim("HGCalGeom") << "Cannot find " << copy << " in a list of " << ncopies << " members";
1062  for (int k = 0; k < ncopies; ++k)
1063  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << hgpar_->waferCopy_[k];
1064 #endif
1065  }
1066 #ifdef EDM_ML_DEBUG
1067  edm::LogVerbatim("HGCalGeom") << "WaferFromCopy " << copy << ":" << wafer << ":" << result;
1068 #endif
1069  return wafer;
1070 }

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 1114 of file HGCalDDDConstants.cc.

1123  {
1124  int ll = layer - hgpar_->firstLayer_;
1127  waferU = waferV = 1 + hgpar_->waferUVMax_;
1128  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1129  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1130  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1131  if (dx <= rmax_ && dy <= hexside_) {
1132  if ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy))) {
1138  } else {
1140  celltype = ((itr == hgpar_->typesInLayers_.end()) ? HGCSiliconDetId::HGCalCoarseThick
1141  : hgpar_->waferTypeL_[itr->second]);
1142  }
1143 #ifdef EDM_ML_DEBUG
1144  if (debug)
1145  edm::LogVerbatim("HGCalGeom") << "WaferFromPosition:: Input " << layer << ":" << ll << ":"
1146  << hgpar_->firstLayer_ << ":" << x << ":" << y << ":" << hgpar_->xLayerHex_[ll]
1147  << ":" << hgpar_->yLayerHex_[ll] << ":" << xx << ":" << yy << " compared with "
1148  << hgpar_->waferPosX_[k] << ":" << hgpar_->waferPosY_[k] << " difference " << dx
1149  << ":" << dy << ":" << dx * tan30deg_ << ":" << (hexside_ - dy)
1150  << " comparator " << rmax_ << ":" << hexside_ << " wafer " << waferU << ":"
1151  << waferV << ":" << celltype;
1152 #endif
1153  xx -= hgpar_->waferPosX_[k];
1154  yy -= hgpar_->waferPosY_[k];
1155  break;
1156  }
1157  }
1158  }
1159  if ((std::abs(waferU) <= hgpar_->waferUVMax_) && (celltype >= 0)) {
1160  cellHex(xx, yy, celltype, cellU, cellV, debug);
1161  wt = ((celltype < 2) ? (hgpar_->cellThickness_[celltype] / hgpar_->waferThick_) : 1.0);
1162  } else {
1163  cellU = cellV = 2 * hgpar_->nCellsFine_;
1164  wt = 1.0;
1165  celltype = -1;
1166  }
1167 #ifdef EDM_ML_DEBUG
1168  if (celltype < 0) {
1171  edm::LogVerbatim("HGCalGeom") << "waferFromPosition: Bad type for X " << x << ":" << x1 << ":" << xx << " Y " << y
1172  << ":" << y1 << ":" << yy << " Wafer " << waferU << ":" << waferV << " Cell " << cellU
1173  << ":" << cellV;
1174  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1175  double dx = std::abs(x1 - hgpar_->waferPosX_[k]);
1176  double dy = std::abs(y1 - hgpar_->waferPosY_[k]);
1177  edm::LogVerbatim("HGCalGeom") << "Wafer [" << k << "] Position (" << hgpar_->waferPosX_[k] << ", "
1178  << hgpar_->waferPosY_[k] << ") difference " << dx << ":" << dy << ":"
1179  << dx * tan30deg_ << ":" << hexside_ - dy << " Paramerers " << rmax_ << ":"
1180  << hexside_;
1181  }
1182  }
1183 #endif
1184 }

References funct::abs(), cellHex(), HGCalParameters::cellThickness_, debug, PVValHelper::dx, PVValHelper::dy, HGCalParameters::firstLayer_, HGCalWaferType::getType(), 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, 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 1072 of file HGCalDDDConstants.cc.

1072  {
1073  // Input x, y in Geant4 unit and transformed to CMSSW standard
1076  int size_ = (int)(hgpar_->waferCopy_.size());
1077  wafer = size_;
1078  for (int k = 0; k < size_; ++k) {
1079  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1080  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1081  if (dx <= rmax_ && dy <= hexside_) {
1082  if ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy))) {
1083  wafer = k;
1084  celltyp = hgpar_->waferTypeT_[k];
1085  xx -= hgpar_->waferPosX_[k];
1086  yy -= hgpar_->waferPosY_[k];
1087  break;
1088  }
1089  }
1090  }
1091  if (wafer < size_) {
1092  if (celltyp - 1 == HGCSiliconDetId::HGCalFine)
1093  icell = cellHex(
1095  else
1096  icell = cellHex(xx,
1097  yy,
1100  hgpar_->cellCoarseY_);
1101  } else {
1102  wafer = -1;
1103 #ifdef EDM_ML_DEBUG
1104  edm::LogWarning("HGCalGeom") << "Cannot get wafer type corresponding to " << x << ":" << y << " " << xx << ":"
1105  << yy;
1106 #endif
1107  }
1108 #ifdef EDM_ML_DEBUG
1109  edm::LogVerbatim("HGCalGeom") << "Position " << x << ":" << y << " Wafer " << wafer << ":" << size_ << " XX " << xx
1110  << ":" << yy << " Cell " << icell << " Type " << celltyp;
1111 #endif
1112 }

References funct::abs(), HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, cellHex(), HGCalParameters::cellSize_, PVValHelper::dx, PVValHelper::dy, hexside_, HGCSiliconDetId::HGCalFine, hgpar_, createfilelist::int, 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 1193 of file HGCalDDDConstants.cc.

1193  {
1194  const auto& indx = getIndex(lay, reco);
1195  if (indx.first < 0)
1196  return false;
1197  return waferInLayerTest(wafer, indx.first, false);
1198 }

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 1605 of file HGCalDDDConstants.cc.

1605  {
1606  int layer = layerFromIndex(index, true);
1610 #ifdef EDM_ML_DEBUG
1611  edm::LogVerbatim("HGCalGeom") << "WaferIndex for " << wafer << ":" << index << " (" << layer << ":" << waferU << ":"
1612  << waferV << ") " << indx;
1613 #endif
1614  return indx;
1615 }

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 1186 of file HGCalDDDConstants.cc.

1186  {
1187  const auto& indx = getIndex(lay, reco);
1188  if (indx.first < 0)
1189  return false;
1190  return waferInLayerTest(wafer, indx.first, hgpar_->defineFull_);
1191 }

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 1617 of file HGCalDDDConstants.cc.

1617  {
1618  bool in = (waferHexagon6()) ? true : false;
1619  if (!in) {
1620  double xpos = hgpar_->waferPosX_[wafer] + hgpar_->xLayerHex_[lay];
1621  double ypos = hgpar_->waferPosY_[wafer] + hgpar_->yLayerHex_[lay];
1622  std::pair<int, int> corner = HGCalGeomTools::waferCorner(
1623  xpos, ypos, rmax_, hexside_, hgpar_->rMinLayHex_[lay], hgpar_->rMaxLayHex_[lay], in);
1624  in = (full ? (corner.first > 0) : (corner.first == (int)(HGCalParameters::k_CornerSize)));
1625  if (in && fullAndPart_) {
1626  int indx = waferIndex(wafer, lay);
1627  in = (hgpar_->waferInfoMap_.find(indx) != hgpar_->waferInfoMap_.end());
1628 #ifdef EDM_ML_DEBUG
1629  if (!in)
1630  edm::LogVerbatim("HGCalGeom") << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " index " << indx
1631  << "( " << HGCalWaferIndex::waferLayer(indx) << ", "
1632  << HGCalWaferIndex::waferU(indx) << ", " << HGCalWaferIndex::waferV(indx)
1633  << ") in " << in;
1634 #endif
1635  }
1636 #ifdef EDM_ML_DEBUG
1637  edm::LogVerbatim("HGCalGeom") << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " R-limits "
1638  << hgpar_->rMinLayHex_[lay] << ":" << hgpar_->rMaxLayHex_[lay] << " Corners "
1639  << corner.first << ":" << corner.second << " In " << in;
1640 #endif
1641  }
1642  return in;
1643 }

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 149 of file HGCalDDDConstants.h.

149 { return waferMax_[1]; }

References waferMax_.

Referenced by HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

◆ waferMin()

int HGCalDDDConstants::waferMin ( ) const
inline

Definition at line 150 of file HGCalDDDConstants.h.

150 { return waferMax_[0]; }

References waferMax_.

Referenced by HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

◆ waferParameters()

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

Definition at line 1200 of file HGCalDDDConstants.cc.

1200  {
1201  if (reco)
1202  return std::make_pair(rmax_, hexside_);
1203  else
1205 }

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 1220 of file HGCalDDDConstants.cc.

1221  {
1222  int ll = lay - hgpar_->firstLayer_;
1223  double x = hgpar_->xLayerHex_[ll];
1224  double y = hgpar_->yLayerHex_[ll];
1225 #ifdef EDM_ML_DEBUG
1226  if (debug)
1227  edm::LogVerbatim("HGCalGeom") << "Layer " << lay << ":" << ll << " Shift " << hgpar_->xLayerHex_[ll] << ":"
1228  << hgpar_->yLayerHex_[ll];
1229 #endif
1230  if (!reco) {
1233  }
1234 
1235  const auto& xy = waferPosition(waferU, waferV, reco);
1236  x += xy.first;
1237  y += xy.second;
1238 #ifdef EDM_ML_DEBUG
1239  if (debug)
1240  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << ":" << xy.first << ":" << xy.second;
1241 #endif
1242  return std::make_pair(x, y);
1243 }

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 1207 of file HGCalDDDConstants.cc.

1207  {
1208  double xx(0), yy(0);
1209  if (wafer >= 0 && wafer < (int)(hgpar_->waferPosX_.size())) {
1210  xx = hgpar_->waferPosX_[wafer];
1211  yy = hgpar_->waferPosY_[wafer];
1212  }
1213  if (!reco) {
1216  }
1217  return std::make_pair(xx, yy);
1218 }

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 1645 of file HGCalDDDConstants.cc.

1645  {
1646  double xx(0), yy(0);
1647  int indx = HGCalWaferIndex::waferIndex(0, waferU, waferV);
1648  auto itr = hgpar_->wafersInLayers_.find(indx);
1649  if (itr != hgpar_->wafersInLayers_.end()) {
1650  xx = hgpar_->waferPosX_[itr->second];
1651  yy = hgpar_->waferPosY_[itr->second];
1652  }
1653  if (!reco) {
1656  }
1657  return std::make_pair(xx, yy);
1658 }

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 1398 of file HGCalDDDConstants.cc.

1398  {
1399  int wafer(0);
1400  if (!tileTrapezoid()) {
1401  for (unsigned int i = 0; i < layers(true); ++i) {
1402  int lay = hgpar_->depth_[i];
1403  wafer += modules(lay, true);
1404  }
1405  } else {
1406  wafer = (int)(hgpar_->moduleLayR_.size());
1407  }
1408  return wafer;
1409 }

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 1411 of file HGCalDDDConstants.cc.

1411  {
1412  int wafer(0);
1413  if (!tileTrapezoid()) {
1414  auto itr = waferLayer_.find(layer);
1415  if (itr != waferLayer_.end()) {
1416  unsigned ity = (type > 0 && type <= 2) ? type : 0;
1417  wafer = (itr->second)[ity];
1418  }
1419  } else {
1420  const auto& index = getIndex(layer, true);
1421  wafer = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
1422  }
1423  return wafer;
1424 }

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 187 of file HGCalDDDConstants.h.

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

References hgpar_, and HGCalParameters::waferCopy_.

◆ waferType() [1/3]

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

Definition at line 1245 of file HGCalDDDConstants.cc.

1245  {
1246  int type(1);
1247  if (waferHexagon8()) {
1248  if (fromFile && (waferFileSize() > 0)) {
1249  int layer(0), waferU(0), waferV(0);
1250  if (id.det() != DetId::Forward) {
1251  HGCSiliconDetId hid(id);
1252  layer = hid.layer();
1253  waferU = hid.waferU();
1254  waferV = hid.waferV();
1255  } else {
1256  HFNoseDetId hid(id);
1257  layer = hid.layer();
1258  waferU = hid.waferU();
1259  waferV = hid.waferV();
1260  }
1262  if (itr != hgpar_->waferInfoMap_.end())
1263  type = (itr->second).type;
1264  } else {
1265  type = ((id.det() != DetId::Forward) ? HGCSiliconDetId(id).type() : HFNoseDetId(id).type());
1266  }
1267  } else if (waferHexagon6()) {
1268  type = waferTypeL(HGCalDetId(id).wafer()) - 1;
1269  }
1270  return type;
1271 }

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 1292 of file HGCalDDDConstants.cc.

1292  {
1293  const auto& index = HGCalWaferIndex::waferIndex(id.layer(), id.waferU(), id.waferV());
1294  int type(-1), part(-1), orient(-1);
1295  if (fromFile && (waferFileSize() > 0)) {
1296  auto itr = hgpar_->waferInfoMap_.find(index);
1297  if (itr != hgpar_->waferInfoMap_.end()) {
1298  type = (itr->second).type;
1299  part = (itr->second).part;
1300  orient = (itr->second).orient;
1301  }
1302  } else {
1303  auto ktr = hgpar_->typesInLayers_.find(index);
1304  if (ktr != hgpar_->typesInLayers_.end())
1305  type = hgpar_->waferTypeL_[ktr->second];
1306  auto itr = hgpar_->waferTypes_.find(index);
1307  if (itr != hgpar_->waferTypes_.end()) {
1308  if ((itr->second).second < HGCalWaferMask::k_OffsetRotation) {
1309  orient = (itr->second).second;
1310  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1312  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1314  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1316  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1318  }
1319  } else {
1320  part = (itr->second).first;
1321  orient = ((itr->second).second - HGCalWaferMask::k_OffsetRotation);
1322  }
1323  } else {
1325  orient = 0;
1326  }
1327  }
1328  return std::make_tuple(type, part, orient);
1329 }

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 1273 of file HGCalDDDConstants.cc.

1273  {
1275  if (waferHexagon8()) {
1276  if (fromFile && (waferFileSize() > 0)) {
1278  if (itr != hgpar_->waferInfoMap_.end())
1279  type = (itr->second).type;
1280  } else {
1282  if (itr != hgpar_->typesInLayers_.end())
1283  type = hgpar_->waferTypeL_[itr->second];
1284  }
1285  } else if (waferHexagon6()) {
1286  if ((waferU >= 0) && (waferU < (int)(hgpar_->waferTypeL_.size())))
1287  type = (hgpar_->waferTypeL_[waferU] - 1);
1288  }
1289  return type;
1290 }

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 196 of file HGCalDDDConstants.h.

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

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 1331 of file HGCalDDDConstants.cc.

1332  {
1333  int type(HGCalTypes::WaferOut), rotn(0);
1335  bool withinList(true);
1336  if (fromFile && (waferFileSize() > 0)) {
1337  auto itr = hgpar_->waferInfoMap_.find(wl);
1338  withinList = (itr != hgpar_->waferInfoMap_.end());
1339  if (withinList) {
1340  type = (itr->second).part;
1341  rotn = (itr->second).orient;
1342  }
1343  } else {
1344  auto itr = hgpar_->waferTypes_.find(wl);
1345  if (waferHexagon8()) {
1346  withinList = (itr != hgpar_->waferTypes_.end());
1347  if (withinList) {
1348  if ((itr->second).second < HGCalWaferMask::k_OffsetRotation) {
1349  rotn = (itr->second).second;
1350  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1352  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1354  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1356  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1358  }
1359  } else {
1360  type = (itr->second).first;
1361  rotn = ((itr->second).second - HGCalWaferMask::k_OffsetRotation);
1362  }
1363  } else {
1365  rotn = HGCalTypes::WaferCorner0;
1366  }
1367  }
1368  }
1369 #ifdef EDM_ML_DEBUG
1370  if (debug)
1371  edm::LogVerbatim("HGCalGeom") << "waferTypeRotation: Layer " << layer << " Wafer " << waferU << ":" << waferV
1372  << " Index " << std::hex << wl << std::dec << ":" << withinList << " Type " << type
1373  << " Rotation " << rotn;
1374 #endif
1375  return std::make_pair(type, rotn);
1376 }

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 192 of file HGCalDDDConstants.h.

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

References hgpar_, and HGCalParameters::waferTypeT_.

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

◆ waferUVMax()

int HGCalDDDConstants::waferUVMax ( ) const
inline

Definition at line 204 of file HGCalDDDConstants.h.

204 { 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 1378 of file HGCalDDDConstants.cc.

1378  {
1379  bool type(false);
1380  if (waferHexagon8()) {
1382  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1383  } else if (waferHexagon6()) {
1384  int wl = HGCalWaferIndex::waferIndex(layer, waferU, 0, true);
1385  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1386  }
1387  return type;
1388 }

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 225 of file HGCalDDDConstants.h.

◆ fullAndPart_

bool HGCalDDDConstants::fullAndPart_
private

Definition at line 233 of file HGCalDDDConstants.h.

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

◆ geomTools_

HGCalGeomTools HGCalDDDConstants::geomTools_
private

Definition at line 223 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 224 of file HGCalDDDConstants.h.

◆ max_modules_layer_

Simrecovecs HGCalDDDConstants::max_modules_layer_
private

Definition at line 236 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and modules().

◆ maxWafersPerLayer_

int32_t HGCalDDDConstants::maxWafersPerLayer_
private

Definition at line 237 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and maxModulesPerLayer().

◆ mode_

HGCalGeometryMode::GeometryMode HGCalDDDConstants::mode_
private

◆ modHalf_

int32_t HGCalDDDConstants::modHalf_
private

Definition at line 234 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and maxModules().

◆ rmax_

double HGCalDDDConstants::rmax_
private

◆ sqrt3_

const double HGCalDDDConstants::sqrt3_
private

Definition at line 230 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 235 of file HGCalDDDConstants.h.

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

◆ tot_wafers_

int32_t HGCalDDDConstants::tot_wafers_
private

Definition at line 234 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants().

◆ waferIn_

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

Definition at line 240 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and isValidHex8().

◆ waferLayer_

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

Definition at line 238 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and wafers().

◆ waferMax_

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

Definition at line 239 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:234
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:229
cms::cuda::wmax
__host__ __device__ V V wmax
Definition: HistoContainer.h:136
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:229
HGCalParameters::moduleCellS_
std::vector< double > moduleCellS_
Definition: HGCalParameters.h:82
HGCalParameters::firstLayer_
int firstLayer_
Definition: HGCalParameters.h:172
HGCalDDDConstants::waferFromPosition
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
Definition: HGCalDDDConstants.cc:1072
HGCalDDDConstants::maxWafersPerLayer_
int32_t maxWafersPerLayer_
Definition: HGCalDDDConstants.h:237
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:1426
HGCalDDDConstants::sqrt3_
const double sqrt3_
Definition: HGCalDDDConstants.h:230
HGCalDDDConstants::modulesInit
int modulesInit(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:864
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:240
HGCalDDDConstants::isValidCell
bool isValidCell(int layindex, int wafer, int cell) const
Definition: HGCalDDDConstants.cc:1532
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
HGCalTypes::WaferThree
Definition: HGCalTypes.h:57
HGCalTypes::WaferFull
Definition: HGCalTypes.h:50
mod
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
cuy.col
col
Definition: cuy.py:1010
HGCalParameters::k_CornerSize
static constexpr uint32_t k_CornerSize
Definition: HGCalParameters.h:44
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
HGCalWaferIndex::waferU
int32_t waferU(const int32_t index)
Definition: HGCalWaferIndex.cc:27
HGCalDDDConstants::waferHexagon8
bool waferHexagon8() const
Definition: HGCalDDDConstants.h:142
HGCalParameters::slopeTop_
std::vector< double > slopeTop_
Definition: HGCalParameters.h:168
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
if
if(0==first)
Definition: CAHitNtupletGeneratorKernelsImpl.h:48
cells
const caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple cms::cuda::AtomicPairCounter const GPUCACell *__restrict__ cells
Definition: CAHitNtupletGeneratorKernelsImpl.h:33
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:176
HGCalParameters::waferSize_
double waferSize_
Definition: HGCalParameters.h:144
HGCalTypes::WaferOut
Definition: HGCalTypes.h:58
HGCalTypes::WaferCornerMin
static constexpr int32_t WaferCornerMin
Definition: HGCalTypes.h:61
HGCalGeomTools::shiftXY
std::pair< double, double > shiftXY(int waferPosition, double waferSize) const
Definition: HGCalGeomTools.cc:176
full
Definition: GenABIO.cc:168
DDAxes::x
HGCalGeometryMode::Hexagon8Module
Definition: HGCalGeometryMode.h:34
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
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
HGCalTypes::WaferFive
Definition: HGCalTypes.h:51
HFNoseDetId
Definition: HFNoseDetId.h:22
HGCalParameters::iradMaxBH_
std::vector< int > iradMaxBH_
Definition: HGCalParameters.h:164
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:26
HGCalTypes::SiPMLarge
Definition: HGCalTypes.h:78
HGCalDDDConstants::max_modules_layer_
Simrecovecs max_modules_layer_
Definition: HGCalDDDConstants.h:236
HGCSiliconDetId::HGCalCoarseThick
Definition: HGCSiliconDetId.h:24
HGCalDDDConstants::geomTools_
HGCalGeomTools geomTools_
Definition: HGCalDDDConstants.h:223
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:1512
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:1331
HGCalDDDConstants::isValidHex8
bool isValidHex8(int lay, int waferU, int waferV, bool fullAndPart=false) const
Definition: HGCalDDDConstants.cc:486
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:1245
HGCalDDDConstants::waferHexagon6
bool waferHexagon6() const
Definition: HGCalDDDConstants.h:139
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:1556
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
HGCalDDDConstants::mode_
HGCalGeometryMode::GeometryMode mode_
Definition: HGCalDDDConstants.h:232
trackingPlots.hp
hp
Definition: trackingPlots.py:1230
HGCalParameters::radiusLayer_
std::vector< double > radiusLayer_[2]
Definition: HGCalParameters.h:162
HGCalParameters::cellFineHalf_
std::vector< bool > cellFineHalf_
Definition: HGCalParameters.h:123
HGCalDDDConstants::maxCells
int maxCells(bool reco) const
Definition: HGCalDDDConstants.cc:787
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
HGCalParameters::layerGroup_
std::vector< int > layerGroup_
Definition: HGCalParameters.h:105
HGCalParameters::radiusMixBoundary_
std::vector< double > radiusMixBoundary_
Definition: HGCalParameters.h:158
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:1186
HGCalParameters::waferUVMax_
int waferUVMax_
Definition: HGCalParameters.h:148
DDAxes::z
HGCalDDDConstants::layerIndex
int layerIndex(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:563
N
#define N
Definition: blowfish.cc:9
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:288
HGCalWaferType::getType
int getType(double xpos, double ypos, double zpos)
Definition: HGCalWaferType.cc:36
HGCalDDDConstants::waferFileSize
unsigned int waferFileSize() const
Definition: HGCalDDDConstants.h:154
HGCalDDDConstants::wafers
int wafers() const
Definition: HGCalDDDConstants.cc:1398
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition: GetRecoTauVFromDQM_MC_cff.py:84
HGCalParameters::typesInLayers_
wafer_map typesInLayers_
Definition: HGCalParameters.h:177
HGCalParameters::getTrForm
hgtrform getTrForm(unsigned int k) const
Definition: HGCalParameters.cc:108
dqmdumpme.k
k
Definition: dqmdumpme.py:60
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:949
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
HGCalParameters::iradMinBH_
std::vector< int > iradMinBH_
Definition: HGCalParameters.h:163
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:112
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:166
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
HGCalDDDConstants::hexside_
double hexside_
Definition: HGCalDDDConstants.h:231
HFNoseDetId::type
int type() const
get the type
Definition: HFNoseDetId.h:50
HGCalDDDConstants::waferLayer_
std::map< int, HGCWaferParam > waferLayer_
Definition: HGCalDDDConstants.h:238
HGCalDDDConstants::modHalf_
int32_t modHalf_
Definition: HGCalDDDConstants.h:234
HGCalDDDConstants::numberCells
int numberCells(bool reco) const
Definition: HGCalDDDConstants.cc:884
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:170
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:1495
HGCalParameters::mode_
HGCalGeometryMode::GeometryMode mode_
Definition: HGCalParameters.h:137
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
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:561
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:136
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:109
HGCalParameters::waferR_
double waferR_
Definition: HGCalParameters.h:134
HGCalDDDConstants::getUVMax
int getUVMax(int type) const
Definition: HGCalDDDConstants.h:71
HGCalGeomTools::k_fiveCorners
static constexpr int k_fiveCorners
Definition: HGCalGeomTools.h:14
HGCalParameters::layerOffset_
int layerOffset_
Definition: HGCalParameters.h:174
HGCalParameters::waferThick_
double waferThick_
Definition: HGCalParameters.h:145
HGCalDDDConstants::rmax_
double rmax_
Definition: HGCalDDDConstants.h:231
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:34
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:239
HGCalTypes::CellType::BottomRightCorner
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HGCalDDDConstants::tot_layers_
std::array< uint32_t, 2 > tot_layers_
Definition: HGCalDDDConstants.h:235
HGCalDDDConstants::numberCellsHexagon
int numberCellsHexagon(int wafer) const
Definition: HGCalDDDConstants.cc:927
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:11
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:239
std
Definition: JetResolutionObject.h:76
HGCalParameters::waferMaskMode_
int waferMaskMode_
Definition: HGCalParameters.h:179
HGCalTypes::CellType::BottomLeftCorner
HGCalParameters::waferInfoMap_
waferInfo_map waferInfoMap_
Definition: HGCalParameters.h:181
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:178
HGCalTypes::CellType::BottomRightEdge
HGCalDDDConstants::waferPosition
std::pair< double, double > waferPosition(int wafer, bool reco) const
Definition: HGCalDDDConstants.cc:1207
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
HGCalTypes::WaferHalf
Definition: HGCalTypes.h:54
dt_dqm_sourceclient_common_cff.reco
reco
Definition: dt_dqm_sourceclient_common_cff.py:110
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
HGCalParameters::layerCenter_
std::vector< int > layerCenter_
Definition: HGCalParameters.h:175
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:167
HGCalDDDConstants::modules
int modules(int lay, bool reco) const
Definition: HGCalDDDConstants.cc:857
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:151
HGCalParameters::firstMixedLayer_
int firstMixedLayer_
Definition: HGCalParameters.h:173
HGCalDDDConstants::getLayer
int getLayer(double z, bool reco) const
Definition: HGCalDDDConstants.cc:355
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:196
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:233
HGCalDDDConstants::layersInit
unsigned int layersInit(bool reco) const
Definition: HGCalDDDConstants.cc:576
HGCalDDDConstants::locateCell
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
Definition: HGCalDDDConstants.cc:580
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:1605
HGCalParameters::zFrontTop_
std::vector< double > zFrontTop_
Definition: HGCalParameters.h:169
HGCalParameters::hgtrap
Definition: HGCalParameters.h:47
edm::Log
Definition: MessageLogger.h:70
dttmaxenums::R
Definition: DTTMax.h:29
HGCalTypes::SiPMSmall
Definition: HGCalTypes.h:78
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
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:228
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:289
HGCalDDDConstants::HGCWaferParam
std::array< int, 3 > HGCWaferParam
Definition: HGCalDDDConstants.h:227
HGCalDDDConstants::waferInLayerTest
bool waferInLayerTest(int wafer, int lay, bool full) const
Definition: HGCalDDDConstants.cc:1617
HGCalGeomTools::k_threeCorners
static constexpr int k_threeCorners
Definition: HGCalGeomTools.h:16
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
HGCalTypes::CellType::TopRightCorner
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
HGCalParameters::tileInfoMap_
tileInfo_map tileInfoMap_
Definition: HGCalParameters.h:182
HGCalTypes::WaferCorner0
Definition: HGCalTypes.h:30
HGCalParameters::copiesInLayers_
layer_map copiesInLayers_
Definition: HGCalParameters.h:141