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 zside, int lay, bool reco, bool extend, bool debug) const
 
std::array< int, 3 > assignCellTrap (float x, float y, float z, int lay, bool reco) const
 
double calibCellRad (bool hd) const
 
std::vector< int > calibCells (bool hd, bool full) const
 
bool cassetteMode () const
 
bool cassetteShiftScintillator (int zside, int layer, int iphi) const
 
bool cassetteShiftSilicon (int zside, int layer, int waferU, int waferV) const
 
int cassetteTile (int iphi) const
 
std::pair< double, double > cellEtaPhiTrap (int type, int irad) const
 
bool cellInLayer (int waferU, int waferV, int cellU, int cellV, int lay, int zside, bool reco) const
 
const HGCalCellOffsetcellOffset () 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
 
int32_t cellType (int type, int waferU, int waferV, int iz, int fwdBack, int orient) 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< double, double > getRangeR (int, bool reco) const
 
std::pair< int, int > getREtaRange (int lay) const
 
HGCalParameters::hgtrform getTrForm (unsigned int k) const
 
unsigned int getTrFormN () const
 
std::vector< HGCalParameters::hgtrformgetTrForms () const
 
int getTypeHex (int layer, int waferU, int waferV) const
 
int getTypeTrap (int layer) const
 
int getUVMax (int type) const
 
std::pair< double, double > getXY (int layer, double x, double y, bool forwd) const
 
double guardRingOffset (bool reco) 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 waferU, int waferV, bool fullAndPart) const
 
bool isValidHex8 (int lay, int modU, int modV, int cellU, int cellV, bool fullAndPart) const
 
bool isValidTrap (int zside, 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 layerType (int lay) const
 
int levelTop (int ind=0) const
 
std::pair< float, float > localToGlobal8 (int zside, int lay, int waferU, int waferV, double localX, double localY, bool reco, bool debug) const
 
std::pair< float, float > locateCell (int cell, int lay, int type, bool reco) const
 
std::pair< float, float > locateCell (int zside, int lay, int waferU, int waferV, int cellU, int cellV, bool reco, bool all, bool norot, bool cog, bool debug) const
 
std::pair< float, float > locateCell (const HGCSiliconDetId &, bool cog, bool debug) const
 
std::pair< float, float > locateCell (const HGCScintillatorDetId &, bool debug) const
 
std::pair< float, float > locateCellHex (int cell, int wafer, bool reco) const
 
std::pair< float, float > locateCellTrap (int zside, int lay, int ieta, int iphi, bool reco, bool debug) 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 wafer) const
 
int numberCellsHexagon (int lay, int waferU, int waferV, bool flag) const
 
int partialWaferType (int lay, int waferU, int waferV) 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
 
double sensorSizeOffset (bool reco) const
 
std::pair< int, int > simToReco (int cell, int layer, int mod, bool half) const
 
int tileCount (int layer, int ring) const
 
bool tileExist (int zside, int layer, int ring, int phi) const
 
HGCalParameters::tileInfo tileInfo (int zside, int layer, int ring) const
 
bool tilePhiEdge (double phi, int layer, int iphi) const
 
bool tileRingEdge (double rho, int layer, int ring) const
 
std::pair< int, int > tileRings (int layer) const
 
int tileSiPM (int sipm) const
 
bool tileTrapezoid () const
 
std::pair< int, int > tileType (int layer, int ring, int phi) const
 
bool trapezoidFile () const
 
bool v17OrLess () const
 
unsigned int volumes () const
 
int waferCount (const int type) const
 
int waferFileIndex (unsigned int kk) const
 
std::tuple< int, int, int, int > waferFileInfo (unsigned int kk) const
 
bool waferFileInfoExist (int kk) const
 
std::tuple< int, int, int, int > waferFileInfoFromIndex (int kk) const
 
unsigned int waferFileSize () const
 
int waferFromCopy (int copy) const
 
void waferFromPosition (const double x, const double y, int &wafer, int &icell, int &celltyp) const
 
void waferFromPosition (const double x, const double y, const int zside, const int layer, int &waferU, int &waferV, int &cellU, int &cellV, int &celltype, double &wt, bool extend, bool debug) const
 
bool waferFullInLayer (int wafer, int lay, bool reco) const
 
bool waferHexagon6 () const
 
bool waferHexagon8 () const
 
bool waferHexagon8File () const
 
bool waferHexagon8Fine () const
 
bool waferHexagon8Module () const
 
HGCalParameters::waferInfo waferInfo (int lay, int waferU, int waferV) const
 
bool waferInLayer (int wafer, int lay, bool reco) const
 
GlobalPoint waferLocal2Global (HepGeom::Point3D< float > &loc, const DetId &id, bool useWafer, bool reco, bool debug) const
 
int waferMax () const
 
int waferMin () const
 
std::pair< double, double > waferParameters (bool reco) const
 
std::pair< double, double > waferPosition (int wafer, bool reco) const
 
std::pair< double, double > waferPosition (int lay, int waferU, int waferV, bool reco, bool debug) 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) const
 
int waferType (int layer, int waferU, int waferV, bool fromFile) const
 
std::tuple< int, int, int > waferType (HGCSiliconDetId const &id, bool fromFile) const
 
int waferTypeL (int wafer) const
 
std::pair< int, int > waferTypeRotation (int layer, int waferU, int waferV, bool fromFile, bool debug) 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 ()=default
 

Private Types

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

Private Member Functions

int cellHex (double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
 
void cellHex (double xloc, double yloc, int cellType, int place, int part, int &cellU, int &cellV, bool extend, bool debug) 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
 
std::pair< double, double > waferPositionNoRot (int lay, int waferU, int waferV, bool reco, bool debug) const
 

Private Attributes

std::unique_ptr< HGCalCellOffsetcellOffset_
 
const bool fullAndPart_
 
HGCalGeomTools geomTools_
 
double hexside_
 
double hexsideT_
 
HGCalCassette hgcassette_
 
std::unique_ptr< HGCalCellhgcell_
 
std::unique_ptr< HGCalCellUVhgcellUV_
 
const HGCalParametershgpar_
 
Simrecovecs max_modules_layer_
 
int32_t maxWafersPerLayer_
 
const HGCalGeometryMode::GeometryMode mode_
 
int32_t modHalf_
 
double rmax_
 
double rmaxT_
 
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

static constexpr float dPhiMin = 0.02
 
static constexpr double k_horizontalShift = 1.0
 
static constexpr double tan30deg_ = 0.5773502693
 
static constexpr double tol_ = 0.001
 

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

Member Typedef Documentation

◆ HGCWaferParam

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

Definition at line 287 of file HGCalDDDConstants.h.

◆ Simrecovecs

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

Definition at line 286 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.

References cassetteMode(), HGCalParameters::cassettes_, HGCalParameters::cassetteShift_, cellOffset_, HGCalParameters::cellSize_, funct::cos(), fullAndPart_, getIndex(), getTrForm(), getTrFormN(), HGCalParameters::guardRingOffset_, hexside_, hexsideT_, hgcassette_, hgcell_, hgcellUV_, hgpar_, mps_fire::i, HGCalParameters::k_ScaleFromDDD, HGCalParameters::hgtrform::lay, nano_mu_digi_cff::layer, layers(), layersInit(), SiStripPI::max, max_modules_layer_, maxCells(), maxWafersPerLayer_, mode_, modHalf_, modulesInit(), HGCalParameters::mouseBite_, Skims_PA_cff::name, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, rmax_, rmaxT_, sectors(), HGCalParameters::sensorSeparation_, HGCalParameters::sensorSizeOffset_, HGCalCassette::setParameter(), tan30deg_, tot_layers_, tot_wafers_, HGCalParameters::waferCopy_, waferHexagon6(), waferHexagon8(), waferIn_, HGCalWaferIndex::waferIndex(), waferInLayer(), waferLayer_, waferMax_, HGCalParameters::waferR_, wafers(), HGCalParameters::waferSize_, HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), cms::cuda::wmax, and cms::cuda::wmin.

