CMS 3D CMS Logo

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

#include <HGCalDDDConstants.h>

Public Member Functions

std::pair< int, int > assignCell (float x, float y, int lay, int subSec, bool reco) const
 
std::array< int, 5 > assignCellHex (float x, float y, int lay, bool reco, bool extend=false, bool debug=false) const
 
std::array< int, 3 > assignCellTrap (float x, float y, float z, int lay, bool reco) const
 
std::pair< double, double > cellEtaPhiTrap (int type, int irad) const
 
bool cellInLayer (int waferU, int waferV, int cellU, int cellV, int lay, bool reco) const
 
double cellSizeHex (int type) const
 
std::pair< double, double > cellSizeTrap (int type, int irad) const
 
double cellThickness (int layer, int waferU, int waferV) const
 
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< int, int > getREtaRange (int lay) const
 
HGCalParameters::hgtrform getTrForm (unsigned int k) const
 
unsigned int getTrFormN () const
 
std::vector< HGCalParameters::hgtrformgetTrForms () const
 
int getTypeHex (int layer, int waferU, int waferV) const
 
int getTypeTrap (int layer) const
 
int getUVMax (int type) const
 
std::pair< double, double > getXY (int layer, double x, double y, bool forwd) const
 
 HGCalDDDConstants (const HGCalParameters *hp, const std::string &name)
 
bool isHalfCell (int waferType, int cell) const
 
bool isValidHex (int lay, int mod, int cell, bool reco) const
 
bool isValidHex8 (int lay, int waferU, int waferV, bool fullAndPart=false) const
 
bool isValidHex8 (int lay, int modU, int modV, int cellU, int cellV, bool fullAndPart=false) 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 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 lay, int waferU, int waferV, int cellU, int cellV, bool reco, bool all, bool norot=false, bool debug=false) const
 
std::pair< float, float > locateCell (const HGCSiliconDetId &, bool debug=false) const
 
std::pair< float, float > locateCell (const HGCScintillatorDetId &, bool debug=false) const
 
std::pair< float, float > locateCellHex (int cell, int wafer, bool reco) const
 
std::pair< float, float > locateCellTrap (int lay, int ieta, int iphi, bool reco, bool debug=false) 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
 
std::pair< double, double > rangeR (double z, bool reco) const
 
std::pair< double, double > rangeRLayer (int lay, bool reco) const
 
std::pair< double, double > rangeZ (bool reco) const
 
std::pair< int, int > rowColumnWafer (const int wafer) const
 
int sectors () const
 
std::pair< int, int > simToReco (int cell, int layer, int mod, bool half) const
 
int 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
 
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
 
unsigned int volumes () const
 
int waferCount (const int type) const
 
int waferFileIndex (unsigned int kk) const
 
std::tuple< int, int, int > waferFileInfo (unsigned int kk) const
 
bool waferFileInfoExist (int kk) const
 
std::tuple< int, int, int > waferFileInfoFromIndex (int kk) const
 
unsigned int waferFileSize () const
 
int waferFromCopy (int copy) const
 
void waferFromPosition (const double x, const double y, int &wafer, int &icell, int &celltyp) const
 
void waferFromPosition (const double x, const double y, const int layer, int &waferU, int &waferV, int &cellU, int &cellV, int &celltype, double &wt, bool extend=false, bool debug=false) const
 
bool waferFullInLayer (int wafer, int lay, bool reco) const
 
bool waferHexagon6 () const
 
bool waferHexagon8 () const
 
bool waferHexagon8File () 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=false) const
 
int wafers () const
 
int wafers (int layer, int type) const
 
double waferSepar (bool reco) const
 
double waferSize (bool reco) const
 
int waferToCopy (int wafer) const
 
int waferType (DetId const &id, bool fromFile=false) const
 
int waferType (int layer, int waferU, int waferV, bool fromFile=false) const
 
std::tuple< int, int, int > waferType (HGCSiliconDetId const &id, bool fromFile=false) const
 
int waferTypeL (int wafer) const
 
std::pair< int, int > waferTypeRotation (int layer, int waferU, int waferV, bool fromFile=false, bool debug=false) const
 
int waferTypeT (int wafer) const
 
int waferUVMax () const
 
bool waferVirtual (int layer, int waferU, int waferV) const
 
double waferZ (int layer, bool reco) const
 
 ~HGCalDDDConstants ()=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=false, bool debug=false) 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=false) const
 

Private Attributes

const float dPhiMin = 0.02
 
const bool fullAndPart_
 
HGCalGeomTools geomTools_
 
double hexside_
 
double hexsideT_
 
HGCalCassette hgcassette_
 
std::unique_ptr< HGCalCellhgcell_
 
std::unique_ptr< HGCalCellUVhgcellUV_
 
const HGCalParametershgpar_
 
const double k_horizontalShift = 1.0
 
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 double tan30deg_ = 0.5773502693
 

Detailed Description

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

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

Definition at line 35 of file HGCalDDDConstants.h.

Member Typedef Documentation

◆ HGCWaferParam

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

Definition at line 250 of file HGCalDDDConstants.h.

◆ Simrecovecs

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

Definition at line 249 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 HGCalParameters::cassettes_, HGCalParameters::cassetteShift_, HGCalParameters::cellSize_, funct::cos(), fullAndPart_, getIndex(), getTrForm(), getTrFormN(), HGCalGeometryMode::Hexagon8Cassette, hexside_, hexsideT_, hgcassette_, hgcell_, hgcellUV_, hgpar_, mps_fire::i, HGCalParameters::k_ScaleFromDDD, HGCalParameters::hgtrform::lay, phase1PixelTopology::layer, layers(), layersInit(), SiStripPI::max, max_modules_layer_, maxCells(), maxWafersPerLayer_, mode_, modHalf_, modulesInit(), Skims_PA_cff::name, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, rmax_, rmaxT_, sectors(), HGCalParameters::sensorSeparation_, HGCalCassette::setParameter(), tan30deg_, tot_layers_, tot_wafers_, HGCalGeometryMode::TrapezoidCassette, HGCalParameters::waferCopy_, waferHexagon6(), waferHexagon8(), waferIn_, HGCalWaferIndex::waferIndex(), waferInLayer(), waferLayer_, waferMax_, HGCalParameters::waferR_, wafers(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), cms::cuda::wmax, and cms::cuda::wmin.

27 #ifdef EDM_ML_DEBUG
28  edm::LogVerbatim("HGCalGeom") << "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 #ifdef EDM_ML_DEBUG
39  edm::LogVerbatim("HGCalGeom") << "rmax_ " << rmax_ << ":" << rmaxT_ << ":" << hexside_ << ":" << hexsideT_
40  << " CellSize " << 0.5 * HGCalParameters::k_ScaleFromDDD * hgpar_->cellSize_[0] << ":"
42 #endif
43  }
46 #ifdef EDM_ML_DEBUG
47  edm::LogVerbatim("HGCalGeom") << "Setup HGCalCassette for " << hgpar_->cassettes_ << " cassettes";
48 #endif
49  }
50  // init maps and constants
51  modHalf_ = 0;
53  for (int simreco = 0; simreco < 2; ++simreco) {
54  tot_layers_[simreco] = layersInit((bool)simreco);
55  max_modules_layer_[simreco].resize(tot_layers_[simreco] + 1);
56  for (unsigned int layer = 1; layer <= tot_layers_[simreco]; ++layer) {
57  max_modules_layer_[simreco][layer] = modulesInit(layer, (bool)simreco);
58  if (simreco == 1) {
59  modHalf_ += max_modules_layer_[simreco][layer];
61 #ifdef EDM_ML_DEBUG
62  edm::LogVerbatim("HGCalGeom") << "Layer " << layer << " with " << max_modules_layer_[simreco][layer] << ":"
63  << modHalf_ << " modules in RECO";
64  } else {
65  edm::LogVerbatim("HGCalGeom") << "Layer " << layer << " with " << max_modules_layer_[simreco][layer]
66  << " modules in SIM";
67 #endif
68  }
69  }
70 #ifdef EDM_ML_DEBUG
71  edm::LogVerbatim("HGCalGeom") << "SimReco " << simreco << " with " << tot_layers_[simreco] << " Layers";
72 #endif
73  }
74  tot_wafers_ = wafers();
75 
76 #ifdef EDM_ML_DEBUG
77  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants initialized for " << name << " with " << layers(false) << ":"
78  << layers(true) << " layers, " << wafers() << ":" << 2 * modHalf_
79  << " wafers with maximum " << maxWafersPerLayer_ << " per layer and "
80  << "maximum of " << maxCells(false) << ":" << maxCells(true) << " cells";
81 #endif
82  if (waferHexagon6() || waferHexagon8()) {
83  int wminT(9999999), wmaxT(-9999999), kount1(0), kount2(0);
84  for (unsigned int i = 0; i < getTrFormN(); ++i) {
85  int lay0 = getTrForm(i).lay;
86  int wmin(9999999), wmax(-9999999), kount(0);
87  for (int wafer = 0; wafer < sectors(); ++wafer) {
88  bool waferIn = waferInLayer(wafer, lay0, true);
89  if (waferHexagon8()) {
90  int kndx = HGCalWaferIndex::waferIndex(lay0,
93  waferIn_[kndx] = waferIn;
94  }
95  if (waferIn) {
96  int waferU = ((waferHexagon6()) ? wafer : HGCalWaferIndex::waferU(hgpar_->waferCopy_[wafer]));
97  if (waferU < wmin)
98  wmin = waferU;
99  if (waferU > wmax)
100  wmax = waferU;
101  ++kount;
102  }
103  }
104  if (wminT > wmin)
105  wminT = wmin;
106  if (wmaxT < wmax)
107  wmaxT = wmax;
108  if (kount1 < kount)
109  kount1 = kount;
110  kount2 += kount;
111 #ifdef EDM_ML_DEBUG
112  int lay1 = getIndex(lay0, true).first;
113  edm::LogVerbatim("HGCalGeom") << "Index " << i << " Layer " << lay0 << ":" << lay1 << " Wafer " << wmin << ":"
114  << wmax << ":" << kount;
115 #endif
116  HGCWaferParam a1{{wmin, wmax, kount}};
117  waferLayer_[lay0] = a1;
118  }
119  waferMax_ = std::array<int, 4>{{wminT, wmaxT, kount1, kount2}};
120 #ifdef EDM_ML_DEBUG
121  edm::LogVerbatim("HGCalGeom") << "Overall wafer statistics: " << wminT << ":" << wmaxT << ":" << kount1 << ":"
122  << kount2;
123 #endif
124  }
125 }
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_
constexpr std::array< uint8_t, layerIndexSize > layer
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:19
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)
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
int32_t waferV(const int32_t index)
std::vector< int > waferCopy_
std::vector< double > cassetteShift_
static constexpr double tan30deg_
std::array< uint32_t, 2 > tot_layers_
__host__ __device__ V wmin
const HGCalParameters * hgpar_
void setParameter(int cassette, const std::vector< double > &shifts)
Definition: HGCalCassette.cc:7
__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 127 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 HGCNumberingScheme::assignCell(), and HGCalGeometry::getClosestCell().

127  {
128  const auto& index = getIndex(lay, reco);
129  if (index.first < 0)
130  return std::make_pair(-1, -1);
131  if (waferHexagon6()) {
132  float xx = (reco) ? x : HGCalParameters::k_ScaleFromDDD * x;
133  float yy = (reco) ? y : HGCalParameters::k_ScaleFromDDD * y;
134 
135  // First the wafer
136  int wafer = cellHex(xx, yy, rmax_, hgpar_->waferPosX_, hgpar_->waferPosY_);
137  if (wafer < 0 || wafer >= static_cast<int>(hgpar_->waferTypeT_.size())) {
138  edm::LogWarning("HGCalGeom") << "Wafer no. out of bound for " << wafer << ":" << (hgpar_->waferTypeT_).size()
139  << ":" << (hgpar_->waferPosX_).size() << ":" << (hgpar_->waferPosY_).size()
140  << " ***** ERROR *****";
141  return std::make_pair(-1, -1);
142  } else {
143  // Now the cell
144  xx -= hgpar_->waferPosX_[wafer];
145  yy -= hgpar_->waferPosY_[wafer];
146  if (hgpar_->waferTypeT_[wafer] == 1)
147  return std::make_pair(wafer,
148  cellHex(xx,
149  yy,
152  hgpar_->cellFineY_));
153  else
154  return std::make_pair(wafer,
155  cellHex(xx,
156  yy,
159  hgpar_->cellCoarseY_));
160  }
161  } else {
162  return std::make_pair(-1, -1);
163  }
164 }
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  lay,
bool  reco,
bool  extend = false,
bool  debug = false 
) const

Definition at line 166 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, and geometryCSVtoXML::yy.

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

167  {
168  int waferU(0), waferV(0), waferType(-1), cellU(0), cellV(0);
169  if (waferHexagon8()) {
170  double xx = (reco) ? HGCalParameters::k_ScaleToDDD * x : x;
171  double yy = (reco) ? HGCalParameters::k_ScaleToDDD * y : y;
172  double wt(1.0);
173 #ifdef EDM_ML_DEBUG
174  edm::LogVerbatim("HGCalGeom") << "assignCellHex x " << x << ":" << xx << " y " << y << ":" << yy << " Lay " << lay;
175 #endif
176  waferFromPosition(xx, yy, lay, waferU, waferV, cellU, cellV, waferType, wt, extend, debug);
177  }
178  return std::array<int, 5>{{waferU, waferV, waferType, cellU, cellV}};
179 }
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 waferType(DetId const &id, bool fromFile=false) const
static constexpr double k_ScaleToDDD
#define debug
Definition: HDRShower.cc:19
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 181 of file HGCalDDDConstants.cc.