27 #ifdef EDM_ML_DEBUG
28  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::Mode " << mode_ << " FullAndPart " << fullAndPart_;
29 #endif
30  if (waferHexagon6() || waferHexagon8()) {
33  hexside_ = 2.0 * rmax_ * tan30deg_;
34  hexsideT_ = 2.0 * rmaxT_ * tan30deg_;
35  hgcell_ = std::make_unique<HGCalCell>(2.0 * rmaxT_, hgpar_->nCellsFine_, hgpar_->nCellsCoarse_);
36  hgcellUV_ = std::make_unique<HGCalCellUV>(
38  cellOffset_ = std::make_unique<HGCalCellOffset>(hgpar_->waferSize_,
44 #ifdef EDM_ML_DEBUG
45  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::rmax_ " << rmax_ << ":" << rmaxT_ << ":" << hexside_ << ":"
46  << hexsideT_ << " CellSize "
49 #endif
50  } else {
51  hgcell_.reset();
52  hgcellUV_.reset();
53  cellOffset_.reset();
54  }
55  if (cassetteMode()) {
57 #ifdef EDM_ML_DEBUG
58  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::Setup HGCalCassette for " << hgpar_->cassettes_
59  << " cassettes";
60 #endif
61  }
62  // init maps and constants
63  modHalf_ = 0;
65  for (int simreco = 0; simreco < 2; ++simreco) {
66  tot_layers_[simreco] = layersInit((bool)simreco);
67  max_modules_layer_[simreco].resize(tot_layers_[simreco] + 1);
68  for (unsigned int layer = 1; layer <= tot_layers_[simreco]; ++layer) {
69  max_modules_layer_[simreco][layer] = modulesInit(layer, (bool)simreco);
70  if (simreco == 1) {
71  modHalf_ += max_modules_layer_[simreco][layer];
73 #ifdef EDM_ML_DEBUG
74  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::Layer " << layer << " with "
75  << max_modules_layer_[simreco][layer] << ":" << modHalf_ << " modules in RECO";
76  } else {
77  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::Layer " << layer << " with "
78  << max_modules_layer_[simreco][layer] << " modules in SIM";
79 #endif
80  }
81  }
82 #ifdef EDM_ML_DEBUG
83  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::SimReco " << simreco << " with " << tot_layers_[simreco]
84  << " Layers";
85 #endif
86  }
87  tot_wafers_ = wafers();
88 
89 #ifdef EDM_ML_DEBUG
90  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants initialized for " << name << " with " << layers(false) << ":"
91  << layers(true) << " layers, " << wafers() << ":" << 2 * modHalf_
92  << " wafers with maximum " << maxWafersPerLayer_ << " per layer and "
93  << "maximum of " << maxCells(false) << ":" << maxCells(true) << " cells";
94 #endif
95  if (waferHexagon6() || waferHexagon8()) {
96  int wminT(9999999), wmaxT(-9999999), kount1(0), kount2(0);
97  for (unsigned int i = 0; i < getTrFormN(); ++i) {
98  int lay0 = getTrForm(i).lay;
99  int wmin(9999999), wmax(-9999999), kount(0);
100  for (int wafer = 0; wafer < sectors(); ++wafer) {
101  bool waferIn = waferInLayer(wafer, lay0, true);
102  if (waferHexagon8()) {
103  int kndx = HGCalWaferIndex::waferIndex(lay0,
106  waferIn_[kndx] = waferIn;
107  }
108  if (waferIn) {
109  int waferU = ((waferHexagon6()) ? wafer : HGCalWaferIndex::waferU(hgpar_->waferCopy_[wafer]));
110  if (waferU < wmin)
111  wmin = waferU;
112  if (waferU > wmax)
113  wmax = waferU;
114  ++kount;
115  }
116  }
117  if (wminT > wmin)
118  wminT = wmin;
119  if (wmaxT < wmax)
120  wmaxT = wmax;
121  if (kount1 < kount)
122  kount1 = kount;
123  kount2 += kount;
124 #ifdef EDM_ML_DEBUG
125  int lay1 = getIndex(lay0, true).first;
126  edm::LogVerbatim("HGCalGeom") << "Index " << i << " Layer " << lay0 << ":" << lay1 << " Wafer " << wmin << ":"
127  << wmax << ":" << kount;
128 #endif
129  HGCWaferParam a1{{wmin, wmax, kount}};
130  waferLayer_[lay0] = a1;
131  }
132  waferMax_ = std::array<int, 4>{{wminT, wmaxT, kount1, kount2}};
133 #ifdef EDM_ML_DEBUG
134  edm::LogVerbatim("HGCalGeom") << "Overall wafer statistics: " << wminT << ":" << wmaxT << ":" << kount1 << ":"
135  << kount2;
136 #endif
137  }
138 }
Log< level::Info, true > LogVerbatim
unsigned int layersInit(bool reco) const
HGCalCassette hgcassette_
std::unique_ptr< HGCalCellUV > hgcellUV_
Simrecovecs max_modules_layer_
int32_t waferU(const int32_t index)
bool waferHexagon8() const
int modulesInit(int lay, bool reco) const
std::unordered_map< int32_t, bool > waferIn_
bool waferHexagon6() const
HGCalGeometryMode::GeometryMode mode_
bool waferInLayer(int wafer, int lay, bool reco) const
std::map< int, HGCWaferParam > waferLayer_
std::unique_ptr< HGCalCell > hgcell_
int maxCells(bool reco) const
std::vector< double > cellSize_
T sqrt(T t)
Definition: SSEVec.h:23
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::pair< int, float > getIndex(int lay, bool reco) const
unsigned int layers(bool reco) const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
void setParameter(int cassette, const std::vector< double > &shifts, bool both=true)
Definition: HGCalCassette.cc:8
std::array< int, 4 > waferMax_
unsigned int getTrFormN() const
HGCalParameters::hgtrform getTrForm(unsigned int k) const
bool waferHexagon8File() const
const HGCalGeometryMode::GeometryMode mode_
static constexpr double k_ScaleFromDDD
std::array< int, 3 > HGCWaferParam
bool cassetteMode() const
int32_t waferV(const int32_t index)
std::vector< int > waferCopy_
std::vector< double > cassetteShift_
static constexpr double tan30deg_
std::unique_ptr< HGCalCellOffset > cellOffset_
std::array< uint32_t, 2 > tot_layers_
__host__ __device__ V wmin
const HGCalParameters * hgpar_
__host__ __device__ V V wmax

◆ ~HGCalDDDConstants()

HGCalDDDConstants::~HGCalDDDConstants ( )
default

Member Function Documentation

◆ assignCell()

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

Definition at line 140 of file HGCalDDDConstants.cc.

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 HGCalGeometry::getClosestCell().

140  {
141  const auto& index = getIndex(lay, reco);
142  if (index.first < 0)
143  return std::make_pair(-1, -1);
144  if (waferHexagon6()) {
145  float xx = (reco) ? x : HGCalParameters::k_ScaleFromDDD * x;
146  float yy = (reco) ? y : HGCalParameters::k_ScaleFromDDD * y;
147 
148  // First the wafer
149  int wafer = cellHex(xx, yy, rmax_, hgpar_->waferPosX_, hgpar_->waferPosY_);
150  if (wafer < 0 || wafer >= static_cast<int>(hgpar_->waferTypeT_.size())) {
151  edm::LogWarning("HGCalGeom") << "Wafer no. out of bound for " << wafer << ":" << (hgpar_->waferTypeT_).size()
152  << ":" << (hgpar_->waferPosX_).size() << ":" << (hgpar_->waferPosY_).size()
153  << " ***** ERROR *****";
154  return std::make_pair(-1, -1);
155  } else {
156  // Now the cell
157  xx -= hgpar_->waferPosX_[wafer];
158  yy -= hgpar_->waferPosY_[wafer];
159  if (hgpar_->waferTypeT_[wafer] == 1)
160  return std::make_pair(wafer,
161  cellHex(xx,
162  yy,
165  hgpar_->cellFineY_));
166  else
167  return std::make_pair(wafer,
168  cellHex(xx,
169  yy,
172  hgpar_->cellCoarseY_));
173  }
174  } else {
175  return std::make_pair(-1, -1);
176  }
177 }
size
Write out results.
std::vector< double > waferPosY_
std::vector< double > cellFineY_
bool waferHexagon6() const
std::vector< double > cellCoarseX_
std::vector< double > cellSize_
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< double > cellFineX_
static constexpr double k_ScaleFromDDD
fixed size matrix
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
Log< level::Warning, false > LogWarning
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const

◆ assignCellHex()

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

Definition at line 179 of file HGCalDDDConstants.cc.

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

Referenced by HGCalGeometry::getClosestCell(), and HGCalGeometry::getClosestCellHex().

180  {
181  int waferU(0), waferV(0), waferType(-1), cellU(0), cellV(0);
182  if (waferHexagon8()) {
183  double xx = (reco) ? HGCalParameters::k_ScaleToDDD * x : x;
184  double yy = (reco) ? HGCalParameters::k_ScaleToDDD * y : y;
185  double wt(1.0);
186 #ifdef EDM_ML_DEBUG
187  edm::LogVerbatim("HGCalGeom") << "assignCellHex x " << x << ":" << xx << " y " << y << ":" << yy << " Lay " << lay;
188 #endif
189  waferFromPosition(xx, yy, zside, lay, waferU, waferV, cellU, cellV, waferType, wt, extend, debug);
190  }
191  return std::array<int, 5>{{waferU, waferV, waferType, cellU, cellV}};
192 }
Log< level::Info, true > LogVerbatim
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
int32_t waferU(const int32_t index)
bool waferHexagon8() const
int zside(DetId const &)
static constexpr double k_ScaleToDDD
#define debug
Definition: HDRShower.cc:19
int waferType(DetId const &id, bool fromFile) const
int32_t waferV(const int32_t index)

◆ assignCellTrap()

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

Definition at line 194 of file HGCalDDDConstants.cc.

References funct::abs(), cassetteMode(), HGCalParameters::cassettes_, angle_units::operators::convertRadToDeg(), HGCalParameters::firstLayer_, getIndex(), HGCalCassette::getShift(), hgcassette_, hgpar_, hcalRecHitTable_cff::iphi, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, HGCalParameters::k_ScaleFromDDD, nano_mu_digi_cff::layer, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, M_PI, HGCalParameters::nphiCassette_, phi, HGCalParameters::phiOffset_, alignCSCRings::r, HGCalParameters::radiusLayer_, dt_dqm_sourceclient_common_cff::reco, HGCalParameters::scintCells(), HGCalParameters::scintCellSize(), HGCalParameters::scintType(), mathSSE::sqrt(), HGCalTileIndex::tileCassette(), tileExist(), tilePhiEdge(), tileRingEdge(), tol_, x, HGCalParameters::xLayerHex_, geometryCSVtoXML::xx, y, HGCalParameters::yLayerHex_, geometryCSVtoXML::yy, z, and ecaldqm::zside().

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

194  {
195  int irad(-1), iphi(-1), type(-1);
196  const auto& indx = getIndex(layer, reco);
197  if (indx.first < 0)
198  return std::array<int, 3>{{irad, iphi, type}};
199  int zside = (z > 0) ? 1 : -1;
200  double xx = (reco) ? (zside * x) : (zside * HGCalParameters::k_ScaleFromDDD * x);
201  double yy = (reco) ? y : HGCalParameters::k_ScaleFromDDD * y;
202  int ll = layer - hgpar_->firstLayer_;
203  xx -= hgpar_->xLayerHex_[ll];
204  yy -= hgpar_->yLayerHex_[ll];
205  double phi = (((yy == 0.0) && (xx == 0.0)) ? 0. : std::atan2(yy, xx));
206  if (phi < 0)
207  phi += (2.0 * M_PI);
208  if (indx.second != 0)
209  iphi = (1 + static_cast<int>(phi / indx.second)) % hgpar_->scintCells(layer);
210  if (iphi == 0)
212  if (cassetteMode()) {
214  auto cshift = hgcassette_.getShift(layer, -1, cassette);
215 #ifdef EDM_ML_DEBUG
216  std::ostringstream st1;
217  st1 << "Cassette " << cassette << " Shift " << cshift.first << ":" << cshift.second << " Original " << xx << ":"
218  << yy;
219 #endif
220  xx += (zside * cshift.first);
221  yy -= cshift.second;
222 #ifdef EDM_ML_DEBUG
223  st1 << " Shifted " << xx << ":" << yy;
224  edm::LogVerbatim("HGCalGeomT") << st1.str();
225 #endif
226  }
228  double r = std::sqrt(xx * xx + yy * yy);
229  auto ir = std::lower_bound(hgpar_->radiusLayer_[type].begin(), hgpar_->radiusLayer_[type].end(), r);
230  irad = static_cast<int>(ir - hgpar_->radiusLayer_[type].begin());
231  irad = std::clamp(irad, hgpar_->iradMinBH_[indx.first], hgpar_->iradMaxBH_[indx.first]);
232 #ifdef EDM_ML_DEBUG
233  edm::LogVerbatim("HGCalGeomT") << "assignCellTrap Input " << x << ":" << y << ":" << z << ":" << layer << ":" << reco
234  << " x|y|r " << xx << ":" << yy << ":" << r << " phi " << phi << ":"
235  << convertRadToDeg(phi) << " o/p " << irad << ":" << iphi << ":" << type;
236 #endif
237  if (!tileExist(zside, layer, irad, iphi)) {
238  if (tileRingEdge(r, layer, irad)) {
239  if (std::abs(r - hgpar_->radiusLayer_[type][irad - 1]) < tol_) {
240  --irad;
241  if (irad <= hgpar_->iradMinBH_[indx.first])
242  irad = hgpar_->iradMinBH_[indx.first];
243  } else {
244  ++irad;
245  if (irad > hgpar_->iradMaxBH_[indx.first])
246  irad = hgpar_->iradMaxBH_[indx.first];
247  }
248 #ifdef EDM_ML_DEBUG
249  edm::LogVerbatim("HGCalGeomT") << "assignCellTrap: ring # modified to " << irad << ":"
250  << hgpar_->iradMinBH_[indx.first] << ":" << hgpar_->iradMaxBH_[indx.first];
251  ;
252 #endif
253  } else if (tilePhiEdge(phi, layer, iphi)) {
254  if (std::abs(phi - hgpar_->scintCellSize(layer) * (iphi - 1)) < tol_) {
255  --iphi;
256  if (iphi <= 0)
257  iphi = 1;
258  } else {
259  ++iphi;
260  if (iphi > hgpar_->scintCells(layer))
261  iphi = 1;
262  }
263 #ifdef EDM_ML_DEBUG
264  edm::LogVerbatim("HGCalGeomT") << "assignCellTrap: iphi # modified to " << iphi << ":"
265  << hgpar_->scintCells(layer);
266 #endif
267  }
268  }
269  return std::array<int, 3>{{irad, iphi, type}};
270 }
std::vector< int > iradMaxBH_
Log< level::Info, true > LogVerbatim
static constexpr double tol_
HGCalCassette hgcassette_
int scintType(const int layer) const
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
bool tileRingEdge(double rho, int layer, int ring) const
std::pair< double, double > getShift(int layer, int zside, int cassette, bool scnt=false) const
int zside(DetId const &)
double scintCellSize(const int layer) const
std::vector< double > yLayerHex_
T sqrt(T t)
Definition: SSEVec.h:23
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< int, float > getIndex(int lay, bool reco) const
bool tilePhiEdge(double phi, int layer, int iphi) const
int32_t tileCassette(int32_t, int32_t, int32_t, int32_t)
#define M_PI
bool tileExist(int zside, int layer, int ring, int phi) const
std::vector< int > iradMinBH_
static constexpr double k_ScaleFromDDD
fixed size matrix
bool cassetteMode() const
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
int scintCells(const int layer) const
std::vector< double > xLayerHex_

◆ calibCellRad()

double HGCalDDDConstants::calibCellRad ( bool  hd) const
inline

Definition at line 51 of file HGCalDDDConstants.h.

References HGCalParameters::calibCellRHD_, HGCalParameters::calibCellRLD_, and hgpar_.

Referenced by HGCalSD::update().

51 { return (hd ? hgpar_->calibCellRHD_ : hgpar_->calibCellRLD_); }
const HGCalParameters * hgpar_

◆ calibCells()

std::vector<int> HGCalDDDConstants::calibCells ( bool  hd,
bool  full 
) const
inline

Definition at line 44 of file HGCalDDDConstants.h.

References HGCalParameters::calibCellFullHD_, HGCalParameters::calibCellFullLD_, HGCalParameters::calibCellPartHD_, HGCalParameters::calibCellPartLD_, full, and hgpar_.

Referenced by HGCalSD::update().

44  {
45  if (hd) {
47  } else {
49  }
50  }
Definition: GenABIO.cc:168
std::vector< int > calibCellPartHD_
std::vector< int > calibCellFullHD_
std::vector< int > calibCellPartLD_
const HGCalParameters * hgpar_
std::vector< int > calibCellFullLD_

◆ cassetteMode()

bool HGCalDDDConstants::cassetteMode ( ) const
inline

◆ cassetteShiftScintillator()

bool HGCalDDDConstants::cassetteShiftScintillator ( int  zside,
int  layer,
int  iphi 
) const

Definition at line 286 of file HGCalDDDConstants.cc.

References cassetteMode(), cassetteTile(), HGCalCassette::getShift(), hgcassette_, hcalRecHitTable_cff::iphi, nano_mu_digi_cff::layer, edm::shift, and ecaldqm::zside().

Referenced by HGCScintSD::setDetUnitId().

286  {
287  bool shift(false);
288  if (cassetteMode()) {
289  auto cshift = hgcassette_.getShift(layer, zside, cassetteTile(iphi));
290  if ((cshift.first != 0) || (cshift.second != 0))
291  shift = true;
292  }
293  return shift;
294 }
HGCalCassette hgcassette_
std::pair< double, double > getShift(int layer, int zside, int cassette, bool scnt=false) const
int zside(DetId const &)
bool cassetteMode() const
static unsigned int const shift
int cassetteTile(int iphi) const

◆ cassetteShiftSilicon()

bool HGCalDDDConstants::cassetteShiftSilicon ( int  zside,
int  layer,
int  waferU,
int  waferV 
) const

Definition at line 272 of file HGCalDDDConstants.cc.

References cassetteMode(), HGCalCassette::getShift(), hgcassette_, hgpar_, nano_mu_digi_cff::layer, edm::shift, HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), and ecaldqm::zside().

Referenced by HGCalSD::setDetUnitId().

272  {
273  bool shift(false);
274  if (cassetteMode()) {
276  auto ktr = hgpar_->waferInfoMap_.find(indx);
277  if (ktr != hgpar_->waferInfoMap_.end()) {
278  auto cshift = hgcassette_.getShift(layer, zside, (ktr->second).cassette);
279  if ((cshift.first != 0) || (cshift.second != 0))
280  shift = true;
281  }
282  }
283  return shift;
284 }
HGCalCassette hgcassette_
int32_t waferU(const int32_t index)
std::pair< double, double > getShift(int layer, int zside, int cassette, bool scnt=false) const
int zside(DetId const &)
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
bool cassetteMode() const
int32_t waferV(const int32_t index)
static unsigned int const shift
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ cassetteTile()

int HGCalDDDConstants::cassetteTile ( int  iphi) const
inline

◆ cellEtaPhiTrap()

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

Definition at line 296 of file HGCalDDDConstants.cc.

References HGCalParameters::cellSize_, das-up-to-nevents::df, l1ctLayer1_cff::dr, hgpar_, alignCSCRings::r, HGCalParameters::radiusLayer_, and tileTrapezoid().

296  {
297  double dr(0), df(0);
298  if (tileTrapezoid()) {
299  double r = 0.5 * ((hgpar_->radiusLayer_[type][irad - 1] + hgpar_->radiusLayer_[type][irad]));
300  dr = (hgpar_->radiusLayer_[type][irad] - hgpar_->radiusLayer_[type][irad - 1]);
301  df = r * hgpar_->cellSize_[type];
302  }
303  return std::make_pair(dr, df);
304 }
std::vector< double > cellSize_
bool tileTrapezoid() const
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_

◆ cellHex() [1/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 1959 of file HGCalDDDConstants.cc.

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().

1960  {
1961  int num(0);
1962  const double tol(0.00001);
1963  double cellY = 2.0 * cellR * tan30deg_;
1964  for (unsigned int k = 0; k < posX.size(); ++k) {
1965  double dx = std::abs(xx - posX[k]);
1966  double dy = std::abs(yy - posY[k]);
1967  if (dx <= (cellR + tol) && dy <= (cellY + tol)) {
1968  double xmax = (dy <= 0.5 * cellY) ? cellR : (cellR - (dy - 0.5 * cellY) / tan30deg_);
1969  if (dx <= (xmax + tol)) {
1970  num = k;
1971  break;
1972  }
1973  }
1974  }
1975  return num;
1976 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr double tan30deg_

◆ cellHex() [2/2]

void HGCalDDDConstants::cellHex ( double  xloc,
double  yloc,
int  cellType,
int  place,
int  part,
int &  cellU,
int &  cellV,
bool  extend,
bool  debug 
) const
private

Definition at line 1978 of file HGCalDDDConstants.cc.

References funct::abs(), cassetteMode(), cellType(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), debug, newFWLiteAna::found, HGCSiliconDetId::HGCalHD120, HGCSiliconDetId::HGCalHD200, hgcellUV_, hgpar_, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, SiStripPI::max, SiStripPI::min, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, rmax_, rmaxT_, edm::shift, sqrt3_, V0Monitor_cff::v0, HGCalTypes::WaferFull, and waferHexagon8File().

1979  {
1980  if (cassetteMode()) {
1981  auto uv = (part == HGCalTypes::WaferFull)
1982  ? hgcellUV_->cellUVFromXY3(xloc, yloc, place, cellType, true, debug)
1983  : hgcellUV_->cellUVFromXY1(xloc, yloc, place, cellType, part, true, debug);
1984  cellU = uv.first;
1985  cellV = uv.second;
1986  } else if (waferHexagon8File()) {
1987  auto uv = hgcellUV_->cellUVFromXY3(xloc, yloc, place, cellType, extend, debug);
1988  cellU = uv.first;
1989  cellV = uv.second;
1990  } else {
1992  ? hgpar_->nCellsFine_
1993  : hgpar_->nCellsCoarse_;
1994  double delY = 2 * rmax_ / (3 * ncell);
1995  double delX = 0.5 * delY * sqrt3_;
1996  double delYT = (extend) ? (2 * rmaxT_ / (3 * ncell)) : delY;
1997  double delXT = 0.5 * delYT * sqrt3_;
1998  double v0 = ((xloc / delY - 1.0) / 1.5);
1999  int cv0 = (v0 > 0) ? (ncell + static_cast<int>(v0 + 0.5)) : (ncell - static_cast<int>(-v0 + 0.5));
2000  double u0 = (0.5 * yloc / delX + 0.5 * cv0);
2001  int cu0 = (u0 > 0) ? (ncell / 2 + static_cast<int>(u0 + 0.5)) : (ncell / 2 - static_cast<int>(-u0 + 0.5));
2002  cu0 = std::max(0, std::min(cu0, 2 * ncell - 1));
2003  cv0 = std::max(0, std::min(cv0, 2 * ncell - 1));
2004  if (cv0 - cu0 >= ncell)
2005  cv0 = cu0 + ncell - 1;
2006  if (debug)
2007  edm::LogVerbatim("HGCalGeom") << "cellHex: input " << xloc << ":" << yloc << ":" << cellType << " parameter "
2008  << delX << ":" << delY << " u0 " << u0 << ":" << cu0 << " v0 " << v0 << ":" << cv0;
2009  bool found(false);
2010  static constexpr int shift[3] = {0, 1, -1};
2011  for (int i1 = 0; i1 < 3; ++i1) {
2012  cellU = cu0 + shift[i1];
2013  for (int i2 = 0; i2 < 3; ++i2) {
2014  cellV = cv0 + shift[i2];
2015  if (((cellV - cellU) < ncell) && ((cellU - cellV) <= ncell) && (cellU >= 0) && (cellV >= 0) &&
2016  (cellU < 2 * ncell) && (cellV < 2 * ncell)) {
2017  double xc = (1.5 * (cellV - ncell) + 1.0) * delY;
2018  double yc = (2 * cellU - cellV - ncell) * delX;
2019  if ((std::abs(yloc - yc) <= delXT) && (std::abs(xloc - xc) <= delYT) &&
2020  ((std::abs(xloc - xc) <= 0.5 * delYT) ||
2021  (std::abs(yloc - yc) <= sqrt3_ * (delYT - std::abs(xloc - xc))))) {
2022  if (debug)
2023  edm::LogVerbatim("HGCalGeom")
2024  << "cellHex: local " << xc << ":" << yc << " difference " << std::abs(xloc - xc) << ":"
2025  << std::abs(yloc - yc) << ":" << sqrt3_ * (delY - std::abs(yloc - yc)) << " comparator " << delX
2026  << ":" << delY << " (u,v) = (" << cellU << "," << cellV << ")";
2027  found = true;
2028  break;
2029  }
2030  }
2031  }
2032  if (found)
2033  break;
2034  }
2035  if (!found) {
2036  cellU = cu0;
2037  cellV = cv0;
2038  }
2039  }
2040 }
Log< level::Info, true > LogVerbatim
std::unique_ptr< HGCalCellUV > hgcellUV_
int32_t cellType(int type, int waferU, int waferV, int iz, int fwdBack, int orient) const
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define debug
Definition: HDRShower.cc:19
part
Definition: HCALResponse.h:20
bool waferHexagon8File() const
bool cassetteMode() const
static unsigned int const shift
const HGCalParameters * hgpar_

◆ cellInLayer()

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

Definition at line 306 of file HGCalDDDConstants.cc.

References cassetteMode(), getIndex(), HGCalWaferMask::goodCell(), HGCalGeometryMode::Hexagon8Module, hgpar_, locateCell(), mode_, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, hgcalPerformanceValidation::orient, HGCalParameters::rMinLayHex_, mathSSE::sqrt(), HGCalTypes::WaferFull, HGCalTypes::WaferHD120, HGCalTypes::WaferHD200, waferHexagon6(), waferHexagon8(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalTypes::WaferOrient0, HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), geometryCSVtoXML::xy, and ecaldqm::zside().

Referenced by HGCalGeometry::newCell().

306  {
307  const auto& indx = getIndex(lay, true);
308  if (indx.first >= 0) {
309  if (cassetteMode()) {
310  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
311  auto ktr = hgpar_->waferInfoMap_.find(indx);
312  int part = (ktr != hgpar_->waferInfoMap_.end()) ? (ktr->second).part : HGCalTypes::WaferFull;
313  return HGCalWaferMask::goodCell(cellU, cellV, part);
315  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
316  auto ktr = hgpar_->waferInfoMap_.find(indx);
318  if (ktr != hgpar_->waferInfoMap_.end()) {
319  thck = (ktr->second).type;
320  part = (ktr->second).part;
321  rotn = (ktr->second).orient;
322  }
323  int ncell = ((thck == HGCalTypes::WaferHD120) || (thck == HGCalTypes::WaferHD200)) ? hgpar_->nCellsFine_
325  return HGCalWaferMask::goodCell(cellU, cellV, ncell, part, rotn);
326  } else if (waferHexagon8() || waferHexagon6()) {
327  const auto& xy =
328  ((waferHexagon8()) ? locateCell(zside, lay, waferU, waferV, cellU, cellV, reco, true, false, false, false)
329  : locateCell(cellU, lay, waferU, reco));
330  double rpos = sqrt(xy.first * xy.first + xy.second * xy.second);
331  return ((rpos >= hgpar_->rMinLayHex_[indx.first]) && (rpos <= hgpar_->rMaxLayHex_[indx.first]));
332  } else {
333  return true;
334  }
335  } else {
336  return false;
337  }
338 }
static constexpr int32_t WaferHD200
Definition: HGCalTypes.h:33
int32_t waferU(const int32_t index)
static bool goodCell(int u, int v, int N, int type, int rotn)
bool waferHexagon8() const
int zside(DetId const &)
bool waferHexagon6() const
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
T sqrt(T t)
Definition: SSEVec.h:23
static constexpr int32_t WaferOrient0
Definition: HGCalTypes.h:63
std::pair< int, float > getIndex(int lay, bool reco) const
static constexpr int32_t WaferHD120
Definition: HGCalTypes.h:30
std::vector< double > rMinLayHex_
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
part
Definition: HCALResponse.h:20
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
const HGCalGeometryMode::GeometryMode mode_
fixed size matrix
bool cassetteMode() const
int32_t waferV(const int32_t index)
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ cellOffset()

const HGCalCellOffset* HGCalDDDConstants::cellOffset ( ) const
inline

Definition at line 64 of file HGCalDDDConstants.h.

References cellOffset_.

64 { return cellOffset_.get(); }
std::unique_ptr< HGCalCellOffset > cellOffset_

◆ cellSizeHex()

double HGCalDDDConstants::cellSizeHex ( int  type) const

Definition at line 353 of file HGCalDDDConstants.cc.

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

Referenced by hgcal::RecHitTools::getRadiusToSide().

353  {
354  int indx = ((waferHexagon8()) ? ((type >= 1) ? 1 : 0) : ((type == 1) ? 1 : 0));
355  double cell = (tileTrapezoid() ? 0.5 * hgpar_->cellSize_[indx]
357  return cell;
358 }
bool waferHexagon8() const
std::vector< double > cellSize_
bool tileTrapezoid() const
static constexpr double k_ScaleFromDDD
const HGCalParameters * hgpar_

◆ cellSizeTrap()

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

Definition at line 66 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::radiusLayer_.

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

66  {
67  return std::make_pair(hgpar_->radiusLayer_[type][irad - 1], hgpar_->radiusLayer_[type][irad]);
68  }
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_

◆ cellThickness()

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

Definition at line 340 of file HGCalDDDConstants.cc.

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

Referenced by HGCalTB23Analyzer::analyzeSimHits(), and hgcal::RecHitTools::getSiThickness().

340  {
341  double thick(-1);
342  int type = waferType(layer, waferU, waferV, false);
343  if (type >= 0) {
344  if (waferHexagon8()) {
345  thick = 10000.0 * hgpar_->cellThickness_[type]; // cm to micron
346  } else if (waferHexagon6()) {
347  thick = 100.0 * (type + 1); // type = 1,2,3 for 100,200,300 micron
348  }
349  }
350  return thick;
351 }
int32_t waferU(const int32_t index)
bool waferHexagon8() const
bool waferHexagon6() const
std::vector< double > cellThickness_
int waferType(DetId const &id, bool fromFile) const
int32_t waferV(const int32_t index)
const HGCalParameters * hgpar_

◆ cellType()

int32_t HGCalDDDConstants::cellType ( int  type,
int  waferU,
int  waferV,
int  iz,
int  fwdBack,
int  orient 
) const

Definition at line 360 of file HGCalDDDConstants.cc.

References HGCalCell::cellPlacementIndex(), HGCalCell::cellPlacementOld, HGCalCell::cellType(), HGCSiliconDetId::HGCalHD120, HGCSiliconDetId::HGCalHD200, hgpar_, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, and hgcalPerformanceValidation::orient.

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

360  {
361  int placement = (orient < 0) ? HGCalCell::cellPlacementOld : HGCalCell::cellPlacementIndex(iz, fwdBack, orient);
364  auto cellType = HGCalCell::cellType(cellU, cellV, ncell, placement);
365  return cellType.first;
366 }
static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient)
Definition: HGCalCell.cc:239
static constexpr int32_t cellPlacementOld
Definition: HGCalCell.h:25
static std::pair< int32_t, int32_t > cellType(int32_t u, int32_t v, int32_t ncell, int32_t placementIndex)
Definition: HGCalCell.cc:251
int32_t cellType(int type, int waferU, int waferV, int iz, int fwdBack, int orient) const
const HGCalParameters * hgpar_

◆ distFromEdgeHex()

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

Definition at line 368 of file HGCalDDDConstants.cc.

References funct::abs(), PVValHelper::dx, PVValHelper::dy, getLayer(), hexside_, hgpar_, 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().

368  {
369  // Assming the point is within a hexagonal plane of the wafer, calculate
370  // the shortest distance from the edge
371  if (z < 0)
372  x = -x;
373  double dist(0);
374  // Input x, y in Geant4 unit and transformed to CMSSW standard
377  if (waferHexagon8()) {
378  int ll = layerIndex(getLayer(z, false), false);
379  xx -= hgpar_->xLayerHex_[ll];
380  yy -= hgpar_->yLayerHex_[ll];
381  }
382  int sizew = static_cast<int>(hgpar_->waferPosX_.size());
383  int wafer = sizew;
384  // Transform to the local coordinate frame of the wafer first
385  for (int k = 0; k < sizew; ++k) {
386  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
387  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
388  if ((dx <= rmax_) && (dy <= hexside_) && ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy)))) {
389  wafer = k;
390  xx -= hgpar_->waferPosX_[k];
391  yy -= hgpar_->waferPosY_[k];
392  break;
393  }
394  }
395  // Look at only one quarter (both x,y are positive)
396  if (wafer < sizew) {
397  if (std::abs(yy) < 0.5 * hexside_) {
398  dist = rmax_ - std::abs(xx);
399  } else {
400  dist = 0.5 * ((rmax_ - std::abs(xx)) - sqrt3_ * (std::abs(yy) - 0.5 * hexside_));
401  }
402  } else {
403  dist = 0;
404  }
406 #ifdef EDM_ML_DEBUG
407  edm::LogVerbatim("HGCalGeom") << "DistFromEdgeHex: Local " << xx << ":" << yy << " wafer " << wafer << " flag "
408  << (wafer < sizew) << " Distance " << rmax_ << ":" << (rmax_ - std::abs(xx)) << ":"
409  << (std::abs(yy) - 0.5 * hexside_) << ":" << 0.5 * hexside_ << ":" << dist;
410 #endif
411  return dist;
412 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
bool waferHexagon8() const
std::vector< double > yLayerHex_
int layerIndex(int lay, bool reco) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr double k_ScaleToDDD
static constexpr double k_ScaleFromDDD
int getLayer(double z, bool reco) const
static constexpr double tan30deg_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::vector< double > xLayerHex_

◆ distFromEdgeTrap()

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

Definition at line 414 of file HGCalDDDConstants.cc.

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

Referenced by HGCScintSD::isItinFidVolume().

414  {
415  // Assming the point is within the eta-phi plane of the scintillator tile,
416  // calculate the shortest distance from the edge
417  int lay = getLayer(z, false);
418  double xx = (z < 0) ? -x : x;
419  int indx = layerIndex(lay, false);
420  double r = HGCalParameters::k_ScaleFromDDD * std::sqrt(x * x + y * y);
421  double phi = (r == 0. ? 0. : std::atan2(y, xx));
422  if (phi < 0)
423  phi += (2.0 * M_PI);
424  int type = hgpar_->scintType(lay);
425  double cell = hgpar_->scintCellSize(lay);
426  // Compare with the center of the tile find distances along R and also phi
427  // Take the smaller value
428  auto ir = std::lower_bound(hgpar_->radiusLayer_[type].begin(), hgpar_->radiusLayer_[type].end(), r);
429  int irad = static_cast<int>(ir - hgpar_->radiusLayer_[type].begin());
430  irad = std::clamp(irad, hgpar_->iradMinBH_[indx], hgpar_->iradMaxBH_[indx]);
431  int iphi = 1 + static_cast<int>(phi / cell);
432  double dphi = std::max(0.0, (0.5 * cell - std::abs(phi - (iphi - 0.5) * cell)));
433  double dist = std::min((r - hgpar_->radiusLayer_[type][irad - 1]), (hgpar_->radiusLayer_[type][irad] - r));
434 #ifdef EDM_ML_DEBUG
435  edm::LogVerbatim("HGCalGeom") << "DistFromEdgeTrap: Global " << x << ":" << y << ":" << z << " Layer " << lay
436  << " Index " << indx << ":" << type << " xx " << xx << " R " << r << ":" << irad << ":"
437  << hgpar_->radiusLayer_[type][irad - 1] << ":" << hgpar_->radiusLayer_[type][irad]
438  << " Phi " << phi << ":" << iphi << ":" << (iphi - 0.5) * cell << " cell " << cell
439  << " Dphi " << dphi << " Dist " << dist << ":" << r * dphi;
440 #endif
441  return HGCalParameters::k_ScaleToDDD * std::min(r * dphi, dist);
442 }
std::vector< int > iradMaxBH_
Log< level::Info, true > LogVerbatim
int scintType(const int layer) const
double scintCellSize(const int layer) const
T sqrt(T t)
Definition: SSEVec.h:23
int layerIndex(int lay, bool reco) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI
static constexpr double k_ScaleToDDD
std::vector< int > iradMinBH_
static constexpr double k_ScaleFromDDD
int getLayer(double z, bool reco) const
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_

◆ 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

Definition at line 82 of file HGCalDDDConstants.h.

References mode_.

Referenced by HGCalSimHitValidation::analyzeHits(), HGCalTopology::HGCalTopology(), HGCScintSD::update(), HFNoseSD::update(), and HGCalSD::update().

82 { return mode_; }
const HGCalGeometryMode::GeometryMode mode_

◆ getIndex()

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

Definition at line 2042 of file HGCalDDDConstants.cc.

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().

2042  {
2043  int indx = layerIndex(lay, reco);
2044  if (indx < 0)
2045  return std::make_pair(-1, 0);
2046  float cell(0);
2047  if (waferHexagon6()) {
2048  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
2049  } else {
2050  if (waferHexagon8()) {
2051  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
2052  } else {
2053  cell = hgpar_->scintCellSize(lay);
2054  }
2055  }
2056  return std::make_pair(indx, cell);
2057 }
std::vector< double > moduleCellR_
bool waferHexagon8() const
bool waferHexagon6() const
double scintCellSize(const int layer) const
int layerIndex(int lay, bool reco) const
std::vector< double > moduleCellS_
fixed size matrix
const HGCalParameters * hgpar_

◆ getLayer()

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

Definition at line 444 of file HGCalDDDConstants.cc.

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(), HGCalGeometry::getClosestCell(), and HGCalGeometry::getClosestCellHex().

444  {
445  // Get the layer # from the gloabl z coordinate
446  unsigned int k = 0;
447  double zz = (reco ? std::abs(z) : HGCalParameters::k_ScaleFromDDD * std::abs(z));
448  const auto& zLayerHex = hgpar_->zLayerHex_;
449  auto itr = std::find_if(zLayerHex.begin() + 1, zLayerHex.end(), [&k, &zz, &zLayerHex](double zLayer) {
450  ++k;
451  return zz < 0.5 * (zLayerHex[k - 1] + zLayerHex[k]);
452  });
453  int lay = (itr == zLayerHex.end()) ? static_cast<int>(zLayerHex.size()) : k;
454  if (waferHexagon6() && reco) {
455  int indx = layerIndex(lay, false);
456  if (indx >= 0)
457  lay = hgpar_->layerGroupO_[indx];
458  } else {
459  lay += (hgpar_->firstLayer_ - 1);
460  }
461  return lay;
462 }
bool waferHexagon6() const
int layerIndex(int lay, bool reco) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< double > zLayerHex_
std::vector< int > layerGroupO_
fixed size matrix
const HGCalParameters * hgpar_

◆ getLayerOffset()

int HGCalDDDConstants::getLayerOffset ( ) const
inline

Definition at line 84 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::layerOffset_.

Referenced by HGCalNumberingScheme::HGCalNumberingScheme().

84 { return hgpar_->layerOffset_; }
const HGCalParameters * hgpar_

◆ getModule()

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

Definition at line 464 of file HGCalDDDConstants.cc.

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

Referenced by HGCalGeometry::getSummary().

464  {
466  if (hexType) {
467  if (indx >= hgpar_->waferTypeL_.size())
468  edm::LogWarning("HGCalGeom") << "Wafer no. out bound for index " << indx << ":" << (hgpar_->waferTypeL_).size()
469  << ":" << (hgpar_->waferPosX_).size() << ":" << (hgpar_->waferPosY_).size()
470  << " ***** ERROR *****";
471  unsigned int type =
472  ((indx < hgpar_->waferTypeL_.size()) ? hgpar_->waferTypeL_[indx] - 1 : HGCSiliconDetId::HGCalLD300);
473  mytr = hgpar_->getModule(type, reco);
474  } else {
475  mytr = hgpar_->getModule(indx, reco);
476  }
477  return mytr;
478 }
size
Write out results.
std::vector< double > waferPosY_
hgtrap getModule(unsigned int k, bool reco) const
fixed size matrix
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::vector< int > waferTypeL_

◆ getModules()

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

Definition at line 480 of file HGCalDDDConstants.cc.

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

480  {
481  std::vector<HGCalParameters::hgtrap> mytrs;
482  for (unsigned int k = 0; k < hgpar_->moduleLayR_.size(); ++k)
483  mytrs.emplace_back(hgpar_->getModule(k, true));
484  return mytrs;
485 }
hgtrap getModule(unsigned int k, bool reco) const
std::vector< int > moduleLayR_
const HGCalParameters * hgpar_

◆ getParameter()

const HGCalParameters* HGCalDDDConstants::getParameter ( ) const
inline

◆ getPhiBins()

int HGCalDDDConstants::getPhiBins ( int  lay) const

Definition at line 487 of file HGCalDDDConstants.cc.

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

487 { return (tileTrapezoid() ? hgpar_->scintCells(lay) : 0); }
bool tileTrapezoid() const
const HGCalParameters * hgpar_
int scintCells(const int layer) const

◆ getRadiusLayer()

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

Definition at line 91 of file HGCalDDDConstants.h.

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

91  {
93  }
int scintType(const int layer) const
bool tileTrapezoid() const
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_

◆ getRangeR()

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

Definition at line 489 of file HGCalDDDConstants.cc.

References hgpar_, layerIndex(), HGCalParameters::rMaxLayHex_, and HGCalParameters::rMinLayHex_.

489  {
490  int indx = layerIndex(lay, false);
491  if ((indx >= 0) && (indx < static_cast<int>(hgpar_->rMinLayHex_.size())))
492  return std::make_pair(hgpar_->rMinLayHex_[indx], hgpar_->rMaxLayHex_[indx]);
493  else
494  return std::make_pair(0, -1.);
495 }
int layerIndex(int lay, bool reco) const
std::vector< double > rMinLayHex_
std::vector< double > rMaxLayHex_
const HGCalParameters * hgpar_

◆ getREtaRange()

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

Definition at line 497 of file HGCalDDDConstants.cc.

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

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

497  {
498  int irmin(0), irmax(0);
499  if (tileTrapezoid()) {
500  int indx = layerIndex(lay, false);
501  if ((indx >= 0) && (indx < static_cast<int>(hgpar_->iradMinBH_.size()))) {
502  irmin = hgpar_->iradMinBH_[indx];
503  irmax = hgpar_->iradMaxBH_[indx];
504  }
505  }
506  return std::make_pair(irmin, irmax);
507 }
std::vector< int > iradMaxBH_
int layerIndex(int lay, bool reco) const
bool tileTrapezoid() const
std::vector< int > iradMinBH_
const HGCalParameters * hgpar_

◆ getTrForm()

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

Definition at line 94 of file HGCalDDDConstants.h.

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

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

94 { return hgpar_->getTrForm(k); }
hgtrform getTrForm(unsigned int k) const
const HGCalParameters * hgpar_

◆ getTrFormN()

unsigned int HGCalDDDConstants::getTrFormN ( ) const
inline

Definition at line 95 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::trformIndex_.

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

95 { return hgpar_->trformIndex_.size(); }
std::vector< uint32_t > trformIndex_
const HGCalParameters * hgpar_

◆ getTrForms()

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

Definition at line 509 of file HGCalDDDConstants.cc.

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

Referenced by HGCalTrackCollectionProducer::beginLuminosityBlock().

509  {
510  std::vector<HGCalParameters::hgtrform> mytrs;
511  for (unsigned int k = 0; k < hgpar_->trformIndex_.size(); ++k)
512  mytrs.emplace_back(hgpar_->getTrForm(k));
513  return mytrs;
514 }
std::vector< uint32_t > trformIndex_
hgtrform getTrForm(unsigned int k) const
const HGCalParameters * hgpar_

◆ getTypeHex()

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

Definition at line 525 of file HGCalDDDConstants.cc.

References hgpar_, nano_mu_digi_cff::layer, HGCalParameters::typesInLayers_, waferHexagon8(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferTypeL_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

Referenced by HGCalTriggerGeometryV9Imp2::detIdWaferType(), HGCalTriggerGeometryV9Imp3::detIdWaferType(), and HGCalTopology::neighbors().

525  {
526  // Get the module type for a silicon wafer
527  if (waferHexagon8()) {
529  return ((itr == hgpar_->typesInLayers_.end() ? 2 : hgpar_->waferTypeL_[itr->second]));
530  } else {
531  return -1;
532  }
533 }
int32_t waferU(const int32_t index)
bool waferHexagon8() const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
wafer_map typesInLayers_
int32_t waferV(const int32_t index)
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_

◆ getTypeTrap()

int HGCalDDDConstants::getTypeTrap ( int  layer) const

Definition at line 516 of file HGCalDDDConstants.cc.

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

Referenced by HGCalTriggerGeometryV9Imp3::detIdWaferType().

516  {
517  // Get the module type for scinitllator
518  if (tileTrapezoid()) {
519  return hgpar_->scintType(layer);
520  } else {
521  return -1;
522  }
523 }
int scintType(const int layer) const
bool tileTrapezoid() const
const HGCalParameters * hgpar_

◆ getUVMax()

int HGCalDDDConstants::getUVMax ( int  type) const
inline

◆ getXY()

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

Definition at line 535 of file HGCalDDDConstants.cc.

References HGCalParameters::firstLayer_, hgpar_, nano_mu_digi_cff::layer, HGCalParameters::layerRotV_, HGCalParameters::layerType_, x, testProducerWithPsetDescEmpty_cfi::x1, y, and testProducerWithPsetDescEmpty_cfi::y1.

Referenced by localToGlobal8(), locateCell(), waferFromPosition(), waferLocal2Global(), and waferPosition().

535  {
536  int ll = layer - hgpar_->firstLayer_;
537  double x0(x), y0(y);
538  if ((!hgpar_->layerType_.empty()) && (ll < static_cast<int>(hgpar_->layerRotV_.size()))) {
539  if (forwd) {
540  x0 = x * hgpar_->layerRotV_[ll].first + y * hgpar_->layerRotV_[ll].second;
541  y0 = y * hgpar_->layerRotV_[ll].first - x * hgpar_->layerRotV_[ll].second;
542  } else {
543  x0 = x * hgpar_->layerRotV_[ll].first - y * hgpar_->layerRotV_[ll].second;
544  y0 = y * hgpar_->layerRotV_[ll].first + x * hgpar_->layerRotV_[ll].second;
545  }
546  }
547 #ifdef EDM_ML_DEBUG
548  double x1(x0), y1(y0);
549  if (ll < static_cast<int>(hgpar_->layerRotV_.size())) {
550  if (forwd) {
551  x1 = x0 * hgpar_->layerRotV_[ll].first - y0 * hgpar_->layerRotV_[ll].second;
552  y1 = y0 * hgpar_->layerRotV_[ll].first + x0 * hgpar_->layerRotV_[ll].second;
553  } else {
554  x1 = x0 * hgpar_->layerRotV_[ll].first + y0 * hgpar_->layerRotV_[ll].second;
555  y1 = y0 * hgpar_->layerRotV_[ll].first - x0 * hgpar_->layerRotV_[ll].second;
556  }
557  }
558  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << layer << ":" << ll << " mode " << forwd << " x " << x
559  << ":" << x0 << ":" << x1 << " y " << y << ":" << y0 << ":" << y1;
560 #endif
561  return std::make_pair(x0, y0);
562 }
Log< level::Info, true > LogVerbatim
std::vector< std::pair< double, double > > layerRotV_
std::vector< int > layerType_
const HGCalParameters * hgpar_

◆ guardRingOffset()

double HGCalDDDConstants::guardRingOffset ( bool  reco) const

Definition at line 564 of file HGCalDDDConstants.cc.

References HGCalParameters::guardRingOffset_, hgpar_, and HGCalParameters::k_ScaleToDDD.

Referenced by HGCalSD::update().

564  {
566 }
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

◆ isHalfCell()

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

Definition at line 568 of file HGCalDDDConstants.cc.

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

Referenced by hgcal::RecHitTools::isHalfCell().

568  {
569  if (waferType < 1 || cell < 0)
570  return false;
572  ? hgpar_->cellCoarseHalf_[cell]
573  : hgpar_->cellFineHalf_[cell];
574 }
std::vector< bool > cellCoarseHalf_
std::vector< bool > cellFineHalf_
static constexpr int32_t WaferLD300
Definition: HGCalTypes.h:32
int waferType(DetId const &id, bool fromFile) const
const HGCalParameters * hgpar_
static constexpr int32_t WaferLD200
Definition: HGCalTypes.h:31

◆ isValidCell()

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

Definition at line 2079 of file HGCalDDDConstants.cc.

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

Referenced by isValidHex().

2079  {
2080  // Calculate the position of the cell
2081  // Works for options HGCalHexagon/HGCalHexagonFull
2082  double x = hgpar_->waferPosX_[wafer];
2083  double y = hgpar_->waferPosY_[wafer];
2084  if (((hgpar_->waferTypeT_[wafer] - 1) == HGCSiliconDetId::HGCalHD120) ||
2085  ((hgpar_->waferTypeT_[wafer] - 1) == HGCSiliconDetId::HGCalHD200)) {
2086  x += hgpar_->cellFineX_[cell];
2087  y += hgpar_->cellFineY_[cell];
2088  } else {
2089  x += hgpar_->cellCoarseX_[cell];
2090  y += hgpar_->cellCoarseY_[cell];
2091  }
2092  double rr = sqrt(x * x + y * y);
2093  bool result = ((rr >= hgpar_->rMinLayHex_[lay - 1]) && (rr <= hgpar_->rMaxLayHex_[lay - 1]) &&
2094  (wafer < static_cast<int>(hgpar_->waferPosX_.size())));
2095 #ifdef EDM_ML_DEBUG
2096  if (!result)
2097  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << wafer << ":" << cell << " Position " << x << ":" << y
2098  << ":" << rr << " Compare Limits " << hgpar_->rMinLayHex_[lay - 1] << ":"
2099  << hgpar_->rMaxLayHex_[lay - 1] << " Flag " << result;
2100 #endif
2101  return result;
2102 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
T sqrt(T t)
Definition: SSEVec.h:23
std::vector< double > rMinLayHex_
std::vector< double > rMaxLayHex_
std::vector< double > cellFineX_
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_

◆ isValidCell8()

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

Definition at line 2104 of file HGCalDDDConstants.cc.

References cassetteMode(), HGCalParameters::cellCoarseIndex_, HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineIndex_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, HGCalParameters::firstLayer_, HGCalWaferMask::goodCell(), HGCSiliconDetId::HGCalHD120, HGCSiliconDetId::HGCalHD200, hgpar_, mode_, N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, mps_fire::result, HGCalParameters::rMaxLayHex_, HGCalParameters::rMinLayHex_, findQualityFiles::rr, mathSSE::sqrt(), waferHexagon8File(), waferPositionNoRot(), waferTypeRotation(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), x, geometryCSVtoXML::xy, and y.

Referenced by isValidHex8().

2104  {
2105  bool result(false);
2106  auto partn = waferTypeRotation(lay, waferU, waferV, false, false);
2107 #ifdef EDM_ML_DEBUG
2108  edm::LogVerbatim("HGCalGeom") << "waferHexagon8 " << waferHexagon8File() << ":" << mode_ << ":" << cassetteMode()
2109  << " part " << partn.first << ":" << partn.second;
2110 #endif
2111  if (cassetteMode()) {
2112  result = HGCalWaferMask::goodCell(cellU, cellV, partn.first);
2113 #ifdef EDM_ML_DEBUG
2114  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << waferU << ":" << waferV << ":" << cellU << ":" << cellV
2115  << " Result " << result << " from goodCell";
2116 #endif
2117  } else {
2118  float x(0), y(0);
2119  int kndx = cellV * 100 + cellU;
2121  auto ktr = hgpar_->cellFineIndex_.find(kndx);
2122  if (ktr != hgpar_->cellFineIndex_.end()) {
2123  x = hgpar_->cellFineX_[ktr->second];
2124  y = hgpar_->cellFineY_[ktr->second];
2125  }
2126 #ifdef EDM_ML_DEBUG
2127  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
2128  << (ktr != hgpar_->cellFineIndex_.end());
2129 #endif
2130  } else {
2131  auto ktr = hgpar_->cellCoarseIndex_.find(kndx);
2132  if (ktr != hgpar_->cellCoarseIndex_.end()) {
2133  x = hgpar_->cellCoarseX_[ktr->second];
2134  y = hgpar_->cellCoarseY_[ktr->second];
2135  }
2136 #ifdef EDM_ML_DEBUG
2137  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
2138  << (ktr != hgpar_->cellCoarseIndex_.end());
2139 #endif
2140  }
2141  const auto& xy = waferPositionNoRot(lay, waferU, waferV, true, false);
2142  x += xy.first;
2143  y += xy.second;
2144 #ifdef EDM_ML_DEBUG
2145  edm::LogVerbatim("HGCalGeom") << "With wafer (" << waferU << "," << waferV << ") " << x << ":" << y;
2146 #endif
2147  double rr = sqrt(x * x + y * y);
2148  int ll = lay - hgpar_->firstLayer_;
2149  double tol = waferHexagon8File() ? 0.5 : 0.0;
2150  result = (((rr + tol) >= hgpar_->rMinLayHex_[ll]) && (rr <= hgpar_->rMaxLayHex_[ll]));
2151 #ifdef EDM_ML_DEBUG
2152  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << ll << ":" << waferU << ":" << waferV << ":" << cellU
2153  << ":" << cellV << " Position " << x << ":" << y << ":" << rr << " Compare Limits "
2154  << hgpar_->rMinLayHex_[ll] << ":" << hgpar_->rMaxLayHex_[ll] << " Flag " << result
2155  << " from Radius Limits";
2156 #endif
2157  if (result && waferHexagon8File()) {
2159  : hgpar_->nCellsCoarse_;
2160  result = HGCalWaferMask::goodCell(cellU, cellV, N, partn.first, partn.second);
2161 #ifdef EDM_ML_DEBUG
2162  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << waferU << ":" << waferV << ":" << cellU << ":" << cellV
2163  << " N " << N << " part " << partn.first << ":" << partn.second << " Result "
2164  << result << " from goodCell";
2165 #endif
2166  }
2167  }
2168  return result;
2169 }
Log< level::Info, true > LogVerbatim
wafer_map cellFineIndex_
int32_t waferU(const int32_t index)
static bool goodCell(int u, int v, int N, int type, int rotn)
std::vector< double > cellFineY_
std::pair< int, int > waferTypeRotation(int layer, int waferU, int waferV, bool fromFile, bool debug) const
std::vector< double > cellCoarseX_
T sqrt(T t)
Definition: SSEVec.h:23
std::vector< double > rMinLayHex_
std::vector< double > rMaxLayHex_
#define N
Definition: blowfish.cc:9
wafer_map cellCoarseIndex_
bool waferHexagon8File() const
std::vector< double > cellFineX_
const HGCalGeometryMode::GeometryMode mode_
bool cassetteMode() const
int32_t waferV(const int32_t index)
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug) const

◆ isValidHex()

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

Definition at line 576 of file HGCalDDDConstants.cc.

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

Referenced by HGCalTopology::valid().

576  {
577  // Check validity for a layer|wafer|cell of pre-TDR version
578  bool result(false), resultMod(false);
579  int cellmax(0);
580  if (waferHexagon6()) {
581  int32_t copyNumber = hgpar_->waferCopy_[mod];
582  result = ((lay > 0 && lay <= static_cast<int>(layers(reco))));
583  if (result) {
584  const int32_t lay_idx = reco ? (lay - 1) * 3 + 1 : lay;
585  const auto& the_modules = hgpar_->copiesInLayers_[lay_idx];
586  auto moditr = the_modules.find(copyNumber);
587  result = resultMod = (moditr != the_modules.end());
588 #ifdef EDM_ML_DEBUG
589  if (!result)
590  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << lay << ":" << lay_idx << " Copy " << copyNumber
591  << ":" << mod << " Flag " << result;
592 #endif
593  if (result) {
594  if (moditr->second >= 0) {
595  if (mod >= static_cast<int>(hgpar_->waferTypeT_.size()))
596  edm::LogWarning("HGCalGeom") << "Module no. out of bound for " << mod << " to be compared with "
597  << (hgpar_->waferTypeT_).size() << " ***** ERROR *****";
598  cellmax = (((hgpar_->waferTypeT_[mod] - 1) == HGCSiliconDetId::HGCalHD120) ||
600  ? static_cast<int>(hgpar_->cellFineX_.size())
601  : static_cast<int>(hgpar_->cellCoarseX_.size());
602  result = (cell >= 0 && cell <= cellmax);
603  } else {
604  result = isValidCell(lay_idx, mod, cell);
605  }
606  }
607  }
608  }
609 
610 #ifdef EDM_ML_DEBUG
611  if (!result)
612  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << lay << ":"
613  << (lay > 0 && (lay <= static_cast<int>(layers(reco)))) << " Module " << mod << ":"
614  << resultMod << " Cell " << cell << ":" << cellmax << ":"
615  << (cell >= 0 && cell <= cellmax) << ":" << maxCells(reco);
616 #endif
617  return result;
618 }
size
Write out results.
Log< level::Info, true > LogVerbatim
bool isValidCell(int layindex, int wafer, int cell) const
layer_map copiesInLayers_
bool waferHexagon6() const
std::vector< double > cellCoarseX_
int maxCells(bool reco) const
unsigned int layers(bool reco) const
std::vector< double > cellFineX_
fixed size matrix
std::vector< int > waferCopy_
std::vector< int > waferTypeT_
Log< level::Warning, false > LogWarning
const HGCalParameters * hgpar_
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4

◆ isValidHex8() [1/2]

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

Definition at line 620 of file HGCalDDDConstants.cc.

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

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

620  {
621  // Check validity for a layer|wafer|cell of post-TDR version
622  int indx = HGCalWaferIndex::waferIndex(layer, modU, modV);
623  auto itr = hgpar_->typesInLayers_.find(indx);
624 #ifdef EDM_ML_DEBUG
625  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferType " << layer << ":" << modU << ":" << modV
626  << ":" << indx << " Test " << (itr != hgpar_->typesInLayers_.end());
627 #endif
628  if (itr == hgpar_->typesInLayers_.end()) {
629 #ifdef EDM_ML_DEBUG
630  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:: Cannot find " << layer << ":" << modU << ":" << modV
631  << " in wadferIndex";
632 #endif
633  return false;
634  }
635 
636  if (fullAndPart_) {
637  auto ktr = hgpar_->waferInfoMap_.find(indx);
638 #ifdef EDM_ML_DEBUG
639  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferInfoMap " << layer << ":" << modU << ":"
640  << modV << ":" << indx << " Test " << (ktr != hgpar_->waferInfoMap_.end());
641 #endif
642  if (ktr == hgpar_->waferInfoMap_.end()) {
643 #ifdef EDM_ML_DEBUG
644  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:: Cannot find " << layer << ":" << modU << ":" << modV
645  << " in wadferInfoMap";
646 #endif
647  return false;
648  }
649  } else {
650  auto jtr = waferIn_.find(indx);
651 #ifdef EDM_ML_DEBUG
652  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferIn " << jtr->first << ":" << jtr->second;
653 #endif
654  if (!(jtr->second)) {
655 #ifdef EDM_ML_DEBUG
656  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:: Cannot find " << layer << ":" << modU << ":" << modV
657  << " in wadferIn";
658 #endif
659  return false;
660  }
661  }
662 
663  if (fullAndPart || fullAndPart_) {
664  auto ktr = hgpar_->waferTypes_.find(indx);
665  if (ktr != hgpar_->waferTypes_.end()) {
666  if (hgpar_->waferMaskMode_ > 0) {
667  if (ktr->second.first == HGCalTypes::WaferOut) {
668 #ifdef EDM_ML_DEBUG
669  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:: Cannot find " << layer << ":" << modU << ":" << modV
670  << " due to WaferOut";
671 #endif
672  return false;
673  }
674  } else {
675  if (ktr->second.first < HGCalTypes::WaferCornerMin) {
676 #ifdef EDM_ML_DEBUG
677  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:: Cannot find " << layer << ":" << modU << ":" << modV
678  << " due to WaferCornerMin";
679 #endif
680  return false;
681  }
682  }
683  }
684  }
685  return true;
686 }
Log< level::Info, true > LogVerbatim
static constexpr int32_t WaferOut
Definition: HGCalTypes.h:56
std::unordered_map< int32_t, bool > waferIn_
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
waferT_map waferTypes_
wafer_map typesInLayers_
static constexpr int32_t WaferCornerMin
Definition: HGCalTypes.h:76
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ isValidHex8() [2/2]

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

Definition at line 688 of file HGCalDDDConstants.cc.

References hgpar_, isValidCell8(), isValidHex8(), nano_mu_digi_cff::layer, N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, HGCalParameters::typesInLayers_, HGCalTypes::WaferHD120, HGCalTypes::WaferHD200, HGCalWaferIndex::waferIndex(), and HGCalParameters::waferTypeL_.

688  {
689  // First check validity for a layer|wafer| of post TDR version
690 #ifdef EDM_ML_DEBUG
691  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:: layer|wafer " << layer << ":" << modU << ":" << modV << ":"
692  << fullAndPart << " Valid " << isValidHex8(layer, modU, modV, fullAndPart);
693 #endif
694  if (!isValidHex8(layer, modU, modV, fullAndPart))
695  return false;
696  int indx = HGCalWaferIndex::waferIndex(layer, modU, modV);
697  auto itr = hgpar_->typesInLayers_.find(indx);
698  int type = hgpar_->waferTypeL_[itr->second];
699  int N = (((hgpar_->waferTypeL_[itr->second] == HGCalTypes::WaferHD120) ||
700  (hgpar_->waferTypeL_[itr->second] == HGCalTypes::WaferHD200))
702  : hgpar_->nCellsCoarse_);
703 #ifdef EDM_ML_DEBUG
704  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:Cell " << cellU << ":" << cellV << ":" << N
705  << " Tests " << (cellU >= 0) << ":" << (cellU < 2 * N) << ":" << (cellV >= 0) << ":"
706  << (cellV < 2 * N) << ":" << ((cellV - cellU) < N) << ":" << ((cellU - cellV) <= N);
707 #endif
708  if ((cellU < 0) || (cellU >= 2 * N) || (cellV < 0) || (cellV >= 2 * N)) {
709 #ifdef EDM_ML_DEBUG
710  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:: Cannot statisfy Cell 1 condition " << cellU << ":" << cellV
711  << ":" << N;
712 #endif
713  return false;
714  }
715  if (((cellV - cellU) >= N) || ((cellU - cellV) > N)) {
716 #ifdef EDM_ML_DEBUG
717  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:: Cannot statisfy Cell 2 condition " << cellU << ":" << cellV
718  << ":" << N;
719 #endif
720  return false;
721  }
722  return isValidCell8(layer, modU, modV, cellU, cellV, type);
723 }
Log< level::Info, true > LogVerbatim
static constexpr int32_t WaferHD200
Definition: HGCalTypes.h:33
bool isValidHex8(int lay, int waferU, int waferV, bool fullAndPart) const
bool isValidCell8(int lay, int waferU, int waferV, int cellU, int cellV, int type) const
static constexpr int32_t WaferHD120
Definition: HGCalTypes.h:30
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
#define N
Definition: blowfish.cc:9
wafer_map typesInLayers_
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_

◆ isValidTrap()

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

Definition at line 725 of file HGCalDDDConstants.cc.

References getIndex(), hgpar_, hcalRecHitTable_cff::iphi, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, nano_mu_digi_cff::layer, convertSQLiteXML::ok, HGCalParameters::scintCells(), tileExist(), trapezoidFile(), validateGeometry_cfg::valid, and ecaldqm::zside().

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

725  {
726  // Check validity for a layer|eta|phi of scintillator
727  const auto& indx = getIndex(layer, true);
728  if (indx.first < 0)
729  return false;
730  bool ok = ((irad >= hgpar_->iradMinBH_[indx.first]) && (irad <= (hgpar_->iradMaxBH_[indx.first] + 1)) && (iphi > 0) &&
731  (iphi <= hgpar_->scintCells(layer)));
732  bool valid = ((ok && trapezoidFile()) ? tileExist(zside, layer, irad, iphi) : ok);
733 #ifdef EDM_ML_DEBUG
734  bool tileEx = trapezoidFile() ? tileExist(zside, layer, irad, iphi) : true;
735  edm::LogVerbatim("HGCalGeomT") << "HGCalDDDConstants::isValidityTrap: Input " << zside << ":" << layer << ":" << irad
736  << ":" << iphi << " Range on Ring " << hgpar_->iradMinBH_[indx.first] << ":"
737  << (hgpar_->iradMaxBH_[indx.first] + 1)
738  << " Range on phi 0:" << hgpar_->scintCells(layer) << " tileExist " << tileEx
739  << " Valid " << ok << ":" << valid;
740 #endif
741  return valid;
742 }
std::vector< int > iradMaxBH_
Log< level::Info, true > LogVerbatim
bool trapezoidFile() const
int zside(DetId const &)
std::pair< int, float > getIndex(int lay, bool reco) const
bool tileExist(int zside, int layer, int ring, int phi) const
std::vector< int > iradMinBH_
const HGCalParameters * hgpar_
int scintCells(const int layer) const

◆ lastLayer()

int HGCalDDDConstants::lastLayer ( bool  reco) const

Definition at line 744 of file HGCalDDDConstants.cc.

References HGCalParameters::firstLayer_, hgpar_, and tot_layers_.

Referenced by HGCalGeometry::neighborZ(), HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_(), and tileCount().

744  {
745  return (hgpar_->firstLayer_ + tot_layers_[static_cast<int>(reco)] - 1);
746 }
fixed size matrix
std::array< uint32_t, 2 > tot_layers_
const HGCalParameters * hgpar_

◆ layerFromIndex()

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

Definition at line 2059 of file HGCalDDDConstants.cc.

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

Referenced by waferIndex().

2059  {
2060  int ll(-1);
2061  if (waferHexagon6() && reco) {
2062  ll = static_cast<int>(std::find(hgpar_->depthLayerF_.begin(), hgpar_->depthLayerF_.end(), index) -
2063  hgpar_->depthLayerF_.begin());
2064  if (ll == static_cast<int>(hgpar_->depthLayerF_.size()))
2065  ll = -1;
2066  } else {
2067  ll = static_cast<int>(std::find(hgpar_->layerIndex_.begin(), hgpar_->layerIndex_.end(), index) -
2068  hgpar_->layerIndex_.begin());
2069  if (ll == static_cast<int>(hgpar_->layerIndex_.size()))
2070  ll = -1;
2071  }
2072 #ifdef EDM_ML_DEBUG
2073  edm::LogVerbatim("HGCalGeom") << "LayerFromIndex for " << index << ":" << reco << ":" << waferHexagon6() << " is"
2074  << ll << ":" << (ll + hgpar_->firstLayer_);
2075 #endif
2076  return ((ll < 0) ? ll : (ll + hgpar_->firstLayer_));
2077 }
Log< level::Info, true > LogVerbatim
std::vector< int > depthLayerF_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
bool waferHexagon6() const
std::vector< int > layerIndex_
fixed size matrix
const HGCalParameters * hgpar_

◆ layerIndex()

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

Definition at line 750 of file HGCalDDDConstants.cc.

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

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

750  {
751  int ll = lay - hgpar_->firstLayer_;
752  if (ll < 0 || ll >= static_cast<int>(hgpar_->layerIndex_.size()))
753  return -1;
754  if (waferHexagon6()) {
755  if (reco && ll >= static_cast<int>(hgpar_->depthIndex_.size()))
756  return -1;
757  return (reco ? hgpar_->depthLayerF_[ll] : hgpar_->layerIndex_[ll]);
758  } else {
759  return (hgpar_->layerIndex_[ll]);
760  }
761 }
std::vector< int > depthLayerF_
bool waferHexagon6() const
std::vector< int > layerIndex_
fixed size matrix
std::vector< int > depthIndex_
const HGCalParameters * hgpar_

◆ layers()

unsigned int HGCalDDDConstants::layers ( bool  reco) const

◆ layersInit()

unsigned int HGCalDDDConstants::layersInit ( bool  reco) const

Definition at line 763 of file HGCalDDDConstants.cc.

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

Referenced by HGCalDDDConstants().

763  {
764  return (reco ? hgpar_->depthIndex_.size() : hgpar_->layerIndex_.size());
765 }
std::vector< int > layerIndex_
fixed size matrix
std::vector< int > depthIndex_
const HGCalParameters * hgpar_

◆ layerType()

int HGCalDDDConstants::layerType ( int  lay) const
inline

◆ levelTop()

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

Definition at line 132 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::levelT_.

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

132 { return hgpar_->levelT_[ind]; }
std::vector< int > levelT_
const HGCalParameters * hgpar_

◆ localToGlobal8()

std::pair< float, float > HGCalDDDConstants::localToGlobal8 ( int  zside,
int  lay,
int  waferU,
int  waferV,
double  localX,
double  localY,
bool  reco,
bool  debug 
) const

Definition at line 767 of file HGCalDDDConstants.cc.

References cassetteMode(), debug, HGCalParameters::firstLayer_, HGCalCassette::getShift(), getXY(), hgcassette_, hgpar_, ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::if(), HGCalParameters::k_ScaleToDDD, HGCalParameters::layerType_, HGCalTypes::WaferCenterR, HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, waferPositionNoRot(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), x, geometryCSVtoXML::xy, y, and ecaldqm::zside().

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

768  {
769  double x(localX), y(localY);
770  bool rotx =
772  if (debug)
773  edm::LogVerbatim("HGCalGeom") << "LocalToGlobal8 " << lay << ":" << (lay - hgpar_->firstLayer_) << ":" << rotx
774  << " Local (" << x << ":" << y << ") Reco " << reco;
775  if (!reco) {
778  }
779  const auto& xy = waferPositionNoRot(lay, waferU, waferV, reco, debug);
780  x += xy.first;
781  y += xy.second;
782  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
783  auto ktr = hgpar_->waferInfoMap_.find(indx);
784  if (cassetteMode() && (ktr != hgpar_->waferInfoMap_.end())) {
785  auto cshift = hgcassette_.getShift(lay, -1, (ktr->second).cassette);
786  std::ostringstream st1;
787  if (debug)
788  st1 << "Cassette " << (ktr->second).cassette << " Shift " << cshift.first << ":" << cshift.second << " Original "
789  << x << ":" << y;
790  if (!reco) {
791  x -= ((HGCalParameters::k_ScaleToDDD)*zside * cshift.first);
792  y += ((HGCalParameters::k_ScaleToDDD)*cshift.second);
793  } else {
794  x -= (zside * cshift.first);
795  y += cshift.second;
796  }
797  if (debug) {
798  st1 << " Final " << x << ":" << y;
799  edm::LogVerbatim("HGCalGeom") << st1.str();
800  }
801  }
802  if (debug)
803  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << " by adding " << xy.first << ":" << xy.second;
804  return (rotx ? getXY(lay, x, y, false) : std::make_pair(x, y));
805 }
Log< level::Info, true > LogVerbatim
HGCalCassette hgcassette_
int32_t waferU(const int32_t index)
std::pair< double, double > getShift(int layer, int zside, int cassette, bool scnt=false) const
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
int zside(DetId const &)
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
std::vector< int > layerType_
static constexpr int32_t WaferCenterR
Definition: HGCalTypes.h:27
static constexpr double k_ScaleToDDD
#define debug
Definition: HDRShower.cc:19
fixed size matrix
bool cassetteMode() const
int32_t waferV(const int32_t index)
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug) const

◆ locateCell() [1/4]

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

Definition at line 807 of file HGCalDDDConstants.cc.

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

Referenced by HGCalSimHitValidation::analyzeHits(), HGCalTB23Analyzer::analyzeSimHits(), cellInLayer(), HFNoseNumberingScheme::checkPosition(), HGCalNumberingScheme::checkPosition(), HGCalGeometry::get8Corners(), HGCalGeometry::getCorners(), HGCalGeometry::getNewCorners(), HGCalGeometry::getPosition(), locateCell(), HGCScintSD::setDetUnitId(), and HGCalSD::setDetUnitId().

807  {
808  // type refers to wafer # for hexagon cell
809  float x(999999.), y(999999.);
810  const auto& index = getIndex(lay, reco);
811  int i = index.first;
812  if (i < 0)
813  return std::make_pair(x, y);
814  if (waferHexagon6()) {
815  x = hgpar_->waferPosX_[type];
816  y = hgpar_->waferPosY_[type];
817 #ifdef EDM_ML_DEBUG
818  float x0(x), y0(y);
819 #endif
822  x += hgpar_->cellFineX_[cell];
823  y += hgpar_->cellFineY_[cell];
824  } else {
825  x += hgpar_->cellCoarseX_[cell];
826  y += hgpar_->cellCoarseY_[cell];
827  }
828 #ifdef EDM_ML_DEBUG
829  edm::LogVerbatim("HGCalGeom") << "LocateCell (Wafer) " << x0 << ":" << y0 << " Final " << x << ":" << y;
830 #endif
831  if (!reco) {
834  }
835  }
836  return std::make_pair(x, y);
837 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
std::vector< double > cellFineY_
bool waferHexagon6() const
std::vector< double > cellCoarseX_
std::pair< int, float > getIndex(int lay, bool reco) const
static constexpr double k_ScaleToDDD
std::vector< double > cellFineX_
fixed size matrix
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_

◆ locateCell() [2/4]

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

Definition at line 839 of file HGCalDDDConstants.cc.

References python.cmstools::all(), cassetteMode(), HGCalParameters::cellCoarseIndex_, HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineIndex_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, cellOffset_, HGCalCell::cellPlacementIndex(), HGCalCell::cellPlacementOld, debug, HGCalParameters::firstLayer_, HGCalCassette::getShift(), getXY(), HGCSiliconDetId::HGCalHD120, HGCSiliconDetId::HGCalHD200, hgcassette_, hgcell_, hgpar_, ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::if(), HGCalParameters::k_ScaleToDDD, HGCalTypes::layerFrontBack(), layerType(), hgcalPerformanceValidation::orient, partialWaferType(), HGCalParameters::typesInLayers_, HGCalTypes::WaferCenterR, waferHexagon8File(), waferHexagon8Fine(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, waferPositionNoRot(), HGCalParameters::waferTypeL_, HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), x, geometryCSVtoXML::xy, and y.

849  {
850  double x(0), y(0);
851  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
852  auto itr = hgpar_->typesInLayers_.find(indx);
853  int type = ((itr == hgpar_->typesInLayers_.end()) ? 2 : hgpar_->waferTypeL_[itr->second]);
854  int layertype = layerType(lay);
855  bool rotx = (norot) ? false : (layertype == HGCalTypes::WaferCenterR);
856  if (debug) {
857  edm::LogVerbatim("HGCalGeom") << "LocateCell " << lay << ":" << (lay - hgpar_->firstLayer_) << ":" << layertype
858  << ":" << rotx << ":" << waferU << ":" << waferV << ":" << indx << ":"
859  << (itr == hgpar_->typesInLayers_.end()) << ":" << type << " Flags " << reco << ":"
860  << all;
861  }
862  auto ktr = hgpar_->waferInfoMap_.end();
863  int place(HGCalCell::cellPlacementOld);
864  if (waferHexagon8File()) {
865  if (cassetteMode()) {
866  ktr = hgpar_->waferInfoMap_.find(indx);
867  if (ktr != hgpar_->waferInfoMap_.end())
868  place = HGCalCell::cellPlacementIndex(1, HGCalTypes::layerFrontBack(layertype), (ktr->second).orient);
869  }
870  int part = partialWaferType(lay, waferU, waferV);
871  auto xy = (waferHexagon8Fine() || cog) ? cellOffset_->cellOffsetUV2XY1(cellU, cellV, place, type, part)
872  : hgcell_->cellUV2XY2(cellU, cellV, place, type);
873  x = xy.first;
874  y = xy.second;
875  if (debug)
876  edm::LogVerbatim("HGCalGeom") << "Type " << type << " Place " << place << " Cell " << cellU << ":" << cellV
877  << " Position " << x << ":" << y;
878  } else {
879  int kndx = cellV * 100 + cellU;
881  auto jtr = hgpar_->cellFineIndex_.find(kndx);
882  if (jtr != hgpar_->cellFineIndex_.end()) {
883  x = hgpar_->cellFineX_[jtr->second];
884  y = hgpar_->cellFineY_[jtr->second];
885  }
886  if (debug)
887  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
888  << (jtr != hgpar_->cellFineIndex_.end());
889  } else {
890  auto jtr = hgpar_->cellCoarseIndex_.find(kndx);
891  if (jtr != hgpar_->cellCoarseIndex_.end()) {
892  x = hgpar_->cellCoarseX_[jtr->second];
893  y = hgpar_->cellCoarseY_[jtr->second];
894  }
895  if (debug)
896  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y
897  << ":" << (jtr != hgpar_->cellCoarseIndex_.end());
898  }
899  }
900  if (!reco) {
903  }
904  if (all) {
905  const auto& xy = waferPositionNoRot(lay, waferU, waferV, reco, debug);
906  x += xy.first;
907  y += xy.second;
908  if (cassetteMode() && (ktr != hgpar_->waferInfoMap_.end())) {
909  auto cshift = hgcassette_.getShift(lay, -1, (ktr->second).cassette);
910  std::ostringstream st1;
911  if (debug)
912  st1 << "Cassette " << (ktr->second).cassette << " Shift " << cshift.first << ":" << cshift.second
913  << " Original " << x << ":" << y;
914  if (!reco) {
915  x -= ((HGCalParameters::k_ScaleToDDD)*cshift.first);
916  y += ((HGCalParameters::k_ScaleToDDD)*cshift.second);
917  } else {
918  x -= cshift.first;
919  y += cshift.second;
920  }
921  if (debug) {
922  st1 << " Final " << x << ":" << y;
923  edm::LogVerbatim("HGCalGeom") << st1.str();
924  }
925  }
926  if (debug)
927  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << " by adding " << xy.first << ":" << xy.second;
928  }
929  return (rotx ? getXY(lay, x, y, false) : std::make_pair(x, y));
930 }
Log< level::Info, true > LogVerbatim
static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient)
Definition: HGCalCell.cc:239
static constexpr int32_t cellPlacementOld
Definition: HGCalCell.h:25
wafer_map cellFineIndex_
HGCalCassette hgcassette_
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
int32_t waferU(const int32_t index)
std::pair< double, double > getShift(int layer, int zside, int cassette, bool scnt=false) const
std::vector< double > cellFineY_
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
std::vector< double > cellCoarseX_
std::unique_ptr< HGCalCell > hgcell_
bool waferHexagon8Fine() const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
static constexpr int32_t WaferCenterR
Definition: HGCalTypes.h:27
static constexpr double k_ScaleToDDD
#define debug
Definition: HDRShower.cc:19
part
Definition: HCALResponse.h:20
wafer_map cellCoarseIndex_
bool waferHexagon8File() const
std::vector< double > cellFineX_
wafer_map typesInLayers_
fixed size matrix
bool cassetteMode() const
int32_t waferV(const int32_t index)
std::unique_ptr< HGCalCellOffset > cellOffset_
std::vector< double > cellCoarseY_
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
int partialWaferType(int lay, int waferU, int waferV) const
std::vector< int > waferTypeL_
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug) const
int layerType(int lay) const
static constexpr int32_t layerFrontBack(int32_t layerOrient)
Definition: HGCalTypes.h:137