References HGCalParameters::cassettes_, angle_units::operators::convertRadToDeg(), HGCalParameters::firstLayer_, getIndex(), HGCalCassette::getShift(), hgcassette_, hgpar_, LEDCalibrationChannels::iphi, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, HGCalParameters::k_ScaleFromDDD, phase1PixelTopology::layer, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, M_PI, mode_, HGCalParameters::nphiCassette_, phi, HGCalParameters::phiOffset_, alignCSCRings::r, HGCalParameters::radiusLayer_, dt_dqm_sourceclient_common_cff::reco, HGCalParameters::scintType(), mathSSE::sqrt(), HGCalTileIndex::tileCassette(), HGCalGeometryMode::TrapezoidCassette, x, HGCalParameters::xLayerHex_, geometryCSVtoXML::xx, y, HGCalParameters::yLayerHex_, geometryCSVtoXML::yy, and z.

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

181  {
182  int irad(-1), iphi(-1), type(-1);
183  const auto& indx = getIndex(layer, reco);
184  if (indx.first < 0)
185  return std::array<int, 3>{{irad, iphi, type}};
186  double xx = (reco) ? ((z > 0) ? x : -x)
188  double yy = (reco) ? y : HGCalParameters::k_ScaleFromDDD * y;
189  int ll = layer - hgpar_->firstLayer_;
190  xx -= hgpar_->xLayerHex_[ll];
191  yy -= hgpar_->yLayerHex_[ll];
194  auto cshift = hgcassette_.getShift(layer, 1, cassette);
195 #ifdef EDM_ML_DEBUG
196  edm::LogVerbatim("HGCalGeom") << "Cassette " << cassette << " Shift " << cshift.first << ":" << cshift.second;
197 #endif
198  xx -= cshift.first;
199  yy -= cshift.second;
200  }
201  double phi = (((yy == 0.0) && (xx == 0.0)) ? 0. : std::atan2(yy, xx));
202  if (phi < 0)
203  phi += (2.0 * M_PI);
204  if (indx.second != 0)
205  iphi = 1 + static_cast<int>(phi / indx.second);
207  double r = std::sqrt(xx * xx + yy * yy);
208  auto ir = std::lower_bound(hgpar_->radiusLayer_[type].begin(), hgpar_->radiusLayer_[type].end(), r);
209  irad = static_cast<int>(ir - hgpar_->radiusLayer_[type].begin());
210  irad = std::clamp(irad, hgpar_->iradMinBH_[indx.first], hgpar_->iradMaxBH_[indx.first]);
211 #ifdef EDM_ML_DEBUG
212  edm::LogVerbatim("HGCalGeom") << "assignCellTrap Input " << x << ":" << y << ":" << z << ":" << layer << ":" << reco
213  << " x|y|r " << xx << ":" << yy << ":" << r << " phi " << phi << ":"
214  << convertRadToDeg(phi) << " o/p " << irad << ":" << iphi << ":" << type;
215 #endif
216  return std::array<int, 3>{{irad, iphi, type}};
217 }
std::vector< int > iradMaxBH_
Log< level::Info, true > LogVerbatim
HGCalCassette hgcassette_
int scintType(const int layer) const
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
std::pair< double, double > getShift(int layer, int zside, int cassette) const
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< double > yLayerHex_
T sqrt(T t)
Definition: SSEVec.h:19
std::pair< int, float > getIndex(int lay, bool reco) const
int32_t tileCassette(int32_t, int32_t, int32_t, int32_t)
#define M_PI
std::vector< int > iradMinBH_
const HGCalGeometryMode::GeometryMode mode_
static constexpr double k_ScaleFromDDD
fixed size matrix
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
std::vector< double > xLayerHex_

◆ cellEtaPhiTrap()

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

Definition at line 219 of file HGCalDDDConstants.cc.

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

219  {
220  double dr(0), df(0);
221  if (tileTrapezoid()) {
222  double r = 0.5 * ((hgpar_->radiusLayer_[type][irad - 1] + hgpar_->radiusLayer_[type][irad]));
223  dr = (hgpar_->radiusLayer_[type][irad] - hgpar_->radiusLayer_[type][irad - 1]);
224  df = r * hgpar_->cellSize_[type];
225  }
226  return std::make_pair(dr, df);
227 }
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 1700 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().

1701  {
1702  int num(0);
1703  const double tol(0.00001);
1704  double cellY = 2.0 * cellR * tan30deg_;
1705  for (unsigned int k = 0; k < posX.size(); ++k) {
1706  double dx = std::abs(xx - posX[k]);
1707  double dy = std::abs(yy - posY[k]);
1708  if (dx <= (cellR + tol) && dy <= (cellY + tol)) {
1709  double xmax = (dy <= 0.5 * cellY) ? cellR : (cellR - (dy - 0.5 * cellY) / tan30deg_);
1710  if (dx <= (xmax + tol)) {
1711  num = k;
1712  break;
1713  }
1714  }
1715  }
1716  return num;
1717 }
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 = false,
bool  debug = false 
) const
private

Definition at line 1719 of file HGCalDDDConstants.cc.

References funct::abs(), cellType(), debug, newFWLiteAna::found, HGCalGeometryMode::Hexagon8Cassette, hgcellUV_, hgpar_, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, SiStripPI::max, SiStripPI::min, mode_, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, rmax_, rmaxT_, edm::shift, sqrt3_, V0Monitor_cff::v0, HGCalTypes::WaferFull, and waferHexagon8File().

1720  {
1722  auto uv = (part == HGCalTypes::WaferFull)
1723  ? hgcellUV_->cellUVFromXY3(xloc, yloc, place, cellType, true, debug)
1724  : hgcellUV_->cellUVFromXY1(xloc, yloc, place, cellType, part, true, debug);
1725  cellU = uv.first;
1726  cellV = uv.second;
1727  } else if (waferHexagon8File()) {
1728  auto uv = hgcellUV_->cellUVFromXY3(xloc, yloc, place, cellType, extend, debug);
1729  cellU = uv.first;
1730  cellV = uv.second;
1731  } else {
1732  int ncell = (cellType == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1733  double delY = 2 * rmax_ / (3 * ncell);
1734  double delX = 0.5 * delY * sqrt3_;
1735  double delYT = (extend) ? (2 * rmaxT_ / (3 * ncell)) : delY;
1736  double delXT = 0.5 * delYT * sqrt3_;
1737  double v0 = ((xloc / delY - 1.0) / 1.5);
1738  int cv0 = (v0 > 0) ? (ncell + static_cast<int>(v0 + 0.5)) : (ncell - static_cast<int>(-v0 + 0.5));
1739  double u0 = (0.5 * yloc / delX + 0.5 * cv0);
1740  int cu0 = (u0 > 0) ? (ncell / 2 + static_cast<int>(u0 + 0.5)) : (ncell / 2 - static_cast<int>(-u0 + 0.5));
1741  cu0 = std::max(0, std::min(cu0, 2 * ncell - 1));
1742  cv0 = std::max(0, std::min(cv0, 2 * ncell - 1));
1743  if (cv0 - cu0 >= ncell)
1744  cv0 = cu0 + ncell - 1;
1745  if (debug)
1746  edm::LogVerbatim("HGCalGeom") << "cellHex: input " << xloc << ":" << yloc << ":" << cellType << " parameter "
1747  << delX << ":" << delY << " u0 " << u0 << ":" << cu0 << " v0 " << v0 << ":" << cv0;
1748  bool found(false);
1749  static constexpr int shift[3] = {0, 1, -1};
1750  for (int i1 = 0; i1 < 3; ++i1) {
1751  cellU = cu0 + shift[i1];
1752  for (int i2 = 0; i2 < 3; ++i2) {
1753  cellV = cv0 + shift[i2];
1754  if (((cellV - cellU) < ncell) && ((cellU - cellV) <= ncell) && (cellU >= 0) && (cellV >= 0) &&
1755  (cellU < 2 * ncell) && (cellV < 2 * ncell)) {
1756  double xc = (1.5 * (cellV - ncell) + 1.0) * delY;
1757  double yc = (2 * cellU - cellV - ncell) * delX;
1758  if ((std::abs(yloc - yc) <= delXT) && (std::abs(xloc - xc) <= delYT) &&
1759  ((std::abs(xloc - xc) <= 0.5 * delYT) ||
1760  (std::abs(yloc - yc) <= sqrt3_ * (delYT - std::abs(xloc - xc))))) {
1761  if (debug)
1762  edm::LogVerbatim("HGCalGeom")
1763  << "cellHex: local " << xc << ":" << yc << " difference " << std::abs(xloc - xc) << ":"
1764  << std::abs(yloc - yc) << ":" << sqrt3_ * (delY - std::abs(yloc - yc)) << " comparator " << delX
1765  << ":" << delY << " (u,v) = (" << cellU << "," << cellV << ")";
1766  found = true;
1767  break;
1768  }
1769  }
1770  }
1771  if (found)
1772  break;
1773  }
1774  if (!found) {
1775  cellU = cu0;
1776  cellV = cv0;
1777  }
1778  }
1779 }
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
const HGCalGeometryMode::GeometryMode mode_
static unsigned int const shift
const HGCalParameters * hgpar_

◆ cellInLayer()

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

Definition at line 229 of file HGCalDDDConstants.cc.

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

Referenced by HGCalGeometry::newCell().

229  {
230  const auto& indx = getIndex(lay, true);
231  if (indx.first >= 0) {
233  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
234  auto ktr = hgpar_->waferInfoMap_.find(indx);
235  int part = (ktr != hgpar_->waferInfoMap_.end()) ? (ktr->second).part : HGCalTypes::WaferFull;
236  return HGCalWaferMask::goodCell(cellU, cellV, part);
238  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
239  auto ktr = hgpar_->waferInfoMap_.find(indx);
241  if (ktr != hgpar_->waferInfoMap_.end()) {
242  thck = (ktr->second).type;
243  part = (ktr->second).part;
244  rotn = (ktr->second).orient;
245  }
247  return HGCalWaferMask::goodCell(cellU, cellV, ncell, part, rotn);
248  } else if (waferHexagon8() || waferHexagon6()) {
249  const auto& xy = ((waferHexagon8()) ? locateCell(lay, waferU, waferV, cellU, cellV, reco, true, false, false)
250  : locateCell(cellU, lay, waferU, reco));
251  double rpos = sqrt(xy.first * xy.first + xy.second * xy.second);
252  return ((rpos >= hgpar_->rMinLayHex_[indx.first]) && (rpos <= hgpar_->rMaxLayHex_[indx.first]));
253  } else {
254  return true;
255  }
256  } else {
257  return false;
258  }
259 }
int32_t waferU(const int32_t index)
static bool goodCell(int u, int v, int N, int type, int rotn)
bool waferHexagon8() const
bool waferHexagon6() const
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
T sqrt(T t)
Definition: SSEVec.h:19
static constexpr int32_t WaferOrient0
Definition: HGCalTypes.h:61
std::pair< int, float > getIndex(int lay, bool reco) const
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
int32_t waferV(const int32_t index)
static constexpr int32_t WaferFineThin
Definition: HGCalTypes.h:30
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ cellSizeHex()

double HGCalDDDConstants::cellSizeHex ( int  type) const

Definition at line 274 of file HGCalDDDConstants.cc.

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

Referenced by HGCalGeometryLoader::build(), and hgcal::RecHitTools::getRadiusToSide().

274  {
275  int indx = ((waferHexagon8()) ? ((type >= 1) ? 1 : 0) : ((type == 1) ? 1 : 0));
276  double cell = (tileTrapezoid() ? 0.5 * hgpar_->cellSize_[indx]
278  return cell;
279 }
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 46 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::radiusLayer_.

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

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

◆ cellThickness()

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

Definition at line 261 of file HGCalDDDConstants.cc.

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

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

261  {
262  double thick(-1);
263  int type = waferType(layer, waferU, waferV, false);
264  if (type >= 0) {
265  if (waferHexagon8()) {
266  thick = 10000.0 * hgpar_->cellThickness_[type]; // cm to micron
267  } else if (waferHexagon6()) {
268  thick = 100.0 * (type + 1); // type = 1,2,3 for 100,200,300 micron
269  }
270  }
271  return thick;
272 }
int32_t waferU(const int32_t index)
bool waferHexagon8() const
bool waferHexagon6() const
constexpr std::array< uint8_t, layerIndexSize > layer
int waferType(DetId const &id, bool fromFile=false) const
std::vector< double > cellThickness_
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 281 of file HGCalDDDConstants.cc.

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

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

281  {
282  int placement = (orient < 0) ? HGCalCell::cellPlacementOld : HGCalCell::cellPlacementIndex(iz, fwdBack, orient);
283  int ncell = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
284  auto cellType = HGCalCell::cellType(cellU, cellV, ncell, placement);
285  return cellType.first;
286 }
static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient)
Definition: HGCalCell.cc:230
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:242
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 288 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(), and HGCalSD::isItinFidVolume().

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

References funct::abs(), getLayer(), hgpar_, LEDCalibrationChannels::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().

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

◆ getIndex()

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

Definition at line 1781 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().

1781  {
1782  int indx = layerIndex(lay, reco);
1783  if (indx < 0)
1784  return std::make_pair(-1, 0);
1785  float cell(0);
1786  if (waferHexagon6()) {
1787  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1788  } else {
1789  if (waferHexagon8()) {
1790  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1791  } else {
1792  cell = hgpar_->scintCellSize(lay);
1793  }
1794  }
1795  return std::make_pair(indx, cell);
1796 }
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 364 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(), HGCMouseBite::exclude(), HGCalGeometry::getClosestCell(), and HGCalGeometry::getClosestCellHex().

364  {
365  // Get the layer # from the gloabl z coordinate
366  unsigned int k = 0;
367  double zz = (reco ? std::abs(z) : HGCalParameters::k_ScaleFromDDD * std::abs(z));
368  const auto& zLayerHex = hgpar_->zLayerHex_;
369  auto itr = std::find_if(zLayerHex.begin() + 1, zLayerHex.end(), [&k, &zz, &zLayerHex](double zLayer) {
370  ++k;
371  return zz < 0.5 * (zLayerHex[k - 1] + zLayerHex[k]);
372  });
373  int lay = (itr == zLayerHex.end()) ? static_cast<int>(zLayerHex.size()) : k;
374  if (waferHexagon6() && reco) {
375  int indx = layerIndex(lay, false);
376  if (indx >= 0)
377  lay = hgpar_->layerGroupO_[indx];
378  } else {
379  lay += (hgpar_->firstLayer_ - 1);
380  }
381  return lay;
382 }
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 64 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::layerOffset_.

Referenced by HGCalNumberingScheme::HGCalNumberingScheme().

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

◆ getModule()

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

Definition at line 384 of file HGCalDDDConstants.cc.

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

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

384  {
386  if (hexType) {
387  if (indx >= hgpar_->waferTypeL_.size())
388  edm::LogWarning("HGCalGeom") << "Wafer no. out bound for index " << indx << ":" << (hgpar_->waferTypeL_).size()
389  << ":" << (hgpar_->waferPosX_).size() << ":" << (hgpar_->waferPosY_).size()
390  << " ***** ERROR *****";
391  unsigned int type =
392  ((indx < hgpar_->waferTypeL_.size()) ? hgpar_->waferTypeL_[indx] - 1 : HGCSiliconDetId::HGCalCoarseThick);
393  mytr = hgpar_->getModule(type, reco);
394  } else {
395  mytr = hgpar_->getModule(indx, reco);
396  }
397  return mytr;
398 }
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 400 of file HGCalDDDConstants.cc.

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

400  {
401  std::vector<HGCalParameters::hgtrap> mytrs;
402  for (unsigned int k = 0; k < hgpar_->moduleLayR_.size(); ++k)
403  mytrs.emplace_back(hgpar_->getModule(k, true));
404  return mytrs;
405 }
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 407 of file HGCalDDDConstants.cc.

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

407 { 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 70 of file HGCalDDDConstants.h.

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

70  {
72  }
int scintType(const int layer) const
constexpr std::array< uint8_t, layerIndexSize > layer
bool tileTrapezoid() const
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_

◆ getREtaRange()

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

Definition at line 409 of file HGCalDDDConstants.cc.

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

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

409  {
410  int irmin(0), irmax(0);
411  if (tileTrapezoid()) {
412  int indx = layerIndex(lay, false);
413  if ((indx >= 0) && (indx < static_cast<int>(hgpar_->iradMinBH_.size()))) {
414  irmin = hgpar_->iradMinBH_[indx];
415  irmax = hgpar_->iradMaxBH_[indx];
416  }
417  }
418  return std::make_pair(irmin, irmax);
419 }
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 73 of file HGCalDDDConstants.h.

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

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

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

◆ getTrFormN()

unsigned int HGCalDDDConstants::getTrFormN ( ) const
inline

Definition at line 74 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::trformIndex_.

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

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

◆ getTrForms()

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

Definition at line 421 of file HGCalDDDConstants.cc.

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

Referenced by HGCalTrackCollectionProducer::beginLuminosityBlock().

421  {
422  std::vector<HGCalParameters::hgtrform> mytrs;
423  for (unsigned int k = 0; k < hgpar_->trformIndex_.size(); ++k)
424  mytrs.emplace_back(hgpar_->getTrForm(k));
425  return mytrs;
426 }
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 437 of file HGCalDDDConstants.cc.

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

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

437  {
438  // Get the module type for a silicon wafer
439  if (waferHexagon8()) {
441  return ((itr == hgpar_->typesInLayers_.end() ? 2 : hgpar_->waferTypeL_[itr->second]));
442  } else {
443  return -1;
444  }
445 }
int32_t waferU(const int32_t index)
bool waferHexagon8() const
constexpr std::array< uint8_t, layerIndexSize > layer
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 428 of file HGCalDDDConstants.cc.

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

Referenced by HGCalTriggerGeometryV9Imp3::detIdWaferType().

428  {
429  // Get the module type for scinitllator
430  if (tileTrapezoid()) {
431  return hgpar_->scintType(layer);
432  } else {
433  return -1;
434  }
435 }
int scintType(const int layer) const
constexpr std::array< uint8_t, layerIndexSize > layer
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 447 of file HGCalDDDConstants.cc.

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

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

447  {
448  int ll = layer - hgpar_->firstLayer_;
449  double x0(x), y0(y);
450  if ((!hgpar_->layerType_.empty()) && (ll < static_cast<int>(hgpar_->layerRotV_.size()))) {
451  if (forwd) {
452  x0 = x * hgpar_->layerRotV_[ll].first + y * hgpar_->layerRotV_[ll].second;
453  y0 = y * hgpar_->layerRotV_[ll].first - x * hgpar_->layerRotV_[ll].second;
454  } else {
455  x0 = x * hgpar_->layerRotV_[ll].first - y * hgpar_->layerRotV_[ll].second;
456  y0 = y * hgpar_->layerRotV_[ll].first + x * hgpar_->layerRotV_[ll].second;
457  }
458  }
459 #ifdef EDM_ML_DEBUG
460  double x1(x0), y1(y0);
461  if (ll < static_cast<int>(hgpar_->layerRotV_.size())) {
462  if (forwd) {
463  x1 = x0 * hgpar_->layerRotV_[ll].first - y0 * hgpar_->layerRotV_[ll].second;
464  y1 = y0 * hgpar_->layerRotV_[ll].first + x0 * hgpar_->layerRotV_[ll].second;
465  } else {
466  x1 = x0 * hgpar_->layerRotV_[ll].first + y0 * hgpar_->layerRotV_[ll].second;
467  y1 = y0 * hgpar_->layerRotV_[ll].first - x0 * hgpar_->layerRotV_[ll].second;
468  }
469  }
470  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << layer << ":" << ll << " mode " << forwd << " x " << x
471  << ":" << x0 << ":" << x1 << " y " << y << ":" << y0 << ":" << y1;
472 #endif
473  return std::make_pair(x0, y0);
474 }
Log< level::Info, true > LogVerbatim
std::vector< std::pair< double, double > > layerRotV_
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< int > layerType_
const HGCalParameters * hgpar_

◆ isHalfCell()

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

Definition at line 476 of file HGCalDDDConstants.cc.

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

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

476  {
477  if (waferType < 1 || cell < 0)
478  return false;
479  return waferType == 2 ? hgpar_->cellCoarseHalf_[cell] : hgpar_->cellFineHalf_[cell];
480 }
std::vector< bool > cellCoarseHalf_
std::vector< bool > cellFineHalf_
int waferType(DetId const &id, bool fromFile=false) const
const HGCalParameters * hgpar_

◆ isValidCell()

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

Definition at line 1818 of file HGCalDDDConstants.cc.

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

Referenced by isValidHex().

1818  {
1819  // Calculate the position of the cell
1820  // Works for options HGCalHexagon/HGCalHexagonFull
1821  double x = hgpar_->waferPosX_[wafer];
1822  double y = hgpar_->waferPosY_[wafer];
1823  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine) {
1824  x += hgpar_->cellFineX_[cell];
1825  y += hgpar_->cellFineY_[cell];
1826  } else {
1827  x += hgpar_->cellCoarseX_[cell];
1828  y += hgpar_->cellCoarseY_[cell];
1829  }
1830  double rr = sqrt(x * x + y * y);
1831  bool result = ((rr >= hgpar_->rMinLayHex_[lay - 1]) && (rr <= hgpar_->rMaxLayHex_[lay - 1]) &&
1832  (wafer < static_cast<int>(hgpar_->waferPosX_.size())));
1833 #ifdef EDM_ML_DEBUG
1834  if (!result)
1835  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << wafer << ":" << cell << " Position " << x << ":" << y
1836  << ":" << rr << " Compare Limits " << hgpar_->rMinLayHex_[lay - 1] << ":"
1837  << hgpar_->rMaxLayHex_[lay - 1] << " Flag " << result;
1838 #endif
1839  return result;
1840 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
T sqrt(T t)
Definition: SSEVec.h:19
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 1842 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseIndex_, HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineIndex_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, HGCalParameters::firstLayer_, HGCalWaferMask::goodCell(), HGCalGeometryMode::Hexagon8Cassette, 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().

1842  {
1843  bool result(false);
1844  auto partn = waferTypeRotation(lay, waferU, waferV, false, false);
1845 #ifdef EDM_ML_DEBUG
1846  edm::LogVerbatim("HGCalGeom") << "waferHexagon8 " << waferHexagon8File() << ":" << mode_ << ":"
1847  << HGCalGeometryMode::Hexagon8Cassette << " part " << partn.first << ":"
1848  << partn.second;
1849 #endif
1851  result = HGCalWaferMask::goodCell(cellU, cellV, partn.first);
1852 #ifdef EDM_ML_DEBUG
1853  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << waferU << ":" << waferV << ":" << cellU << ":" << cellV
1854  << " Result " << result;
1855 #endif
1856  } else {
1857  float x(0), y(0);
1858  int kndx = cellV * 100 + cellU;
1859  if (type == 0) {
1860  auto ktr = hgpar_->cellFineIndex_.find(kndx);
1861  if (ktr != hgpar_->cellFineIndex_.end()) {
1862  x = hgpar_->cellFineX_[ktr->second];
1863  y = hgpar_->cellFineY_[ktr->second];
1864  }
1865 #ifdef EDM_ML_DEBUG
1866  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
1867  << (ktr != hgpar_->cellFineIndex_.end());
1868 #endif
1869  } else {
1870  auto ktr = hgpar_->cellCoarseIndex_.find(kndx);
1871  if (ktr != hgpar_->cellCoarseIndex_.end()) {
1872  x = hgpar_->cellCoarseX_[ktr->second];
1873  y = hgpar_->cellCoarseY_[ktr->second];
1874  }
1875 #ifdef EDM_ML_DEBUG
1876  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
1877  << (ktr != hgpar_->cellCoarseIndex_.end());
1878 #endif
1879  }
1880  const auto& xy = waferPositionNoRot(lay, waferU, waferV, true, false);
1881  x += xy.first;
1882  y += xy.second;
1883 #ifdef EDM_ML_DEBUG
1884  edm::LogVerbatim("HGCalGeom") << "With wafer (" << waferU << "," << waferV << ") " << x << ":" << y;
1885 #endif
1886  double rr = sqrt(x * x + y * y);
1887  int ll = lay - hgpar_->firstLayer_;
1888  result = ((rr >= hgpar_->rMinLayHex_[ll]) && (rr <= hgpar_->rMaxLayHex_[ll]));
1889 #ifdef EDM_ML_DEBUG
1890  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << ll << ":" << waferU << ":" << waferV << ":" << cellU
1891  << ":" << cellV << " Position " << x << ":" << y << ":" << rr << " Compare Limits "
1892  << hgpar_->rMinLayHex_[ll] << ":" << hgpar_->rMaxLayHex_[ll] << " Flag " << result;
1893 #endif
1894  if (result && waferHexagon8File()) {
1895  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1896  result = HGCalWaferMask::goodCell(cellU, cellV, N, partn.first, partn.second);
1897 #ifdef EDM_ML_DEBUG
1898  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << waferU << ":" << waferV << ":" << cellU << ":" << cellV
1899  << " N " << N << " part " << partn.first << ":" << partn.second << " Result "
1900  << result;
1901 #endif
1902  }
1903  }
1904  return result;
1905 }
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::pair< int, int > waferTypeRotation(int layer, int waferU, int waferV, bool fromFile=false, bool debug=false) const
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
T sqrt(T t)
Definition: SSEVec.h:19
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_
int32_t waferV(const int32_t index)
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug=false) const
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_

◆ isValidHex()

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

Definition at line 482 of file HGCalDDDConstants.cc.

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

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

482  {
483  // Check validity for a layer|wafer|cell of pre-TDR version
484  bool result(false), resultMod(false);
485  int cellmax(0);
486  if (waferHexagon6()) {
487  int32_t copyNumber = hgpar_->waferCopy_[mod];
488  result = ((lay > 0 && lay <= static_cast<int>(layers(reco))));
489  if (result) {
490  const int32_t lay_idx = reco ? (lay - 1) * 3 + 1 : lay;
491  const auto& the_modules = hgpar_->copiesInLayers_[lay_idx];
492  auto moditr = the_modules.find(copyNumber);
493  result = resultMod = (moditr != the_modules.end());
494 #ifdef EDM_ML_DEBUG
495  if (!result)
496  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << lay << ":" << lay_idx << " Copy " << copyNumber
497  << ":" << mod << " Flag " << result;
498 #endif
499  if (result) {
500  if (moditr->second >= 0) {
501  if (mod >= static_cast<int>(hgpar_->waferTypeT_.size()))
502  edm::LogWarning("HGCalGeom") << "Module no. out of bound for " << mod << " to be compared with "
503  << (hgpar_->waferTypeT_).size() << " ***** ERROR *****";
504  cellmax = ((hgpar_->waferTypeT_[mod] - 1 == HGCSiliconDetId::HGCalFine)
505  ? static_cast<int>(hgpar_->cellFineX_.size())
506  : static_cast<int>(hgpar_->cellCoarseX_.size()));
507  result = (cell >= 0 && cell <= cellmax);
508  } else {
509  result = isValidCell(lay_idx, mod, cell);
510  }
511  }
512  }
513  }
514 
515 #ifdef EDM_ML_DEBUG
516  if (!result)
517  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << lay << ":"
518  << (lay > 0 && (lay <= static_cast<int>(layers(reco)))) << " Module " << mod << ":"
519  << resultMod << " Cell " << cell << ":" << cellmax << ":"
520  << (cell >= 0 && cell <= cellmax) << ":" << maxCells(reco);
521 #endif
522  return result;
523 }
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 = false 
) const