◆ locateCell() [3/4]

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

Definition at line 932 of file HGCalDDDConstants.cc.

References debug, nano_mu_digi_cff::layer, locateCell(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), and ecaldqm::zside().

932  {
933  return locateCell(
934  id.zside(), id.layer(), id.waferU(), id.waferV(), id.cellU(), id.cellV(), true, true, false, cog, debug);
935 }
int32_t waferU(const int32_t index)
int zside(DetId const &)
#define debug
Definition: HDRShower.cc:19
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
int32_t waferV(const int32_t index)

◆ locateCell() [4/4]

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

Definition at line 937 of file HGCalDDDConstants.cc.

References debug, hcalRecHitTable_cff::iphi, nano_mu_digi_cff::layer, locateCellTrap(), and ecaldqm::zside().

937  {
938  return locateCellTrap(id.zside(), id.layer(), id.iradius(), id.iphi(), true, debug);
939 }
int zside(DetId const &)
std::pair< float, float > locateCellTrap(int zside, int lay, int ieta, int iphi, bool reco, bool debug) const
#define debug
Definition: HDRShower.cc:19

◆ locateCellHex()

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

Definition at line 941 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, HGCSiliconDetId::HGCalHD120, HGCSiliconDetId::HGCalHD200, hgpar_, HGCalParameters::k_ScaleToDDD, HGCalParameters::waferTypeT_, x, and y.

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