Definition at line 525 of file HGCalDDDConstants.cc.

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

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

525  {
526  // Check validity for a layer|wafer|cell of post-TDR version
527  int indx = HGCalWaferIndex::waferIndex(layer, modU, modV);
528  auto itr = hgpar_->typesInLayers_.find(indx);
529 #ifdef EDM_ML_DEBUG
530  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferType " << layer << ":" << modU << ":" << modV
531  << ":" << indx << " Test " << (itr != hgpar_->typesInLayers_.end());
532 #endif
533  if (itr == hgpar_->typesInLayers_.end())
534  return false;
535 
536  if (fullAndPart_) {
537  auto ktr = hgpar_->waferInfoMap_.find(indx);
538 #ifdef EDM_ML_DEBUG
539  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferInfoMap " << layer << ":" << modU << ":"
540  << modV << ":" << indx << " Test " << (ktr != hgpar_->waferInfoMap_.end());
541 #endif
542  if (ktr == hgpar_->waferInfoMap_.end())
543  return false;
544  } else {
545  auto jtr = waferIn_.find(indx);
546 #ifdef EDM_ML_DEBUG
547  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferIn " << jtr->first << ":" << jtr->second;
548 #endif
549  if (!(jtr->second))
550  return false;
551  }
552 
553  if (fullAndPart || fullAndPart_) {
554  auto ktr = hgpar_->waferTypes_.find(indx);
555  if (ktr != hgpar_->waferTypes_.end()) {
556  if (hgpar_->waferMaskMode_ > 0) {
557  if (ktr->second.first == HGCalTypes::WaferOut)
558  return false;
559  } else {
560  if (ktr->second.first < HGCalTypes::WaferCornerMin)
561  return false;
562  }
563  }
564  }
565  return true;
566 }
Log< level::Info, true > LogVerbatim
static constexpr int32_t WaferOut
Definition: HGCalTypes.h:56
std::unordered_map< int32_t, bool > waferIn_
constexpr std::array< uint8_t, layerIndexSize > layer
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:74
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ isValidHex8() [2/2]

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

Definition at line 568 of file HGCalDDDConstants.cc.

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

568  {
569  // First check validity for a layer|wafer| of post TDR version
570 #ifdef EDM_ML_DEBUG
571  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:: layer|wafer " << layer << ":" << modU << ":" << modV << ":"
572  << fullAndPart << " Valid " << isValidHex8(layer, modU, modV, fullAndPart);
573 #endif
574  if (!isValidHex8(layer, modU, modV, fullAndPart))
575  return false;
576  int indx = HGCalWaferIndex::waferIndex(layer, modU, modV);
577  auto itr = hgpar_->typesInLayers_.find(indx);
578  int type = hgpar_->waferTypeL_[itr->second];
579  int N = ((hgpar_->waferTypeL_[itr->second] == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_);
580 #ifdef EDM_ML_DEBUG
581  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:Cell " << cellU << ":" << cellV << ":" << N
582  << " Tests " << (cellU >= 0) << ":" << (cellU < 2 * N) << ":" << (cellV >= 0) << ":"
583  << (cellV < 2 * N) << ":" << ((cellV - cellU) < N) << ":" << ((cellU - cellV) <= N);
584 #endif
585  if ((cellU < 0) || (cellU >= 2 * N) || (cellV < 0) || (cellV >= 2 * N))
586  return false;
587  if (((cellV - cellU) >= N) || ((cellU - cellV) > N))
588  return false;
589 
590  return isValidCell8(layer, modU, modV, cellU, cellV, type);
591 }
Log< level::Info, true > LogVerbatim
bool isValidHex8(int lay, int waferU, int waferV, bool fullAndPart=false) const
constexpr std::array< uint8_t, layerIndexSize > layer
bool isValidCell8(int lay, int waferU, int waferV, int cellU, int cellV, int type) const
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 593 of file HGCalDDDConstants.cc.

References getIndex(), hgpar_, LEDCalibrationChannels::iphi, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, phase1PixelTopology::layer, convertSQLiteXML::ok, HGCalParameters::scintCells(), tileExist(), trapezoidFile(), and ecaldqm::zside().

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

593  {
594  // Check validity for a layer|eta|phi of scintillator
595  const auto& indx = getIndex(layer, true);
596  if (indx.first < 0)
597  return false;
598  bool ok = ((irad >= hgpar_->iradMinBH_[indx.first]) && (irad <= (hgpar_->iradMaxBH_[indx.first] + 1)) && (iphi > 0) &&
599  (iphi <= hgpar_->scintCells(layer)));
600  return ((ok && trapezoidFile()) ? tileExist(zside, layer, irad, iphi) : ok);
601 }
std::vector< int > iradMaxBH_
bool trapezoidFile() const
int zside(DetId const &)
constexpr std::array< uint8_t, layerIndexSize > layer
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 603 of file HGCalDDDConstants.cc.

References HGCalParameters::firstLayer_, hgpar_, and tot_layers_.

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

603  {
604  return (hgpar_->firstLayer_ + tot_layers_[static_cast<int>(reco)] - 1);
605 }
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 1798 of file HGCalDDDConstants.cc.

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

Referenced by waferIndex().

1798  {
1799  int ll(-1);
1800  if (waferHexagon6() && reco) {
1801  ll = static_cast<int>(std::find(hgpar_->depthLayerF_.begin(), hgpar_->depthLayerF_.end(), index) -
1802  hgpar_->depthLayerF_.begin());
1803  if (ll == static_cast<int>(hgpar_->depthLayerF_.size()))
1804  ll = -1;
1805  } else {
1806  ll = static_cast<int>(std::find(hgpar_->layerIndex_.begin(), hgpar_->layerIndex_.end(), index) -
1807  hgpar_->layerIndex_.begin());
1808  if (ll == static_cast<int>(hgpar_->layerIndex_.size()))
1809  ll = -1;
1810  }
1811 #ifdef EDM_ML_DEBUG
1812  edm::LogVerbatim("HGCalGeom") << "LayerFromIndex for " << index << ":" << reco << ":" << waferHexagon6() << " is"
1813  << ll << ":" << (ll + hgpar_->firstLayer_);
1814 #endif
1815  return ((ll < 0) ? ll : (ll + hgpar_->firstLayer_));
1816 }
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 609 of file HGCalDDDConstants.cc.

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

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

609  {
610  int ll = lay - hgpar_->firstLayer_;
611  if (ll < 0 || ll >= static_cast<int>(hgpar_->layerIndex_.size()))
612  return -1;
613  if (waferHexagon6()) {
614  if (reco && ll >= static_cast<int>(hgpar_->depthIndex_.size()))
615  return -1;
616  return (reco ? hgpar_->depthLayerF_[ll] : hgpar_->layerIndex_[ll]);
617  } else {
618  return (hgpar_->layerIndex_[ll]);
619  }
620 }
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 622 of file HGCalDDDConstants.cc.

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

Referenced by HGCalDDDConstants().

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

◆ layerType()

int HGCalDDDConstants::layerType ( int  lay) const
inline

Definition at line 89 of file HGCalDDDConstants.h.

References HGCalParameters::firstLayer_, hgpar_, HGCalParameters::layerType_, and HGCalTypes::WaferCenter.

Referenced by locateCell(), and waferFromPosition().

89  {
91  }
static constexpr int32_t WaferCenter
Definition: HGCalTypes.h:21
std::vector< int > layerType_
const HGCalParameters * hgpar_

◆ levelTop()

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

Definition at line 108 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::levelT_.

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

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

◆ localToGlobal8()

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

Definition at line 626 of file HGCalDDDConstants.cc.

References debug, HGCalParameters::firstLayer_, HGCalCassette::getShift(), getXY(), HGCalGeometryMode::Hexagon8Cassette, hgcassette_, hgpar_, if(), HGCalParameters::k_ScaleToDDD, HGCalParameters::layerType_, phase1PixelTopology::localX(), pixelTopology::localY(), mode_, HGCalTypes::WaferCenterR, HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, waferPositionNoRot(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), x, geometryCSVtoXML::xy, and y.

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

627  {
628  double x(localX), y(localY);
629  bool rotx =
631  if (debug)
632  edm::LogVerbatim("HGCalGeom") << "LocalToGlobal8 " << lay << ":" << (lay - hgpar_->firstLayer_) << ":" << rotx
633  << " Local (" << x << ":" << y << ") Reco " << reco;
634  if (!reco) {
637  }
638  const auto& xy = waferPositionNoRot(lay, waferU, waferV, reco, debug);
639  x += xy.first;
640  y += xy.second;
641  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
642  auto ktr = hgpar_->waferInfoMap_.find(indx);
643  if ((mode_ == HGCalGeometryMode::Hexagon8Cassette) && (ktr != hgpar_->waferInfoMap_.end())) {
644  auto cshift = hgcassette_.getShift(lay, 1, (ktr->second).cassette);
645  if (debug)
646  edm::LogVerbatim("HGCalGeom") << "Cassette " << (ktr->second).cassette << " Shift " << cshift.first << ":"
647  << cshift.second;
648  if (!reco) {
649  x += (HGCalParameters::k_ScaleToDDD)*cshift.first;
650  y += (HGCalParameters::k_ScaleToDDD)*cshift.second;
651  } else {
652  x += cshift.first;
653  y += cshift.second;
654  }
655  }
656  if (debug)
657  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << " by adding " << xy.first << ":" << xy.second;
658  return (rotx ? getXY(lay, x, y, false) : std::make_pair(x, y));
659 }
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) const
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) 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
constexpr uint16_t localX(uint16_t px)
constexpr uint16_t localY(uint16_t py, uint16_t n)
const HGCalGeometryMode::GeometryMode mode_
fixed size matrix
int32_t waferV(const int32_t index)
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug=false) const
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ locateCell() [1/4]

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

Definition at line 661 of file HGCalDDDConstants.cc.

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

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

661  {
662  // type refers to wafer # for hexagon cell
663  float x(999999.), y(999999.);
664  const auto& index = getIndex(lay, reco);
665  int i = index.first;
666  if (i < 0)
667  return std::make_pair(x, y);
668  if (waferHexagon6()) {
669  x = hgpar_->waferPosX_[type];
670  y = hgpar_->waferPosY_[type];
671 #ifdef EDM_ML_DEBUG
672  float x0(x), y0(y);
673 #endif
675  x += hgpar_->cellFineX_[cell];
676  y += hgpar_->cellFineY_[cell];
677  } else {
678  x += hgpar_->cellCoarseX_[cell];
679  y += hgpar_->cellCoarseY_[cell];
680  }
681 #ifdef EDM_ML_DEBUG
682  edm::LogVerbatim("HGCalGeom") << "LocateCell (Wafer) " << x0 << ":" << y0 << " Final " << x << ":" << y;
683 #endif
684  if (!reco) {
687  }
688  }
689  return std::make_pair(x, y);
690 }
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  lay,
int  waferU,
int  waferV,
int  cellU,
int  cellV,
bool  reco,
bool  all,
bool  norot = false,
bool  debug = false 
) const

Definition at line 692 of file HGCalDDDConstants.cc.

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

693  {
694  double x(0), y(0);
695  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
696  auto itr = hgpar_->typesInLayers_.find(indx);
697  int type = ((itr == hgpar_->typesInLayers_.end()) ? 2 : hgpar_->waferTypeL_[itr->second]);
698  int layertype = layerType(lay);
699  bool rotx = (norot) ? false : (layertype == HGCalTypes::WaferCenterR);
700  if (debug) {
701  edm::LogVerbatim("HGCalGeom") << "LocateCell " << lay << ":" << (lay - hgpar_->firstLayer_) << ":" << layertype
702  << ":" << rotx << ":" << waferU << ":" << waferV << ":" << indx << ":"
703  << (itr == hgpar_->typesInLayers_.end()) << ":" << type << " Flags " << reco << ":"
704  << all;
705  }
706  auto ktr = hgpar_->waferInfoMap_.end();
707  int place(HGCalCell::cellPlacementOld);
708  if (waferHexagon8File()) {
710  ktr = hgpar_->waferInfoMap_.find(indx);
711  if (ktr != hgpar_->waferInfoMap_.end())
712  place = HGCalCell::cellPlacementIndex(1, HGCalTypes::layerFrontBack(layertype), (ktr->second).orient);
713  }
714  auto xy = hgcell_->cellUV2XY2(cellU, cellV, place, type);
715  x = xy.first;
716  y = xy.second;
717  if (debug)
718  edm::LogVerbatim("HGCalGeom") << "Type " << type << " Place " << place << " Cell " << cellU << ":" << cellV
719  << " Position " << x << ":" << y;
720  } else {
721  int kndx = cellV * 100 + cellU;
722  if (type == 0) {
723  auto jtr = hgpar_->cellFineIndex_.find(kndx);
724  if (jtr != hgpar_->cellFineIndex_.end()) {
725  x = hgpar_->cellFineX_[jtr->second];
726  y = hgpar_->cellFineY_[jtr->second];
727  }
728  if (debug)
729  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
730  << (jtr != hgpar_->cellFineIndex_.end());
731  } else {
732  auto jtr = hgpar_->cellCoarseIndex_.find(kndx);
733  if (jtr != hgpar_->cellCoarseIndex_.end()) {
734  x = hgpar_->cellCoarseX_[jtr->second];
735  y = hgpar_->cellCoarseY_[jtr->second];
736  }
737  if (debug)
738  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y
739  << ":" << (jtr != hgpar_->cellCoarseIndex_.end());
740  }
741  }
742  if (!reco) {
745  }
746  if (all) {
747  const auto& xy = waferPositionNoRot(lay, waferU, waferV, reco, debug);
748  x += xy.first;
749  y += xy.second;
750  if ((mode_ == HGCalGeometryMode::Hexagon8Cassette) && (ktr != hgpar_->waferInfoMap_.end())) {
751  auto cshift = hgcassette_.getShift(lay, 1, (ktr->second).cassette);
752  if (debug)
753  edm::LogVerbatim("HGCalGeom") << "Cassette " << (ktr->second).cassette << " Shift " << cshift.first << ":"
754  << cshift.second;
755  if (!reco) {
756  x += (HGCalParameters::k_ScaleToDDD)*cshift.first;
757  y += (HGCalParameters::k_ScaleToDDD)*cshift.second;
758  } else {
759  x += cshift.first;
760  y += cshift.second;
761  }
762  }
763  if (debug)
764  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << " by adding " << xy.first << ":" << xy.second;
765  }
766  return (rotx ? getXY(lay, x, y, false) : std::make_pair(x, y));
767 }
Log< level::Info, true > LogVerbatim
static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient)
Definition: HGCalCell.cc:230
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) 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_
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
wafer_map cellCoarseIndex_
bool waferHexagon8File() const
std::vector< double > cellFineX_
wafer_map typesInLayers_
const HGCalGeometryMode::GeometryMode mode_
fixed size matrix
int32_t waferV(const int32_t index)
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug=false) const
std::vector< double > cellCoarseY_
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
static int32_t layerFrontBack(int32_t layerOrient)
Definition: HGCalTypes.h:125
int layerType(int lay) const