941  {
942  float x(0), y(0);
943  if ((hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalHD120) ||
945  x = hgpar_->cellFineX_[cell];
946  y = hgpar_->cellFineY_[cell];
947  } else {
948  x = hgpar_->cellCoarseX_[cell];
949  y = hgpar_->cellCoarseY_[cell];
950  }
951  if (!reco) {
954  }
955  return std::make_pair(x, y);
956 }
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
static constexpr double k_ScaleToDDD
std::vector< double > cellFineX_
fixed size matrix
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_

◆ locateCellTrap()

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

Definition at line 958 of file HGCalDDDConstants.cc.

References funct::abs(), cassetteMode(), HGCalParameters::cassettes_, angle_units::operators::convertRadToDeg(), funct::cos(), debug, HGCalParameters::firstLayer_, getIndex(), HGCalCassette::getShift(), hgcassette_, hgpar_, hcalRecHitTable_cff::iphi, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, HGCalParameters::k_ScaleToDDD, SiStripPI::max, SiStripPI::min, HGCalParameters::nphiCassette_, phi, HGCalParameters::phiOffset_, alignCSCRings::r, HGCalParameters::radiusLayer_, FastTimerService_cff::range, rangeR(), HGCalParameters::scintType(), funct::sin(), HGCalTileIndex::tileCassette(), trapezoidFile(), x, HGCalParameters::xLayerHex_, y, HGCalParameters::yLayerHex_, z, and HGCalParameters::zLayerHex_.

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

959  {
960  float x(0), y(0);
961  const auto& indx = getIndex(lay, reco);
962  if (indx.first >= 0) {
963  int ir = std::abs(irad);
964  int type = hgpar_->scintType(lay);
965  double phi = (iphi - 0.5) * indx.second;
966  double z = hgpar_->zLayerHex_[indx.first];
967  double r = 0.5 * (hgpar_->radiusLayer_[type][ir - 1] + hgpar_->radiusLayer_[type][ir]);
968  std::pair<double, double> range = rangeR(z, true);
969  if (debug)
970  edm::LogVerbatim("HGCalGeom") << "locateCellTrap:: Input " << lay << ":" << irad << ":" << iphi << ":" << reco
971  << " IR " << ir << ":" << hgpar_->iradMinBH_[indx.first] << ":"
972  << hgpar_->iradMaxBH_[indx.first] << " Type " << type << " Z " << indx.first << ":"
973  << z << " phi " << phi << ":" << convertRadToDeg(phi) << " R " << r << ":"
974  << range.first << ":" << range.second;
975  if (!trapezoidFile())
976  r = std::max(range.first, std::min(r, range.second));
977  x = r * std::cos(phi);
978  y = r * std::sin(phi);
979  int ll = lay - hgpar_->firstLayer_;
980  x += hgpar_->xLayerHex_[ll];
981  y += hgpar_->yLayerHex_[ll];
982  if (irad < 0)
983  x = -x;
984  if (cassetteMode()) {
986  auto cshift = hgcassette_.getShift(lay, -1, cassette);
987  std::ostringstream st1;
988  if (debug)
989  st1 << "Cassette " << cassette << " Shift " << cshift.first << ":" << cshift.second << " Original " << x << ":"
990  << y;
991  x -= cshift.first;
992  y += cshift.second;
993  if (debug) {
994  st1 << " Final " << x << ":" << y;
995  edm::LogVerbatim("HGCalGeom") << st1.str();
996  }
997  }
998  }
999  if (!reco) {
1002  }
1003  return std::make_pair(x, y);
1004 }
std::vector< int > iradMaxBH_
Log< level::Info, true > LogVerbatim
HGCalCassette hgcassette_
int scintType(const int layer) const
bool trapezoidFile() const
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::pair< double, double > getShift(int layer, int zside, int cassette, bool scnt=false) const
std::vector< double > yLayerHex_
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::pair< int, float > getIndex(int lay, bool reco) const
int32_t tileCassette(int32_t, int32_t, int32_t, int32_t)
std::vector< double > zLayerHex_
std::pair< double, double > rangeR(double z, bool reco) const
static constexpr double k_ScaleToDDD
#define debug
Definition: HDRShower.cc:19
std::vector< int > iradMinBH_
fixed size matrix
bool cassetteMode() const
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
std::vector< double > xLayerHex_

◆ maskCell()

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

Definition at line 1006 of file HGCalDDDConstants.cc.

References cassetteMode(), hcalRecHitTable_cff::detId, DetId::Forward, getUVMax(), HGCalWaferMask::goodCell(), hgpar_, l1ctLayer2EG_cff::id, HGCalParameters::k_CornerSize, HGCalTypes::k_OffsetRotation, nano_mu_digi_cff::layer, ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, HGCalWaferMask::maskCell(), N, edm::second(), findQualityFiles::v, HGCalTypes::WaferFull, waferHexagon8(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalParameters::waferTypes_, HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), and LaserClient_cfi::wl.

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

1006  {
1007  bool mask(false);
1008  if (corners > 2 && corners <= static_cast<int>(HGCalParameters::k_CornerSize)) {
1009  if (waferHexagon8()) {
1010  int N(0), layer(0), waferU(0), waferV(0), u(0), v(0);
1011  if (detId.det() == DetId::Forward) {
1012  HFNoseDetId id(detId);
1013  N = getUVMax(id.type());
1014  layer = id.layer();
1015  waferU = id.waferU();
1016  waferV = id.waferV();
1017  u = id.cellU();
1018  v = id.cellV();
1019  } else {
1021  N = getUVMax(id.type());
1022  layer = id.layer();
1023  waferU = id.waferU();
1024  waferV = id.waferV();
1025  u = id.cellU();
1026  v = id.cellV();
1027  }
1029  auto itr = hgpar_->waferTypes_.find(wl);
1030  auto ktr = hgpar_->waferInfoMap_.find(wl);
1031 #ifdef EDM_ML_DEBUG
1032  edm::LogVerbatim("HGCalGeom") << "MaskCell: Layer " << layer << " Wafer " << waferU << ":" << waferV << " Index "
1033  << wl << ":" << (itr != hgpar_->waferTypes_.end()) << ":"
1034  << (ktr != hgpar_->waferInfoMap_.end());
1035 #endif
1036  if (cassetteMode()) {
1037  int part = (ktr != hgpar_->waferInfoMap_.end()) ? (ktr->second).part : HGCalTypes::WaferFull;
1038  mask = !(HGCalWaferMask::goodCell(u, v, part));
1039  } else if (itr != hgpar_->waferTypes_.end()) {
1040  if ((itr->second).second <= HGCalTypes::k_OffsetRotation)
1041  mask = HGCalWaferMask::maskCell(u, v, N, (itr->second).first, (itr->second).second, corners);
1042  else
1044  u, v, N, (itr->second).first, ((itr->second).second - HGCalTypes::k_OffsetRotation)));
1045  }
1046  }
1047  }
1048  return mask;
1049 }
Log< level::Info, true > LogVerbatim
static constexpr int k_OffsetRotation
Definition: HGCalTypes.h:93
int32_t waferU(const int32_t index)
static bool goodCell(int u, int v, int N, int type, int rotn)
bool waferHexagon8() const
static constexpr uint32_t k_CornerSize
U second(std::pair< T, U > const &p)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
int getUVMax(int type) const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
waferT_map waferTypes_
#define N
Definition: blowfish.cc:9
part
Definition: HCALResponse.h:20
bool cassetteMode() const
int32_t waferV(const int32_t index)
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
static bool maskCell(int u, int v, int N, int ncor, int fcor, int corners)

◆ maxCells() [1/2]

int HGCalDDDConstants::maxCells ( bool  reco) const

Definition at line 1051 of file HGCalDDDConstants.cc.

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

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

1051  {
1052  int cells(0);
1053  for (unsigned int i = 0; i < layers(reco); ++i) {
1054  int lay = reco ? hgpar_->depth_[i] : hgpar_->layer_[i];
1055  if (cells < maxCells(lay, reco))
1056  cells = maxCells(lay, reco);
1057  }
1058  return cells;
1059 }
std::vector< int > layer_
std::vector< int > depth_
int maxCells(bool reco) const
unsigned int layers(bool reco) const
fixed size matrix
const HGCalParameters * hgpar_

◆ maxCells() [2/2]

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

Definition at line 1061 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, hgcalTBTopologyTester_cfi::cells, HGCalParameters::defineFull_, HGCalParameters::firstLayer_, getIndex(), HGCSiliconDetId::HGCalHD120, HGCSiliconDetId::HGCalHD200, HGCSiliconDetId::HGCalLD300, 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().

1061  {
1062  const auto& index = getIndex(lay, reco);
1063  if (index.first < 0)
1064  return 0;
1065  if (waferHexagon6()) {
1066  unsigned int cells(0);
1067  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
1068  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
1069  unsigned int cell = (((hgpar_->waferTypeT_[k] - 1) == HGCSiliconDetId::HGCalHD120) ||
1071  ? (hgpar_->cellFineX_.size())
1072  : (hgpar_->cellCoarseX_.size());
1073  if (cell > cells)
1074  cells = cell;
1075  }
1076  }
1077  return static_cast<int>(cells);
1078  } else if (waferHexagon8()) {
1079  int cells(0);
1080  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
1081  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
1084  int type =
1085  ((itr == hgpar_->typesInLayers_.end()) ? HGCSiliconDetId::HGCalLD300 : hgpar_->waferTypeL_[itr->second]);
1087  ? hgpar_->nCellsFine_
1088  : hgpar_->nCellsCoarse_;
1089  cells = std::max(cells, 3 * N * N);
1090  }
1091  }
1092  return cells;
1093  } else if (tileTrapezoid()) {
1094  return hgpar_->scintCells(index.first + hgpar_->firstLayer_);
1095  } else {
1096  return 0;
1097  }
1098 }
bool waferInLayerTest(int wafer, int lay, bool full) const
int32_t waferU(const int32_t index)
bool waferHexagon8() const
bool waferHexagon6() const
std::vector< double > cellCoarseX_
std::pair< int, float > getIndex(int lay, bool reco) const
bool tileTrapezoid() const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
#define N
Definition: blowfish.cc:9
std::vector< double > cellFineX_
wafer_map typesInLayers_
fixed size matrix
int32_t waferV(const int32_t index)
std::vector< int > waferCopy_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
int scintCells(const int layer) const
std::vector< int > waferTypeL_

◆ maxCellUV()

int HGCalDDDConstants::maxCellUV ( ) const
inline

Definition at line 134 of file HGCalDDDConstants.h.

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

Referenced by HGCalTopology::HGCalTopology().

134 { return (tileTrapezoid() ? hgpar_->nCellsFine_ : 2 * hgpar_->nCellsFine_); }
bool tileTrapezoid() const
const HGCalParameters * hgpar_

◆ maxModules()

int HGCalDDDConstants::maxModules ( ) const
inline

Definition at line 137 of file HGCalDDDConstants.h.

References modHalf_.

137 { return modHalf_; }

◆ maxModulesPerLayer()

int HGCalDDDConstants::maxModulesPerLayer ( ) const
inline

Definition at line 138 of file HGCalDDDConstants.h.

References maxWafersPerLayer_.

138 { return maxWafersPerLayer_; }

◆ maxRows()

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

Definition at line 1100 of file HGCalDDDConstants.cc.

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

1100  {
1101  int kymax(0);
1102  const auto& index = getIndex(lay, reco);
1103  int i = index.first;
1104  if (i < 0)
1105  return kymax;
1106  if (waferHexagon6()) {
1107  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
1109  int ky = ((hgpar_->waferCopy_[k]) / 100) % 100;
1110  if (ky > kymax)
1111  kymax = ky;
1112  }
1113  }
1114  } else if (waferHexagon8()) {
1115  kymax = 1 + 2 * hgpar_->waferUVMaxLayer_[index.first];
1116  }
1117  return kymax;
1118 }
bool waferInLayerTest(int wafer, int lay, bool full) const
bool waferHexagon8() const
bool waferHexagon6() const
std::vector< int > waferUVMaxLayer_
std::pair< int, float > getIndex(int lay, bool reco) const
fixed size matrix
std::vector< int > waferCopy_
const HGCalParameters * hgpar_

◆ minSlope()

double HGCalDDDConstants::minSlope ( ) const
inline

Definition at line 140 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::slopeMin_.

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

140 { return hgpar_->slopeMin_[0]; }
std::vector< double > slopeMin_
const HGCalParameters * hgpar_

◆ modifyUV()

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

Definition at line 1120 of file HGCalDDDConstants.cc.

References HGCSiliconDetId::HGCalHD120, HGCSiliconDetId::HGCalHD200, HGCSiliconDetId::HGCalLD200, and HGCSiliconDetId::HGCalLD300.

Referenced by HGCalTopology::neighbors().

1120  {
1121  // Modify u/v for transition of type1 to type2
1122  int uvx(uv);
1123  if (type1 != type2) {
1124  if ((type1 == HGCSiliconDetId::HGCalHD120) || (type1 == HGCSiliconDetId::HGCalHD200)) {
1125  if ((type2 == HGCSiliconDetId::HGCalLD200) || (type2 == HGCSiliconDetId::HGCalLD300))
1126  uvx = (2 * uv + 1) / 3;
1127  } else {
1128  if ((type2 == HGCSiliconDetId::HGCalHD120) || (type2 == HGCSiliconDetId::HGCalHD200))
1129  uvx = (3 * uv) / 2;
1130  }
1131  }
1132  return uvx;
1133 }

◆ modules()

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

Definition at line 1135 of file HGCalDDDConstants.cc.

References dqmdumpme::first, getIndex(), max_modules_layer_, and dt_dqm_sourceclient_common_cff::reco.

Referenced by wafers().

1135  {
1136  if (getIndex(lay, reco).first < 0)
1137  return 0;
1138  else
1139  return max_modules_layer_[static_cast<int>(reco)][lay];
1140 }
Simrecovecs max_modules_layer_
std::pair< int, float > getIndex(int lay, bool reco) const
fixed size matrix

◆ modulesInit()

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

Definition at line 1142 of file HGCalDDDConstants.cc.

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

Referenced by HGCalDDDConstants().

1142  {
1143  int nmod(0);
1144  const auto& index = getIndex(lay, reco);
1145  if (index.first < 0)
1146  return nmod;
1147  if (!tileTrapezoid()) {
1148  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1149  if (waferInLayerTest(k, index.first, hgpar_->defineFull_))
1150  ++nmod;
1151  }
1152  } else {
1153  nmod = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
1154  }
1155  return nmod;
1156 }
bool waferInLayerTest(int wafer, int lay, bool full) const
std::vector< int > firstModule_
std::pair< int, float > getIndex(int lay, bool reco) const
bool tileTrapezoid() const
std::vector< int > lastModule_
fixed size matrix
const HGCalParameters * hgpar_
std::vector< double > waferPosX_

◆ mouseBite()

double HGCalDDDConstants::mouseBite ( bool  reco) const

Definition at line 1158 of file HGCalDDDConstants.cc.

References hgpar_, HGCalParameters::k_ScaleToDDD, and HGCalParameters::mouseBite_.

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

1158  {
1160 }
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

◆ numberCells() [1/2]

int HGCalDDDConstants::numberCells ( bool  reco) const

Definition at line 1162 of file HGCalDDDConstants.cc.

References hgcalTBTopologyTester_cfi::cells, HGCalParameters::depth_, hgpar_, dqmdumpme::k, HGCalParameters::layer_, dt_dqm_sourceclient_common_cff::reco, HGCalGeomParameters::scintillatorCassette, HGCalGeomParameters::scintillatorFile, tileCount(), tileTrapezoid(), and HGCalParameters::waferMaskMode_.

Referenced by HGCalTopology::allGeomModules().

1162  {
1165  ? tileCount(0, -1)
1166  : 0;
1167  if (cells == 0) {
1168  unsigned int nlayer = (reco) ? hgpar_->depth_.size() : hgpar_->layer_.size();
1169  for (unsigned k = 0; k < nlayer; ++k) {
1170  std::vector<int> ncells = numberCells(((reco) ? hgpar_->depth_[k] : hgpar_->layer_[k]), reco);
1171  cells = std::accumulate(ncells.begin(), ncells.end(), cells);
1172  }
1173  }
1174  return cells;
1175 }
std::vector< int > layer_
static constexpr int scintillatorCassette
std::vector< int > depth_
static constexpr int scintillatorFile
int tileCount(int layer, int ring) const
bool tileTrapezoid() const
int numberCells(bool reco) const
fixed size matrix
const HGCalParameters * hgpar_

◆ numberCells() [2/2]

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

Definition at line 1177 of file HGCalDDDConstants.cc.

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

1177  {
1178  const auto& index = getIndex(lay, reco);
1179  int i = index.first;
1180  std::vector<int> ncell;
1181  if (i >= 0) {
1182  if (waferHexagon6()) {
1183  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
1185  unsigned int cell = (((hgpar_->waferTypeT_[k] - 1) == HGCSiliconDetId::HGCalHD120) ||
1187  ? (hgpar_->cellFineX_.size())
1188  : (hgpar_->cellCoarseX_.size());
1189  ncell.emplace_back(static_cast<int>(cell));
1190  }
1191  }
1192  } else if (tileTrapezoid()) {
1193  int nphi = hgpar_->scintCells(lay);
1194  for (int k = hgpar_->firstModule_[i]; k <= hgpar_->lastModule_[i]; ++k)
1195  ncell.emplace_back(nphi);
1196  } else {
1197  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
1198  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
1199  int cell = numberCellsHexagon(lay,
1202  true);
1203  ncell.emplace_back(cell);
1204  }
1205  }
1206  }
1207  }
1208  return ncell;
1209 }
const int nphi
bool waferInLayerTest(int wafer, int lay, bool full) const
int32_t waferU(const int32_t index)
bool waferHexagon6() const
std::vector< double > cellCoarseX_
std::vector< int > firstModule_
std::pair< int, float > getIndex(int lay, bool reco) const
bool tileTrapezoid() const
int numberCellsHexagon(int wafer) const
std::vector< double > cellFineX_
fixed size matrix
int32_t waferV(const int32_t index)
std::vector< int > waferCopy_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
int scintCells(const int layer) const

◆ numberCellsHexagon() [1/2]

int HGCalDDDConstants::numberCellsHexagon ( int  wafer) const

Definition at line 1211 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, HGCSiliconDetId::HGCalHD120, HGCSiliconDetId::HGCalHD200, hgpar_, and HGCalParameters::waferTypeT_.

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

1211  {
1212  if (wafer >= 0 && wafer < static_cast<int>(hgpar_->waferTypeT_.size())) {
1213  if (((hgpar_->waferTypeT_[wafer] - 1) == HGCSiliconDetId::HGCalHD120) ||
1214  ((hgpar_->waferTypeT_[wafer] - 1) == HGCSiliconDetId::HGCalHD200))
1215  return static_cast<int>(hgpar_->cellFineX_.size());
1216  else
1217  return static_cast<int>(hgpar_->cellCoarseX_.size());
1218  } else {
1219  return 0;
1220  }
1221 }
std::vector< double > cellCoarseX_
std::vector< double > cellFineX_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_

◆ numberCellsHexagon() [2/2]

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

Definition at line 1223 of file HGCalDDDConstants.cc.

References RemoveAddSevLevel::flag, HGCSiliconDetId::HGCalHD120, HGCSiliconDetId::HGCalHD200, HGCSiliconDetId::HGCalLD300, hgpar_, ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::if(), N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, HGCalParameters::typesInLayers_, HGCalWaferIndex::waferIndex(), HGCalParameters::waferTypeL_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

1223  {
1225  int type = ((itr == hgpar_->typesInLayers_.end()) ? HGCSiliconDetId::HGCalLD300 : hgpar_->waferTypeL_[itr->second]);
1227  : hgpar_->nCellsCoarse_;
1228  if (flag)
1229  return (3 * N * N);
1230  else
1231  return N;
1232 }
int32_t waferU(const int32_t index)
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
#define N
Definition: blowfish.cc:9
wafer_map typesInLayers_
int32_t waferV(const int32_t index)
const HGCalParameters * hgpar_
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
std::vector< int > waferTypeL_