◆ locateCell() [3/4]

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

Definition at line 769 of file HGCalDDDConstants.cc.

References debug, phase1PixelTopology::layer, locateCell(), HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

769  {
770  return locateCell(id.layer(), id.waferU(), id.waferV(), id.cellU(), id.cellV(), true, true, false, debug);
771 }
int32_t waferU(const int32_t index)
constexpr std::array< uint8_t, layerIndexSize > layer
#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 = false 
) const

Definition at line 773 of file HGCalDDDConstants.cc.

References debug, LEDCalibrationChannels::iphi, phase1PixelTopology::layer, and locateCellTrap().

773  {
774  return locateCellTrap(id.layer(), id.iradius(), id.iphi(), true, debug);
775 }
std::pair< float, float > locateCellTrap(int lay, int ieta, int iphi, bool reco, bool debug=false) const
constexpr std::array< uint8_t, layerIndexSize > layer
#define debug
Definition: HDRShower.cc:19

◆ locateCellHex()

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

Definition at line 777 of file HGCalDDDConstants.cc.

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

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

777  {
778  float x(0), y(0);
779  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine) {
780  x = hgpar_->cellFineX_[cell];
781  y = hgpar_->cellFineY_[cell];
782  } else {
783  x = hgpar_->cellCoarseX_[cell];
784  y = hgpar_->cellCoarseY_[cell];
785  }
786  if (!reco) {
789  }
790  return std::make_pair(x, y);
791 }
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  lay,
int  ieta,
int  iphi,
bool  reco,
bool  debug = false 
) const

Definition at line 793 of file HGCalDDDConstants.cc.

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

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

793  {
794  float x(0), y(0);
795  const auto& indx = getIndex(lay, reco);
796  if (indx.first >= 0) {
797  int ir = std::abs(irad);
798  int type = hgpar_->scintType(lay);
799  double phi = (iphi - 0.5) * indx.second;
800  double z = hgpar_->zLayerHex_[indx.first];
801  double r = 0.5 * (hgpar_->radiusLayer_[type][ir - 1] + hgpar_->radiusLayer_[type][ir]);
802  std::pair<double, double> range = rangeR(z, true);
803  if (debug)
804  edm::LogVerbatim("HGCalGeom") << "locateCellTrap:: Input " << lay << ":" << irad << ":" << iphi << ":" << reco
805  << " IR " << ir << ":" << hgpar_->iradMinBH_[indx.first] << ":"
806  << hgpar_->iradMaxBH_[indx.first] << " Type " << type << " Z " << indx.first << ":"
807  << z << " phi " << phi << ":" << convertRadToDeg(phi) << " R " << r << ":"
808  << range.first << ":" << range.second;
811  r = std::max(range.first, std::min(r, range.second));
812  x = r * std::cos(phi);
813  y = r * std::sin(phi);
814  int ll = lay - hgpar_->firstLayer_;
815  x += hgpar_->xLayerHex_[ll];
816  y += hgpar_->yLayerHex_[ll];
819  auto cshift = hgcassette_.getShift(lay, 1, cassette);
820  if (debug)
821  edm::LogVerbatim("HGCalGeom") << "Cassette " << cassette << " Shift " << cshift.first << ":" << cshift.second;
822  x += cshift.first;
823  y += cshift.second;
824  }
825  if (irad < 0)
826  x = -x;
827  }
828  if (!reco) {
831  }
832  return std::make_pair(x, y);
833 }
std::vector< int > iradMaxBH_
Log< level::Info, true > LogVerbatim
HGCalCassette hgcassette_
int scintType(const int layer) 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) 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_
const HGCalGeometryMode::GeometryMode mode_
fixed size matrix
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 835 of file HGCalDDDConstants.cc.

References DetId::det(), DetId::Forward, getUVMax(), HGCalWaferMask::goodCell(), HGCalGeometryMode::Hexagon8Cassette, hgpar_, l1ctLayer2EG_cff::id, HGCalParameters::k_CornerSize, HGCalTypes::k_OffsetRotation, phase1PixelTopology::layer, gpuClustering::pixelStatus::mask, HGCalWaferMask::maskCell(), mode_, 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().

835  {
836  bool mask(false);
837  if (corners > 2 && corners <= static_cast<int>(HGCalParameters::k_CornerSize)) {
838  if (waferHexagon8()) {
839  int N(0), layer(0), waferU(0), waferV(0), u(0), v(0);
840  if (detId.det() == DetId::Forward) {
841  HFNoseDetId id(detId);
842  N = getUVMax(id.type());
843  layer = id.layer();
844  waferU = id.waferU();
845  waferV = id.waferV();
846  u = id.cellU();
847  v = id.cellV();
848  } else {
849  HGCSiliconDetId id(detId);
850  N = getUVMax(id.type());
851  layer = id.layer();
852  waferU = id.waferU();
853  waferV = id.waferV();
854  u = id.cellU();
855  v = id.cellV();
856  }
858  auto itr = hgpar_->waferTypes_.find(wl);
859  auto ktr = hgpar_->waferInfoMap_.find(wl);
860 #ifdef EDM_ML_DEBUG
861  edm::LogVerbatim("HGCalGeom") << "MaskCell: Layer " << layer << " Wafer " << waferU << ":" << waferV << " Index "
862  << wl << ":" << (itr != hgpar_->waferTypes_.end()) << ":"
863  << (ktr != hgpar_->waferInfoMap_.end());
864 #endif
866  int part = (ktr != hgpar_->waferInfoMap_.end()) ? (ktr->second).part : HGCalTypes::WaferFull;
868  } else if (itr != hgpar_->waferTypes_.end()) {
869  if ((itr->second).second <= HGCalTypes::k_OffsetRotation)
870  mask = HGCalWaferMask::maskCell(u, v, N, (itr->second).first, (itr->second).second, corners);
871  else
873  u, v, N, (itr->second).first, ((itr->second).second - HGCalTypes::k_OffsetRotation)));
874  }
875  }
876  }
877  return mask;
878 }
Log< level::Info, true > LogVerbatim
static constexpr int k_OffsetRotation
Definition: HGCalTypes.h:91
int32_t waferU(const int32_t index)
static bool goodCell(int u, int v, int N, int type, int rotn)
bool waferHexagon8() const
constexpr uint32_t mask
Definition: gpuClustering.h:24
static constexpr uint32_t k_CornerSize
constexpr std::array< uint8_t, layerIndexSize > layer
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
const HGCalGeometryMode::GeometryMode mode_
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 880 of file HGCalDDDConstants.cc.

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

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

880  {
881  int cells(0);
882  for (unsigned int i = 0; i < layers(reco); ++i) {
883  int lay = reco ? hgpar_->depth_[i] : hgpar_->layer_[i];
884  if (cells < maxCells(lay, reco))
885  cells = maxCells(lay, reco);
886  }
887  return cells;
888 }
std::vector< int > layer_
std::vector< int > depth_
int maxCells(bool reco) const
unsigned int layers(bool reco) const
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
fixed size matrix
const HGCalParameters * hgpar_

◆ maxCells() [2/2]

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

Definition at line 890 of file HGCalDDDConstants.cc.

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

890  {
891  const auto& index = getIndex(lay, reco);
892  if (index.first < 0)
893  return 0;
894  if (waferHexagon6()) {
895  unsigned int cells(0);
896  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
897  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
898  unsigned int cell = (hgpar_->waferTypeT_[k] - 1 == HGCSiliconDetId::HGCalFine) ? (hgpar_->cellFineX_.size())
899  : (hgpar_->cellCoarseX_.size());
900  if (cell > cells)
901  cells = cell;
902  }
903  }
904  return static_cast<int>(cells);
905  } else if (waferHexagon8()) {
906  int cells(0);
907  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
908  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
912  : hgpar_->waferTypeL_[itr->second]);
914  cells = std::max(cells, 3 * N * N);
915  }
916  }
917  return cells;
918  } else if (tileTrapezoid()) {
919  return hgpar_->scintCells(index.first + hgpar_->firstLayer_);
920  } else {
921  return 0;
922  }
923 }
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)
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
#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 110 of file HGCalDDDConstants.h.

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

Referenced by HGCalTopology::HGCalTopology().

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

◆ maxModules()

int HGCalDDDConstants::maxModules ( ) const
inline

Definition at line 113 of file HGCalDDDConstants.h.

References modHalf_.

113 { return modHalf_; }

◆ maxModulesPerLayer()

int HGCalDDDConstants::maxModulesPerLayer ( ) const
inline

Definition at line 114 of file HGCalDDDConstants.h.

References maxWafersPerLayer_.

114 { return maxWafersPerLayer_; }

◆ maxRows()

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

Definition at line 925 of file HGCalDDDConstants.cc.

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

925  {
926  int kymax(0);
927  const auto& index = getIndex(lay, reco);
928  int i = index.first;
929  if (i < 0)
930  return kymax;
931  if (waferHexagon6()) {
932  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
934  int ky = ((hgpar_->waferCopy_[k]) / 100) % 100;
935  if (ky > kymax)
936  kymax = ky;
937  }
938  }
939  } else if (waferHexagon8()) {
940  kymax = 1 + 2 * hgpar_->waferUVMaxLayer_[index.first];
941  }
942  return kymax;
943 }
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 116 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::slopeMin_.

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

116 { 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 945 of file HGCalDDDConstants.cc.

Referenced by HGCalTopology::neighbors().

945  {
946  // Modify u/v for transition of type1 to type2
947  return (((type1 == type2) || (type1 * type2 != 0)) ? uv : ((type1 == 0) ? (2 * uv + 1) / 3 : (3 * uv) / 2));
948 }

◆ modules()

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

Definition at line 950 of file HGCalDDDConstants.cc.

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

Referenced by wafers().

950  {
951  if (getIndex(lay, reco).first < 0)
952  return 0;
953  else
954  return max_modules_layer_[static_cast<int>(reco)][lay];
955 }
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 957 of file HGCalDDDConstants.cc.

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

Referenced by HGCalDDDConstants().

957  {
958  int nmod(0);
959  const auto& index = getIndex(lay, reco);
960  if (index.first < 0)
961  return nmod;
962  if (!tileTrapezoid()) {
963  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
964  if (waferInLayerTest(k, index.first, hgpar_->defineFull_))
965  ++nmod;
966  }
967  } else {
968  nmod = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
969  }
970  return nmod;
971 }
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 973 of file HGCalDDDConstants.cc.

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

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

973  {
975 }
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

◆ numberCells() [1/2]

int HGCalDDDConstants::numberCells ( bool  reco) const

Definition at line 977 of file HGCalDDDConstants.cc.

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

977  {
980  ? tileCount(0, -1)
981  : 0;
982  if (cells == 0) {
983  unsigned int nlayer = (reco) ? hgpar_->depth_.size() : hgpar_->layer_.size();
984  for (unsigned k = 0; k < nlayer; ++k) {
985  std::vector<int> ncells = numberCells(((reco) ? hgpar_->depth_[k] : hgpar_->layer_[k]), reco);
986  cells = std::accumulate(ncells.begin(), ncells.end(), cells);
987  }
988  }
989  return cells;
990 }
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
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
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 992 of file HGCalDDDConstants.cc.

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

992  {
993  const auto& index = getIndex(lay, reco);
994  int i = index.first;
995  std::vector<int> ncell;
996  if (i >= 0) {
997  if (waferHexagon6()) {
998  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
1000  unsigned int cell = (hgpar_->waferTypeT_[k] - 1 == HGCSiliconDetId::HGCalFine)
1001  ? (hgpar_->cellFineX_.size())
1002  : (hgpar_->cellCoarseX_.size());
1003  ncell.emplace_back(static_cast<int>(cell));
1004  }
1005  }
1006  } else if (tileTrapezoid()) {
1007  int nphi = hgpar_->scintCells(lay);
1008  for (int k = hgpar_->firstModule_[i]; k <= hgpar_->lastModule_[i]; ++k)
1009  ncell.emplace_back(nphi);
1010  } else {
1011  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
1012  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
1013  int cell = numberCellsHexagon(lay,
1016  true);
1017  ncell.emplace_back(cell);
1018  }
1019  }
1020  }
1021  }
1022  return ncell;
1023 }
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 1025 of file HGCalDDDConstants.cc.

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

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

1025  {
1026  if (wafer >= 0 && wafer < static_cast<int>(hgpar_->waferTypeT_.size())) {
1027  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine)
1028  return static_cast<int>(hgpar_->cellFineX_.size());
1029  else
1030  return static_cast<int>(hgpar_->cellCoarseX_.size());
1031  } else {
1032  return 0;
1033  }
1034 }
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 1036 of file HGCalDDDConstants.cc.