◆ partialWaferType()

int HGCalDDDConstants::partialWaferType ( int  lay,
int  waferU,
int  waferV 
) const
inline

Definition at line 149 of file HGCalDDDConstants.h.

References hgpar_, HGCalTypes::WaferFull, HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

Referenced by locateCell().

149  {
150  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
151  auto ktr = hgpar_->waferInfoMap_.find(indx);
152  int part = (ktr != hgpar_->waferInfoMap_.end()) ? (ktr->second).part : HGCalTypes::WaferFull;
153  return part;
154  }
int32_t waferU(const int32_t index)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
part
Definition: HCALResponse.h:20
int32_t waferV(const int32_t index)
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ rangeR()

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

Definition at line 1234 of file HGCalDDDConstants.cc.

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(), ticl::GeneralInterpretationAlgo::buildLayers(), ticl::LinkingAlgoByDirectionGeometric::buildLayers(), ticl::TracksterLinkingbySkeletons::buildLayers(), HFNoseNumberingScheme::checkPosition(), HGCalNumberingScheme::checkPosition(), HGCDigitizer::checkPosition(), DetectorTools::DetectorTools(), locateCellTrap(), HGCalGeometry::neighborZ(), and TICLCandidateProducer::produce().

1234  {
1235  double rmin(0), rmax(0), zz(0);
1236  if (hgpar_->detectorType_ > 0) {
1237  zz = (reco ? std::abs(z) : HGCalParameters::k_ScaleFromDDD * std::abs(z));
1238  if (hgpar_->detectorType_ <= 2) {
1240  } else {
1241  rmin = HGCalGeomTools::radius(
1243  }
1244  if ((hgpar_->detectorType_ == 2) && (zz >= hgpar_->zLayerHex_[hgpar_->firstMixedLayer_ - 1])) {
1245  rmax = HGCalGeomTools::radius(
1247  } else {
1249  }
1250  }
1251  if (!reco) {
1254  }
1255 #ifdef EDM_ML_DEBUG
1256  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << z << ":" << zz << " R " << rmin << ":" << rmax;
1257 #endif
1258  return std::make_pair(rmin, rmax);
1259 }
Log< level::Info, true > LogVerbatim
std::vector< double > zFrontMin_
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)
std::vector< double > rMaxFront_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< double > slopeTop_
std::vector< double > zLayerHex_
std::vector< double > slopeMin_
static constexpr double k_ScaleToDDD
std::vector< double > radiusMixBoundary_
std::vector< double > rMinFront_
fixed size matrix
std::vector< double > zFrontTop_
const HGCalParameters * hgpar_

◆ rangeRLayer()

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

Definition at line 1261 of file HGCalDDDConstants.cc.

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

1261  {
1262  double rmin(0), rmax(0);
1263  const auto& index = getIndex(lay, reco);
1264  if (index.first >= 0 && index.first < static_cast<int>(hgpar_->rMinLayHex_.size())) {
1265  rmin = hgpar_->rMinLayHex_[index.first];
1266  rmax = hgpar_->rMaxLayHex_[index.first];
1267  }
1268  if (!reco) {
1271  }
1272 #ifdef EDM_ML_DEBUG
1273  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << lay << ":" << index.first << " R " << rmin << ":"
1274  << rmax;
1275 #endif
1276  return std::make_pair(rmin, rmax);
1277 }
Log< level::Info, true > LogVerbatim
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< double > rMinLayHex_
std::vector< double > rMaxLayHex_
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

◆ rangeZ()

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

Definition at line 1279 of file HGCalDDDConstants.cc.

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().

1279  {
1280  double zmin = (hgpar_->zLayerHex_[0] - hgpar_->waferThick_);
1281  double zmax = (hgpar_->zLayerHex_[hgpar_->zLayerHex_.size() - 1] + hgpar_->waferThick_);
1282 #ifdef EDM_ML_DEBUG
1283  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeZ: " << zmin << ":" << zmax << ":" << hgpar_->waferThick_;
1284 #endif
1285  if (!reco) {
1288  }
1289  return std::make_pair(zmin, zmax);
1290 }
Log< level::Info, true > LogVerbatim
std::vector< double > zLayerHex_
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

◆ rowColumnWafer()

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

Definition at line 1292 of file HGCalDDDConstants.cc.

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

1292  {
1293  int row(0), col(0);
1294  if (wafer < static_cast<int>(hgpar_->waferCopy_.size())) {
1295  int copy = hgpar_->waferCopy_[wafer];
1298  ;
1299  }
1300  return std::make_pair(row, col);
1301 }
static int32_t getUnpackedU(int id)
Definition: HGCalTypes.cc:16
static int32_t getUnpackedV(int id)
Definition: HGCalTypes.cc:22
std::vector< int > waferCopy_
col
Definition: cuy.py:1009
const HGCalParameters * hgpar_

◆ sectors()

int HGCalDDDConstants::sectors ( ) const
inline

Definition at line 159 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::nSectors_.

Referenced by HGCalGeometry::getSummary(), HGCalDDDConstants(), and HGCalTopology::HGCalTopology().

159 { return hgpar_->nSectors_; }
const HGCalParameters * hgpar_

◆ sensorSizeOffset()

double HGCalDDDConstants::sensorSizeOffset ( bool  reco) const

Definition at line 1303 of file HGCalDDDConstants.cc.

References hgpar_, HGCalParameters::k_ScaleToDDD, and HGCalParameters::sensorSizeOffset_.

Referenced by HGCalSD::update().

1303  {
1305 }
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

◆ simToReco()

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

Definition at line 1307 of file HGCalDDDConstants.cc.

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

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

1307  {
1308  if (!waferHexagon6()) {
1309  return std::make_pair(cell, lay);
1310  } else {
1311  const auto& index = getIndex(lay, false);
1312  int i = index.first;
1313  if (i < 0) {
1314  edm::LogWarning("HGCalGeom") << "Wrong Layer # " << lay << " not in the list ***** ERROR *****";
1315  return std::make_pair(-1, -1);
1316  }
1317  if (mod >= static_cast<int>(hgpar_->waferTypeL_.size())) {
1318  edm::LogWarning("HGCalGeom") << "Invalid Wafer # " << mod << "should be < " << (hgpar_->waferTypeL_).size()
1319  << " ***** ERROR *****";
1320  return std::make_pair(-1, -1);
1321  }
1322  int depth(-1);
1323  int kx = cell;
1324  int type = hgpar_->waferTypeL_[mod];
1325  if (type == 1) {
1326  depth = hgpar_->layerGroup_[i];
1327  } else if (type == 2) {
1328  depth = hgpar_->layerGroupM_[i];
1329  } else {
1330  depth = hgpar_->layerGroupO_[i];
1331  }
1332  return std::make_pair(kx, depth);
1333  }
1334 }
size
Write out results.
std::vector< int > layerGroupM_
bool waferHexagon6() const
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< int > layerGroup_
std::vector< int > layerGroupO_
Log< level::Warning, false > LogWarning
const HGCalParameters * hgpar_
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< int > waferTypeL_

◆ tileCount()

int HGCalDDDConstants::tileCount ( int  layer,
int  ring 
) const

Definition at line 1336 of file HGCalDDDConstants.cc.

References b, HGCalParameters::firstLayer_, hgpar_, dqmdumpme::k, lastLayer(), nano_mu_digi_cff::layer, relativeConstraints::ring, HGCalTileIndex::tileIndex(), HGCalParameters::tileInfoMap_, and HGCalParameters::tileRingRange_.

Referenced by numberCells().

1336  {
1337  int laymin(layer), laymax(layer), ringmin(ring), ringmax(ring), kount(0);
1338  if (layer == 0) {
1339  laymin = hgpar_->firstLayer_;
1340  laymax = lastLayer(true);
1341  }
1342 #ifdef EDM_ML_DEBUG
1343  edm::LogVerbatim("HGCalGeom") << "tileCount: layer " << layer << " ring " << ring << " layerMin/Max " << laymin << ":"
1344  << laymax;
1345 #endif
1346  for (int lay = laymin; lay <= laymax; ++lay) {
1347  if (ring < 0) {
1348  int ll = lay - hgpar_->firstLayer_;
1349  ringmin = hgpar_->tileRingRange_[ll].first;
1350  ringmax = hgpar_->tileRingRange_[ll].second;
1351  }
1352 #ifdef EDM_ML_DEBUG
1353  edm::LogVerbatim("HGCalGeom") << "tileCount: lay " << lay << ":" << (lay - hgpar_->firstLayer_) << " rings "
1354  << ringmin << ":" << ringmax;
1355 #endif
1356  for (int rin = ringmin; rin <= ringmax; ++rin) {
1357  int indx = HGCalTileIndex::tileIndex(lay, rin + 1, 0);
1358  auto itr = hgpar_->tileInfoMap_.find(indx);
1359 #ifdef EDM_ML_DEBUG
1360  edm::LogVerbatim("HGCalGeom") << "tileCount: rin " << rin << " indx " << indx << " itr "
1361  << (itr != hgpar_->tileInfoMap_.end());
1362 #endif
1363  if (itr != hgpar_->tileInfoMap_.end()) {
1364  for (int k = 0; k < 4; ++k) {
1365  std::bitset<24> b(itr->second.hex[k]);
1366  kount += b.count();
1367  }
1368  }
1369 #ifdef EDM_ML_DEBUG
1370  edm::LogVerbatim("HGCalGeom") << "tileCount: lay|rin " << lay << ":" << rin << " kount " << kount;
1371 #endif
1372  }
1373  }
1374  return (3 * kount);
1375 }
Log< level::Info, true > LogVerbatim
int lastLayer(bool reco) const
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
std::vector< std::pair< int, int > > tileRingRange_
double b
Definition: hdecay.h:120
const HGCalParameters * hgpar_
tileInfo_map tileInfoMap_

◆ tileExist()

bool HGCalDDDConstants::tileExist ( int  zside,
int  layer,
int  ring,
int  phi 
) const

Definition at line 1377 of file HGCalDDDConstants.cc.

References hgpar_, nano_mu_digi_cff::layer, convertSQLiteXML::ok, phi, relativeConstraints::ring, HGCalTileIndex::tileExist(), HGCalTileIndex::tileIndex(), HGCalParameters::tileInfoMap_, and ecaldqm::zside().

Referenced by assignCellTrap(), and isValidTrap().

1377  {
1378  int indx = HGCalTileIndex::tileIndex(layer, ring, 0);
1379  auto itr = hgpar_->tileInfoMap_.find(indx);
1380  bool ok = (itr == hgpar_->tileInfoMap_.end()) ? false : HGCalTileIndex::tileExist(itr->second.hex, zside, phi);
1381  return ok;
1382 }
int zside(DetId const &)
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
bool tileExist(const int32_t *hex, int32_t zside, int32_t phi)
const HGCalParameters * hgpar_
tileInfo_map tileInfoMap_

◆ tileInfo()

HGCalParameters::tileInfo HGCalDDDConstants::tileInfo ( int  zside,
int  layer,
int  ring 
) const

Definition at line 1384 of file HGCalDDDConstants.cc.

References hgpar_, nano_mu_digi_cff::layer, relativeConstraints::ring, HGCalTileIndex::tileIndex(), and HGCalParameters::tileInfoMap_.

1384  {
1385  int indx = HGCalTileIndex::tileIndex(layer, ring, 0);
1386  auto itr = hgpar_->tileInfoMap_.find(indx);
1387  return ((itr == hgpar_->tileInfoMap_.end()) ? HGCalParameters::tileInfo() : itr->second);
1388 }
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
const HGCalParameters * hgpar_
tileInfo_map tileInfoMap_

◆ tilePhiEdge()

bool HGCalDDDConstants::tilePhiEdge ( double  phi,
int  layer,
int  iphi 
) const

Definition at line 1390 of file HGCalDDDConstants.cc.

References funct::abs(), cuy::dif1, cuy::dif2, hgpar_, hcalRecHitTable_cff::iphi, nano_mu_digi_cff::layer, phi, HGCalParameters::scintCellSize(), and tol_.

Referenced by assignCellTrap().

1390  {
1391  double dif1 = std::abs(phi - hgpar_->scintCellSize(layer) * (iphi - 1));
1392  double dif2 = std::abs(phi - hgpar_->scintCellSize(layer) * iphi);
1393 #ifdef EDM_ML_DEBUG
1394  edm::LogVerbatim("HGCalGeomT") << "HGCalDDDConstants::tilePhiEdge:: input: " << phi << ":" << layer << ":" << iphi
1395  << " Differences " << dif1 << ":" << dif2;
1396 #endif
1397  return ((dif1 < tol_) || (dif2 < tol_));
1398 }
Log< level::Info, true > LogVerbatim
static constexpr double tol_
double scintCellSize(const int layer) const
dif1
Definition: cuy.py:893
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dif2
Definition: cuy.py:895
const HGCalParameters * hgpar_

◆ tileRingEdge()

bool HGCalDDDConstants::tileRingEdge ( double  rho,
int  layer,
int  ring 
) const

Definition at line 1400 of file HGCalDDDConstants.cc.

References funct::abs(), cuy::dif1, cuy::dif2, hgpar_, nano_mu_digi_cff::layer, alignCSCRings::r, HGCalParameters::radiusLayer_, relativeConstraints::ring, HGCalParameters::scintType(), and tol_.

Referenced by assignCellTrap().

1400  {
1401  int type = hgpar_->scintType(layer);
1402  double dif1 = std::abs(r - hgpar_->radiusLayer_[type][ring - 1]);
1403  double dif2 = std::abs(r - hgpar_->radiusLayer_[type][ring]);
1404 #ifdef EDM_ML_DEBUG
1405  edm::LogVerbatim("HGCalGeomT") << "HGCalDDDConstants::tileRingEdge:: input: " << r << ":" << layer << ":" << ring
1406  << " Differences " << dif1 << ":" << dif2;
1407 #endif
1408  return ((dif1 < tol_) || (dif2 < tol_));
1409 }
Log< level::Info, true > LogVerbatim
static constexpr double tol_
int scintType(const int layer) const
dif1
Definition: cuy.py:893
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dif2
Definition: cuy.py:895
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_

◆ tileRings()

std::pair< int, int > HGCalDDDConstants::tileRings ( int  layer) const

Definition at line 1410 of file HGCalDDDConstants.cc.

References HGCalParameters::firstLayer_, hgpar_, nano_mu_digi_cff::layer, HGCalParameters::tileRingRange_, and trapezoidFile().

1410  {
1411  if (trapezoidFile()) {
1412  int ll = layer - hgpar_->firstLayer_;
1413  if (ll >= 0 && ll < static_cast<int>(hgpar_->tileRingRange_.size()))
1414  return hgpar_->tileRingRange_[ll];
1415  }
1416  return std::make_pair(0, 0);
1417 }
bool trapezoidFile() const
std::vector< std::pair< int, int > > tileRingRange_
const HGCalParameters * hgpar_

◆ tileSiPM()

int HGCalDDDConstants::tileSiPM ( int  sipm) const
inline

◆ tileTrapezoid()

bool HGCalDDDConstants::tileTrapezoid ( ) const
inline

◆ tileType()

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

Definition at line 1419 of file HGCalDDDConstants.cc.

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

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

1419  {
1420  int indx = HGCalTileIndex::tileIndex(layer, ring, phi);
1421  int type(-1), sipm(-1);
1422  auto itr = hgpar_->tileInfoMap_.find(indx);
1423  if (itr != hgpar_->tileInfoMap_.end()) {
1424  type = 1 + (itr->second).type;
1425  sipm = ((itr->second).sipm == HGCalTypes::SiPMLarge) ? 0 : 1;
1426  }
1427  return std::make_pair(type, sipm);
1428 }
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
const HGCalParameters * hgpar_
tileInfo_map tileInfoMap_

◆ trapezoidFile()

bool HGCalDDDConstants::trapezoidFile ( ) const
inline

◆ v17OrLess()

bool HGCalDDDConstants::v17OrLess ( ) const
inline

◆ volumes()

unsigned int HGCalDDDConstants::volumes ( ) const
inline

Definition at line 180 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::moduleLayR_.

180 { return hgpar_->moduleLayR_.size(); }
std::vector< int > moduleLayR_
const HGCalParameters * hgpar_

◆ waferCount()

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

Definition at line 216 of file HGCalDDDConstants.h.

References waferMax_.

216 { return ((type == 0) ? waferMax_[2] : waferMax_[3]); }
std::array< int, 4 > waferMax_

◆ waferFileIndex()

int HGCalDDDConstants::waferFileIndex ( unsigned int  kk) const

Definition at line 1737 of file HGCalDDDConstants.cc.

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

1737  {
1738  if (kk < hgpar_->waferInfoMap_.size()) {
1739  auto itr = hgpar_->waferInfoMap_.begin();
1740  std::advance(itr, kk);
1741  return itr->first;
1742  } else
1743  return 0;
1744 }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ waferFileInfo()

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

Definition at line 1746 of file HGCalDDDConstants.cc.

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

Referenced by HGCalSD::setDetUnitId().

1746  {
1747  if (kk < hgpar_->waferInfoMap_.size()) {
1748  auto itr = hgpar_->waferInfoMap_.begin();
1749  std::advance(itr, kk);
1750  return std::make_tuple(itr->second.type, itr->second.part, itr->second.orient, itr->second.cassette);
1751  } else
1752  return std::make_tuple(0, 0, 0, 0);
1753 }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ waferFileInfoExist()

bool HGCalDDDConstants::waferFileInfoExist ( int  kk) const
inline

Definition at line 227 of file HGCalDDDConstants.h.

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

227  {
228  return (hgpar_->waferInfoMap_.find(kk) != hgpar_->waferInfoMap_.end());
229  }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ waferFileInfoFromIndex()

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

Definition at line 1755 of file HGCalDDDConstants.cc.

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

1755  {
1756  auto itr = hgpar_->waferInfoMap_.find(kk);
1757  if (itr != hgpar_->waferInfoMap_.end()) {
1758  return std::make_tuple(itr->second.type, itr->second.part, itr->second.orient, itr->second.cassette);
1759  } else
1760  return std::make_tuple(0, 0, 0, 0);
1761 }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ waferFileSize()

unsigned int HGCalDDDConstants::waferFileSize ( ) const
inline

Definition at line 223 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferInfoMap_.

Referenced by waferType(), and waferTypeRotation().

223 { return hgpar_->waferInfoMap_.size(); }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ waferFromCopy()

int HGCalDDDConstants::waferFromCopy ( int  copy) const

Definition at line 1430 of file HGCalDDDConstants.cc.

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

1430  {
1431  const int ncopies = hgpar_->waferCopy_.size();
1432  int wafer(ncopies);
1433  bool result(false);
1434  for (int k = 0; k < ncopies; ++k) {
1435  if (copy == hgpar_->waferCopy_[k]) {
1436  wafer = k;
1437  result = true;
1438  break;
1439  }
1440  }
1441  if (!result) {
1442  wafer = -1;
1443 #ifdef EDM_ML_DEBUG
1444  edm::LogVerbatim("HGCalGeom") << "Cannot find " << copy << " in a list of " << ncopies << " members";
1445  for (int k = 0; k < ncopies; ++k)
1446  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << hgpar_->waferCopy_[k];
1447 #endif
1448  }
1449 #ifdef EDM_ML_DEBUG
1450  edm::LogVerbatim("HGCalGeom") << "WaferFromCopy " << copy << ":" << wafer << ":" << result;
1451 #endif
1452  return wafer;
1453 }
Log< level::Info, true > LogVerbatim
std::vector< int > waferCopy_
const HGCalParameters * hgpar_

◆ waferFromPosition() [1/2]

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

Definition at line 1455 of file HGCalDDDConstants.cc.

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

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

1455  {
1456  // Input x, y in Geant4 unit and transformed to CMSSW standard
1459  int size_ = static_cast<int>(hgpar_->waferCopy_.size());
1460  wafer = size_;
1461  for (int k = 0; k < size_; ++k) {
1462  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1463  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1464  if (dx <= rmax_ && dy <= hexside_) {
1465  if ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy))) {
1466  wafer = k;
1467  celltyp = hgpar_->waferTypeT_[k];
1468  xx -= hgpar_->waferPosX_[k];
1469  yy -= hgpar_->waferPosY_[k];
1470  break;
1471  }
1472  }
1473  }
1474  if (wafer < size_) {
1475  if ((celltyp - 1 == HGCSiliconDetId::HGCalHD120) || (celltyp - 1 == HGCSiliconDetId::HGCalHD200))
1476  icell = cellHex(
1478  else
1479  icell = cellHex(xx,
1480  yy,
1483  hgpar_->cellCoarseY_);
1484  } else {
1485  wafer = -1;
1486 #ifdef EDM_ML_DEBUG
1487  edm::LogWarning("HGCalGeom") << "Cannot get wafer type corresponding to " << x << ":" << y << " " << xx << ":"
1488  << yy;
1489 #endif
1490  }
1491 #ifdef EDM_ML_DEBUG
1492  edm::LogVerbatim("HGCalGeom") << "Position " << x << ":" << y << " Wafer " << wafer << ":" << size_ << " XX " << xx
1493  << ":" << yy << " Cell " << icell << " Type " << celltyp;
1494 #endif
1495 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
std::vector< double > cellSize_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< double > cellFineX_
static constexpr double k_ScaleFromDDD
std::vector< int > waferCopy_
static constexpr double tan30deg_
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
Log< level::Warning, false > LogWarning
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const

◆ waferFromPosition() [2/2]

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

Definition at line 1497 of file HGCalDDDConstants.cc.

References funct::abs(), cassetteMode(), cellHex(), HGCalCell::cellPlacementIndex(), HGCalCell::cellPlacementOld, HGCalParameters::cellThickness_, ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), debug, PVValHelper::dx, PVValHelper::dy, HGCalParameters::firstLayer_, HGCalWaferType::getCassette(), HGCalWaferType::getOrient(), HGCalWaferType::getPartial(), HGCalCassette::getShift(), HGCalWaferType::getType(), getXY(), hexside_, hexsideT_, HGCSiliconDetId::HGCalHD120, HGCSiliconDetId::HGCalHD200, HGCSiliconDetId::HGCalLD300, hgcassette_, hgpar_, dqmdumpme::k, HGCalParameters::k_ScaleFromDDD, nano_mu_digi_cff::layer, HGCalTypes::layerFrontBack(), layerType(), HGCalParameters::layerType_, SiStripPI::min, HGCalParameters::nCellsFine_, hgcalPerformanceValidation::orient, rmax_, rmaxT_, tan30deg_, tolmin, HGCalParameters::typesInLayers_, HGCalParameters::useSimWt_, HGCalTypes::WaferCenterR, HGCalParameters::waferCopy_, HGCalTypes::WaferFull, waferHexagon8File(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferThick_, HGCalParameters::waferTypeL_, HGCalWaferIndex::waferU(), HGCalParameters::waferUVMax_, HGCalWaferIndex::waferV(), x, testProducerWithPsetDescEmpty_cfi::x1, HGCalParameters::xLayerHex_, geometryCSVtoXML::xx, geometryCSVtoXML::xy, y, testProducerWithPsetDescEmpty_cfi::y1, HGCalParameters::yLayerHex_, geometryCSVtoXML::yy, and ecaldqm::zside().

1508  {
1509  // Expect x, y as in SIM step
1510  bool waferin = ((waferU == 0) && (waferV == 0));
1511  if (waferin)
1512  waferU = waferV = 1 + hgpar_->waferUVMax_;
1513  cellU = cellV = celltype = 0;
1514  if ((hgpar_->xLayerHex_.empty()) || (hgpar_->yLayerHex_.empty()))
1515  return;
1516  int ll = layer - hgpar_->firstLayer_;
1517  int layertype = layerType(layer);
1518  bool rotx = ((!hgpar_->layerType_.empty()) && (layertype == HGCalTypes::WaferCenterR));
1519  double xx(0), yy(0);
1520  if (rotx) {
1521  std::pair<double, double> xy =
1523  xx = xy.first - hgpar_->xLayerHex_[ll];
1524  yy = xy.second - hgpar_->yLayerHex_[ll];
1525  } else {
1528  }
1529  if (debug)
1530  edm::LogVerbatim("HGCalGeom") << "waferFromPosition:: Layer " << layer << ":" << ll << " Rot " << rotx << " X " << x
1531  << ":" << xx << " Y " << y << ":" << yy << " side " << zside << " extend " << extend
1532  << " initial wafer index " << waferU << ":" << waferV;
1533  ;
1534  double rmax = extend ? rmaxT_ : rmax_;
1535  double hexside = extend ? hexsideT_ : hexside_;
1536  if (waferin) {
1537  double tolmin(100.0);
1538  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1539  double dx0(0), dy0(0);
1542  if (cassetteMode()) {
1544  auto ktr = hgpar_->waferInfoMap_.find(indx);
1545  if (ktr != hgpar_->waferInfoMap_.end()) {
1546  auto cshift = hgcassette_.getShift(layer, -1, (ktr->second).cassette);
1547  if (debug)
1548  edm::LogVerbatim("HGCalGeom")
1549  << "Cassette " << (ktr->second).cassette << " Shift " << cshift.first << ":" << cshift.second;
1550  dx0 = -cshift.first;
1551  dy0 = cshift.second;
1552  }
1553  }
1554  double dx = std::abs(xx - dx0 - hgpar_->waferPosX_[k]);
1555  double dy = std::abs(yy - dy0 - hgpar_->waferPosY_[k]);
1556  constexpr double tolc = 0.01;
1557  if (debug) {
1558  edm::LogVerbatim("HGCalGeom") << "Wafer " << waferU << ":" << waferV << " position " << xx << ":" << yy
1559  << " Distance " << dx << ":" << dy << " diff0 " << (dx - rmax) << ":"
1560  << (dy - hexside) << " diff1 " << (dy - 0.5 * hexside) << ":"
1561  << (dx * tan30deg_ - (hexside - dy));
1562  if ((dx - rmax) <= tolc && (dy - hexside) <= tolc) {
1563  tolmin = std::min(tolmin, (dy - 0.5 * hexside));
1564  tolmin = std::min(tolmin, (dx * tan30deg_ - (hexside - dy)));
1565  }
1566  }
1567  if ((dx - rmax) <= tolc && (dy - hexside) <= tolc) {
1568  if (((dy - 0.5 * hexside) <= tolc) || ((dx * tan30deg_ - (hexside - dy)) <= tolc)) {
1569  if (waferHexagon8File()) {
1572  if (debug)
1573  edm::LogVerbatim("HGCalGeom")
1574  << "Position (" << x << ", " << y << ") Wafer type:partial:orient:cassette " << celltype << ":"
1578  } else {
1580  celltype = ((itr == hgpar_->typesInLayers_.end()) ? HGCSiliconDetId::HGCalLD300
1581  : hgpar_->waferTypeL_[itr->second]);
1582  }
1583  if (debug)
1584  edm::LogVerbatim("HGCalGeom")
1585  << "WaferFromPosition:: Input " << layer << ":" << ll << ":" << hgpar_->firstLayer_ << ":" << rotx
1586  << ":" << x << ":" << y << ":" << hgpar_->xLayerHex_[ll] << ":" << hgpar_->yLayerHex_[ll] << ":" << xx
1587  << ":" << yy << " compared with " << hgpar_->waferPosX_[k] << ":" << hgpar_->waferPosY_[k]
1588  << " difference " << dx << ":" << dy << ":" << dx * tan30deg_ << ":" << (hexside_ - dy)
1589  << " comparator " << rmax_ << ":" << rmaxT_ << ":" << hexside_ << ":" << hexsideT_ << " wafer "
1590  << waferU << ":" << waferV << ":" << celltype;
1591  xx -= (dx0 + hgpar_->waferPosX_[k]);
1592  yy -= (dy0 + hgpar_->waferPosY_[k]);
1593  break;
1594  }
1595  }
1596  }
1597  if (debug)
1598  edm::LogVerbatim("HGCalGeom") << "Tolmin " << tolmin;
1599  } else {
1600  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1601  double dx0(0), dy0(0);
1604  if (cassetteMode()) {
1606  auto ktr = hgpar_->waferInfoMap_.find(indx);
1607  if (ktr != hgpar_->waferInfoMap_.end()) {
1608  auto cshift = hgcassette_.getShift(layer, -1, (ktr->second).cassette);
1609  if (debug)
1610  edm::LogVerbatim("HGCalGeom")
1611  << "Cassette " << (ktr->second).cassette << " Shift " << cshift.first << ":" << cshift.second;
1612  dx0 = -cshift.first;
1613  dy0 = cshift.second;
1614  }
1615  }
1616  if (waferHexagon8File()) {
1619  if (debug)
1620  edm::LogVerbatim("HGCalGeom") << "Position (" << x << ", " << y << ") Wafer type:partial:orient:cassette "
1621  << celltype << ":" << HGCalWaferType::getPartial(index, hgpar_->waferInfoMap_)
1624  } else {
1626  celltype =
1627  ((itr == hgpar_->typesInLayers_.end()) ? HGCSiliconDetId::HGCalLD300 : hgpar_->waferTypeL_[itr->second]);
1628  }
1629  xx -= (dx0 + hgpar_->waferPosX_[k]);
1630  yy -= (dy0 + hgpar_->waferPosY_[k]);
1631  break;
1632  }
1633  }
1634  }
1635  if ((std::abs(waferU) <= hgpar_->waferUVMax_) && (celltype >= 0)) {
1637  if (cassetteMode()) {
1639  auto ktr = hgpar_->waferInfoMap_.find(indx);
1640  if (ktr != hgpar_->waferInfoMap_.end()) {
1641  place = HGCalCell::cellPlacementIndex(1, HGCalTypes::layerFrontBack(layertype), (ktr->second).orient);
1642  part = (ktr->second).part;
1643  if (debug)
1644  edm::LogVerbatim("HGCalGeom") << "waferFromPosition: frontback " << layertype << ":"
1645  << HGCalTypes::layerFrontBack(layertype) << " Orient " << (ktr->second).orient
1646  << " place " << place << " part " << part;
1647  }
1648  }
1649  cellHex(xx, yy, celltype, place, part, cellU, cellV, extend, debug);
1650  wt = ((((celltype == HGCSiliconDetId::HGCalHD120) || (celltype == HGCSiliconDetId::HGCalHD200)) &&
1651  (hgpar_->useSimWt_ > 0))
1652  ? (hgpar_->cellThickness_[celltype] / hgpar_->waferThick_)
1653  : 1.0);
1654  } else {
1655  cellU = cellV = 2 * hgpar_->nCellsFine_;
1656  wt = 1.0;
1657  celltype = -1;
1658  }
1659  if ((celltype < 0) && debug) {
1660  double x1(xx);
1661  double y1(yy);
1662  edm::LogVerbatim("HGCalGeom") << "waferfFromPosition: Bad type for X " << x << ":" << x1 << ":" << xx << " Y " << y
1663  << ":" << y1 << ":" << yy << " Wafer " << waferU << ":" << waferV << " Cell " << cellU
1664  << ":" << cellV;
1665  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1666  double dx = std::abs(x1 - hgpar_->waferPosX_[k]);
1667  double dy = std::abs(y1 - hgpar_->waferPosY_[k]);
1668  edm::LogVerbatim("HGCalGeom") << "Wafer [" << k << "] Position (" << hgpar_->waferPosX_[k] << ", "
1669  << hgpar_->waferPosY_[k] << ") difference " << dx << ":" << dy << ":"
1670  << dx * tan30deg_ << ":" << hexside - dy << " Paramerers " << rmax << ":"
1671  << hexside;
1672  }
1673  }
1674  edm::LogVerbatim("HGCalGeomX") << "Input x:y:layer " << x << ":" << y << ":" << layer << " Wafer " << waferU << ":"
1675  << waferV << " Cell " << cellU << ":" << cellV << ":" << celltype << " wt " << wt;
1676 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient)
Definition: HGCalCell.cc:239
static constexpr int32_t cellPlacementOld
Definition: HGCalCell.h:25
static int getType(int index, const HGCalParameters::waferInfo_map &wafers)
HGCalCassette hgcassette_
int32_t waferU(const int32_t index)
std::pair< double, double > getShift(int layer, int zside, int cassette, bool scnt=false) const
static int getPartial(int index, const HGCalParameters::waferInfo_map &wafers)
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
int zside(DetId const &)
static int getOrient(int index, const HGCalParameters::waferInfo_map &wafers)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
std::vector< double > yLayerHex_
static const float tolmin
Definition: FlatHexagon.cc:21
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static int getCassette(int index, const HGCalParameters::waferInfo_map &wafers)
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
std::vector< int > layerType_
static constexpr int32_t WaferCenterR
Definition: HGCalTypes.h:27
#define debug
Definition: HDRShower.cc:19
std::vector< double > cellThickness_
part
Definition: HCALResponse.h:20
bool waferHexagon8File() const
wafer_map typesInLayers_
static constexpr double k_ScaleFromDDD
bool cassetteMode() const
int32_t waferV(const int32_t index)
std::vector< int > waferCopy_
static constexpr double tan30deg_
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
std::vector< int > waferTypeL_
std::vector< double > xLayerHex_
int layerType(int lay) const
static constexpr int32_t layerFrontBack(int32_t layerOrient)
Definition: HGCalTypes.h:137