References RemoveAddSevLevel::flag, HGCSiliconDetId::HGCalCoarseThick, hgpar_, if(), N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, HGCalParameters::typesInLayers_, HGCalWaferIndex::waferIndex(), HGCalParameters::waferTypeL_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

1036  {
1038  int type =
1039  ((itr == hgpar_->typesInLayers_.end()) ? HGCSiliconDetId::HGCalCoarseThick : hgpar_->waferTypeL_[itr->second]);
1040  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1041  if (flag)
1042  return (3 * N * N);
1043  else
1044  return N;
1045 }
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_
std::vector< int > waferTypeL_

◆ rangeR()

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

Definition at line 1047 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(), HFNoseNumberingScheme::checkPosition(), HGCalNumberingScheme::checkPosition(), HGCDigitizer::checkPosition(), locateCellTrap(), and HGCalGeometry::neighborZ().

1047  {
1048  double rmin(0), rmax(0), zz(0);
1049  if (hgpar_->detectorType_ > 0) {
1050  zz = (reco ? std::abs(z) : HGCalParameters::k_ScaleFromDDD * std::abs(z));
1051  if (hgpar_->detectorType_ <= 2) {
1053  } else {
1054  rmin = HGCalGeomTools::radius(
1056  }
1057  if ((hgpar_->detectorType_ == 2) && (zz >= hgpar_->zLayerHex_[hgpar_->firstMixedLayer_ - 1])) {
1058  rmax = HGCalGeomTools::radius(
1060  } else {
1062  }
1063  }
1064  if (!reco) {
1067  }
1068 #ifdef EDM_ML_DEBUG
1069  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << z << ":" << zz << " R " << rmin << ":" << rmax;
1070 #endif
1071  return std::make_pair(rmin, rmax);
1072 }
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 1074 of file HGCalDDDConstants.cc.

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

1074  {
1075  double rmin(0), rmax(0);
1076  const auto& index = getIndex(lay, reco);
1077  if (index.first >= 0 && index.first < static_cast<int>(hgpar_->rMinLayHex_.size())) {
1078  rmin = hgpar_->rMinLayHex_[index.first];
1079  rmax = hgpar_->rMaxLayHex_[index.first];
1080  }
1081  if (!reco) {
1084  }
1085 #ifdef EDM_ML_DEBUG
1086  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << lay << ":" << index.first << " R " << rmin << ":"
1087  << rmax;
1088 #endif
1089  return std::make_pair(rmin, rmax);
1090 }
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 1092 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().

1092  {
1093  double zmin = (hgpar_->zLayerHex_[0] - hgpar_->waferThick_);
1094  double zmax = (hgpar_->zLayerHex_[hgpar_->zLayerHex_.size() - 1] + hgpar_->waferThick_);
1095 #ifdef EDM_ML_DEBUG
1096  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeZ: " << zmin << ":" << zmax << ":" << hgpar_->waferThick_;
1097 #endif
1098  if (!reco) {
1101  }
1102  return std::make_pair(zmin, zmax);
1103 }
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 1105 of file HGCalDDDConstants.cc.

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

1105  {
1106  int row(0), col(0);
1107  if (wafer < static_cast<int>(hgpar_->waferCopy_.size())) {
1108  int copy = hgpar_->waferCopy_[wafer];
1111  ;
1112  }
1113  return std::make_pair(row, col);
1114 }
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

◆ simToReco()

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

Definition at line 1116 of file HGCalDDDConstants.cc.

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

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

1116  {
1117  if (!waferHexagon6()) {
1118  return std::make_pair(cell, lay);
1119  } else {
1120  const auto& index = getIndex(lay, false);
1121  int i = index.first;
1122  if (i < 0) {
1123  edm::LogWarning("HGCalGeom") << "Wrong Layer # " << lay << " not in the list ***** ERROR *****";
1124  return std::make_pair(-1, -1);
1125  }
1126  if (mod >= static_cast<int>(hgpar_->waferTypeL_.size())) {
1127  edm::LogWarning("HGCalGeom") << "Invalid Wafer # " << mod << "should be < " << (hgpar_->waferTypeL_).size()
1128  << " ***** ERROR *****";
1129  return std::make_pair(-1, -1);
1130  }
1131  int depth(-1);
1132  int kx = cell;
1133  int type = hgpar_->waferTypeL_[mod];
1134  if (type == 1) {
1135  depth = hgpar_->layerGroup_[i];
1136  } else if (type == 2) {
1137  depth = hgpar_->layerGroupM_[i];
1138  } else {
1139  depth = hgpar_->layerGroupO_[i];
1140  }
1141  return std::make_pair(kx, depth);
1142  }
1143 }
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 1145 of file HGCalDDDConstants.cc.

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

Referenced by numberCells().

1145  {
1146  int laymin(layer), laymax(layer), ringmin(ring), ringmax(ring), kount(0);
1147  if (layer == 0) {
1148  laymin = hgpar_->firstLayer_;
1149  laymax = lastLayer(true);
1150  }
1151 #ifdef EDM_ML_DEBUG
1152  edm::LogVerbatim("HGCalGeom") << "tileCount: layer " << layer << " ring " << ring << " layerMin/Max " << laymin << ":"
1153  << laymax;
1154 #endif
1155  for (int lay = laymin; lay <= laymax; ++lay) {
1156  if (ring < 0) {
1157  int ll = lay - hgpar_->firstLayer_;
1158  ringmin = hgpar_->tileRingRange_[ll].first;
1159  ringmax = hgpar_->tileRingRange_[ll].second;
1160  }
1161 #ifdef EDM_ML_DEBUG
1162  edm::LogVerbatim("HGCalGeom") << "tileCount: lay " << lay << ":" << (lay - hgpar_->firstLayer_) << " rings "
1163  << ringmin << ":" << ringmax;
1164 #endif
1165  for (int rin = ringmin; rin <= ringmax; ++rin) {
1166  int indx = HGCalTileIndex::tileIndex(lay, rin + 1, 0);
1167  auto itr = hgpar_->tileInfoMap_.find(indx);
1168 #ifdef EDM_ML_DEBUG
1169  edm::LogVerbatim("HGCalGeom") << "tileCount: rin " << rin << " indx " << indx << " itr "
1170  << (itr != hgpar_->tileInfoMap_.end());
1171 #endif
1172  if (itr != hgpar_->tileInfoMap_.end()) {
1173  for (int k = 0; k < 4; ++k) {
1174  std::bitset<24> b(itr->second.hex[k]);
1175  kount += b.count();
1176  }
1177  }
1178 #ifdef EDM_ML_DEBUG
1179  edm::LogVerbatim("HGCalGeom") << "tileCount: lay|rin " << lay << ":" << rin << " kount " << kount;
1180 #endif
1181  }
1182  }
1183  return (3 * kount);
1184 }
Log< level::Info, true > LogVerbatim
int lastLayer(bool reco) const
constexpr std::array< uint8_t, layerIndexSize > layer
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
std::vector< std::pair< int, int > > tileRingRange_
double b
Definition: hdecay.h:118
const HGCalParameters * hgpar_
tileInfo_map tileInfoMap_

◆ tileExist()

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

Definition at line 1186 of file HGCalDDDConstants.cc.

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

Referenced by HGCalGeometryLoader::build(), HGCalNumberingScheme::getUnitID(), and isValidTrap().

1186  {
1187  int indx = HGCalTileIndex::tileIndex(layer, ring, 0);
1188  auto itr = hgpar_->tileInfoMap_.find(indx);
1189  bool ok = (itr == hgpar_->tileInfoMap_.end()) ? false : HGCalTileIndex::tileExist(itr->second.hex, zside, phi);
1190  return ok;
1191 }
int zside(DetId const &)
constexpr std::array< uint8_t, layerIndexSize > layer
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 1193 of file HGCalDDDConstants.cc.

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

1193  {
1194  int indx = HGCalTileIndex::tileIndex(layer, ring, 0);
1195  auto itr = hgpar_->tileInfoMap_.find(indx);
1196  return ((itr == hgpar_->tileInfoMap_.end()) ? HGCalParameters::tileInfo() : itr->second);
1197 }
constexpr std::array< uint8_t, layerIndexSize > layer
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
const HGCalParameters * hgpar_
tileInfo_map tileInfoMap_

◆ tileRings()

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

Definition at line 1199 of file HGCalDDDConstants.cc.

References HGCalParameters::firstLayer_, hgpar_, phase1PixelTopology::layer, mode_, HGCalParameters::tileRingRange_, HGCalGeometryMode::TrapezoidCassette, HGCalGeometryMode::TrapezoidFile, and HGCalGeometryMode::TrapezoidModule.

Referenced by HGCalNumberingScheme::getUnitID().

1199  {
1202  int ll = layer - hgpar_->firstLayer_;
1203  if (ll >= 0 && ll < static_cast<int>(hgpar_->tileRingRange_.size()))
1204  return hgpar_->tileRingRange_[ll];
1205  }
1206  return std::make_pair(0, 0);
1207 }
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< std::pair< int, int > > tileRingRange_
const HGCalGeometryMode::GeometryMode mode_
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 1209 of file HGCalDDDConstants.cc.

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

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

1209  {
1210  int indx = HGCalTileIndex::tileIndex(layer, ring, phi);
1211  int type(-1), sipm(-1);
1212  auto itr = hgpar_->tileInfoMap_.find(indx);
1213  if (itr != hgpar_->tileInfoMap_.end()) {
1214  type = 1 + (itr->second).type;
1215  sipm = ((itr->second).sipm == HGCalTypes::SiPMLarge) ? 0 : 1;
1216  }
1217  return std::make_pair(type, sipm);
1218 }
constexpr std::array< uint8_t, layerIndexSize > layer
int32_t tileIndex(int32_t layer, int32_t ring, int32_t phi)
const HGCalParameters * hgpar_
tileInfo_map tileInfoMap_

◆ trapezoidFile()

bool HGCalDDDConstants::trapezoidFile ( ) const
inline

◆ volumes()

unsigned int HGCalDDDConstants::volumes ( ) const
inline

Definition at line 145 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::moduleLayR_.

Referenced by HGCalGeometryLoader::build().

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

◆ waferCount()

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

Definition at line 173 of file HGCalDDDConstants.h.

References waferMax_.

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

◆ waferFileIndex()

int HGCalDDDConstants::waferFileIndex ( unsigned int  kk) const

Definition at line 1478 of file HGCalDDDConstants.cc.

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

1478  {
1479  if (kk < hgpar_->waferInfoMap_.size()) {
1480  auto itr = hgpar_->waferInfoMap_.begin();
1481  std::advance(itr, kk);
1482  return itr->first;
1483  } else
1484  return 0;
1485 }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ waferFileInfo()

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

Definition at line 1487 of file HGCalDDDConstants.cc.

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

1487  {
1488  if (kk < hgpar_->waferInfoMap_.size()) {
1489  auto itr = hgpar_->waferInfoMap_.begin();
1490  std::advance(itr, kk);
1491  return std::make_tuple(itr->second.type, itr->second.part, itr->second.orient);
1492  } else
1493  return std::make_tuple(0, 0, 0);
1494 }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ waferFileInfoExist()

bool HGCalDDDConstants::waferFileInfoExist ( int  kk) const
inline

Definition at line 184 of file HGCalDDDConstants.h.

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

184  {
185  return (hgpar_->waferInfoMap_.find(kk) != hgpar_->waferInfoMap_.end());
186  }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ waferFileInfoFromIndex()

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

Definition at line 1496 of file HGCalDDDConstants.cc.

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

1496  {
1497  auto itr = hgpar_->waferInfoMap_.find(kk);
1498  if (itr != hgpar_->waferInfoMap_.end()) {
1499  return std::make_tuple(itr->second.type, itr->second.part, itr->second.orient);
1500  } else
1501  return std::make_tuple(0, 0, 0);
1502 }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ waferFileSize()

unsigned int HGCalDDDConstants::waferFileSize ( ) const
inline

Definition at line 180 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferInfoMap_.

Referenced by waferType(), and waferTypeRotation().

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

◆ waferFromCopy()

int HGCalDDDConstants::waferFromCopy ( int  copy) const

Definition at line 1220 of file HGCalDDDConstants.cc.

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

Referenced by HGCNumberingScheme::getUnitID().

1220  {
1221  const int ncopies = hgpar_->waferCopy_.size();
1222  int wafer(ncopies);
1223  bool result(false);
1224  for (int k = 0; k < ncopies; ++k) {
1225  if (copy == hgpar_->waferCopy_[k]) {
1226  wafer = k;
1227  result = true;
1228  break;
1229  }
1230  }
1231  if (!result) {
1232  wafer = -1;
1233 #ifdef EDM_ML_DEBUG
1234  edm::LogVerbatim("HGCalGeom") << "Cannot find " << copy << " in a list of " << ncopies << " members";
1235  for (int k = 0; k < ncopies; ++k)
1236  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << hgpar_->waferCopy_[k];
1237 #endif
1238  }
1239 #ifdef EDM_ML_DEBUG
1240  edm::LogVerbatim("HGCalGeom") << "WaferFromCopy " << copy << ":" << wafer << ":" << result;
1241 #endif
1242  return wafer;
1243 }
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 1245 of file HGCalDDDConstants.cc.

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

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

1245  {
1246  // Input x, y in Geant4 unit and transformed to CMSSW standard
1249  int size_ = static_cast<int>(hgpar_->waferCopy_.size());
1250  wafer = size_;
1251  for (int k = 0; k < size_; ++k) {
1252  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1253  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1254  if (dx <= rmax_ && dy <= hexside_) {
1255  if ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy))) {
1256  wafer = k;
1257  celltyp = hgpar_->waferTypeT_[k];
1258  xx -= hgpar_->waferPosX_[k];
1259  yy -= hgpar_->waferPosY_[k];
1260  break;
1261  }
1262  }
1263  }
1264  if (wafer < size_) {
1265  if (celltyp - 1 == HGCSiliconDetId::HGCalFine)
1266  icell = cellHex(
1268  else
1269  icell = cellHex(xx,
1270  yy,
1273  hgpar_->cellCoarseY_);
1274  } else {
1275  wafer = -1;
1276 #ifdef EDM_ML_DEBUG
1277  edm::LogWarning("HGCalGeom") << "Cannot get wafer type corresponding to " << x << ":" << y << " " << xx << ":"
1278  << yy;
1279 #endif
1280  }
1281 #ifdef EDM_ML_DEBUG
1282  edm::LogVerbatim("HGCalGeom") << "Position " << x << ":" << y << " Wafer " << wafer << ":" << size_ << " XX " << xx
1283  << ":" << yy << " Cell " << icell << " Type " << celltyp;
1284 #endif
1285 }
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  layer,
int &  waferU,
int &  waferV,
int &  cellU,
int &  cellV,
int &  celltype,
double &  wt,
bool  extend = false,
bool  debug = false 
) const