◆ waferFullInLayer()

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

Definition at line 1685 of file HGCalDDDConstants.cc.

References getIndex(), and waferInLayerTest().

1685  {
1686  const auto& indx = getIndex(lay, reco);
1687  if (indx.first < 0)
1688  return false;
1689  return waferInLayerTest(wafer, indx.first, false);
1690 }
bool waferInLayerTest(int wafer, int lay, bool full) const
std::pair< int, float > getIndex(int lay, bool reco) const
fixed size matrix

◆ waferHexagon6()

bool HGCalDDDConstants::waferHexagon6 ( ) const
inline

◆ waferHexagon8()

bool HGCalDDDConstants::waferHexagon8 ( ) const
inline

Definition at line 198 of file HGCalDDDConstants.h.

References HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8CalibCell, HGCalGeometryMode::Hexagon8Cassette, HGCalGeometryMode::Hexagon8File, HGCalGeometryMode::Hexagon8FineCell, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::Hexagon8Module, and mode_.

Referenced by HGCalSimHitValidation::analyzeHits(), assignCellHex(), cellInLayer(), cellSizeHex(), cellThickness(), distFromEdgeHex(), getIndex(), getTypeHex(), HGCalNumberingScheme::getUnitID(), HGCalDDDConstants(), HGCMouseBite::HGCMouseBite(), maskCell(), maxCells(), maxRows(), HGCalTopology::waferHexagon8(), waferType(), waferTypeRotation(), and waferVirtual().

◆ waferHexagon8File()

bool HGCalDDDConstants::waferHexagon8File ( ) const
inline

◆ waferHexagon8Fine()

bool HGCalDDDConstants::waferHexagon8Fine ( ) const
inline

Definition at line 209 of file HGCalDDDConstants.h.

References HGCalGeometryMode::Hexagon8FineCell, and mode_.

Referenced by locateCell().

◆ waferHexagon8Module()

bool HGCalDDDConstants::waferHexagon8Module ( ) const
inline

◆ waferIndex()

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

Definition at line 2171 of file HGCalDDDConstants.cc.

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

Referenced by waferInLayerTest().

2171  {
2172  int layer = layerFromIndex(index, true);
2176 #ifdef EDM_ML_DEBUG
2177  edm::LogVerbatim("HGCalGeom") << "WaferIndex for " << wafer << ":" << index << " (" << layer << ":" << waferU << ":"
2178  << waferV << ") " << indx;
2179 #endif
2180  return indx;
2181 }
Log< level::Info, true > LogVerbatim
int32_t waferU(const int32_t index)
int layerFromIndex(int index, bool reco) const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
int32_t waferV(const int32_t index)
std::vector< int > waferCopy_
const HGCalParameters * hgpar_

◆ waferInfo()

HGCalParameters::waferInfo HGCalDDDConstants::waferInfo ( int  lay,
int  waferU,
int  waferV 
) const

Definition at line 1692 of file HGCalDDDConstants.cc.

References hgpar_, HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

Referenced by HGCalSD::calibCell(), HGCalCalibrationCell::findCell(), and HGCalNumberingScheme::getUnitID().

1692  {
1693  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
1694  auto itr = hgpar_->waferInfoMap_.find(indx);
1695  return ((itr == hgpar_->waferInfoMap_.end()) ? HGCalParameters::waferInfo() : itr->second);
1696 }
int32_t waferU(const int32_t index)
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
int32_t waferV(const int32_t index)
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ waferInLayer()

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

Definition at line 1678 of file HGCalDDDConstants.cc.

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

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

1678  {
1679  const auto& indx = getIndex(lay, reco);
1680  if (indx.first < 0)
1681  return false;
1682  return waferInLayerTest(wafer, indx.first, hgpar_->defineFull_);
1683 }
bool waferInLayerTest(int wafer, int lay, bool full) const
std::pair< int, float > getIndex(int lay, bool reco) const
fixed size matrix
const HGCalParameters * hgpar_

◆ waferInLayerTest()

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

Definition at line 2183 of file HGCalDDDConstants.cc.

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().

2183  {
2184  bool in = (waferHexagon6()) ? true : false;
2185  if (!in) {
2186  double xpos = hgpar_->waferPosX_[wafer] + hgpar_->xLayerHex_[lay];
2187  double ypos = hgpar_->waferPosY_[wafer] + hgpar_->yLayerHex_[lay];
2188  std::pair<int, int> corner = HGCalGeomTools::waferCorner(
2189  xpos, ypos, rmax_, hexside_, hgpar_->rMinLayHex_[lay], hgpar_->rMaxLayHex_[lay], in);
2190  in = (full ? (corner.first > 0) : (corner.first == static_cast<int>(HGCalParameters::k_CornerSize)));
2191  if (in && fullAndPart_) {
2192  int indx = waferIndex(wafer, lay);
2193  in = (hgpar_->waferInfoMap_.find(indx) != hgpar_->waferInfoMap_.end());
2194 #ifdef EDM_ML_DEBUG
2195  if (!in)
2196  edm::LogVerbatim("HGCalGeom") << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " index " << indx
2197  << "( " << HGCalWaferIndex::waferLayer(indx) << ", "
2198  << HGCalWaferIndex::waferU(indx) << ", " << HGCalWaferIndex::waferV(indx)
2199  << ") in " << in;
2200 #endif
2201  }
2202 #ifdef EDM_ML_DEBUG
2203  edm::LogVerbatim("HGCalGeom") << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " R-limits "
2204  << hgpar_->rMinLayHex_[lay] << ":" << hgpar_->rMaxLayHex_[lay] << " Corners "
2205  << corner.first << ":" << corner.second << " In " << in;
2206 #endif
2207  }
2208  return in;
2209 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
int32_t waferU(const int32_t index)
int32_t waferLayer(const int32_t index)
bool waferHexagon6() const
static constexpr uint32_t k_CornerSize
static std::pair< int32_t, int32_t > waferCorner(double xpos, double ypos, double r, double R, double rMin, double rMax, bool oldBug=false)
std::vector< double > yLayerHex_
Definition: GenABIO.cc:168
std::vector< double > rMinLayHex_
std::vector< double > rMaxLayHex_
int32_t waferIndex(int wafer, int index) const
int32_t waferV(const int32_t index)
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::vector< double > xLayerHex_

◆ waferLocal2Global()

GlobalPoint HGCalDDDConstants::waferLocal2Global ( HepGeom::Point3D< float > &  loc,
const DetId id,
bool  useWafer,
bool  reco,
bool  debug 
) const

Definition at line 1763 of file HGCalDDDConstants.cc.

References debug, getXY(), HGCSiliconDetId::layer(), dt_dqm_sourceclient_common_cff::reco, waferPositionNoRot(), HGCSiliconDetId::waferU(), HGCSiliconDetId::waferV(), waferZ(), x, geometryCSVtoXML::xx, geometryCSVtoXML::xy, y, HGCSiliconDetId::zside(), and geometryCSVtoXML::zz.

1764  {
1765  HGCSiliconDetId detid(id);
1766  double x(0), y(0);
1767  if (useWafer) {
1768  auto xyw = waferPositionNoRot(detid.layer(), detid.waferU(), detid.waferV(), reco, debug);
1769  x = xyw.first;
1770  y = xyw.second;
1771  }
1772  auto xy = getXY(detid.layer(), (x + loc.x()), (y + loc.y()), false);
1773  double zz = (detid.zside() < 0) ? -(loc.z() + waferZ(detid.layer(), reco)) : (loc.z() + waferZ(detid.layer(), reco));
1774  double xx = (detid.zside() < 0) ? -xy.first : xy.first;
1775  return GlobalPoint(xx, xy.second, zz);
1776 }
double waferZ(int layer, bool reco) const
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
#define debug
Definition: HDRShower.cc:19
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug) const

◆ waferMax()

int HGCalDDDConstants::waferMax ( ) const
inline

Definition at line 218 of file HGCalDDDConstants.h.

References waferMax_.

Referenced by HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

218 { return waferMax_[1]; }
std::array< int, 4 > waferMax_

◆ waferMin()

int HGCalDDDConstants::waferMin ( ) const
inline

Definition at line 219 of file HGCalDDDConstants.h.

References waferMax_.

Referenced by HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

219 { return waferMax_[0]; }
std::array< int, 4 > waferMax_

◆ waferParameters()

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

Definition at line 1698 of file HGCalDDDConstants.cc.

References hexside_, HGCalParameters::k_ScaleToDDD, and rmax_.

1698  {
1699  if (reco)
1700  return std::make_pair(rmax_, hexside_);
1701  else
1703 }
static constexpr double k_ScaleToDDD
fixed size matrix

◆ waferPosition() [1/3]

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

Definition at line 1705 of file HGCalDDDConstants.cc.

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

Referenced by HGCalMouseBiteTester::analyze(), HGCMouseBite::exclude(), and waferPositionNoRot().

1705  {
1706  double xx(0), yy(0);
1707  if (wafer >= 0 && wafer < static_cast<int>(hgpar_->waferPosX_.size())) {
1708  xx = hgpar_->waferPosX_[wafer];
1709  yy = hgpar_->waferPosY_[wafer];
1710  }
1711  if (!reco) {
1714  }
1715  return std::make_pair(xx, yy);
1716 }
std::vector< double > waferPosY_
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_
std::vector< double > waferPosX_

◆ waferPosition() [2/3]

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

Definition at line 1718 of file HGCalDDDConstants.cc.

References debug, HGCalParameters::firstLayer_, getXY(), hgpar_, HGCalParameters::layerType_, HGCalTypes::WaferCenterR, waferPositionNoRot(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), and geometryCSVtoXML::xy.

1719  {
1720  int ll = lay - hgpar_->firstLayer_;
1721  bool rotx = ((!hgpar_->layerType_.empty()) && (hgpar_->layerType_[ll] == HGCalTypes::WaferCenterR));
1722 #ifdef EDM_ML_DEBUG
1723  if (debug)
1724  edm::LogVerbatim("HGCalGeom") << "Layer " << lay << ":" << ll << " Rotation " << rotx << " U:V " << waferU << ":"
1725  << waferV;
1726 #endif
1727  auto xy = waferPositionNoRot(lay, waferU, waferV, reco, debug);
1728  std::pair<double, double> xy0 = (rotx) ? getXY(lay, xy.first, xy.second, false) : xy;
1729 #ifdef EDM_ML_DEBUG
1730  if (debug)
1731  edm::LogVerbatim("HGCalGeom") << "Without and with rotation " << xy.first << ":" << xy.second << ":" << xy0.first
1732  << ":" << xy0.second;
1733 #endif
1734  return xy0;
1735 }
Log< level::Info, true > LogVerbatim
int32_t waferU(const int32_t index)
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
std::vector< int > layerType_
static constexpr int32_t WaferCenterR
Definition: HGCalTypes.h:27
#define debug
Definition: HDRShower.cc:19
fixed size matrix
int32_t waferV(const int32_t index)
const HGCalParameters * hgpar_
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug) const