Definition at line 1287 of file HGCalDDDConstants.cc.

References funct::abs(), cellHex(), HGCalCell::cellPlacementIndex(), HGCalCell::cellPlacementOld, HGCalParameters::cellThickness_, debug, PVValHelper::dx, PVValHelper::dy, HGCalParameters::firstLayer_, HGCalWaferType::getCassette(), HGCalWaferType::getOrient(), HGCalWaferType::getPartial(), HGCalCassette::getShift(), HGCalWaferType::getType(), getXY(), HGCalGeometryMode::Hexagon8Cassette, hexside_, hexsideT_, HGCSiliconDetId::HGCalCoarseThick, hgcassette_, hgpar_, dqmdumpme::k, HGCalParameters::k_ScaleFromDDD, phase1PixelTopology::layer, HGCalTypes::layerFrontBack(), layerType(), HGCalParameters::layerType_, mode_, HGCalParameters::nCellsFine_, hgcalPerformanceValidation::orient, rmax_, rmaxT_, tan30deg_, 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_, and geometryCSVtoXML::yy.

1297  {
1298  // Expect x, y as in SIM step
1299  waferU = waferV = 1 + hgpar_->waferUVMax_;
1300  cellU = cellV = celltype = 0;
1301  if ((hgpar_->xLayerHex_.empty()) || (hgpar_->yLayerHex_.empty()))
1302  return;
1303  int ll = layer - hgpar_->firstLayer_;
1304  int layertype = layerType(layer);
1305  bool rotx = ((!hgpar_->layerType_.empty()) && (layertype == HGCalTypes::WaferCenterR));
1306  double xx(0), yy(0);
1307  if (rotx) {
1308  std::pair<double, double> xy =
1310  xx = xy.first - hgpar_->xLayerHex_[ll];
1311  yy = xy.second - hgpar_->yLayerHex_[ll];
1312  } else {
1315  }
1316 #ifdef EDM_ML_DEBUG
1317  if (debug)
1318  edm::LogVerbatim("HGCalGeom") << "waferFromPosition:: Layer " << layer << ":" << ll << " Rot " << rotx << " X " << x
1319  << ":" << xx << " Y " << y << ":" << yy;
1320 #endif
1321  double rmax = extend ? rmaxT_ : rmax_;
1322  double hexside = extend ? hexsideT_ : hexside_;
1323  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1324  double dx0(0), dy0(0);
1329  auto ktr = hgpar_->waferInfoMap_.find(indx);
1330  if (ktr != hgpar_->waferInfoMap_.end()) {
1331  auto cshift = hgcassette_.getShift(layer, 1, (ktr->second).cassette);
1332 #ifdef EDM_ML_DEBUG
1333  if (debug)
1334  edm::LogVerbatim("HGCalGeom") << "Cassette " << (ktr->second).cassette << " Shift " << cshift.first << ":"
1335  << cshift.second;
1336 #endif
1337  dx0 = cshift.first;
1338  dy0 = cshift.second;
1339  }
1340  }
1341  double dx = std::abs(xx - dx0 - hgpar_->waferPosX_[k]);
1342  double dy = std::abs(yy - dy0 - hgpar_->waferPosY_[k]);
1343  if (dx <= rmax && dy <= hexside) {
1344  if ((dy <= 0.5 * hexside) || (dx * tan30deg_ <= (hexside - dy))) {
1345  if (waferHexagon8File()) {
1348 #ifdef EDM_ML_DEBUG
1349  if (debug)
1350  edm::LogVerbatim("HGCalGeom") << "Position (" << x << ", " << y << ") Wafer type:partial:orient:cassette "
1351  << celltype << ":" << HGCalWaferType::getPartial(index, hgpar_->waferInfoMap_)
1354 #endif
1355  } else {
1357  celltype = ((itr == hgpar_->typesInLayers_.end()) ? HGCSiliconDetId::HGCalCoarseThick
1358  : hgpar_->waferTypeL_[itr->second]);
1359  }
1360 #ifdef EDM_ML_DEBUG
1361  if (debug)
1362  edm::LogVerbatim("HGCalGeom") << "WaferFromPosition:: Input " << layer << ":" << ll << ":"
1363  << hgpar_->firstLayer_ << ":" << rotx << ":" << x << ":" << y << ":"
1364  << hgpar_->xLayerHex_[ll] << ":" << hgpar_->yLayerHex_[ll] << ":" << xx << ":"
1365  << yy << " compared with " << hgpar_->waferPosX_[k] << ":"
1366  << hgpar_->waferPosY_[k] << " difference " << dx << ":" << dy << ":"
1367  << dx * tan30deg_ << ":" << (hexside_ - dy) << " comparator " << rmax_ << ":"
1368  << rmaxT_ << ":" << hexside_ << ":" << hexsideT_ << " wafer " << waferU << ":"
1369  << waferV << ":" << celltype;
1370 #endif
1371  xx -= (dx0 + hgpar_->waferPosX_[k]);
1372  yy -= (dy0 + hgpar_->waferPosY_[k]);
1373  break;
1374  }
1375  }
1376  }
1377  if ((std::abs(waferU) <= hgpar_->waferUVMax_) && (celltype >= 0)) {
1381  auto ktr = hgpar_->waferInfoMap_.find(indx);
1382  if (ktr != hgpar_->waferInfoMap_.end()) {
1383  place = HGCalCell::cellPlacementIndex(1, HGCalTypes::layerFrontBack(layertype), (ktr->second).orient);
1384  part = (ktr->second).part;
1385 #ifdef EDM_ML_DEBUG
1386  if (debug)
1387  edm::LogVerbatim("HGCalGeom") << "waferFromPosition: frontback " << layertype << ":"
1388  << HGCalTypes::layerFrontBack(layertype) << " Orient " << (ktr->second).orient
1389  << " place " << place << " part " << part;
1390 #endif
1391  }
1392  }
1393  cellHex(xx, yy, celltype, place, part, cellU, cellV, extend, debug);
1394  wt = (((celltype < 2) && (hgpar_->useSimWt_ > 0)) ? (hgpar_->cellThickness_[celltype] / hgpar_->waferThick_) : 1.0);
1395  } else {
1396  cellU = cellV = 2 * hgpar_->nCellsFine_;
1397  wt = 1.0;
1398  celltype = -1;
1399  }
1400  if ((celltype < 0) && debug) {
1401  double x1(xx);
1402  double y1(yy);
1403  edm::LogVerbatim("HGCalGeom") << "waferfFromPosition: Bad type for X " << x << ":" << x1 << ":" << xx << " Y " << y
1404  << ":" << y1 << ":" << yy << " Wafer " << waferU << ":" << waferV << " Cell " << cellU
1405  << ":" << cellV;
1406  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1407  double dx = std::abs(x1 - hgpar_->waferPosX_[k]);
1408  double dy = std::abs(y1 - hgpar_->waferPosY_[k]);
1409  edm::LogVerbatim("HGCalGeom") << "Wafer [" << k << "] Position (" << hgpar_->waferPosX_[k] << ", "
1410  << hgpar_->waferPosY_[k] << ") difference " << dx << ":" << dy << ":"
1411  << dx * tan30deg_ << ":" << hexside - dy << " Paramerers " << rmax << ":"
1412  << hexside;
1413  }
1414  }
1415  edm::LogVerbatim("HGCalGeomX") << "Input x:y:layer " << x << ":" << y << ":" << layer << " Wafer " << waferU << ":"
1416  << waferV << " Cell " << cellU << ":" << cellV << ":" << celltype << " wt " << wt;
1417 }
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:230
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) 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
constexpr std::array< uint8_t, layerIndexSize > layer
static int getOrient(int index, const HGCalParameters::waferInfo_map &wafers)
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
std::vector< double > yLayerHex_
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_
const HGCalGeometryMode::GeometryMode mode_
static constexpr double k_ScaleFromDDD
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_
static int32_t layerFrontBack(int32_t layerOrient)
Definition: HGCalTypes.h:125
int layerType(int lay) const

◆ waferFullInLayer()

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

Definition at line 1426 of file HGCalDDDConstants.cc.

References getIndex(), and waferInLayerTest().

1426  {
1427  const auto& indx = getIndex(lay, reco);
1428  if (indx.first < 0)
1429  return false;
1430  return waferInLayerTest(wafer, indx.first, false);
1431 }
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

◆ waferHexagon8File()

bool HGCalDDDConstants::waferHexagon8File ( ) const
inline

◆ waferIndex()

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

Definition at line 1907 of file HGCalDDDConstants.cc.

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

Referenced by waferInLayerTest().

1907  {
1908  int layer = layerFromIndex(index, true);
1912 #ifdef EDM_ML_DEBUG
1913  edm::LogVerbatim("HGCalGeom") << "WaferIndex for " << wafer << ":" << index << " (" << layer << ":" << waferU << ":"
1914  << waferV << ") " << indx;
1915 #endif
1916  return indx;
1917 }
Log< level::Info, true > LogVerbatim
int32_t waferU(const int32_t index)
int layerFromIndex(int index, bool reco) const
constexpr std::array< uint8_t, layerIndexSize > layer
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 1433 of file HGCalDDDConstants.cc.

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

Referenced by HGCalNumberingScheme::getUnitID().

1433  {
1434  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
1435  auto itr = hgpar_->waferInfoMap_.find(indx);
1436  return ((itr == hgpar_->waferInfoMap_.end()) ? HGCalParameters::waferInfo() : itr->second);
1437 }
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 1419 of file HGCalDDDConstants.cc.

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

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

1419  {
1420  const auto& indx = getIndex(lay, reco);
1421  if (indx.first < 0)
1422  return false;
1423  return waferInLayerTest(wafer, indx.first, hgpar_->defineFull_);
1424 }
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 1919 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().

1919  {
1920  bool in = (waferHexagon6()) ? true : false;
1921  if (!in) {
1922  double xpos = hgpar_->waferPosX_[wafer] + hgpar_->xLayerHex_[lay];
1923  double ypos = hgpar_->waferPosY_[wafer] + hgpar_->yLayerHex_[lay];
1924  std::pair<int, int> corner = HGCalGeomTools::waferCorner(
1925  xpos, ypos, rmax_, hexside_, hgpar_->rMinLayHex_[lay], hgpar_->rMaxLayHex_[lay], in);
1926  in = (full ? (corner.first > 0) : (corner.first == static_cast<int>(HGCalParameters::k_CornerSize)));
1927  if (in && fullAndPart_) {
1928  int indx = waferIndex(wafer, lay);
1929  in = (hgpar_->waferInfoMap_.find(indx) != hgpar_->waferInfoMap_.end());
1930 #ifdef EDM_ML_DEBUG
1931  if (!in)
1932  edm::LogVerbatim("HGCalGeom") << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " index " << indx
1933  << "( " << HGCalWaferIndex::waferLayer(indx) << ", "
1934  << HGCalWaferIndex::waferU(indx) << ", " << HGCalWaferIndex::waferV(indx)
1935  << ") in " << in;
1936 #endif
1937  }
1938 #ifdef EDM_ML_DEBUG
1939  edm::LogVerbatim("HGCalGeom") << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " R-limits "
1940  << hgpar_->rMinLayHex_[lay] << ":" << hgpar_->rMaxLayHex_[lay] << " Corners "
1941  << corner.first << ":" << corner.second << " In " << in;
1942 #endif
1943  }
1944  return in;
1945 }
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 1504 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.

1505  {
1506  HGCSiliconDetId detid(id);
1507  double x(0), y(0);
1508  if (useWafer) {
1509  auto xyw = waferPositionNoRot(detid.layer(), detid.waferU(), detid.waferV(), reco, debug);
1510  x = xyw.first;
1511  y = xyw.second;
1512  }
1513  auto xy = getXY(detid.layer(), (x + loc.x()), (y + loc.y()), false);
1514  double zz = (detid.zside() < 0) ? -(loc.z() + waferZ(detid.layer(), reco)) : (loc.z() + waferZ(detid.layer(), reco));
1515  double xx = (detid.zside() < 0) ? -xy.first : xy.first;
1516  return GlobalPoint(xx, xy.second, zz);
1517 }
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=false) const

◆ waferMax()

int HGCalDDDConstants::waferMax ( ) const
inline

Definition at line 175 of file HGCalDDDConstants.h.

References waferMax_.

Referenced by HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

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

◆ waferMin()

int HGCalDDDConstants::waferMin ( ) const
inline

Definition at line 176 of file HGCalDDDConstants.h.

References waferMax_.

Referenced by HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

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

◆ waferParameters()

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

Definition at line 1439 of file HGCalDDDConstants.cc.

References hexside_, HGCalParameters::k_ScaleToDDD, and rmax_.

1439  {
1440  if (reco)
1441  return std::make_pair(rmax_, hexside_);
1442  else
1444 }
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 1446 of file HGCalDDDConstants.cc.

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

Referenced by HGCalGeometryLoader::build(), HGCMouseBite::exclude(), and waferPositionNoRot().

1446  {
1447  double xx(0), yy(0);
1448  if (wafer >= 0 && wafer < static_cast<int>(hgpar_->waferPosX_.size())) {
1449  xx = hgpar_->waferPosX_[wafer];
1450  yy = hgpar_->waferPosY_[wafer];
1451  }
1452  if (!reco) {
1455  }
1456  return std::make_pair(xx, yy);
1457 }
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 = false 
) const

Definition at line 1459 of file HGCalDDDConstants.cc.

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

1460  {
1461  int ll = lay - hgpar_->firstLayer_;
1462  bool rotx = ((!hgpar_->layerType_.empty()) && (hgpar_->layerType_[ll] == HGCalTypes::WaferCenterR));
1463 #ifdef EDM_ML_DEBUG
1464  if (debug)
1465  edm::LogVerbatim("HGCalGeom") << "Layer " << lay << ":" << ll << " Rotation " << rotx << " U:V " << waferU << ":"
1466  << waferV;
1467 #endif
1468  auto xy = waferPositionNoRot(lay, waferU, waferV, reco, debug);
1469  std::pair<double, double> xy0 = (rotx) ? getXY(lay, xy.first, xy.second, false) : xy;
1470 #ifdef EDM_ML_DEBUG
1471  if (debug)
1472  edm::LogVerbatim("HGCalGeom") << "Without and with rotation " << xy.first << ":" << xy.second << ":" << xy0.first
1473  << ":" << xy0.second;
1474 #endif
1475  return xy0;
1476 }
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)
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug=false) const
const HGCalParameters * hgpar_

◆ waferPosition() [3/3]

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

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

1971  {
1972  double xx(0), yy(0);
1973  int indx = HGCalWaferIndex::waferIndex(0, waferU, waferV);
1974  auto itr = hgpar_->wafersInLayers_.find(indx);
1975  if (itr != hgpar_->wafersInLayers_.end()) {
1976  xx = hgpar_->waferPosX_[itr->second];
1977  yy = hgpar_->waferPosY_[itr->second];
1978  }
1979  if (!reco) {
1982  }
1983  return std::make_pair(xx, yy);
1984 }
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 = false 
) const
private

Definition at line 1947 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().

1948  {
1949  int ll = lay - hgpar_->firstLayer_;
1950  double x = hgpar_->xLayerHex_[ll];
1951  double y = hgpar_->yLayerHex_[ll];
1952 #ifdef EDM_ML_DEBUG
1953  if (debug)
1954  edm::LogVerbatim("HGCalGeom") << "Layer " << lay << ":" << ll << " Shift " << hgpar_->xLayerHex_[ll] << ":"
1955  << hgpar_->yLayerHex_[ll] << " U:V " << waferU << ":" << waferV;
1956 #endif
1957  if (!reco) {
1960  }
1961  const auto& xy = waferPosition(waferU, waferV, reco);
1962  x += xy.first;
1963  y += xy.second;
1964 #ifdef EDM_ML_DEBUG
1965  if (debug)
1966  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << ":" << xy.first << ":" << xy.second;
1967 #endif
1968  return std::make_pair(x, y);
1969 }
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 1519 of file HGCalDDDConstants.cc.

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

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

1519  {
1520  int wafer(0);
1521  if (!tileTrapezoid()) {
1522  for (unsigned int i = 0; i < layers(true); ++i) {
1523  int lay = hgpar_->depth_[i];
1524  wafer += modules(lay, true);
1525  }
1526  } else {
1527  wafer = static_cast<int>(hgpar_->moduleLayR_.size());
1528  }
1529  return wafer;
1530 }
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 1532 of file HGCalDDDConstants.cc.

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

1532  {
1533  int wafer(0);
1534  if (!tileTrapezoid()) {
1535  auto itr = waferLayer_.find(layer);
1536  if (itr != waferLayer_.end()) {
1537  unsigned ity = (type > 0 && type <= 2) ? type : 0;
1538  wafer = (itr->second)[ity];
1539  }
1540  } else {
1541  const auto& index = getIndex(layer, true);
1542  wafer = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
1543  }
1544  return wafer;
1545 }
constexpr std::array< uint8_t, layerIndexSize > layer
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 189 of file HGCalDDDConstants.h.

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

189  {
191  }
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

◆ waferSize()

double HGCalDDDConstants::waferSize ( bool  reco) const
inline

Definition at line 192 of file HGCalDDDConstants.h.

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

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

192  {
194  }
static constexpr double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

◆ waferToCopy()

int HGCalDDDConstants::waferToCopy ( int  wafer) const
inline

Definition at line 197 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferCopy_.

197  {
198  return ((wafer >= 0) && (wafer < static_cast<int>(hgpar_->waferCopy_.size())))
199  ? hgpar_->waferCopy_[wafer]
200  : static_cast<int>(hgpar_->waferCopy_.size());
201  }
std::vector< int > waferCopy_
const HGCalParameters * hgpar_

◆ waferType() [1/3]

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

Definition at line 1547 of file HGCalDDDConstants.cc.

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

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

1547  {
1548  int type(1);
1549  if (waferHexagon8()) {
1550  if (fromFile && (waferFileSize() > 0)) {
1551  int layer(0), waferU(0), waferV(0);
1552  if (id.det() != DetId::Forward) {
1553  HGCSiliconDetId hid(id);
1554  layer = hid.layer();
1555  waferU = hid.waferU();
1556  waferV = hid.waferV();
1557  } else {
1558  HFNoseDetId hid(id);
1559  layer = hid.layer();
1560  waferU = hid.waferU();
1561  waferV = hid.waferV();
1562  }
1564  if (itr != hgpar_->waferInfoMap_.end())
1565  type = (itr->second).type;
1566  } else {
1567  type = ((id.det() != DetId::Forward) ? HGCSiliconDetId(id).type() : HFNoseDetId(id).type());
1568  }
1569  } else if (waferHexagon6()) {
1570  type = waferTypeL(HGCalDetId(id).wafer()) - 1;
1571  }
1572  return type;
1573 }
int32_t waferU(const int32_t index)
bool waferHexagon8() const
bool waferHexagon6() const
constexpr std::array< uint8_t, layerIndexSize > layer
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
int type() const
get the type
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_

◆ waferType() [2/3]

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

Definition at line 1575 of file HGCalDDDConstants.cc.

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

1575  {
1577  if (waferHexagon8()) {
1578  if (fromFile && (waferFileSize() > 0)) {
1580  if (itr != hgpar_->waferInfoMap_.end())
1581  type = (itr->second).type;
1582  } else {
1584  if (itr != hgpar_->typesInLayers_.end())
1585  type = hgpar_->waferTypeL_[itr->second];
1586  }
1587  } else if (waferHexagon6()) {
1588  if ((waferU >= 0) && (waferU < static_cast<int>(hgpar_->waferTypeL_.size())))
1589  type = (hgpar_->waferTypeL_[waferU] - 1);
1590  }
1591  return type;
1592 }
int32_t waferU(const int32_t index)
bool waferHexagon8() const
bool waferHexagon6() const
constexpr std::array< uint8_t, layerIndexSize > layer
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 = false 
) const

Definition at line 1594 of file HGCalDDDConstants.cc.

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

1594  {
1595  const auto& index = HGCalWaferIndex::waferIndex(id.layer(), id.waferU(), id.waferV());
1596  int type(-1), part(-1), orient(-1);
1597  if (fromFile && (waferFileSize() > 0)) {
1598  auto itr = hgpar_->waferInfoMap_.find(index);
1599  if (itr != hgpar_->waferInfoMap_.end()) {
1600  type = (itr->second).type;
1601  part = (itr->second).part;
1602  orient = (itr->second).orient;
1603  }
1604  } else {
1605  auto ktr = hgpar_->typesInLayers_.find(index);
1606  if (ktr != hgpar_->typesInLayers_.end())
1607  type = hgpar_->waferTypeL_[ktr->second];
1608  auto itr = hgpar_->waferTypes_.find(index);
1609  if (itr != hgpar_->waferTypes_.end()) {
1610  if ((itr->second).second < HGCalTypes::k_OffsetRotation) {
1611  orient = (itr->second).second;
1612  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1614  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1616  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1618  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1620  }
1621  } else {
1622  part = (itr->second).first;
1623  orient = ((itr->second).second - HGCalTypes::k_OffsetRotation);
1624  }
1625  } else {
1627  orient = 0;
1628  }
1629  }
1630  return std::make_tuple(type, part, orient);
1631 }
static constexpr int k_OffsetRotation
Definition: HGCalTypes.h:91
static constexpr int k_fourCorners
int32_t waferU(const int32_t index)
static constexpr int32_t WaferThree
Definition: HGCalTypes.h:42
constexpr std::array< uint8_t, layerIndexSize > layer
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 207 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferTypeL_.

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

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

◆ waferTypeRotation()

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

Definition at line 1633 of file HGCalDDDConstants.cc.

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

Referenced by isValidCell8().

1634  {
1635  int type(HGCalTypes::WaferOut), rotn(0);
1637  bool withinList(true);
1638  if (fromFile && (waferFileSize() > 0)) {
1639  auto itr = hgpar_->waferInfoMap_.find(wl);
1640  withinList = (itr != hgpar_->waferInfoMap_.end());
1641  if (withinList) {
1642  type = (itr->second).part;
1643  rotn = (itr->second).orient;
1644  }
1645  } else {
1646  auto itr = hgpar_->waferTypes_.find(wl);
1647  if (waferHexagon8()) {
1648  withinList = (itr != hgpar_->waferTypes_.end());
1649  if (withinList) {
1650  if ((itr->second).second < HGCalTypes::k_OffsetRotation) {
1651  rotn = (itr->second).second;
1652  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1654  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1656  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1658  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1660  }
1661  } else {
1662  type = (itr->second).first;
1663  rotn = ((itr->second).second - HGCalTypes::k_OffsetRotation);
1664  }
1665  } else {
1667  rotn = HGCalTypes::WaferCorner0;
1668  }
1669  }
1670  }
1671 #ifdef EDM_ML_DEBUG
1672  if (debug)
1673  edm::LogVerbatim("HGCalGeom") << "waferTypeRotation: Layer " << layer << " Wafer " << waferU << ":" << waferV
1674  << " Index " << std::hex << wl << std::dec << ":" << withinList << " Type " << type
1675  << " Rotation " << rotn;
1676 #endif
1677  return std::make_pair(type, rotn);
1678 }
Log< level::Info, true > LogVerbatim
static constexpr int k_OffsetRotation
Definition: HGCalTypes.h:91
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
constexpr std::array< uint8_t, layerIndexSize > layer
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 203 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferTypeT_.

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

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

◆ waferUVMax()

int HGCalDDDConstants::waferUVMax ( ) const
inline

Definition at line 215 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferUVMax_.

Referenced by HGCalTopology::HGCalTopology().

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

◆ waferVirtual()

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

Definition at line 1680 of file HGCalDDDConstants.cc.

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

1680  {
1681  bool type(false);
1682  if (waferHexagon8()) {
1684  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1685  } else if (waferHexagon6()) {
1686  int wl = HGCalWaferIndex::waferIndex(layer, waferU, 0, true);
1687  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1688  }
1689  return type;
1690 }
int32_t waferU(const int32_t index)
bool waferHexagon8() const
bool waferHexagon6() const
constexpr std::array< uint8_t, layerIndexSize > layer
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

Member Data Documentation

◆ dPhiMin

const float HGCalDDDConstants::dPhiMin = 0.02
private

Definition at line 248 of file HGCalDDDConstants.h.

◆ fullAndPart_

const bool HGCalDDDConstants::fullAndPart_
private

Definition at line 255 of file HGCalDDDConstants.h.

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

◆ geomTools_

HGCalGeomTools HGCalDDDConstants::geomTools_
private

Definition at line 246 of file HGCalDDDConstants.h.

◆ hexside_

double HGCalDDDConstants::hexside_
private

◆ hexsideT_

double HGCalDDDConstants::hexsideT_
private

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

Referenced by HGCalDDDConstants(), and locateCell().

◆ hgcellUV_

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

Definition at line 245 of file HGCalDDDConstants.h.

Referenced by cellHex(), and HGCalDDDConstants().

◆ hgpar_

const HGCalParameters* HGCalDDDConstants::hgpar_
private

◆ k_horizontalShift

const double HGCalDDDConstants::k_horizontalShift = 1.0
private

Definition at line 247 of file HGCalDDDConstants.h.

◆ max_modules_layer_

Simrecovecs HGCalDDDConstants::max_modules_layer_
private

Definition at line 260 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and modules().

◆ maxWafersPerLayer_

int32_t HGCalDDDConstants::maxWafersPerLayer_
private

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

Referenced by HGCalDDDConstants(), and maxModules().

◆ rmax_

double HGCalDDDConstants::rmax_
private

◆ rmaxT_

double HGCalDDDConstants::rmaxT_
private

Definition at line 257 of file HGCalDDDConstants.h.

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

◆ sqrt3_

const double HGCalDDDConstants::sqrt3_
private

Definition at line 253 of file HGCalDDDConstants.h.

Referenced by cellHex(), and distFromEdgeHex().

◆ tan30deg_

constexpr double HGCalDDDConstants::tan30deg_ = 0.5773502693
staticprivate

◆ tot_layers_

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

Definition at line 259 of file HGCalDDDConstants.h.

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

◆ tot_wafers_

int32_t HGCalDDDConstants::tot_wafers_
private

Definition at line 258 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants().

◆ waferIn_

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

Definition at line 264 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and isValidHex8().

◆ waferLayer_

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

Definition at line 262 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and wafers().

◆ waferMax_

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

Definition at line 263 of file HGCalDDDConstants.h.

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