◆ waferPosition() [3/3]

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

Definition at line 2235 of file HGCalDDDConstants.cc.

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

2235  {
2236  double xx(0), yy(0);
2237  int indx = HGCalWaferIndex::waferIndex(0, waferU, waferV);
2238  auto itr = hgpar_->wafersInLayers_.find(indx);
2239  if (itr != hgpar_->wafersInLayers_.end()) {
2240  xx = hgpar_->waferPosX_[itr->second];
2241  yy = hgpar_->waferPosY_[itr->second];
2242  }
2243  if (!reco) {
2246  }
2247  return std::make_pair(xx, yy);
2248 }
std::vector< double > waferPosY_
int32_t waferU(const int32_t index)
wafer_map wafersInLayers_
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
static constexpr double k_ScaleToDDD
fixed size matrix
int32_t waferV(const int32_t index)
const HGCalParameters * hgpar_
std::vector< double > waferPosX_

◆ waferPositionNoRot()

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

Definition at line 2211 of file HGCalDDDConstants.cc.

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

Referenced by isValidCell8(), localToGlobal8(), locateCell(), waferLocal2Global(), and waferPosition().

2212  {
2213  int ll = lay - hgpar_->firstLayer_;
2214  double x = hgpar_->xLayerHex_[ll];
2215  double y = hgpar_->yLayerHex_[ll];
2216 #ifdef EDM_ML_DEBUG
2217  if (debug)
2218  edm::LogVerbatim("HGCalGeom") << "Layer " << lay << ":" << ll << " Shift " << hgpar_->xLayerHex_[ll] << ":"
2219  << hgpar_->yLayerHex_[ll] << " U:V " << waferU << ":" << waferV;
2220 #endif
2221  if (!reco) {
2224  }
2225  const auto& xy = waferPosition(waferU, waferV, reco);
2226  x += xy.first;
2227  y += xy.second;
2228 #ifdef EDM_ML_DEBUG
2229  if (debug)
2230  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << ":" << xy.first << ":" << xy.second;
2231 #endif
2232  return std::make_pair(x, y);
2233 }
Log< level::Info, true > LogVerbatim
int32_t waferU(const int32_t index)
std::vector< double > yLayerHex_
std::pair< double, double > waferPosition(int wafer, bool reco) const
static constexpr double k_ScaleToDDD
#define debug
Definition: HDRShower.cc:19
fixed size matrix
int32_t waferV(const int32_t index)
const HGCalParameters * hgpar_
std::vector< double > xLayerHex_

◆ wafers() [1/2]

int HGCalDDDConstants::wafers ( ) const

Definition at line 1778 of file HGCalDDDConstants.cc.

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

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

1778  {
1779  int wafer(0);
1780  if (!tileTrapezoid()) {
1781  for (unsigned int i = 0; i < layers(true); ++i) {
1782  int lay = hgpar_->depth_[i];
1783  wafer += modules(lay, true);
1784  }
1785  } else {
1786  wafer = static_cast<int>(hgpar_->moduleLayR_.size());
1787  }
1788  return wafer;
1789 }
std::vector< int > depth_
std::vector< int > moduleLayR_
unsigned int layers(bool reco) const
bool tileTrapezoid() const
int modules(int lay, bool reco) const
const HGCalParameters * hgpar_

◆ wafers() [2/2]

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

Definition at line 1791 of file HGCalDDDConstants.cc.

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

1791  {
1792  int wafer(0);
1793  if (!tileTrapezoid()) {
1794  auto itr = waferLayer_.find(layer);
1795  if (itr != waferLayer_.end()) {
1796  unsigned ity = (type > 0 && type <= 2) ? type : 0;
1797  wafer = (itr->second)[ity];
1798  }
1799  } else {
1800  const auto& index = getIndex(layer, true);
1801  wafer = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
1802  }
1803  return wafer;
1804 }
std::map< int, HGCWaferParam > waferLayer_
std::vector< int > firstModule_
std::pair< int, float > getIndex(int lay, bool reco) const
bool tileTrapezoid() const
std::vector< int > lastModule_
const HGCalParameters * hgpar_

◆ waferSepar()

double HGCalDDDConstants::waferSepar ( bool  reco) const
inline

Definition at line 232 of file HGCalDDDConstants.h.

References hgpar_, HGCalParameters::k_ScaleToDDD, and HGCalParameters::sensorSeparation_.

232  {
234  }
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

◆ waferSize()

double HGCalDDDConstants::waferSize ( bool  reco) const
inline

Definition at line 235 of file HGCalDDDConstants.h.

References hgpar_, HGCalParameters::k_ScaleToDDD, and HGCalParameters::waferSize_.

Referenced by HGCalMouseBiteTester::analyze(), HFNoseSD::update(), and HGCalSD::update().

235  {
237  }
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

◆ waferToCopy()

int HGCalDDDConstants::waferToCopy ( int  wafer) const
inline

Definition at line 240 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferCopy_.

240  {
241  return ((wafer >= 0) && (wafer < static_cast<int>(hgpar_->waferCopy_.size())))
242  ? hgpar_->waferCopy_[wafer]
243  : static_cast<int>(hgpar_->waferCopy_.size());
244  }
std::vector< int > waferCopy_
const HGCalParameters * hgpar_

◆ waferType() [1/3]

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

Definition at line 1806 of file HGCalDDDConstants.cc.

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

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

1806  {
1807  int type(1);
1808  if (waferHexagon8()) {
1809  if (fromFile && (waferFileSize() > 0)) {
1810  int layer(0), waferU(0), waferV(0);
1811  if (id.det() != DetId::Forward) {
1812  HGCSiliconDetId hid(id);
1813  layer = hid.layer();
1814  waferU = hid.waferU();
1815  waferV = hid.waferV();
1816  } else {
1817  HFNoseDetId hid(id);
1818  layer = hid.layer();
1819  waferU = hid.waferU();
1820  waferV = hid.waferV();
1821  }
1823  if (itr != hgpar_->waferInfoMap_.end())
1824  type = (itr->second).type;
1825  } else {
1826  type = ((id.det() != DetId::Forward) ? HGCSiliconDetId(id).type() : HFNoseDetId(id).type());
1827  }
1828  } else if (waferHexagon6()) {
1829  type = waferTypeL(HGCalDetId(id).wafer()) - 1;
1830  }
1831  return type;
1832 }
int32_t waferU(const int32_t index)
bool waferHexagon8() const
bool waferHexagon6() const
unsigned int waferFileSize() const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
int type() const
get the type
Definition: HFNoseDetId.h:51
int32_t waferV(const int32_t index)
int waferTypeL(int wafer) const
waferInfo_map waferInfoMap_
constexpr int32_t type() const
get the type
const HGCalParameters * hgpar_

◆ waferType() [2/3]

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

Definition at line 1834 of file HGCalDDDConstants.cc.

References HGCSiliconDetId::HGCalLD300, hgpar_, nano_mu_digi_cff::layer, HGCalParameters::typesInLayers_, waferFileSize(), waferHexagon6(), waferHexagon8(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalParameters::waferTypeL_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

1834  {
1836  if (waferHexagon8()) {
1837  if (fromFile && (waferFileSize() > 0)) {
1839  if (itr != hgpar_->waferInfoMap_.end())
1840  type = (itr->second).type;
1841  } else {
1843  if (itr != hgpar_->typesInLayers_.end())
1844  type = hgpar_->waferTypeL_[itr->second];
1845  }
1846  } else if (waferHexagon6()) {
1847  if ((waferU >= 0) && (waferU < static_cast<int>(hgpar_->waferTypeL_.size())))
1848  type = (hgpar_->waferTypeL_[waferU] - 1);
1849  }
1850  return type;
1851 }
int32_t waferU(const int32_t index)
bool waferHexagon8() const
bool waferHexagon6() const
unsigned int waferFileSize() const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
wafer_map typesInLayers_
int32_t waferV(const int32_t index)
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_

◆ waferType() [3/3]

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

Definition at line 1853 of file HGCalDDDConstants.cc.

References dqmdumpme::first, hgpar_, HGCalGeomTools::k_allCorners, HGCalGeomTools::k_fiveCorners, HGCalGeomTools::k_fourCorners, HGCalTypes::k_OffsetRotation, HGCalGeomTools::k_threeCorners, nano_mu_digi_cff::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().

1853  {
1854  const auto& index = HGCalWaferIndex::waferIndex(id.layer(), id.waferU(), id.waferV());
1855  int type(-1), part(-1), orient(-1);
1856  if (fromFile && (waferFileSize() > 0)) {
1857  auto itr = hgpar_->waferInfoMap_.find(index);
1858  if (itr != hgpar_->waferInfoMap_.end()) {
1859  type = (itr->second).type;
1860  part = (itr->second).part;
1861  orient = (itr->second).orient;
1862  }
1863  } else {
1864  auto ktr = hgpar_->typesInLayers_.find(index);
1865  if (ktr != hgpar_->typesInLayers_.end())
1866  type = hgpar_->waferTypeL_[ktr->second];
1867  auto itr = hgpar_->waferTypes_.find(index);
1868  if (itr != hgpar_->waferTypes_.end()) {
1869  if ((itr->second).second < HGCalTypes::k_OffsetRotation) {
1870  orient = (itr->second).second;
1871  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1873  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1875  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1877  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1879  }
1880  } else {
1881  part = (itr->second).first;
1882  orient = ((itr->second).second - HGCalTypes::k_OffsetRotation);
1883  }
1884  } else {
1886  orient = 0;
1887  }
1888  }
1889  return std::make_tuple(type, part, orient);
1890 }
static constexpr int k_OffsetRotation
Definition: HGCalTypes.h:93
static constexpr int k_fourCorners
int32_t waferU(const int32_t index)
static constexpr int32_t WaferThree
Definition: HGCalTypes.h:42
U second(std::pair< T, U > const &p)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
unsigned int waferFileSize() const
static constexpr int32_t WaferHalf
Definition: HGCalTypes.h:39
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
waferT_map waferTypes_
static constexpr int k_fiveCorners
part
Definition: HCALResponse.h:20
wafer_map typesInLayers_
static constexpr int k_threeCorners
int32_t waferV(const int32_t index)
static constexpr int32_t WaferFive
Definition: HGCalTypes.h:36
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
static constexpr int k_allCorners
std::vector< int > waferTypeL_

◆ waferTypeL()

int HGCalDDDConstants::waferTypeL ( int  wafer) const
inline

Definition at line 250 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferTypeL_.

Referenced by PFRecHitQTestThresholdInThicknessNormalizedMIPs::test(), and waferType().

250  {
251  return ((wafer >= 0) && (wafer < static_cast<int>(hgpar_->waferTypeL_.size()))) ? hgpar_->waferTypeL_[wafer] : 0;
252  }
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_

◆ waferTypeRotation()

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

Definition at line 1892 of file HGCalDDDConstants.cc.

References debug, TauDecayModes::dec, dqmdumpme::first, hgpar_, HGCalGeomTools::k_allCorners, HGCalGeomTools::k_fiveCorners, HGCalGeomTools::k_fourCorners, HGCalTypes::k_OffsetRotation, HGCalGeomTools::k_threeCorners, nano_mu_digi_cff::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(), and HGCalSD::setDetUnitId().

1893  {
1894  int type(HGCalTypes::WaferOut), rotn(0);
1896  bool withinList(true);
1897  if (fromFile && (waferFileSize() > 0)) {
1898  auto itr = hgpar_->waferInfoMap_.find(wl);
1899  withinList = (itr != hgpar_->waferInfoMap_.end());
1900  if (withinList) {
1901  type = (itr->second).part;
1902  rotn = (itr->second).orient;
1903  }
1904  } else {
1905  auto itr = hgpar_->waferTypes_.find(wl);
1906  if (waferHexagon8()) {
1907  withinList = (itr != hgpar_->waferTypes_.end());
1908  if (withinList) {
1909  if ((itr->second).second < HGCalTypes::k_OffsetRotation) {
1910  rotn = (itr->second).second;
1911  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1913  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1915  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1917  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1919  }
1920  } else {
1921  type = (itr->second).first;
1922  rotn = ((itr->second).second - HGCalTypes::k_OffsetRotation);
1923  }
1924  } else {
1926  rotn = HGCalTypes::WaferCorner0;
1927  }
1928  }
1929  }
1930 #ifdef EDM_ML_DEBUG
1931  if (debug)
1932  edm::LogVerbatim("HGCalGeom") << "waferTypeRotation: Layer " << layer << " Wafer " << waferU << ":" << waferV
1933  << " Index " << std::hex << wl << std::dec << ":" << withinList << " Type " << type
1934  << " Rotation " << rotn;
1935 #endif
1936  return std::make_pair(type, rotn);
1937 }
Log< level::Info, true > LogVerbatim
static constexpr int k_OffsetRotation
Definition: HGCalTypes.h:93
static constexpr int k_fourCorners
int32_t waferU(const int32_t index)
static constexpr int32_t WaferOut
Definition: HGCalTypes.h:56
static constexpr int32_t WaferThree
Definition: HGCalTypes.h:42
bool waferHexagon8() const
U second(std::pair< T, U > const &p)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
unsigned int waferFileSize() const
static constexpr int32_t WaferHalf
Definition: HGCalTypes.h:39
static constexpr int32_t WaferCorner0
Definition: HGCalTypes.h:13
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
waferT_map waferTypes_
#define debug
Definition: HDRShower.cc:19
static constexpr int k_fiveCorners
part
Definition: HCALResponse.h:20
static constexpr int k_threeCorners
int32_t waferV(const int32_t index)
static constexpr int32_t WaferFive
Definition: HGCalTypes.h:36
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
static constexpr int k_allCorners

◆ waferTypeT()

int HGCalDDDConstants::waferTypeT ( int  wafer) const
inline

Definition at line 246 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferTypeT_.

Referenced by HGCalGeometry::getClosestCell(), and hgcal::RecHitTools::isHalfCell().

246  {
247  return ((wafer >= 0) && (wafer < static_cast<int>(hgpar_->waferTypeT_.size()))) ? hgpar_->waferTypeT_[wafer] : 0;
248  }
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_

◆ waferUVMax()

int HGCalDDDConstants::waferUVMax ( ) const
inline

Definition at line 257 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferUVMax_.

Referenced by HGCalTopology::HGCalTopology().

257 { return hgpar_->waferUVMax_; }
const HGCalParameters * hgpar_

◆ waferVirtual()

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

Definition at line 1939 of file HGCalDDDConstants.cc.

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

1939  {
1940  bool type(false);
1941  if (waferHexagon8()) {
1943  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1944  } else if (waferHexagon6()) {
1945  int wl = HGCalWaferIndex::waferIndex(layer, waferU, 0, true);
1946  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1947  }
1948  return type;
1949 }
int32_t waferU(const int32_t index)
bool waferHexagon8() const
bool waferHexagon6() const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
waferT_map waferTypes_
int32_t waferV(const int32_t index)
const HGCalParameters * hgpar_

◆ waferZ()

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

Definition at line 1951 of file HGCalDDDConstants.cc.

References getIndex(), hgpar_, HGCalParameters::k_ScaleToDDD, and HGCalParameters::zLayerHex_.

Referenced by HGCalSimHitValidation::analyzeHits(), HGCalTB23Analyzer::analyzeSimHits(), ticl::SeedingRegionByTracks::buildFirstLayers(), ticl::GeneralInterpretationAlgo::buildLayers(), ticl::LinkingAlgoByDirectionGeometric::buildLayers(), ticl::TracksterLinkingbySkeletons::buildLayers(), HFNoseNumberingScheme::checkPosition(), HGCalNumberingScheme::checkPosition(), DetectorTools::DetectorTools(), HGCalGeometry::get8Corners(), HGCalGeometry::getCorners(), HGCalTriggerTools::getLayerZ(), HGCalGeometry::getNewCorners(), HGCalGeometry::getPosition(), hgcal::RecHitTools::getPositionLayer(), ticl::LinkingAlgoByDirectionGeometric::linkTracksters(), ticl::GeneralInterpretationAlgo::makeCandidates(), HGCalGeometry::neighborZ(), HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_(), and waferLocal2Global().

1951  {
1952  const auto& index = getIndex(lay, reco);
1953  if (index.first < 0)
1954  return 0;
1955  else
1957 }
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< double > zLayerHex_
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

Member Data Documentation

◆ cellOffset_

std::unique_ptr<HGCalCellOffset> HGCalDDDConstants::cellOffset_
private

Definition at line 282 of file HGCalDDDConstants.h.

Referenced by cellOffset(), HGCalDDDConstants(), and locateCell().

◆ dPhiMin

constexpr float HGCalDDDConstants::dPhiMin = 0.02
staticprivate

Definition at line 285 of file HGCalDDDConstants.h.

◆ fullAndPart_

const bool HGCalDDDConstants::fullAndPart_
private

Definition at line 293 of file HGCalDDDConstants.h.

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

◆ geomTools_

HGCalGeomTools HGCalDDDConstants::geomTools_
private

Definition at line 283 of file HGCalDDDConstants.h.

◆ hexside_

double HGCalDDDConstants::hexside_
private

◆ hexsideT_

double HGCalDDDConstants::hexsideT_
private

Definition at line 295 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and waferFromPosition().

◆ hgcassette_

HGCalCassette HGCalDDDConstants::hgcassette_
private

◆ hgcell_

std::unique_ptr<HGCalCell> HGCalDDDConstants::hgcell_
private

Definition at line 280 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and locateCell().

◆ hgcellUV_

std::unique_ptr<HGCalCellUV> HGCalDDDConstants::hgcellUV_
private

Definition at line 281 of file HGCalDDDConstants.h.

Referenced by cellHex(), and HGCalDDDConstants().

◆ hgpar_

const HGCalParameters* HGCalDDDConstants::hgpar_
private

Definition at line 288 of file HGCalDDDConstants.h.

Referenced by assignCell(), assignCellTrap(), calibCellRad(), calibCells(), cassetteShiftSilicon(), cassetteTile(), cellEtaPhiTrap(), cellHex(), cellInLayer(), cellSizeHex(), cellSizeTrap(), cellThickness(), cellType(), distFromEdgeHex(), distFromEdgeTrap(), firstLayer(), getIndex(), getLayer(), getLayerOffset(), getModule(), getModules(), getParameter(), getPhiBins(), getRadiusLayer(), getRangeR(), getREtaRange(), getTrForm(), getTrFormN(), getTrForms(), getTypeHex(), getTypeTrap(), getUVMax(), getXY(), guardRingOffset(), HGCalDDDConstants(), isHalfCell(), isValidCell(), isValidCell8(), isValidHex(), isValidHex8(), isValidTrap(), lastLayer(), layerFromIndex(), layerIndex(), layersInit(), layerType(), levelTop(), localToGlobal8(), locateCell(), locateCellHex(), locateCellTrap(), maskCell(), maxCells(), maxCellUV(), maxRows(), minSlope(), modulesInit(), mouseBite(), numberCells(), numberCellsHexagon(), partialWaferType(), rangeR(), rangeRLayer(), rangeZ(), rowColumnWafer(), sectors(), sensorSizeOffset(), simToReco(), tileCount(), tileExist(), tileInfo(), tilePhiEdge(), tileRingEdge(), tileRings(), tileType(), volumes(), waferFileIndex(), waferFileInfo(), waferFileInfoExist(), waferFileInfoFromIndex(), waferFileSize(), waferFromCopy(), waferFromPosition(), waferIndex(), waferInfo(), waferInLayer(), waferInLayerTest(), waferPosition(), waferPositionNoRot(), wafers(), waferSepar(), waferSize(), waferToCopy(), waferType(), waferTypeL(), waferTypeRotation(), waferTypeT(), waferUVMax(), waferVirtual(), and waferZ().

◆ k_horizontalShift

constexpr double HGCalDDDConstants::k_horizontalShift = 1.0
staticprivate

Definition at line 284 of file HGCalDDDConstants.h.

◆ max_modules_layer_

Simrecovecs HGCalDDDConstants::max_modules_layer_
private

Definition at line 298 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and modules().

◆ maxWafersPerLayer_

int32_t HGCalDDDConstants::maxWafersPerLayer_
private

Definition at line 299 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and maxModulesPerLayer().

◆ mode_

const HGCalGeometryMode::GeometryMode HGCalDDDConstants::mode_
private

◆ modHalf_

int32_t HGCalDDDConstants::modHalf_
private

Definition at line 296 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and maxModules().

◆ rmax_

double HGCalDDDConstants::rmax_
private

◆ rmaxT_

double HGCalDDDConstants::rmaxT_
private

Definition at line 295 of file HGCalDDDConstants.h.

Referenced by cellHex(), HGCalDDDConstants(), and waferFromPosition().

◆ sqrt3_

const double HGCalDDDConstants::sqrt3_
private

Definition at line 291 of file HGCalDDDConstants.h.

Referenced by cellHex(), and distFromEdgeHex().

◆ tan30deg_

constexpr double HGCalDDDConstants::tan30deg_ = 0.5773502693
staticprivate

◆ tol_

constexpr double HGCalDDDConstants::tol_ = 0.001
staticprivate

Definition at line 290 of file HGCalDDDConstants.h.

Referenced by assignCellTrap(), tilePhiEdge(), and tileRingEdge().

◆ tot_layers_

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

Definition at line 297 of file HGCalDDDConstants.h.

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

◆ tot_wafers_

int32_t HGCalDDDConstants::tot_wafers_
private

Definition at line 296 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants().

◆ waferIn_

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

Definition at line 302 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and isValidHex8().

◆ waferLayer_

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

Definition at line 300 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and wafers().

◆ waferMax_

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

Definition at line 301 of file HGCalDDDConstants.h.

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