CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
HGCalTypes::CellType cellType (int type, int waferU, int waferV) const
 
double distFromEdgeHex (double x, double y, double z) const
 
double distFromEdgeTrap (double x, double y, double z) const
 
void etaPhiFromPosition (const double x, const double y, const double z, const int layer, int &ieta, int &iphi, int &type, double &wt) const
 
int firstLayer () const
 
HGCalGeometryMode::GeometryMode geomMode () const
 
int getLayer (double z, bool reco) const
 
int getLayerOffset () const
 
HGCalParameters::hgtrap getModule (unsigned int k, bool hexType, bool reco) const
 
std::vector
< HGCalParameters::hgtrap
getModules () 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::hgtrform
getTrForms () 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 lay, int ieta, int iphi) const
 
int lastLayer (bool reco) const
 
int layerIndex (int lay, bool reco) const
 
unsigned int layers (bool reco) const
 
unsigned int layersInit (bool reco) const
 
int levelTop (int ind=0) const
 
std::pair< float, float > 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 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) 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
 
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
 
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 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 ()
 

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 &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_
 
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 29 of file HGCalDDDConstants.h.

Member Typedef Documentation

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

Definition at line 266 of file HGCalDDDConstants.h.

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

Definition at line 265 of file HGCalDDDConstants.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file HGCalDDDConstants.cc.

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

28  : hgpar_(hp),
29  sqrt3_(std::sqrt(3.0)),
30  mode_(hgpar_->mode_),
32 #ifdef EDM_ML_DEBUG
33  edm::LogVerbatim("HGCalGeom") << "Mode " << mode_ << " FullAndPart " << fullAndPart_;
34 #endif
35  if (waferHexagon6() || waferHexagon8()) {
38  hexside_ = 2.0 * rmax_ * tan30deg_;
39  hexsideT_ = 2.0 * rmaxT_ * tan30deg_;
40 #ifdef EDM_ML_DEBUG
41  edm::LogVerbatim("HGCalGeom") << "rmax_ " << rmax_ << ":" << rmaxT_ << ":" << hexside_ << ":" << hexsideT_
42  << " CellSize " << 0.5 * HGCalParameters::k_ScaleFromDDD * hgpar_->cellSize_[0] << ":"
44 #endif
45  }
46  // init maps and constants
47  modHalf_ = 0;
49  for (int simreco = 0; simreco < 2; ++simreco) {
50  tot_layers_[simreco] = layersInit((bool)simreco);
51  max_modules_layer_[simreco].resize(tot_layers_[simreco] + 1);
52  for (unsigned int layer = 1; layer <= tot_layers_[simreco]; ++layer) {
53  max_modules_layer_[simreco][layer] = modulesInit(layer, (bool)simreco);
54  if (simreco == 1) {
55  modHalf_ += max_modules_layer_[simreco][layer];
57 #ifdef EDM_ML_DEBUG
58  edm::LogVerbatim("HGCalGeom") << "Layer " << layer << " with " << max_modules_layer_[simreco][layer] << ":"
59  << modHalf_ << " modules in RECO";
60  } else {
61  edm::LogVerbatim("HGCalGeom") << "Layer " << layer << " with " << max_modules_layer_[simreco][layer]
62  << " modules in SIM";
63 #endif
64  }
65  }
66 #ifdef EDM_ML_DEBUG
67  edm::LogVerbatim("HGCalGeom") << "SimReco " << simreco << " with " << tot_layers_[simreco] << " Layers";
68 #endif
69  }
70  tot_wafers_ = wafers();
71 
72 #ifdef EDM_ML_DEBUG
73  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants initialized for " << name << " with " << layers(false) << ":"
74  << layers(true) << " layers, " << wafers() << ":" << 2 * modHalf_
75  << " wafers with maximum " << maxWafersPerLayer_ << " per layer and "
76  << "maximum of " << maxCells(false) << ":" << maxCells(true) << " cells";
77 #endif
78  if (waferHexagon6() || waferHexagon8()) {
79  int wminT(9999999), wmaxT(-9999999), kount1(0), kount2(0);
80  for (unsigned int i = 0; i < getTrFormN(); ++i) {
81  int lay0 = getTrForm(i).lay;
82  int wmin(9999999), wmax(-9999999), kount(0);
83  for (int wafer = 0; wafer < sectors(); ++wafer) {
84  bool waferIn = waferInLayer(wafer, lay0, true);
85  if (waferHexagon8()) {
86  int kndx = HGCalWaferIndex::waferIndex(lay0,
89  waferIn_[kndx] = waferIn;
90  }
91  if (waferIn) {
92  int waferU = ((waferHexagon6()) ? wafer : HGCalWaferIndex::waferU(hgpar_->waferCopy_[wafer]));
93  if (waferU < wmin)
94  wmin = waferU;
95  if (waferU > wmax)
96  wmax = waferU;
97  ++kount;
98  }
99  }
100  if (wminT > wmin)
101  wminT = wmin;
102  if (wmaxT < wmax)
103  wmaxT = wmax;
104  if (kount1 < kount)
105  kount1 = kount;
106  kount2 += kount;
107 #ifdef EDM_ML_DEBUG
108  int lay1 = getIndex(lay0, true).first;
109  edm::LogVerbatim("HGCalGeom") << "Index " << i << " Layer " << lay0 << ":" << lay1 << " Wafer " << wmin << ":"
110  << wmax << ":" << kount;
111 #endif
112  HGCWaferParam a1{{wmin, wmax, kount}};
113  waferLayer_[lay0] = a1;
114  }
115  waferMax_ = std::array<int, 4>{{wminT, wmaxT, kount1, kount2}};
116 #ifdef EDM_ML_DEBUG
117  edm::LogVerbatim("HGCalGeom") << "Overall wafer statistics: " << wminT << ":" << wmaxT << ":" << kount1 << ":"
118  << kount2;
119 #endif
120  }
121 }
Log< level::Info, true > LogVerbatim
bool waferHexagon6() const
HGCalParameters::hgtrform getTrForm(unsigned int k) const
Simrecovecs max_modules_layer_
unsigned int layersInit(bool reco) const
int32_t waferU(const int32_t index)
std::unordered_map< int32_t, bool > waferIn_
int modulesInit(int lay, bool reco) const
HGCalGeometryMode::GeometryMode mode_
constexpr std::array< uint8_t, layerIndexSize > layer
std::map< int, HGCWaferParam > waferLayer_
unsigned int getTrFormN() const
unsigned int layers(bool reco) const
std::vector< double > cellSize_
T sqrt(T t)
Definition: SSEVec.h:19
std::pair< int, float > getIndex(int lay, bool reco) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
std::array< int, 4 > waferMax_
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_
bool waferHexagon8() const
static constexpr double tan30deg_
std::array< uint32_t, 2 > tot_layers_
__host__ __device__ V wmin
const HGCalParameters * hgpar_
int maxCells(bool reco) const
bool waferInLayer(int wafer, int lay, bool reco) const
__host__ __device__ V V wmax
HGCalDDDConstants::~HGCalDDDConstants ( )

Definition at line 123 of file HGCalDDDConstants.cc.

123 {}

Member Function Documentation

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

Definition at line 125 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_, and HGCalParameters::waferTypeT_.

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

125  {
126  const auto& index = getIndex(lay, reco);
127  if (index.first < 0)
128  return std::make_pair(-1, -1);
129  if (waferHexagon6()) {
130  float xx = (reco) ? x : HGCalParameters::k_ScaleFromDDD * x;
131  float yy = (reco) ? y : HGCalParameters::k_ScaleFromDDD * y;
132 
133  // First the wafer
134  int wafer = cellHex(xx, yy, rmax_, hgpar_->waferPosX_, hgpar_->waferPosY_);
135  if (wafer < 0 || wafer >= (int)(hgpar_->waferTypeT_.size())) {
136  edm::LogWarning("HGCalGeom") << "Wafer no. out of bound for " << wafer << ":" << (hgpar_->waferTypeT_).size()
137  << ":" << (hgpar_->waferPosX_).size() << ":" << (hgpar_->waferPosY_).size()
138  << " ***** ERROR *****";
139  return std::make_pair(-1, -1);
140  } else {
141  // Now the cell
142  xx -= hgpar_->waferPosX_[wafer];
143  yy -= hgpar_->waferPosY_[wafer];
144  if (hgpar_->waferTypeT_[wafer] == 1)
145  return std::make_pair(wafer,
146  cellHex(xx,
147  yy,
150  hgpar_->cellFineY_));
151  else
152  return std::make_pair(wafer,
153  cellHex(xx,
154  yy,
157  hgpar_->cellCoarseY_));
158  }
159  } else {
160  return std::make_pair(-1, -1);
161  }
162 }
std::vector< double > waferPosY_
bool waferHexagon6() const
std::vector< double > cellFineY_
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) 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
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
Log< level::Warning, false > LogWarning
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
tuple size
Write out results.
std::array< int, 5 > HGCalDDDConstants::assignCellHex ( float  x,
float  y,
int  lay,
bool  reco,
bool  extend = false,
bool  debug = false 
) const

Definition at line 164 of file HGCalDDDConstants.cc.

References HGCalParameters::k_ScaleToDDD, dt_dqm_sourceclient_common_cff::reco, waferFromPosition(), waferHexagon8(), waferType(), HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

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

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

Definition at line 179 of file HGCalDDDConstants.cc.

References getIndex(), hgpar_, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, HGCalParameters::k_ScaleFromDDD, cuda_std::lower_bound(), M_PI, phi, alignCSCRings::r, HGCalParameters::radiusLayer_, HGCalParameters::scintType(), and mathSSE::sqrt().

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

179  {
180  int irad(-1), iphi(-1), type(-1);
181  const auto& indx = getIndex(layer, reco);
182  if (indx.first < 0)
183  return std::array<int, 3>{{irad, iphi, type}};
184  double xx = (z > 0) ? x : -x;
185  double r = (reco ? std::sqrt(x * x + y * y) : HGCalParameters::k_ScaleFromDDD * std::sqrt(x * x + y * y));
186  double phi = (r == 0. ? 0. : std::atan2(y, xx));
187  if (phi < 0)
188  phi += (2.0 * M_PI);
190  auto ir = std::lower_bound(hgpar_->radiusLayer_[type].begin(), hgpar_->radiusLayer_[type].end(), r);
191  irad = (int)(ir - hgpar_->radiusLayer_[type].begin());
192  irad = std::clamp(irad, hgpar_->iradMinBH_[indx.first], hgpar_->iradMaxBH_[indx.first]);
193  iphi = 1 + (int)(phi / indx.second);
194 #ifdef EDM_ML_DEBUG
195  edm::LogVerbatim("HGCalGeom") << "assignCellTrap Input " << x << ":" << y << ":" << z << ":" << layer << ":" << reco
196  << " x|r " << xx << ":" << r << " phi " << phi << " o/p " << irad << ":" << iphi << ":"
197  << type;
198 #endif
199  return std::array<int, 3>{{irad, iphi, type}};
200 }
std::vector< int > iradMaxBH_
Log< level::Info, true > LogVerbatim
int scintType(const int layer) const
constexpr std::array< uint8_t, layerIndexSize > layer
T sqrt(T t)
Definition: SSEVec.h:19
std::pair< int, float > getIndex(int lay, bool reco) const
#define M_PI
std::vector< int > iradMinBH_
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
std::pair< double, double > HGCalDDDConstants::cellEtaPhiTrap ( int  type,
int  irad 
) const

Definition at line 202 of file HGCalDDDConstants.cc.

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

202  {
203  double dr(0), df(0);
204  if (tileTrapezoid()) {
205  double r = 0.5 * ((hgpar_->radiusLayer_[type][irad - 1] + hgpar_->radiusLayer_[type][irad]));
206  dr = (hgpar_->radiusLayer_[type][irad] - hgpar_->radiusLayer_[type][irad - 1]);
207  df = r * hgpar_->cellSize_[type];
208  }
209  return std::make_pair(dr, df);
210 }
std::vector< double > cellSize_
bool tileTrapezoid() const
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
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 1539 of file HGCalDDDConstants.cc.

References funct::abs(), PVValHelper::dx, PVValHelper::dy, isotrackApplyRegressor::k, pileupDistInMC::num, tan30deg_, and hlt_dqm_clientPB-live_cfg::xmax.

Referenced by assignCell(), and waferFromPosition().

1540  {
1541  int num(0);
1542  const double tol(0.00001);
1543  double cellY = 2.0 * cellR * tan30deg_;
1544  for (unsigned int k = 0; k < posX.size(); ++k) {
1545  double dx = std::abs(xx - posX[k]);
1546  double dy = std::abs(yy - posY[k]);
1547  if (dx <= (cellR + tol) && dy <= (cellY + tol)) {
1548  double xmax = (dy <= 0.5 * cellY) ? cellR : (cellR - (dy - 0.5 * cellY) / tan30deg_);
1549  if (dx <= (xmax + tol)) {
1550  num = k;
1551  break;
1552  }
1553  }
1554  }
1555  return num;
1556 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr double tan30deg_
void HGCalDDDConstants::cellHex ( double  xloc,
double  yloc,
int  cellType,
int &  cellU,
int &  cellV,
bool  extend = false,
bool  debug = false 
) const
private

Definition at line 1558 of file HGCalDDDConstants.cc.

References funct::abs(), newFWLiteAna::found, hgpar_, SiStripPI::max, min(), N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, rmax_, rmaxT_, edm::shift, and sqrt3_.

1559  {
1560  int N = (cellType == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1561  double Rc = 2 * rmax_ / (3 * N);
1562  double rc = 0.5 * Rc * sqrt3_;
1563  double RcT = (extend) ? (2 * rmaxT_ / (3 * N)) : Rc;
1564  double rcT = 0.5 * RcT * sqrt3_;
1565  double v0 = ((xloc / Rc - 1.0) / 1.5);
1566  int cv0 = (v0 > 0) ? (N + (int)(v0 + 0.5)) : (N - (int)(-v0 + 0.5));
1567  double u0 = (0.5 * yloc / rc + 0.5 * cv0);
1568  int cu0 = (u0 > 0) ? (N / 2 + (int)(u0 + 0.5)) : (N / 2 - (int)(-u0 + 0.5));
1569  cu0 = std::max(0, std::min(cu0, 2 * N - 1));
1570  cv0 = std::max(0, std::min(cv0, 2 * N - 1));
1571  if (cv0 - cu0 >= N)
1572  cv0 = cu0 + N - 1;
1573 #ifdef EDM_ML_DEBUG
1574  if (debug)
1575  edm::LogVerbatim("HGCalGeom") << "cellHex: input " << xloc << ":" << yloc << ":" << cellType << " parameter " << rc
1576  << ":" << Rc << " u0 " << u0 << ":" << cu0 << " v0 " << v0 << ":" << cv0;
1577 #endif
1578  bool found(false);
1579  static constexpr int shift[3] = {0, 1, -1};
1580  for (int i1 = 0; i1 < 3; ++i1) {
1581  cellU = cu0 + shift[i1];
1582  for (int i2 = 0; i2 < 3; ++i2) {
1583  cellV = cv0 + shift[i2];
1584  if (((cellV - cellU) < N) && ((cellU - cellV) <= N) && (cellU >= 0) && (cellV >= 0) && (cellU < 2 * N) &&
1585  (cellV < 2 * N)) {
1586  double xc = (1.5 * (cellV - N) + 1.0) * Rc;
1587  double yc = (2 * cellU - cellV - N) * rc;
1588  if ((std::abs(yloc - yc) <= rcT) && (std::abs(xloc - xc) <= RcT) &&
1589  ((std::abs(xloc - xc) <= 0.5 * RcT) || (std::abs(yloc - yc) <= sqrt3_ * (RcT - std::abs(xloc - xc))))) {
1590 #ifdef EDM_ML_DEBUG
1591  if (debug)
1592  edm::LogVerbatim("HGCalGeom")
1593  << "cellHex: local " << xc << ":" << yc << " difference " << std::abs(xloc - xc) << ":"
1594  << std::abs(yloc - yc) << ":" << sqrt3_ * (Rc - std::abs(yloc - yc)) << " comparator " << rc << ":"
1595  << Rc << " (u,v) = (" << cellU << "," << cellV << ")";
1596 #endif
1597  found = true;
1598  break;
1599  }
1600  }
1601  }
1602  if (found)
1603  break;
1604  }
1605  if (!found) {
1606  cellU = cu0;
1607  cellV = cv0;
1608  }
1609 }
Log< level::Info, true > LogVerbatim
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
HGCalTypes::CellType cellType(int type, int waferU, int waferV) const
#define debug
Definition: HDRShower.cc:19
#define N
Definition: blowfish.cc:9
static unsigned int const shift
const HGCalParameters * hgpar_
bool HGCalDDDConstants::cellInLayer ( int  waferU,
int  waferV,
int  cellU,
int  cellV,
int  lay,
bool  reco 
) const

Definition at line 212 of file HGCalDDDConstants.cc.

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

Referenced by HGCalGeometry::newCell().

212  {
213  const auto& indx = getIndex(lay, true);
214  if (indx.first >= 0) {
215  if (waferHexagon8() || waferHexagon6()) {
216  const auto& xy = ((waferHexagon8()) ? locateCell(lay, waferU, waferV, cellU, cellV, reco, true, true)
217  : locateCell(cellU, lay, waferU, reco));
218  double rpos = sqrt(xy.first * xy.first + xy.second * xy.second);
219  return ((rpos >= hgpar_->rMinLayHex_[indx.first]) && (rpos <= hgpar_->rMaxLayHex_[indx.first]));
220  } else {
221  return true;
222  }
223  } else {
224  return false;
225  }
226 }
bool waferHexagon6() const
int32_t waferU(const int32_t index)
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
T sqrt(T t)
Definition: SSEVec.h:19
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< double > rMinLayHex_
Basic2DVector< T > xy() const
int32_t waferV(const int32_t index)
bool waferHexagon8() const
const HGCalParameters * hgpar_
double HGCalDDDConstants::cellSizeHex ( int  type) const

Definition at line 241 of file HGCalDDDConstants.cc.

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

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

241  {
242  int indx = ((waferHexagon8()) ? ((type >= 1) ? 1 : 0) : ((type == 1) ? 1 : 0));
243  double cell = (tileTrapezoid() ? 0.5 * hgpar_->cellSize_[indx]
245  return cell;
246 }
std::vector< double > cellSize_
bool tileTrapezoid() const
static constexpr double k_ScaleFromDDD
bool waferHexagon8() const
const HGCalParameters * hgpar_
std::pair<double, double> HGCalDDDConstants::cellSizeTrap ( int  type,
int  irad 
) const
inline

Definition at line 40 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::radiusLayer_.

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

40  {
41  return std::make_pair(hgpar_->radiusLayer_[type][irad - 1], hgpar_->radiusLayer_[type][irad]);
42  }
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
double HGCalDDDConstants::cellThickness ( int  layer,
int  waferU,
int  waferV 
) const

Definition at line 228 of file HGCalDDDConstants.cc.

References HGCalParameters::cellThickness_, hgpar_, waferHexagon6(), waferHexagon8(), and waferType().

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

228  {
229  double thick(-1);
230  int type = waferType(layer, waferU, waferV, false);
231  if (type >= 0) {
232  if (waferHexagon8()) {
233  thick = 10000.0 * hgpar_->cellThickness_[type]; // cm to micron
234  } else if (waferHexagon6()) {
235  thick = 100.0 * (type + 1); // type = 1,2,3 for 100,200,300 micron
236  }
237  }
238  return thick;
239 }
bool waferHexagon6() const
int32_t waferU(const int32_t index)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< double > cellThickness_
int32_t waferV(const int32_t index)
bool waferHexagon8() const
const HGCalParameters * hgpar_
int waferType(DetId const &id, bool fromFile=false) const
HGCalTypes::CellType HGCalDDDConstants::cellType ( int  type,
int  waferU,
int  waferV 
) const

Definition at line 248 of file HGCalDDDConstants.cc.

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

Referenced by HGCalTopology::neighbors().

248  {
249  // type=0: in the middle; 1..6: the edges clocwise from bottom left;
250  // =11..16: the corners clockwise from bottom
251  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
252  if (cellU == 0) {
253  if (cellV == 0)
255  else if (cellV - cellU == N - 1)
257  else
259  } else if (cellV == 0) {
260  if (cellU - cellV == N)
262  else
264  } else if (cellU - cellV == N) {
265  if (cellU == 2 * N - 1)
267  else
269  } else if (cellU == 2 * N - 1) {
270  if (cellV == 2 * N - 1)
272  else
274  } else if (cellV == 2 * N - 1) {
275  if (cellV - cellU == N - 1)
277  else
279  } else if (cellV - cellU == N - 1) {
281  } else if ((cellU > 2 * N - 1) || (cellV > 2 * N - 1) || (cellV >= (cellU + N)) || (cellU > (cellV + N))) {
283  } else {
285  }
286 }
if(conf_.getParameter< bool >("UseStripCablingDB"))
#define N
Definition: blowfish.cc:9
const HGCalParameters * hgpar_
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_, isotrackApplyRegressor::k, HGCalParameters::k_ScaleFromDDD, HGCalParameters::k_ScaleToDDD, layerIndex(), rmax_, sqrt3_, tan30deg_, waferHexagon8(), HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, x, HGCalParameters::xLayerHex_, y, and HGCalParameters::yLayerHex_.

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
295  double xx = HGCalParameters::k_ScaleFromDDD * x;
296  double yy = HGCalParameters::k_ScaleFromDDD * y;
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 = (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
int getLayer(double z, bool reco) const
int layerIndex(int lay, bool reco) const
std::vector< double > yLayerHex_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr double k_ScaleToDDD
static constexpr double k_ScaleFromDDD
bool waferHexagon8() const
static constexpr double tan30deg_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::vector< double > xLayerHex_
double HGCalDDDConstants::distFromEdgeTrap ( double  x,
double  y,
double  z 
) const

Definition at line 334 of file HGCalDDDConstants.cc.

References funct::abs(), getLayer(), hgpar_, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, HGCalParameters::k_ScaleFromDDD, HGCalParameters::k_ScaleToDDD, layerIndex(), cuda_std::lower_bound(), M_PI, SiStripPI::max, min(), phi, alignCSCRings::r, HGCalParameters::radiusLayer_, HGCalParameters::scintCellSize(), HGCalParameters::scintType(), and mathSSE::sqrt().

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 = (int)(ir - hgpar_->radiusLayer_[type].begin());
350  irad = std::clamp(irad, hgpar_->iradMinBH_[indx], hgpar_->iradMaxBH_[indx]);
351  int iphi = 1 + (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 getLayer(double z, bool reco) const
int scintType(const int layer) const
double scintCellSize(const int layer) const
int layerIndex(int lay, bool reco) const
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
#define M_PI
static constexpr double k_ScaleToDDD
std::vector< int > iradMinBH_
static constexpr double k_ScaleFromDDD
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
void HGCalDDDConstants::etaPhiFromPosition ( const double  x,
const double  y,
const double  z,
const int  layer,
int &  ieta,
int &  iphi,
int &  type,
double &  wt 
) const
int HGCalDDDConstants::firstLayer ( ) const
inline
HGCalGeometryMode::GeometryMode HGCalDDDConstants::geomMode ( ) const
inline

Definition at line 56 of file HGCalDDDConstants.h.

References mode_.

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

56 { return mode_; }
const HGCalGeometryMode::GeometryMode mode_
std::pair< int, float > HGCalDDDConstants::getIndex ( int  lay,
bool  reco 
) const
private

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

1611  {
1612  int indx = layerIndex(lay, reco);
1613  if (indx < 0)
1614  return std::make_pair(-1, 0);
1615  float cell(0);
1616  if (waferHexagon6()) {
1617  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1618  } else {
1619  if (waferHexagon8()) {
1620  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1621  } else {
1622  cell = hgpar_->scintCellSize(lay);
1623  }
1624  }
1625  return std::make_pair(indx, cell);
1626 }
std::vector< double > moduleCellR_
bool waferHexagon6() const
double scintCellSize(const int layer) const
int layerIndex(int lay, bool reco) const
std::vector< double > moduleCellS_
bool waferHexagon8() const
const HGCalParameters * hgpar_
int HGCalDDDConstants::getLayer ( double  z,
bool  reco 
) const

Definition at line 364 of file HGCalDDDConstants.cc.

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

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_
const HGCalParameters * hgpar_
int HGCalDDDConstants::getLayerOffset ( ) const
inline

Definition at line 58 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::layerOffset_.

Referenced by HGCalNumberingScheme::getUnitID().

58 { return hgpar_->layerOffset_; }
const HGCalParameters * hgpar_
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 }
std::vector< double > waferPosY_
hgtrap getModule(unsigned int k, bool reco) const
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::vector< int > waferTypeL_
tuple size
Write out results.
std::vector< HGCalParameters::hgtrap > HGCalDDDConstants::getModules ( ) const

Definition at line 400 of file HGCalDDDConstants.cc.

References HGCalParameters::getModule(), hgpar_, isotrackApplyRegressor::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 }
std::vector< int > moduleLayR_
hgtrap getModule(unsigned int k, bool reco) const
const HGCalParameters * hgpar_
const HGCalParameters* HGCalDDDConstants::getParameter ( ) const
inline
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
int scintCells(const int layer) const
const HGCalParameters * hgpar_
const std::vector<double>& HGCalDDDConstants::getRadiusLayer ( int  layer) const
inline

Definition at line 64 of file HGCalDDDConstants.h.

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

64  {
65  int type = (tileTrapezoid() ? hgpar_->scintType(layer) : 0);
66  return hgpar_->radiusLayer_[type];
67  }
int scintType(const int layer) const
constexpr std::array< uint8_t, layerIndexSize > layer
bool tileTrapezoid() const
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
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(), HGCalTriggerGeometryV9Imp3::getModuleFromTriggerCell(), HGCalTriggerGeometryV9Imp2::getTriggerCellsFromModule(), and HGCalTriggerGeometryV9Imp3::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_
HGCalParameters::hgtrform HGCalDDDConstants::getTrForm ( unsigned int  k) const
inline

Definition at line 68 of file HGCalDDDConstants.h.

References HGCalParameters::getTrForm(), and hgpar_.

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

68 { return hgpar_->getTrForm(k); }
hgtrform getTrForm(unsigned int k) const
const HGCalParameters * hgpar_
unsigned int HGCalDDDConstants::getTrFormN ( ) const
inline

Definition at line 69 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::trformIndex_.

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

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

Definition at line 421 of file HGCalDDDConstants.cc.

References HGCalParameters::getTrForm(), hgpar_, isotrackApplyRegressor::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_
int HGCalDDDConstants::getTypeHex ( int  layer,
int  waferU,
int  waferV 
) const

Definition at line 437 of file HGCalDDDConstants.cc.

References hgpar_, HGCalParameters::typesInLayers_, waferHexagon8(), HGCalWaferIndex::waferIndex(), and HGCalParameters::waferTypeL_.

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)
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)
bool waferHexagon8() const
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
int HGCalDDDConstants::getTypeTrap ( int  layer) const

Definition at line 428 of file HGCalDDDConstants.cc.

References hgpar_, 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_
int HGCalDDDConstants::getUVMax ( int  type) const
inline
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_, HGCalParameters::layerRotV_, and HGCalParameters::layerType_.

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_
bool HGCalDDDConstants::isHalfCell ( int  waferType,
int  cell 
) const

Definition at line 476 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseHalf_, HGCalParameters::cellFineHalf_, and hgpar_.

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_
const HGCalParameters * hgpar_
int waferType(DetId const &id, bool fromFile=false) const
bool HGCalDDDConstants::isValidCell ( int  layindex,
int  wafer,
int  cell 
) const
private

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

1648  {
1649  // Calculate the position of the cell
1650  // Works for options HGCalHexagon/HGCalHexagonFull
1651  double x = hgpar_->waferPosX_[wafer];
1652  double y = hgpar_->waferPosY_[wafer];
1653  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine) {
1654  x += hgpar_->cellFineX_[cell];
1655  y += hgpar_->cellFineY_[cell];
1656  } else {
1657  x += hgpar_->cellCoarseX_[cell];
1658  y += hgpar_->cellCoarseY_[cell];
1659  }
1660  double rr = sqrt(x * x + y * y);
1661  bool result = ((rr >= hgpar_->rMinLayHex_[lay - 1]) && (rr <= hgpar_->rMaxLayHex_[lay - 1]) &&
1662  (wafer < (int)(hgpar_->waferPosX_.size())));
1663 #ifdef EDM_ML_DEBUG
1664  if (!result)
1665  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << wafer << ":" << cell << " Position " << x << ":" << y
1666  << ":" << rr << " Compare Limits " << hgpar_->rMinLayHex_[lay - 1] << ":"
1667  << hgpar_->rMaxLayHex_[lay - 1] << " Flag " << result;
1668 #endif
1669  return result;
1670 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
std::vector< double > cellFineY_
tuple result
Definition: mps_fire.py:311
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_
bool HGCalDDDConstants::isValidCell8 ( int  lay,
int  waferU,
int  waferV,
int  cellU,
int  cellV,
int  type 
) const
private

Definition at line 1672 of file HGCalDDDConstants.cc.

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

Referenced by isValidHex8().

1672  {
1673  float x(0), y(0);
1674  int kndx = cellV * 100 + cellU;
1675  if (type == 0) {
1676  auto ktr = hgpar_->cellFineIndex_.find(kndx);
1677  if (ktr != hgpar_->cellFineIndex_.end()) {
1678  x = hgpar_->cellFineX_[ktr->second];
1679  y = hgpar_->cellFineY_[ktr->second];
1680  }
1681 #ifdef EDM_ML_DEBUG
1682  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
1683  << (ktr != hgpar_->cellFineIndex_.end());
1684 #endif
1685  } else {
1686  auto ktr = hgpar_->cellCoarseIndex_.find(kndx);
1687  if (ktr != hgpar_->cellCoarseIndex_.end()) {
1688  x = hgpar_->cellCoarseX_[ktr->second];
1689  y = hgpar_->cellCoarseY_[ktr->second];
1690  }
1691 #ifdef EDM_ML_DEBUG
1692  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
1693  << (ktr != hgpar_->cellCoarseIndex_.end());
1694 #endif
1695  }
1696  const auto& xy = waferPositionNoRot(lay, waferU, waferV, true, false);
1697  x += xy.first;
1698  y += xy.second;
1699 #ifdef EDM_ML_DEBUG
1700  edm::LogVerbatim("HGCalGeom") << "With wafer (" << waferU << "," << waferV << ") " << x << ":" << y;
1701 #endif
1702  double rr = sqrt(x * x + y * y);
1703  int ll = lay - hgpar_->firstLayer_;
1704  bool result = ((rr >= hgpar_->rMinLayHex_[ll]) && (rr <= hgpar_->rMaxLayHex_[ll]));
1705 #ifdef EDM_ML_DEBUG
1706  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << ll << ":" << waferU << ":" << waferV << ":" << cellU << ":"
1707  << cellV << " Position " << x << ":" << y << ":" << rr << " Compare Limits "
1708  << hgpar_->rMinLayHex_[ll] << ":" << hgpar_->rMaxLayHex_[ll] << " Flag " << result;
1709 #endif
1711  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1712  auto partn = waferTypeRotation(lay, waferU, waferV, false, false);
1713  result = HGCalWaferMask::goodCell(cellU, cellV, N, partn.first, partn.second);
1714 #ifdef EDM_ML_DEBUG
1715  edm::LogVerbatim("HGCalGeom") << "Input " << lay << ":" << waferU << ":" << waferV << ":" << cellU << ":" << cellV
1716  << " N " << N << " part " << partn.first << ":" << partn.second << " Result "
1717  << result;
1718 #endif
1719  }
1720  return result;
1721 }
Log< level::Info, true > LogVerbatim
wafer_map cellFineIndex_
std::pair< int, int > waferTypeRotation(int layer, int waferU, int waferV, bool fromFile=false, bool debug=false) const
int32_t waferU(const int32_t index)
static bool goodCell(int u, int v, int N, int type, int rotn)
std::vector< double > cellFineY_
tuple result
Definition: mps_fire.py:311
std::vector< double > cellCoarseX_
T sqrt(T t)
Definition: SSEVec.h:19
std::vector< double > rMinLayHex_
std::vector< double > rMaxLayHex_
Basic2DVector< T > xy() const
#define N
Definition: blowfish.cc:9
wafer_map cellCoarseIndex_
std::vector< double > cellFineX_
const HGCalGeometryMode::GeometryMode mode_
int32_t waferV(const int32_t index)
std::vector< double > cellCoarseY_
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug=false) const
const HGCalParameters * hgpar_
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 <= (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 >= (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) ? (int)(hgpar_->cellFineX_.size())
505  : (int)(hgpar_->cellCoarseX_.size()));
506  result = (cell >= 0 && cell <= cellmax);
507  } else {
508  result = isValidCell(lay_idx, mod, cell);
509  }
510  }
511  }
512  }
513 
514 #ifdef EDM_ML_DEBUG
515  if (!result)
516  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants: Layer " << lay << ":"
517  << (lay > 0 && (lay <= (int)(layers(reco)))) << " Module " << mod << ":" << resultMod
518  << " Cell " << cell << ":" << cellmax << ":" << (cell >= 0 && cell <= cellmax) << ":"
519  << maxCells(reco);
520 #endif
521  return result;
522 }
Log< level::Info, true > LogVerbatim
layer_map copiesInLayers_
bool waferHexagon6() const
tuple result
Definition: mps_fire.py:311
std::vector< double > cellCoarseX_
unsigned int layers(bool reco) const
bool isValidCell(int layindex, int wafer, int cell) const
std::vector< double > cellFineX_
std::vector< int > waferCopy_
std::vector< int > waferTypeT_
Log< level::Warning, false > LogWarning
const HGCalParameters * hgpar_
int maxCells(bool reco) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
tuple size
Write out results.
bool HGCalDDDConstants::isValidHex8 ( int  lay,
int  waferU,
int  waferV,
bool  fullAndPart = false 
) const

Definition at line 524 of file HGCalDDDConstants.cc.

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

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

Definition at line 567 of file HGCalDDDConstants.cc.

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

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

Definition at line 588 of file HGCalDDDConstants.cc.

References getIndex(), hgpar_, HGCalParameters::iradMaxBH_, and HGCalParameters::iradMinBH_.

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

588  {
589  // Check validity for a layer|eta|phi of scintillator
590  const auto& indx = getIndex(layer, true);
591  if (indx.first < 0)
592  return false;
593  return ((irad >= hgpar_->iradMinBH_[indx.first]) && (irad <= (hgpar_->iradMaxBH_[indx.first] + 1)) && (iphi > 0) &&
594  (iphi <= hgpar_->scintCells(layer)));
595 }
std::vector< int > iradMaxBH_
constexpr std::array< uint8_t, layerIndexSize > layer
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< int > iradMinBH_
const HGCalParameters * hgpar_
int HGCalDDDConstants::lastLayer ( bool  reco) const
int HGCalDDDConstants::layerFromIndex ( int  index,
bool  reco 
) const
private

Definition at line 1628 of file HGCalDDDConstants.cc.

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

Referenced by waferIndex().

1628  {
1629  int ll(-1);
1630  if (waferHexagon6() && reco) {
1631  ll = static_cast<int>(std::find(hgpar_->depthLayerF_.begin(), hgpar_->depthLayerF_.end(), index) -
1632  hgpar_->depthLayerF_.begin());
1633  if (ll == static_cast<int>(hgpar_->depthLayerF_.size()))
1634  ll = -1;
1635  } else {
1636  ll = static_cast<int>(std::find(hgpar_->layerIndex_.begin(), hgpar_->layerIndex_.end(), index) -
1637  hgpar_->layerIndex_.begin());
1638  if (ll == static_cast<int>(hgpar_->layerIndex_.size()))
1639  ll = -1;
1640  }
1641 #ifdef EDM_ML_DEBUG
1642  edm::LogVerbatim("HGCalGeom") << "LayerFromIndex for " << index << ":" << reco << ":" << waferHexagon6() << " is"
1643  << ll << ":" << (ll + hgpar_->firstLayer_);
1644 #endif
1645  return ((ll < 0) ? ll : (ll + hgpar_->firstLayer_));
1646 }
Log< level::Info, true > LogVerbatim
std::vector< int > depthLayerF_
bool waferHexagon6() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< int > layerIndex_
const HGCalParameters * hgpar_
int HGCalDDDConstants::layerIndex ( int  lay,
bool  reco 
) const

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

601  {
602  int ll = lay - hgpar_->firstLayer_;
603  if (ll < 0 || ll >= (int)(hgpar_->layerIndex_.size()))
604  return -1;
605  if (waferHexagon6()) {
606  if (reco && ll >= (int)(hgpar_->depthIndex_.size()))
607  return -1;
608  return (reco ? hgpar_->depthLayerF_[ll] : hgpar_->layerIndex_[ll]);
609  } else {
610  return (hgpar_->layerIndex_[ll]);
611  }
612 }
std::vector< int > depthLayerF_
bool waferHexagon6() const
std::vector< int > layerIndex_
std::vector< int > depthIndex_
const HGCalParameters * hgpar_
unsigned int HGCalDDDConstants::layers ( bool  reco) const
unsigned int HGCalDDDConstants::layersInit ( bool  reco) const

Definition at line 614 of file HGCalDDDConstants.cc.

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

Referenced by HGCalDDDConstants().

614  {
615  return (reco ? hgpar_->depthIndex_.size() : hgpar_->layerIndex_.size());
616 }
std::vector< int > layerIndex_
std::vector< int > depthIndex_
const HGCalParameters * hgpar_
int HGCalDDDConstants::levelTop ( int  ind = 0) const
inline

Definition at line 93 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::levelT_.

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

93 { return hgpar_->levelT_[ind]; }
std::vector< int > levelT_
const HGCalParameters * hgpar_
std::pair< float, float > HGCalDDDConstants::localToGlobal8 ( int  lay,
int  waferU,
int  waferV,
double  localX,
double  localY,
bool  reco,
bool  debug 
) const

Definition at line 618 of file HGCalDDDConstants.cc.

References HGCalParameters::firstLayer_, getXY(), hgpar_, HGCalParameters::k_ScaleToDDD, HGCalParameters::layerType_, HGCalTypes::WaferCenterR, waferPositionNoRot(), x, xy(), and y.

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

619  {
620  double x(localX), y(localY);
621  bool rotx =
623  if (debug)
624  edm::LogVerbatim("HGCalGeom") << "LocalToGlobal " << lay << ":" << (lay - hgpar_->firstLayer_) << ":" << rotx
625  << " Local (" << x << ":" << y << ") Reco " << reco;
626  if (!reco) {
629  }
630  const auto& xy = waferPositionNoRot(lay, waferU, waferV, reco, debug);
631  x += xy.first;
632  y += xy.second;
633  if (debug)
634  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << " by addong " << xy.first << ":" << xy.second;
635  return (rotx ? getXY(lay, x, y, false) : std::make_pair(x, y));
636 }
Log< level::Info, true > LogVerbatim
int32_t waferU(const int32_t index)
constexpr uint16_t localY(uint16_t py)
std::vector< int > layerType_
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
Basic2DVector< T > xy() const
static constexpr double k_ScaleToDDD
#define debug
Definition: HDRShower.cc:19
constexpr uint16_t localX(uint16_t px)
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_
std::pair< float, float > HGCalDDDConstants::locateCell ( int  cell,
int  lay,
int  type,
bool  reco 
) const

Definition at line 638 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(), and HGCalGeometry::getPosition().

638  {
639  // type refers to wafer # for hexagon cell
640  float x(999999.), y(999999.);
641  const auto& index = getIndex(lay, reco);
642  int i = index.first;
643  if (i < 0)
644  return std::make_pair(x, y);
645  if (waferHexagon6()) {
646  x = hgpar_->waferPosX_[type];
647  y = hgpar_->waferPosY_[type];
648 #ifdef EDM_ML_DEBUG
649  float x0(x), y0(y);
650 #endif
652  x += hgpar_->cellFineX_[cell];
653  y += hgpar_->cellFineY_[cell];
654  } else {
655  x += hgpar_->cellCoarseX_[cell];
656  y += hgpar_->cellCoarseY_[cell];
657  }
658 #ifdef EDM_ML_DEBUG
659  edm::LogVerbatim("HGCalGeom") << "LocateCell (Wafer) " << x0 << ":" << y0 << " Final " << x << ":" << y;
660 #endif
661  if (!reco) {
664  }
665  }
666  return std::make_pair(x, y);
667 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
bool waferHexagon6() const
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
std::pair< int, float > getIndex(int lay, bool reco) const
static constexpr double k_ScaleToDDD
std::vector< double > cellFineX_
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::pair< float, float > HGCalDDDConstants::locateCell ( int  lay,
int  waferU,
int  waferV,
int  cellU,
int  cellV,
bool  reco,
bool  all,
bool  debug = false 
) const

Definition at line 669 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseIndex_, HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineIndex_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, HGCalParameters::firstLayer_, getXY(), hgpar_, HGCalParameters::k_ScaleToDDD, HGCalParameters::layerType_, HGCalParameters::typesInLayers_, HGCalTypes::WaferCenterR, HGCalWaferIndex::waferIndex(), waferPositionNoRot(), HGCalParameters::waferTypeL_, x, xy(), and y.

670  {
671  double x(0), y(0);
672  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
673  auto itr = hgpar_->typesInLayers_.find(indx);
674  int type = ((itr == hgpar_->typesInLayers_.end()) ? 2 : hgpar_->waferTypeL_[itr->second]);
675  bool rotx =
677 #ifdef EDM_ML_DEBUG
678  if (debug) {
679  edm::LogVerbatim("HGCalGeom") << "LocateCell " << lay << ":" << (lay - hgpar_->firstLayer_) << ":" << rotx << ":"
680  << waferU << ":" << waferV << ":" << indx << ":"
681  << (itr == hgpar_->typesInLayers_.end()) << ":" << type << " Flags " << reco << ":"
682  << all;
683  }
684 #endif
685  int kndx = cellV * 100 + cellU;
686  if (type == 0) {
687  auto ktr = hgpar_->cellFineIndex_.find(kndx);
688  if (ktr != hgpar_->cellFineIndex_.end()) {
689  x = hgpar_->cellFineX_[ktr->second];
690  y = hgpar_->cellFineY_[ktr->second];
691  }
692 #ifdef EDM_ML_DEBUG
693  if (debug)
694  edm::LogVerbatim("HGCalGeom") << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
695  << (ktr != hgpar_->cellFineIndex_.end());
696 #endif
697  } else {
698  auto ktr = hgpar_->cellCoarseIndex_.find(kndx);
699  if (ktr != hgpar_->cellCoarseIndex_.end()) {
700  x = hgpar_->cellCoarseX_[ktr->second];
701  y = hgpar_->cellCoarseY_[ktr->second];
702  }
703 #ifdef EDM_ML_DEBUG
704  if (debug)
705  edm::LogVerbatim("HGCalGeom") << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":" << y << ":"
706  << (ktr != hgpar_->cellCoarseIndex_.end());
707 #endif
708  }
709  if (!reco) {
712  }
713  if (all) {
714  const auto& xy = waferPositionNoRot(lay, waferU, waferV, reco, debug);
715  x += xy.first;
716  y += xy.second;
717 #ifdef EDM_ML_DEBUG
718  if (debug)
719  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << " by addong " << xy.first << ":" << xy.second;
720 #endif
721  }
722  return (rotx ? getXY(lay, x, y, false) : std::make_pair(x, y));
723 }
Log< level::Info, true > LogVerbatim
wafer_map cellFineIndex_
int32_t waferU(const int32_t index)
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
std::vector< int > layerType_
def all
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
Basic2DVector< T > xy() const
static constexpr double k_ScaleToDDD
#define debug
Definition: HDRShower.cc:19
wafer_map cellCoarseIndex_
std::vector< double > cellFineX_
wafer_map typesInLayers_
int32_t waferV(const int32_t index)
std::vector< double > cellCoarseY_
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug=false) const
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
std::pair< float, float > HGCalDDDConstants::locateCell ( const HGCSiliconDetId id,
bool  debug = false 
) const

Definition at line 725 of file HGCalDDDConstants.cc.

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

725  {
726  int lay(id.layer());
727  double r = 0.5 * (hgpar_->waferSize_ + hgpar_->sensorSeparation_);
728  double R = 2.0 * r / sqrt3_;
729  int ncells = (id.type() == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
730  int n2 = ncells / 2;
731  auto xyoff = geomTools_.shiftXY(hgpar_->layerCenter_[lay - 1], (2.0 * r));
732  double xpos = xyoff.first + ((-2 * id.waferU() + id.waferV()) * r);
733  double ypos = xyoff.second + (1.5 * id.waferV() * R);
734 #ifdef EDM_ML_DEBUG
735  if (debug)
736  edm::LogVerbatim("HGCalGeom") << "LocateCell " << id << " Lay " << lay << " r:R " << r << ":" << R << " N "
737  << ncells << ":" << n2 << " Off " << xyoff.first << ":" << xyoff.second << " Pos "
738  << xpos << ":" << ypos;
739 #endif
740  double R1 = hgpar_->waferSize_ / (3.0 * ncells);
741  double r1 = 0.5 * R1 * sqrt3_;
742  xpos += ((1.5 * (id.cellV() - ncells) + 1.0) * R1);
743  ypos += ((id.cellU() - 0.5 * id.cellV() - n2) * 2 * r1);
744 #ifdef EDM_ML_DEBUG
745  if (debug)
746  edm::LogVerbatim("HGCalGeom") << "LocateCell r1:R1 " << r1 << ":" << R1 << " dx:dy "
747  << ((1.5 * (id.cellV() - ncells) + 1.0) * R1) << ":"
748  << ((id.cellU() - 0.5 * id.cellV() - n2) * 2 * r1) << " Pos " << xpos << ":" << ypos;
749 #endif
750  std::pair<double, double> xy = getXY(id.layer(), xpos, ypos, true);
751  return std::make_pair(xy.first * id.zside(), xy.second);
752 }
Log< level::Info, true > LogVerbatim
constexpr std::array< uint8_t, layerIndexSize > layer
HGCalGeomTools geomTools_
std::pair< double, double > shiftXY(int waferPosition, double waferSize) const
std::vector< int > layerCenter_
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
Basic2DVector< T > xy() const
#define debug
Definition: HDRShower.cc:19
const HGCalParameters * hgpar_
std::pair< float, float > HGCalDDDConstants::locateCell ( const HGCScintillatorDetId id,
bool  debug = false 
) const

Definition at line 754 of file HGCalDDDConstants.cc.

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

754  {
755  int lay(id.layer()), iphi(id.iphi()), ir(id.iradiusAbs());
756  double phi = (iphi - 0.5) * hgpar_->scintCellSize(lay);
757  int type = (id.type() > 0) ? 1 : 0;
758  double r = (((ir + 1) < static_cast<int>(hgpar_->radiusLayer_[type].size()))
759  ? (0.5 * (hgpar_->radiusLayer_[type][ir] + hgpar_->radiusLayer_[type][ir - 1]))
760  : (1.5 * hgpar_->radiusLayer_[type][ir] - 0.5 * hgpar_->radiusLayer_[type][ir - 1]));
761 #ifdef EDM_ML_DEBUG
762  if (debug)
763  edm::LogVerbatim("HGCalGeom") << "LocateCell lay:ir:iphi:type " << lay << ":" << ir << ":" << iphi << ":" << type
764  << " r:phi " << r << ":" << convertRadToDeg(phi) << " x:y "
765  << (r * cos(phi) * id.zside()) << ":" << (r * sin(phi));
766 #endif
767  return std::make_pair(r * cos(phi) * id.zside(), r * sin(phi));
768 }
Log< level::Info, true > LogVerbatim
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
int zside(DetId const &)
double scintCellSize(const int layer) const
constexpr std::array< uint8_t, layerIndexSize > layer
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
#define debug
Definition: HDRShower.cc:19
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
std::pair< float, float > HGCalDDDConstants::locateCellHex ( int  cell,
int  wafer,
bool  reco 
) const

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

770  {
771  float x(0), y(0);
772  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine) {
773  x = hgpar_->cellFineX_[cell];
774  y = hgpar_->cellFineY_[cell];
775  } else {
776  x = hgpar_->cellCoarseX_[cell];
777  y = hgpar_->cellCoarseY_[cell];
778  }
779  if (!reco) {
782  }
783  return std::make_pair(x, y);
784 }
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
static constexpr double k_ScaleToDDD
std::vector< double > cellFineX_
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::pair< float, float > HGCalDDDConstants::locateCellTrap ( int  lay,
int  ieta,
int  iphi,
bool  reco 
) const

Definition at line 786 of file HGCalDDDConstants.cc.

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

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

786  {
787  float x(0), y(0);
788  const auto& indx = getIndex(lay, reco);
789  if (indx.first >= 0) {
790  int ir = std::abs(irad);
791  int type = hgpar_->scintType(lay);
792  double phi = (iphi - 0.5) * indx.second;
793  double z = hgpar_->zLayerHex_[indx.first];
794  double r = 0.5 * (hgpar_->radiusLayer_[type][ir - 1] + hgpar_->radiusLayer_[type][ir]);
795  std::pair<double, double> range = rangeR(z, true);
796 #ifdef EDM_ML_DEBUG
797  edm::LogVerbatim("HGCalGeom") << "locateCellTrap:: Input " << lay << ":" << irad << ":" << iphi << ":" << reco
798  << " IR " << ir << ":" << hgpar_->iradMinBH_[indx.first] << ":"
799  << hgpar_->iradMaxBH_[indx.first] << " Type " << type << " Z " << indx.first << ":"
800  << z << " phi " << phi << " R " << r << ":" << range.first << ":" << range.second;
801 #endif
803  r = std::max(range.first, std::min(r, range.second));
804  x = r * std::cos(phi);
805  y = r * std::sin(phi);
806  if (irad < 0)
807  x = -x;
808  }
809  if (!reco) {
812  }
813  return std::make_pair(x, y);
814 }
std::vector< int > iradMaxBH_
Log< level::Info, true > LogVerbatim
int scintType(const int layer) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const uint16_t range(const Frame &aFrame)
std::pair< double, double > rangeR(double z, bool reco) const
std::pair< int, float > getIndex(int lay, bool reco) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< double > zLayerHex_
static constexpr double k_ScaleToDDD
std::vector< int > iradMinBH_
const HGCalGeometryMode::GeometryMode mode_
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
bool HGCalDDDConstants::maskCell ( const DetId id,
int  corners 
) const

Definition at line 816 of file HGCalDDDConstants.cc.

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

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

816  {
817  bool mask(false);
818  if (corners > 2 && corners <= (int)(HGCalParameters::k_CornerSize)) {
819  if (waferHexagon8()) {
820  int N(0), layer(0), waferU(0), waferV(0), u(0), v(0);
821  if (detId.det() == DetId::Forward) {
822  HFNoseDetId id(detId);
823  N = getUVMax(id.type());
824  layer = id.layer();
825  waferU = id.waferU();
826  waferV = id.waferV();
827  u = id.cellU();
828  v = id.cellV();
829  } else {
830  HGCSiliconDetId id(detId);
831  N = getUVMax(id.type());
832  layer = id.layer();
833  waferU = id.waferU();
834  waferV = id.waferV();
835  u = id.cellU();
836  v = id.cellV();
837  }
839  auto itr = hgpar_->waferTypes_.find(wl);
840 #ifdef EDM_ML_DEBUG
841  edm::LogVerbatim("HGCalGeom") << "MaskCell: Layer " << layer << " Wafer " << waferU << ":" << waferV << " Index "
842  << wl << ":" << (itr != hgpar_->waferTypes_.end());
843 #endif
844  if (itr != hgpar_->waferTypes_.end()) {
845  if ((itr->second).second <= HGCalWaferMask::k_OffsetRotation)
846  mask = HGCalWaferMask::maskCell(u, v, N, (itr->second).first, (itr->second).second, corners);
847  else
848  mask = !(HGCalWaferMask::goodCell(
849  u, v, N, (itr->second).first, ((itr->second).second - HGCalWaferMask::k_OffsetRotation)));
850  }
851  }
852  }
853  return mask;
854 }
Log< level::Info, true > LogVerbatim
uint16_t *__restrict__ id
int32_t waferU(const int32_t index)
static bool goodCell(int u, int v, int N, int type, int rotn)
static constexpr uint32_t k_CornerSize
constexpr std::array< uint8_t, layerIndexSize > layer
U second(std::pair< T, U > const &p)
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
waferT_map waferTypes_
#define N
Definition: blowfish.cc:9
static constexpr int k_OffsetRotation
int32_t waferV(const int32_t index)
bool waferHexagon8() const
const HGCalParameters * hgpar_
int getUVMax(int type) const
static bool maskCell(int u, int v, int N, int ncor, int fcor, int corners)
int HGCalDDDConstants::maxCells ( bool  reco) const

Definition at line 856 of file HGCalDDDConstants.cc.

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

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

856  {
857  int cells(0);
858  for (unsigned int i = 0; i < layers(reco); ++i) {
859  int lay = reco ? hgpar_->depth_[i] : hgpar_->layer_[i];
860  if (cells < maxCells(lay, reco))
861  cells = maxCells(lay, reco);
862  }
863  return cells;
864 }
std::vector< int > layer_
std::vector< int > depth_
unsigned int layers(bool reco) const
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
const HGCalParameters * hgpar_
int maxCells(bool reco) const
int HGCalDDDConstants::maxCells ( int  lay,
bool  reco 
) const

Definition at line 866 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, cells, HGCalParameters::defineFull_, HGCalParameters::firstLayer_, getIndex(), HGCSiliconDetId::HGCalCoarseThick, HGCSiliconDetId::HGCalFine, hgpar_, isotrackApplyRegressor::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().

866  {
867  const auto& index = getIndex(lay, reco);
868  if (index.first < 0)
869  return 0;
870  if (waferHexagon6()) {
871  unsigned int cells(0);
872  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
873  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
874  unsigned int cell = (hgpar_->waferTypeT_[k] - 1 == HGCSiliconDetId::HGCalFine) ? (hgpar_->cellFineX_.size())
875  : (hgpar_->cellCoarseX_.size());
876  if (cell > cells)
877  cells = cell;
878  }
879  }
880  return (int)(cells);
881  } else if (waferHexagon8()) {
882  int cells(0);
883  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
884  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
888  : hgpar_->waferTypeL_[itr->second]);
890  cells = std::max(cells, 3 * N * N);
891  }
892  }
893  return cells;
894  } else if (tileTrapezoid()) {
895  return hgpar_->scintCells(index.first + hgpar_->firstLayer_);
896  } else {
897  return 0;
898  }
899 }
bool waferHexagon6() const
int32_t waferU(const int32_t index)
bool waferInLayerTest(int wafer, int lay, bool full) const
std::vector< double > cellCoarseX_
std::pair< int, float > getIndex(int lay, bool reco) const
bool tileTrapezoid() const
int scintCells(const int layer) 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_
int32_t waferV(const int32_t index)
std::vector< int > waferCopy_
bool waferHexagon8() const
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
int HGCalDDDConstants::maxCellUV ( ) const
inline

Definition at line 95 of file HGCalDDDConstants.h.

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

Referenced by HGCalTopology::HGCalTopology().

95 { return (tileTrapezoid() ? hgpar_->nCellsFine_ : 2 * hgpar_->nCellsFine_); }
bool tileTrapezoid() const
const HGCalParameters * hgpar_
int HGCalDDDConstants::maxModules ( ) const
inline

Definition at line 98 of file HGCalDDDConstants.h.

References modHalf_.

98 { return modHalf_; }
int HGCalDDDConstants::maxModulesPerLayer ( ) const
inline

Definition at line 99 of file HGCalDDDConstants.h.

References maxWafersPerLayer_.

99 { return maxWafersPerLayer_; }
int HGCalDDDConstants::maxRows ( int  lay,
bool  reco 
) const

Definition at line 901 of file HGCalDDDConstants.cc.

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

901  {
902  int kymax(0);
903  const auto& index = getIndex(lay, reco);
904  int i = index.first;
905  if (i < 0)
906  return kymax;
907  if (waferHexagon6()) {
908  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
909  if (waferInLayerTest(k, i, hgpar_->defineFull_)) {
910  int ky = ((hgpar_->waferCopy_[k]) / 100) % 100;
911  if (ky > kymax)
912  kymax = ky;
913  }
914  }
915  } else if (waferHexagon8()) {
916  kymax = 1 + 2 * hgpar_->waferUVMaxLayer_[index.first];
917  }
918  return kymax;
919 }
bool waferHexagon6() const
bool waferInLayerTest(int wafer, int lay, bool full) const
std::vector< int > waferUVMaxLayer_
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< int > waferCopy_
bool waferHexagon8() const
const HGCalParameters * hgpar_
double HGCalDDDConstants::minSlope ( ) const
inline

Definition at line 101 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::slopeMin_.

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

101 { return hgpar_->slopeMin_[0]; }
std::vector< double > slopeMin_
const HGCalParameters * hgpar_
int HGCalDDDConstants::modifyUV ( int  uv,
int  type1,
int  type2 
) const

Definition at line 921 of file HGCalDDDConstants.cc.

Referenced by HGCalTopology::neighbors().

921  {
922  // Modify u/v for transition of type1 to type2
923  return (((type1 == type2) || (type1 * type2 != 0)) ? uv : ((type1 == 0) ? (2 * uv + 1) / 3 : (3 * uv) / 2));
924 }
int HGCalDDDConstants::modules ( int  lay,
bool  reco 
) const

Definition at line 926 of file HGCalDDDConstants.cc.

References first, getIndex(), and max_modules_layer_.

Referenced by wafers().

926  {
927  if (getIndex(lay, reco).first < 0)
928  return 0;
929  else
930  return max_modules_layer_[(int)reco][lay];
931 }
Simrecovecs max_modules_layer_
std::pair< int, float > getIndex(int lay, bool reco) const
int HGCalDDDConstants::modulesInit ( int  lay,
bool  reco 
) const

Definition at line 933 of file HGCalDDDConstants.cc.

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

Referenced by HGCalDDDConstants().

933  {
934  int nmod(0);
935  const auto& index = getIndex(lay, reco);
936  if (index.first < 0)
937  return nmod;
938  if (!tileTrapezoid()) {
939  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
940  if (waferInLayerTest(k, index.first, hgpar_->defineFull_))
941  ++nmod;
942  }
943  } else {
944  nmod = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
945  }
946  return nmod;
947 }
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_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
double HGCalDDDConstants::mouseBite ( bool  reco) const
int HGCalDDDConstants::numberCells ( bool  reco) const

Definition at line 953 of file HGCalDDDConstants.cc.

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

Referenced by HGCalTopology::allGeomModules().

953  {
954  int cells =
956  if (cells == 0) {
957  unsigned int nlayer = (reco) ? hgpar_->depth_.size() : hgpar_->layer_.size();
958  for (unsigned k = 0; k < nlayer; ++k) {
959  std::vector<int> ncells = numberCells(((reco) ? hgpar_->depth_[k] : hgpar_->layer_[k]), reco);
960  cells = std::accumulate(ncells.begin(), ncells.end(), cells);
961  }
962  }
963  return cells;
964 }
std::vector< int > layer_
std::vector< int > depth_
static constexpr int scintillatorFile
bool tileTrapezoid() const
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
int numberCells(bool reco) const
int tileCount(int layer, int ring) const
const HGCalParameters * hgpar_
std::vector< int > HGCalDDDConstants::numberCells ( int  lay,
bool  reco 
) const

Definition at line 966 of file HGCalDDDConstants.cc.

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

966  {
967  const auto& index = getIndex(lay, reco);
968  int i = index.first;
969  std::vector<int> ncell;
970  if (i >= 0) {
971  if (waferHexagon6()) {
972  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
973  if (waferInLayerTest(k, i, hgpar_->defineFull_)) {
974  unsigned int cell = (hgpar_->waferTypeT_[k] - 1 == HGCSiliconDetId::HGCalFine)
975  ? (hgpar_->cellFineX_.size())
976  : (hgpar_->cellCoarseX_.size());
977  ncell.emplace_back((int)(cell));
978  }
979  }
980  } else if (tileTrapezoid()) {
981  int nphi = hgpar_->scintCells(lay);
982  for (int k = hgpar_->firstModule_[i]; k <= hgpar_->lastModule_[i]; ++k)
983  ncell.emplace_back(nphi);
984  } else {
985  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
986  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
987  int cell = numberCellsHexagon(lay,
990  true);
991  ncell.emplace_back(cell);
992  }
993  }
994  }
995  }
996  return ncell;
997 }
const int nphi
bool waferHexagon6() const
int32_t waferU(const int32_t index)
bool waferInLayerTest(int wafer, int lay, bool full) const
std::vector< double > cellCoarseX_
std::vector< int > firstModule_
int numberCellsHexagon(int wafer) const
std::pair< int, float > getIndex(int lay, bool reco) const
bool tileTrapezoid() const
int scintCells(const int layer) const
std::vector< double > cellFineX_
int32_t waferV(const int32_t index)
std::vector< int > waferCopy_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
int HGCalDDDConstants::numberCellsHexagon ( int  wafer) const

Definition at line 999 of file HGCalDDDConstants.cc.

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

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

999  {
1000  if (wafer >= 0 && wafer < (int)(hgpar_->waferTypeT_.size())) {
1001  if (hgpar_->waferTypeT_[wafer] - 1 == HGCSiliconDetId::HGCalFine)
1002  return (int)(hgpar_->cellFineX_.size());
1003  else
1004  return (int)(hgpar_->cellCoarseX_.size());
1005  } else {
1006  return 0;
1007  }
1008 }
std::vector< double > cellCoarseX_
std::vector< double > cellFineX_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
int HGCalDDDConstants::numberCellsHexagon ( int  lay,
int  waferU,
int  waferV,
bool  flag 
) const

Definition at line 1010 of file HGCalDDDConstants.cc.

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

1010  {
1012  int type =
1013  ((itr == hgpar_->typesInLayers_.end()) ? HGCSiliconDetId::HGCalCoarseThick : hgpar_->waferTypeL_[itr->second]);
1014  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1015  if (flag)
1016  return (3 * N * N);
1017  else
1018  return N;
1019 }
int32_t waferU(const int32_t index)
if(conf_.getParameter< bool >("UseStripCablingDB"))
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_
std::pair< double, double > HGCalDDDConstants::rangeR ( double  z,
bool  reco 
) const

Definition at line 1021 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_, HGCalParameters::zFrontMin_, HGCalParameters::zFrontTop_, and HGCalParameters::zLayerHex_.

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

1021  {
1022  double rmin(0), rmax(0), zz(0);
1023  if (hgpar_->detectorType_ > 0) {
1024  zz = (reco ? std::abs(z) : HGCalParameters::k_ScaleFromDDD * std::abs(z));
1025  if (hgpar_->detectorType_ <= 2) {
1027  } else {
1028  rmin = HGCalGeomTools::radius(
1030  }
1031  if ((hgpar_->detectorType_ == 2) && (zz >= hgpar_->zLayerHex_[hgpar_->firstMixedLayer_ - 1])) {
1032  rmax = HGCalGeomTools::radius(
1034  } else {
1036  }
1037  }
1038  if (!reco) {
1041  }
1042 #ifdef EDM_ML_DEBUG
1043  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << z << ":" << zz << " R " << rmin << ":" << rmax;
1044 #endif
1045  return std::make_pair(rmin, rmax);
1046 }
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_
std::vector< double > zFrontTop_
const HGCalParameters * hgpar_
std::pair< double, double > HGCalDDDConstants::rangeRLayer ( int  lay,
bool  reco 
) const

Definition at line 1048 of file HGCalDDDConstants.cc.

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

1048  {
1049  double rmin(0), rmax(0);
1050  const auto& index = getIndex(lay, reco);
1051  if (index.first >= 0 && index.first < static_cast<int>(hgpar_->rMinLayHex_.size())) {
1052  rmin = hgpar_->rMinLayHex_[index.first];
1053  rmax = hgpar_->rMaxLayHex_[index.first];
1054  }
1055  if (!reco) {
1058  }
1059 #ifdef EDM_ML_DEBUG
1060  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << lay << ":" << index.first << " R " << rmin << ":"
1061  << rmax;
1062 #endif
1063  return std::make_pair(rmin, rmax);
1064 }
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
const HGCalParameters * hgpar_
std::pair< double, double > HGCalDDDConstants::rangeZ ( bool  reco) const

Definition at line 1066 of file HGCalDDDConstants.cc.

References hgpar_, HGCalParameters::k_ScaleToDDD, HGCalParameters::waferThick_, and HGCalParameters::zLayerHex_.

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

1066  {
1067  double zmin = (hgpar_->zLayerHex_[0] - hgpar_->waferThick_);
1068  double zmax = (hgpar_->zLayerHex_[hgpar_->zLayerHex_.size() - 1] + hgpar_->waferThick_);
1069 #ifdef EDM_ML_DEBUG
1070  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeZ: " << zmin << ":" << zmax << ":" << hgpar_->waferThick_;
1071 #endif
1072  if (!reco) {
1075  }
1076  return std::make_pair(zmin, zmax);
1077 }
Log< level::Info, true > LogVerbatim
std::vector< double > zLayerHex_
static constexpr double k_ScaleToDDD
const HGCalParameters * hgpar_
std::pair< int, int > HGCalDDDConstants::rowColumnWafer ( const int  wafer) const

Definition at line 1079 of file HGCalDDDConstants.cc.

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

1079  {
1080  int row(0), col(0);
1081  if (wafer < (int)(hgpar_->waferCopy_.size())) {
1082  int copy = hgpar_->waferCopy_[wafer];
1083  col = HGCalTypes::getUnpackedU(copy);
1084  row = HGCalTypes::getUnpackedV(copy);
1085  ;
1086  }
1087  return std::make_pair(row, col);
1088 }
static int32_t getUnpackedU(int id)
Definition: HGCalTypes.cc:16
static int32_t getUnpackedV(int id)
Definition: HGCalTypes.cc:22
std::vector< int > waferCopy_
int col
Definition: cuy.py:1009
const HGCalParameters * hgpar_
int HGCalDDDConstants::sectors ( ) const
inline
std::pair< int, int > HGCalDDDConstants::simToReco ( int  cell,
int  layer,
int  mod,
bool  half 
) const

Definition at line 1090 of file HGCalDDDConstants.cc.

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

1090  {
1091  if (!waferHexagon6()) {
1092  return std::make_pair(cell, lay);
1093  } else {
1094  const auto& index = getIndex(lay, false);
1095  int i = index.first;
1096  if (i < 0) {
1097  edm::LogWarning("HGCalGeom") << "Wrong Layer # " << lay << " not in the list ***** ERROR *****";
1098  return std::make_pair(-1, -1);
1099  }
1100  if (mod >= (int)(hgpar_->waferTypeL_).size()) {
1101  edm::LogWarning("HGCalGeom") << "Invalid Wafer # " << mod << "should be < " << (hgpar_->waferTypeL_).size()
1102  << " ***** ERROR *****";
1103  return std::make_pair(-1, -1);
1104  }
1105  int depth(-1);
1106  int kx = cell;
1107  int type = hgpar_->waferTypeL_[mod];
1108  if (type == 1) {
1109  depth = hgpar_->layerGroup_[i];
1110  } else if (type == 2) {
1111  depth = hgpar_->layerGroupM_[i];
1112  } else {
1113  depth = hgpar_->layerGroupO_[i];
1114  }
1115  return std::make_pair(kx, depth);
1116  }
1117 }
bool waferHexagon6() const
std::vector< int > layerGroupM_
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_
tuple size
Write out results.
int HGCalDDDConstants::tileCount ( int  layer,
int  ring 
) const

Definition at line 1119 of file HGCalDDDConstants.cc.

References b, HGCalParameters::firstLayer_, hgpar_, isotrackApplyRegressor::k, lastLayer(), HGCalTileIndex::tileIndex(), HGCalParameters::tileInfoMap_, and HGCalParameters::tileRingRange_.

Referenced by numberCells().

1119  {
1120  int laymin(layer), laymax(layer), ringmin(ring), ringmax(ring), kount(0);
1121  if (layer == 0) {
1122  laymin = hgpar_->firstLayer_;
1123  laymax = lastLayer(true);
1124  }
1125  for (int lay = laymin; lay <= laymax; ++lay) {
1126  if (ring < 0) {
1127  int ll = lay - hgpar_->firstLayer_;
1128  ringmin = hgpar_->tileRingRange_[ll].first;
1129  ringmax = hgpar_->tileRingRange_[ll].second;
1130  }
1131  for (int rin = ringmin; rin <= ringmax; ++rin) {
1132  int indx = HGCalTileIndex::tileIndex(lay, rin + 1, 0);
1133  auto itr = hgpar_->tileInfoMap_.find(indx);
1134  if (itr != hgpar_->tileInfoMap_.end()) {
1135  for (int k = 0; k < 4; ++k) {
1136  std::bitset<24> b(itr->second.hex[k]);
1137  kount += b.count();
1138  }
1139  }
1140  }
1141  }
1142  return (3 * kount);
1143 }
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_
bool HGCalDDDConstants::tileExist ( int  zside,
int  layer,
int  ring,
int  phi 
) const
inline

Definition at line 117 of file HGCalDDDConstants.h.

References hgpar_, convertSQLiteXML::ok, HGCalTileIndex::tileExist(), HGCalTileIndex::tileIndex(), and HGCalParameters::tileInfoMap_.

Referenced by HGCalGeometryLoader::build().

117  {
118  int indx = HGCalTileIndex::tileIndex(layer, ring, 0);
119  auto itr = hgpar_->tileInfoMap_.find(indx);
120  bool ok = (itr == hgpar_->tileInfoMap_.end()) ? false : HGCalTileIndex::tileExist(itr->second.hex, zside, phi);
121  return ok;
122  }
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_
std::pair<int, int> HGCalDDDConstants::tileRings ( int  layer) const
inline

Definition at line 123 of file HGCalDDDConstants.h.

References HGCalParameters::firstLayer_, hgpar_, mode_, HGCalParameters::tileRingRange_, and HGCalGeometryMode::TrapezoidFile.

123  {
125  int ll = layer - hgpar_->firstLayer_;
126  if (ll >= 0 && ll < static_cast<int>(hgpar_->tileRingRange_.size()))
127  return hgpar_->tileRingRange_[ll];
128  }
129  return std::make_pair(0, 0);
130  }
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< std::pair< int, int > > tileRingRange_
const HGCalGeometryMode::GeometryMode mode_
const HGCalParameters * hgpar_
int HGCalDDDConstants::tileSiPM ( int  sipm) const
inline
bool HGCalDDDConstants::tileTrapezoid ( ) const
inline
std::pair<int, int> HGCalDDDConstants::tileType ( int  layer,
int  ring,
int  phi 
) const
inline

Definition at line 136 of file HGCalDDDConstants.h.

References hgpar_, HGCalTypes::SiPMLarge, HGCalTileIndex::tileIndex(), and HGCalParameters::tileInfoMap_.

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

136  {
137  int indx = HGCalTileIndex::tileIndex(layer, ring, phi);
138  int type(-1), sipm(-1);
139  auto itr = hgpar_->tileInfoMap_.find(indx);
140  if (itr != hgpar_->tileInfoMap_.end()) {
141  type = 1 + (itr->second).type;
142  sipm = ((itr->second).sipm == HGCalTypes::SiPMLarge) ? 0 : 1;
143  }
144  return std::make_pair(type, sipm);
145  }
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_
unsigned int HGCalDDDConstants::volumes ( ) const
inline

Definition at line 146 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::moduleLayR_.

Referenced by HGCalGeometryLoader::build().

146 { return hgpar_->moduleLayR_.size(); }
std::vector< int > moduleLayR_
const HGCalParameters * hgpar_
int HGCalDDDConstants::waferCount ( const int  type) const
inline

Definition at line 169 of file HGCalDDDConstants.h.

References waferMax_.

169 { return ((type == 0) ? waferMax_[2] : waferMax_[3]); }
std::array< int, 4 > waferMax_
int HGCalDDDConstants::waferFileIndex ( unsigned int  kk) const
inline

Definition at line 176 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferInfoMap_.

176  {
177  if (kk < hgpar_->waferInfoMap_.size()) {
178  auto itr = hgpar_->waferInfoMap_.begin();
179  std::advance(itr, kk);
180  return itr->first;
181  } else
182  return 0;
183  }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
std::tuple<int, int, int> HGCalDDDConstants::waferFileInfo ( unsigned int  kk) const
inline

Definition at line 184 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferInfoMap_.

184  {
185  if (kk < hgpar_->waferInfoMap_.size()) {
186  auto itr = hgpar_->waferInfoMap_.begin();
187  std::advance(itr, kk);
188  return std::make_tuple(itr->second.type, itr->second.part, itr->second.orient);
189  } else
190  return std::make_tuple(0, 0, 0);
191  }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
bool HGCalDDDConstants::waferFileInfoExist ( int  kk) const
inline

Definition at line 199 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferInfoMap_.

199 { return (hgpar_->waferInfoMap_.find(kk) != hgpar_->waferInfoMap_.end()); }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
std::tuple<int, int, int> HGCalDDDConstants::waferFileInfoFromIndex ( int  kk) const
inline

Definition at line 192 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferInfoMap_.

192  {
193  auto itr = hgpar_->waferInfoMap_.find(kk);
194  if (itr != hgpar_->waferInfoMap_.end()) {
195  return std::make_tuple(itr->second.type, itr->second.part, itr->second.orient);
196  } else
197  return std::make_tuple(0, 0, 0);
198  }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
unsigned int HGCalDDDConstants::waferFileSize ( ) const
inline

Definition at line 175 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferInfoMap_.

Referenced by waferType(), and waferTypeRotation().

175 { return hgpar_->waferInfoMap_.size(); }
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
int HGCalDDDConstants::waferFromCopy ( int  copy) const

Definition at line 1145 of file HGCalDDDConstants.cc.

References hgpar_, isotrackApplyRegressor::k, mps_fire::result, and HGCalParameters::waferCopy_.

Referenced by HGCNumberingScheme::getUnitID().

1145  {
1146  const int ncopies = hgpar_->waferCopy_.size();
1147  int wafer(ncopies);
1148  bool result(false);
1149  for (int k = 0; k < ncopies; ++k) {
1150  if (copy == hgpar_->waferCopy_[k]) {
1151  wafer = k;
1152  result = true;
1153  break;
1154  }
1155  }
1156  if (!result) {
1157  wafer = -1;
1158 #ifdef EDM_ML_DEBUG
1159  edm::LogVerbatim("HGCalGeom") << "Cannot find " << copy << " in a list of " << ncopies << " members";
1160  for (int k = 0; k < ncopies; ++k)
1161  edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << hgpar_->waferCopy_[k];
1162 #endif
1163  }
1164 #ifdef EDM_ML_DEBUG
1165  edm::LogVerbatim("HGCalGeom") << "WaferFromCopy " << copy << ":" << wafer << ":" << result;
1166 #endif
1167  return wafer;
1168 }
Log< level::Info, true > LogVerbatim
tuple result
Definition: mps_fire.py:311
std::vector< int > waferCopy_
const HGCalParameters * hgpar_
void HGCalDDDConstants::waferFromPosition ( const double  x,
const double  y,
int &  wafer,
int &  icell,
int &  celltyp 
) const

Definition at line 1170 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_, isotrackApplyRegressor::k, HGCalParameters::k_ScaleFromDDD, rmax_, tan30deg_, HGCalParameters::waferCopy_, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferTypeT_, x, and y.

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

1170  {
1171  // Input x, y in Geant4 unit and transformed to CMSSW standard
1172  double xx = HGCalParameters::k_ScaleFromDDD * x;
1173  double yy = HGCalParameters::k_ScaleFromDDD * y;
1174  int size_ = static_cast<int>(hgpar_->waferCopy_.size());
1175  wafer = size_;
1176  for (int k = 0; k < size_; ++k) {
1177  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1178  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1179  if (dx <= rmax_ && dy <= hexside_) {
1180  if ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy))) {
1181  wafer = k;
1182  celltyp = hgpar_->waferTypeT_[k];
1183  xx -= hgpar_->waferPosX_[k];
1184  yy -= hgpar_->waferPosY_[k];
1185  break;
1186  }
1187  }
1188  }
1189  if (wafer < size_) {
1190  if (celltyp - 1 == HGCSiliconDetId::HGCalFine)
1191  icell = cellHex(
1193  else
1194  icell = cellHex(xx,
1195  yy,
1198  hgpar_->cellCoarseY_);
1199  } else {
1200  wafer = -1;
1201 #ifdef EDM_ML_DEBUG
1202  edm::LogWarning("HGCalGeom") << "Cannot get wafer type corresponding to " << x << ":" << y << " " << xx << ":"
1203  << yy;
1204 #endif
1205  }
1206 #ifdef EDM_ML_DEBUG
1207  edm::LogVerbatim("HGCalGeom") << "Position " << x << ":" << y << " Wafer " << wafer << ":" << size_ << " XX " << xx
1208  << ":" << yy << " Cell " << icell << " Type " << celltyp;
1209 #endif
1210 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
std::vector< double > cellFineY_
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
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_
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 1212 of file HGCalDDDConstants.cc.

References funct::abs(), cellHex(), HGCalParameters::cellThickness_, debug, PVValHelper::dx, PVValHelper::dy, HGCalParameters::firstLayer_, HGCalWaferType::getType(), getXY(), HGCalGeometryMode::Hexagon8File, HGCalGeometryMode::Hexagon8Module, hexside_, hexsideT_, HGCSiliconDetId::HGCalCoarseThick, hgpar_, isotrackApplyRegressor::k, HGCalParameters::k_ScaleFromDDD, HGCalParameters::layerType_, mode_, HGCalParameters::nCellsFine_, rmax_, rmaxT_, tan30deg_, HGCalParameters::typesInLayers_, HGCalTypes::WaferCenterR, HGCalParameters::waferCopy_, HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferThick_, HGCalParameters::waferTypeL_, HGCalWaferIndex::waferU(), HGCalParameters::waferUVMax_, HGCalWaferIndex::waferV(), HGCalParameters::xLayerHex_, xy(), and HGCalParameters::yLayerHex_.

1222  {
1223  waferU = waferV = 1 + hgpar_->waferUVMax_;
1224  cellU = cellV = celltype = 0;
1225  if ((hgpar_->xLayerHex_.empty()) || (hgpar_->yLayerHex_.empty()))
1226  return;
1227  int ll = layer - hgpar_->firstLayer_;
1228  bool rotx = ((!hgpar_->layerType_.empty()) && (hgpar_->layerType_[ll] == HGCalTypes::WaferCenterR));
1229  double xx(0), yy(0);
1230  if (rotx) {
1231  std::pair<double, double> xy =
1233  xx = xy.first - hgpar_->xLayerHex_[ll];
1234  yy = xy.second - hgpar_->yLayerHex_[ll];
1235  } else {
1238  }
1239 #ifdef EDM_ML_DEBUG
1240  if (debug)
1241  edm::LogVerbatim("HGCalGeom") << "waferFromPosition:: Layer " << layer << ":" << ll << " Rot " << rotx << " X " << x
1242  << ":" << xx << " Y " << y << ":" << yy;
1243 #endif
1244  double rmax = extend ? rmaxT_ : rmax_;
1245  double hexside = extend ? hexsideT_ : hexside_;
1246  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1247  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1248  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1249  if (dx <= rmax && dy <= hexside) {
1250  if ((dy <= 0.5 * hexside) || (dx * tan30deg_ <= (hexside - dy))) {
1255  celltype = HGCalWaferType::getType(index, hgpar_->waferInfoMap_);
1256  } else {
1258  celltype = ((itr == hgpar_->typesInLayers_.end()) ? HGCSiliconDetId::HGCalCoarseThick
1259  : hgpar_->waferTypeL_[itr->second]);
1260  }
1261 #ifdef EDM_ML_DEBUG
1262  if (debug)
1263  edm::LogVerbatim("HGCalGeom") << "WaferFromPosition:: Input " << layer << ":" << ll << ":"
1264  << hgpar_->firstLayer_ << ":" << rotx << ":" << x << ":" << y << ":"
1265  << hgpar_->xLayerHex_[ll] << ":" << hgpar_->yLayerHex_[ll] << ":" << xx << ":"
1266  << yy << " compared with " << hgpar_->waferPosX_[k] << ":"
1267  << hgpar_->waferPosY_[k] << " difference " << dx << ":" << dy << ":"
1268  << dx * tan30deg_ << ":" << (hexside_ - dy) << " comparator " << rmax_ << ":"
1269  << rmaxT_ << ":" << hexside_ << ":" << hexsideT_ << " wafer " << waferU << ":"
1270  << waferV << ":" << celltype;
1271 #endif
1272  xx -= hgpar_->waferPosX_[k];
1273  yy -= hgpar_->waferPosY_[k];
1274  break;
1275  }
1276  }
1277  }
1278  if ((std::abs(waferU) <= hgpar_->waferUVMax_) && (celltype >= 0)) {
1279  cellHex(xx, yy, celltype, cellU, cellV, extend, debug);
1280  wt = (((celltype < 2) && (mode_ != HGCalGeometryMode::Hexagon8Module))
1281  ? (hgpar_->cellThickness_[celltype] / hgpar_->waferThick_)
1282  : 1.0);
1283  } else {
1284  cellU = cellV = 2 * hgpar_->nCellsFine_;
1285  wt = 1.0;
1286  celltype = -1;
1287  }
1288  if ((celltype < 0) && debug) {
1289  double x1(xx);
1290  double y1(yy);
1291  edm::LogVerbatim("HGCalGeom") << "waferfFromPosition: Bad type for X " << x << ":" << x1 << ":" << xx << " Y " << y
1292  << ":" << y1 << ":" << yy << " Wafer " << waferU << ":" << waferV << " Cell " << cellU
1293  << ":" << cellV;
1294  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1295  double dx = std::abs(x1 - hgpar_->waferPosX_[k]);
1296  double dy = std::abs(y1 - hgpar_->waferPosY_[k]);
1297  edm::LogVerbatim("HGCalGeom") << "Wafer [" << k << "] Position (" << hgpar_->waferPosX_[k] << ", "
1298  << hgpar_->waferPosY_[k] << ") difference " << dx << ":" << dy << ":"
1299  << dx * tan30deg_ << ":" << hexside - dy << " Paramerers " << rmax << ":"
1300  << hexside;
1301  }
1302  }
1303 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
int32_t waferU(const int32_t index)
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
constexpr std::array< uint8_t, layerIndexSize > layer
int getType(double xpos, double ypos, double zpos)
std::vector< double > yLayerHex_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
std::vector< int > layerType_
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
Basic2DVector< T > xy() const
#define debug
Definition: HDRShower.cc:19
std::vector< double > cellThickness_
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_
std::vector< int > waferTypeL_
std::vector< double > xLayerHex_
bool HGCalDDDConstants::waferFullInLayer ( int  wafer,
int  lay,
bool  reco 
) const

Definition at line 1312 of file HGCalDDDConstants.cc.

References getIndex(), and waferInLayerTest().

1312  {
1313  const auto& indx = getIndex(lay, reco);
1314  if (indx.first < 0)
1315  return false;
1316  return waferInLayerTest(wafer, indx.first, false);
1317 }
bool waferInLayerTest(int wafer, int lay, bool full) const
std::pair< int, float > getIndex(int lay, bool reco) const
bool HGCalDDDConstants::waferHexagon6 ( ) const
inline
bool HGCalDDDConstants::waferHexagon8 ( ) const
inline
int32_t HGCalDDDConstants::waferIndex ( int  wafer,
int  index 
) const
private

Definition at line 1723 of file HGCalDDDConstants.cc.

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

Referenced by waferInLayerTest().

1723  {
1724  int layer = layerFromIndex(index, true);
1727  int indx = HGCalWaferIndex::waferIndex(layer, waferU, waferV);
1728 #ifdef EDM_ML_DEBUG
1729  edm::LogVerbatim("HGCalGeom") << "WaferIndex for " << wafer << ":" << index << " (" << layer << ":" << waferU << ":"
1730  << waferV << ") " << indx;
1731 #endif
1732  return indx;
1733 }
Log< level::Info, true > LogVerbatim
int32_t waferU(const int32_t index)
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_
int layerFromIndex(int index, bool reco) const
bool HGCalDDDConstants::waferInLayer ( int  wafer,
int  lay,
bool  reco 
) const

Definition at line 1305 of file HGCalDDDConstants.cc.

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

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

1305  {
1306  const auto& indx = getIndex(lay, reco);
1307  if (indx.first < 0)
1308  return false;
1309  return waferInLayerTest(wafer, indx.first, hgpar_->defineFull_);
1310 }
bool waferInLayerTest(int wafer, int lay, bool full) const
std::pair< int, float > getIndex(int lay, bool reco) const
const HGCalParameters * hgpar_
bool HGCalDDDConstants::waferInLayerTest ( int  wafer,
int  lay,
bool  full 
) const
private

Definition at line 1735 of file HGCalDDDConstants.cc.

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

1735  {
1736  bool in = (waferHexagon6()) ? true : false;
1737  if (!in) {
1738  double xpos = hgpar_->waferPosX_[wafer] + hgpar_->xLayerHex_[lay];
1739  double ypos = hgpar_->waferPosY_[wafer] + hgpar_->yLayerHex_[lay];
1740  std::pair<int, int> corner = HGCalGeomTools::waferCorner(
1741  xpos, ypos, rmax_, hexside_, hgpar_->rMinLayHex_[lay], hgpar_->rMaxLayHex_[lay], in);
1742  in = (full ? (corner.first > 0) : (corner.first == (int)(HGCalParameters::k_CornerSize)));
1743  if (in && fullAndPart_) {
1744  int indx = waferIndex(wafer, lay);
1745  in = (hgpar_->waferInfoMap_.find(indx) != hgpar_->waferInfoMap_.end());
1746 #ifdef EDM_ML_DEBUG
1747  if (!in)
1748  edm::LogVerbatim("HGCalGeom") << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " index " << indx
1749  << "( " << HGCalWaferIndex::waferLayer(indx) << ", "
1750  << HGCalWaferIndex::waferU(indx) << ", " << HGCalWaferIndex::waferV(indx)
1751  << ") in " << in;
1752 #endif
1753  }
1754 #ifdef EDM_ML_DEBUG
1755  edm::LogVerbatim("HGCalGeom") << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " R-limits "
1756  << hgpar_->rMinLayHex_[lay] << ":" << hgpar_->rMaxLayHex_[lay] << " Corners "
1757  << corner.first << ":" << corner.second << " In " << in;
1758 #endif
1759  }
1760  return in;
1761 }
std::vector< double > waferPosY_
Log< level::Info, true > LogVerbatim
bool waferHexagon6() const
int32_t waferU(const int32_t index)
int32_t waferLayer(const int32_t index)
int32_t waferIndex(int wafer, int index) 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 waferV(const int32_t index)
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::vector< double > xLayerHex_
GlobalPoint HGCalDDDConstants::waferLocal2Global ( HepGeom::Point3D< float > &  loc,
const DetId id,
bool  useWafer,
bool  reco,
bool  debug 
) const
inline

Definition at line 203 of file HGCalDDDConstants.h.

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

204  {
205  HGCSiliconDetId detid(id);
206  double x(0), y(0);
207  if (useWafer) {
208  auto xyw = waferPositionNoRot(detid.layer(), detid.waferU(), detid.waferV(), reco, debug);
209  x = xyw.first;
210  y = xyw.second;
211  }
212  auto xy = getXY(detid.layer(), (x + loc.x()), (y + loc.y()), false);
213  double zz =
214  (detid.zside() < 0) ? -(loc.z() + waferZ(detid.layer(), reco)) : (loc.z() + waferZ(detid.layer(), reco));
215  double xx = (detid.zside() < 0) ? -xy.first : xy.first;
216  return GlobalPoint(xx, xy.second, zz);
217  }
double waferZ(int layer, bool reco) const
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
Basic2DVector< T > xy() const
#define debug
Definition: HDRShower.cc:19
std::pair< double, double > waferPositionNoRot(int lay, int waferU, int waferV, bool reco, bool debug=false) const
int HGCalDDDConstants::waferMax ( ) const
inline

Definition at line 170 of file HGCalDDDConstants.h.

References waferMax_.

Referenced by HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

170 { return waferMax_[1]; }
std::array< int, 4 > waferMax_
int HGCalDDDConstants::waferMin ( ) const
inline

Definition at line 171 of file HGCalDDDConstants.h.

References waferMax_.

Referenced by HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_().

171 { return waferMax_[0]; }
std::array< int, 4 > waferMax_
std::pair< double, double > HGCalDDDConstants::waferParameters ( bool  reco) const

Definition at line 1319 of file HGCalDDDConstants.cc.

References hexside_, HGCalParameters::k_ScaleToDDD, and rmax_.

1319  {
1320  if (reco)
1321  return std::make_pair(rmax_, hexside_);
1322  else
1324 }
static constexpr double k_ScaleToDDD
std::pair< double, double > HGCalDDDConstants::waferPosition ( int  wafer,
bool  reco 
) const

Definition at line 1326 of file HGCalDDDConstants.cc.

References hgpar_, HGCalParameters::k_ScaleToDDD, HGCalParameters::waferPosX_, and HGCalParameters::waferPosY_.

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

1326  {
1327  double xx(0), yy(0);
1328  if (wafer >= 0 && wafer < (int)(hgpar_->waferPosX_.size())) {
1329  xx = hgpar_->waferPosX_[wafer];
1330  yy = hgpar_->waferPosY_[wafer];
1331  }
1332  if (!reco) {
1335  }
1336  return std::make_pair(xx, yy);
1337 }
std::vector< double > waferPosY_
static constexpr double k_ScaleToDDD
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::pair< double, double > HGCalDDDConstants::waferPosition ( int  lay,
int  waferU,
int  waferV,
bool  reco,
bool  debug = false 
) const

Definition at line 1339 of file HGCalDDDConstants.cc.

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

1340  {
1341  int ll = lay - hgpar_->firstLayer_;
1342  bool rotx = ((!hgpar_->layerType_.empty()) && (hgpar_->layerType_[ll] == HGCalTypes::WaferCenterR));
1343 #ifdef EDM_ML_DEBUG
1344  if (debug)
1345  edm::LogVerbatim("HGCalGeom") << "Layer " << lay << ":" << ll << " Rotation " << rotx << " U:V " << waferU << ":"
1346  << waferV;
1347 #endif
1348  auto xy = waferPositionNoRot(lay, waferU, waferV, reco, debug);
1349  std::pair<double, double> xy0 = (rotx) ? getXY(lay, xy.first, xy.second, false) : xy;
1350 #ifdef EDM_ML_DEBUG
1351  if (debug)
1352  edm::LogVerbatim("HGCalGeom") << "Without and with rotation " << xy.first << ":" << xy.second << ":" << xy0.first
1353  << ":" << xy0.second;
1354 #endif
1355  return xy0;
1356 }
Log< level::Info, true > LogVerbatim
int32_t waferU(const int32_t index)
std::vector< int > layerType_
std::pair< double, double > getXY(int layer, double x, double y, bool forwd) const
Basic2DVector< T > xy() const
#define debug
Definition: HDRShower.cc:19
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_
std::pair< double, double > HGCalDDDConstants::waferPosition ( int  waferU,
int  waferV,
bool  reco 
) const
private

Definition at line 1787 of file HGCalDDDConstants.cc.

References hgpar_, HGCalParameters::k_ScaleToDDD, HGCalWaferIndex::waferIndex(), HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, and HGCalParameters::wafersInLayers_.

1787  {
1788  double xx(0), yy(0);
1789  int indx = HGCalWaferIndex::waferIndex(0, waferU, waferV);
1790  auto itr = hgpar_->wafersInLayers_.find(indx);
1791  if (itr != hgpar_->wafersInLayers_.end()) {
1792  xx = hgpar_->waferPosX_[itr->second];
1793  yy = hgpar_->waferPosY_[itr->second];
1794  }
1795  if (!reco) {
1798  }
1799  return std::make_pair(xx, yy);
1800 }
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
int32_t waferV(const int32_t index)
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::pair< double, double > HGCalDDDConstants::waferPositionNoRot ( int  lay,
int  waferU,
int  waferV,
bool  reco,
bool  debug = false 
) const
private

Definition at line 1763 of file HGCalDDDConstants.cc.

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

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

1764  {
1765  int ll = lay - hgpar_->firstLayer_;
1766  double x = hgpar_->xLayerHex_[ll];
1767  double y = hgpar_->yLayerHex_[ll];
1768 #ifdef EDM_ML_DEBUG
1769  if (debug)
1770  edm::LogVerbatim("HGCalGeom") << "Layer " << lay << ":" << ll << " Shift " << hgpar_->xLayerHex_[ll] << ":"
1771  << hgpar_->yLayerHex_[ll] << " U:V " << waferU << ":" << waferV;
1772 #endif
1773  if (!reco) {
1776  }
1777  const auto& xy = waferPosition(waferU, waferV, reco);
1778  x += xy.first;
1779  y += xy.second;
1780 #ifdef EDM_ML_DEBUG
1781  if (debug)
1782  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << ":" << xy.first << ":" << xy.second;
1783 #endif
1784  return std::make_pair(x, y);
1785 }
Log< level::Info, true > LogVerbatim
int32_t waferU(const int32_t index)
std::vector< double > yLayerHex_
Basic2DVector< T > xy() const
static constexpr double k_ScaleToDDD
#define debug
Definition: HDRShower.cc:19
int32_t waferV(const int32_t index)
std::pair< double, double > waferPosition(int wafer, bool reco) const
const HGCalParameters * hgpar_
std::vector< double > xLayerHex_
int HGCalDDDConstants::wafers ( ) const

Definition at line 1511 of file HGCalDDDConstants.cc.

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

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

1511  {
1512  int wafer(0);
1513  if (!tileTrapezoid()) {
1514  for (unsigned int i = 0; i < layers(true); ++i) {
1515  int lay = hgpar_->depth_[i];
1516  wafer += modules(lay, true);
1517  }
1518  } else {
1519  wafer = (int)(hgpar_->moduleLayR_.size());
1520  }
1521  return wafer;
1522 }
std::vector< int > depth_
std::vector< int > moduleLayR_
int modules(int lay, bool reco) const
unsigned int layers(bool reco) const
bool tileTrapezoid() const
const HGCalParameters * hgpar_
int HGCalDDDConstants::wafers ( int  layer,
int  type 
) const

Definition at line 1524 of file HGCalDDDConstants.cc.

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

1524  {
1525  int wafer(0);
1526  if (!tileTrapezoid()) {
1527  auto itr = waferLayer_.find(layer);
1528  if (itr != waferLayer_.end()) {
1529  unsigned ity = (type > 0 && type <= 2) ? type : 0;
1530  wafer = (itr->second)[ity];
1531  }
1532  } else {
1533  const auto& index = getIndex(layer, true);
1534  wafer = 1 + hgpar_->lastModule_[index.first] - hgpar_->firstModule_[index.first];
1535  }
1536  return wafer;
1537 }
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_
double HGCalDDDConstants::waferSepar ( bool  reco) const
inline
double HGCalDDDConstants::waferSize ( bool  reco) const
inline
int HGCalDDDConstants::waferToCopy ( int  wafer) const
inline

Definition at line 223 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferCopy_.

223  {
224  return ((wafer >= 0) && (wafer < static_cast<int>(hgpar_->waferCopy_.size())))
225  ? hgpar_->waferCopy_[wafer]
226  : static_cast<int>(hgpar_->waferCopy_.size());
227  }
std::vector< int > waferCopy_
const HGCalParameters * hgpar_
int HGCalDDDConstants::waferType ( DetId const &  id,
bool  fromFile = false 
) const

Definition at line 1358 of file HGCalDDDConstants.cc.

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

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

1358  {
1359  int type(1);
1360  if (waferHexagon8()) {
1361  if (fromFile && (waferFileSize() > 0)) {
1362  int layer(0), waferU(0), waferV(0);
1363  if (id.det() != DetId::Forward) {
1364  HGCSiliconDetId hid(id);
1365  layer = hid.layer();
1366  waferU = hid.waferU();
1367  waferV = hid.waferV();
1368  } else {
1369  HFNoseDetId hid(id);
1370  layer = hid.layer();
1371  waferU = hid.waferU();
1372  waferV = hid.waferV();
1373  }
1375  if (itr != hgpar_->waferInfoMap_.end())
1376  type = (itr->second).type;
1377  } else {
1378  type = ((id.det() != DetId::Forward) ? HGCSiliconDetId(id).type() : HFNoseDetId(id).type());
1379  }
1380  } else if (waferHexagon6()) {
1381  type = waferTypeL(HGCalDetId(id).wafer()) - 1;
1382  }
1383  return type;
1384 }
bool waferHexagon6() const
int type() const
get the type
Definition: HFNoseDetId.h:50
int32_t waferU(const int32_t index)
unsigned int waferFileSize() const
constexpr std::array< uint8_t, layerIndexSize > layer
int type() const
get the type
int waferTypeL(int wafer) const
int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
int32_t waferV(const int32_t index)
bool waferHexagon8() const
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
int HGCalDDDConstants::waferType ( int  layer,
int  waferU,
int  waferV,
bool  fromFile = false 
) const

Definition at line 1386 of file HGCalDDDConstants.cc.

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

1386  {
1388  if (waferHexagon8()) {
1389  if (fromFile && (waferFileSize() > 0)) {
1391  if (itr != hgpar_->waferInfoMap_.end())
1392  type = (itr->second).type;
1393  } else {
1395  if (itr != hgpar_->typesInLayers_.end())
1396  type = hgpar_->waferTypeL_[itr->second];
1397  }
1398  } else if (waferHexagon6()) {
1399  if ((waferU >= 0) && (waferU < (int)(hgpar_->waferTypeL_.size())))
1400  type = (hgpar_->waferTypeL_[waferU] - 1);
1401  }
1402  return type;
1403 }
bool waferHexagon6() const
int32_t waferU(const int32_t index)
unsigned int waferFileSize() 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)
bool waferHexagon8() const
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
std::tuple< int, int, int > HGCalDDDConstants::waferType ( HGCSiliconDetId const &  id,
bool  fromFile = false 
) const

Definition at line 1405 of file HGCalDDDConstants.cc.

References first, hgpar_, HGCalGeomTools::k_allCorners, HGCalGeomTools::k_fiveCorners, HGCalGeomTools::k_fourCorners, HGCalWaferMask::k_OffsetRotation, HGCalGeomTools::k_threeCorners, phase1PixelTopology::layer, 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().

1405  {
1406  const auto& index = HGCalWaferIndex::waferIndex(id.layer(), id.waferU(), id.waferV());
1407  int type(-1), part(-1), orient(-1);
1408  if (fromFile && (waferFileSize() > 0)) {
1409  auto itr = hgpar_->waferInfoMap_.find(index);
1410  if (itr != hgpar_->waferInfoMap_.end()) {
1411  type = (itr->second).type;
1412  part = (itr->second).part;
1413  orient = (itr->second).orient;
1414  }
1415  } else {
1416  auto ktr = hgpar_->typesInLayers_.find(index);
1417  if (ktr != hgpar_->typesInLayers_.end())
1418  type = hgpar_->waferTypeL_[ktr->second];
1419  auto itr = hgpar_->waferTypes_.find(index);
1420  if (itr != hgpar_->waferTypes_.end()) {
1421  if ((itr->second).second < HGCalWaferMask::k_OffsetRotation) {
1422  orient = (itr->second).second;
1423  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1425  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1427  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1429  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1431  }
1432  } else {
1433  part = (itr->second).first;
1434  orient = ((itr->second).second - HGCalWaferMask::k_OffsetRotation);
1435  }
1436  } else {
1438  orient = 0;
1439  }
1440  }
1441  return std::make_tuple(type, part, orient);
1442 }
static constexpr int k_fourCorners
int32_t waferU(const int32_t index)
unsigned int waferFileSize() const
constexpr std::array< uint8_t, layerIndexSize > layer
U second(std::pair< T, U > const &p)
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_OffsetRotation
static constexpr int k_threeCorners
int32_t waferV(const int32_t index)
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
static constexpr int k_allCorners
std::vector< int > waferTypeL_
int HGCalDDDConstants::waferTypeL ( int  wafer) const
inline

Definition at line 233 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferTypeL_.

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

233  {
234  return ((wafer >= 0) && (wafer < static_cast<int>(hgpar_->waferTypeL_.size()))) ? hgpar_->waferTypeL_[wafer] : 0;
235  }
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
std::pair< int, int > HGCalDDDConstants::waferTypeRotation ( int  layer,
int  waferU,
int  waferV,
bool  fromFile = false,
bool  debug = false 
) const

Definition at line 1444 of file HGCalDDDConstants.cc.

References TauDecayModes::dec, first, hgpar_, HGCalGeomTools::k_allCorners, HGCalGeomTools::k_fiveCorners, HGCalGeomTools::k_fourCorners, HGCalWaferMask::k_OffsetRotation, HGCalGeomTools::k_threeCorners, edm::second(), HGCalTypes::WaferCorner0, waferFileSize(), HGCalTypes::WaferFive, HGCalTypes::WaferFull, HGCalTypes::WaferHalf, waferHexagon8(), HGCalWaferIndex::waferIndex(), HGCalParameters::waferInfoMap_, HGCalTypes::WaferOut, HGCalTypes::WaferThree, and HGCalParameters::waferTypes_.

Referenced by isValidCell8().

1445  {
1446  int type(HGCalTypes::WaferOut), rotn(0);
1448  bool withinList(true);
1449  if (fromFile && (waferFileSize() > 0)) {
1450  auto itr = hgpar_->waferInfoMap_.find(wl);
1451  withinList = (itr != hgpar_->waferInfoMap_.end());
1452  if (withinList) {
1453  type = (itr->second).part;
1454  rotn = (itr->second).orient;
1455  }
1456  } else {
1457  auto itr = hgpar_->waferTypes_.find(wl);
1458  if (waferHexagon8()) {
1459  withinList = (itr != hgpar_->waferTypes_.end());
1460  if (withinList) {
1461  if ((itr->second).second < HGCalWaferMask::k_OffsetRotation) {
1462  rotn = (itr->second).second;
1463  if ((itr->second).first == HGCalGeomTools::k_allCorners) {
1465  } else if ((itr->second).first == HGCalGeomTools::k_fiveCorners) {
1467  } else if ((itr->second).first == HGCalGeomTools::k_fourCorners) {
1469  } else if ((itr->second).first == HGCalGeomTools::k_threeCorners) {
1471  }
1472  } else {
1473  type = (itr->second).first;
1474  rotn = ((itr->second).second - HGCalWaferMask::k_OffsetRotation);
1475  }
1476  } else {
1478  rotn = HGCalTypes::WaferCorner0;
1479  }
1480  }
1481  }
1482 #ifdef EDM_ML_DEBUG
1483  if (debug)
1484  edm::LogVerbatim("HGCalGeom") << "waferTypeRotation: Layer " << layer << " Wafer " << waferU << ":" << waferV
1485  << " Index " << std::hex << wl << std::dec << ":" << withinList << " Type " << type
1486  << " Rotation " << rotn;
1487 #endif
1488  return std::make_pair(type, rotn);
1489 }
Log< level::Info, true > LogVerbatim
static constexpr int k_fourCorners
int32_t waferU(const int32_t index)
unsigned int waferFileSize() const
constexpr std::array< uint8_t, layerIndexSize > layer
U second(std::pair< T, U > const &p)
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_OffsetRotation
static constexpr int k_threeCorners
int32_t waferV(const int32_t index)
bool waferHexagon8() const
waferInfo_map waferInfoMap_
const HGCalParameters * hgpar_
static constexpr int k_allCorners
int HGCalDDDConstants::waferTypeT ( int  wafer) const
inline

Definition at line 229 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferTypeT_.

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

229  {
230  return ((wafer >= 0) && (wafer < static_cast<int>(hgpar_->waferTypeT_.size()))) ? hgpar_->waferTypeT_[wafer] : 0;
231  }
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
int HGCalDDDConstants::waferUVMax ( ) const
inline

Definition at line 241 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferUVMax_.

Referenced by HGCalTopology::HGCalTopology().

241 { return hgpar_->waferUVMax_; }
const HGCalParameters * hgpar_
bool HGCalDDDConstants::waferVirtual ( int  layer,
int  waferU,
int  waferV 
) const

Definition at line 1491 of file HGCalDDDConstants.cc.

References hgpar_, waferHexagon6(), waferHexagon8(), HGCalWaferIndex::waferIndex(), and HGCalParameters::waferTypes_.

1491  {
1492  bool type(false);
1493  if (waferHexagon8()) {
1494  int wl = HGCalWaferIndex::waferIndex(layer, waferU, waferV, false);
1495  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1496  } else if (waferHexagon6()) {
1497  int wl = HGCalWaferIndex::waferIndex(layer, waferU, 0, true);
1498  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1499  }
1500  return type;
1501 }
bool waferHexagon6() const
int32_t waferU(const int32_t index)
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)
bool waferHexagon8() const
const HGCalParameters * hgpar_
double HGCalDDDConstants::waferZ ( int  layer,
bool  reco 
) const

Definition at line 1503 of file HGCalDDDConstants.cc.

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

Referenced by HGCalSimHitValidation::analyzeHits(), HGCalTBAnalyzer::analyzeRecHits(), HGCalTBAnalyzer::analyzeSimHits(), ticl::SeedingRegionByTracks::buildFirstLayers(), HFNoseNumberingScheme::checkPosition(), HGCalNumberingScheme::checkPosition(), HGCalGeometry::get8Corners(), HGCalGeometry::getCorners(), HGCalTriggerTools::getLayerZ(), HGCalGeometry::getNewCorners(), HGCalGeometry::getPosition(), hgcal::RecHitTools::getPositionLayer(), HGCalGeometry::neighborZ(), HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_(), and waferLocal2Global().

1503  {
1504  const auto& index = getIndex(lay, reco);
1505  if (index.first < 0)
1506  return 0;
1507  else
1509 }
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< double > zLayerHex_
static constexpr double k_ScaleToDDD
const HGCalParameters * hgpar_

Member Data Documentation

const float HGCalDDDConstants::dPhiMin = 0.02
private

Definition at line 264 of file HGCalDDDConstants.h.

const bool HGCalDDDConstants::fullAndPart_
private

Definition at line 271 of file HGCalDDDConstants.h.

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

HGCalGeomTools HGCalDDDConstants::geomTools_
private

Definition at line 262 of file HGCalDDDConstants.h.

Referenced by locateCell().

double HGCalDDDConstants::hexside_
private
double HGCalDDDConstants::hexsideT_
private

Definition at line 273 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and waferFromPosition().

const HGCalParameters* HGCalDDDConstants::hgpar_
private
const double HGCalDDDConstants::k_horizontalShift = 1.0
private

Definition at line 263 of file HGCalDDDConstants.h.

Simrecovecs HGCalDDDConstants::max_modules_layer_
private

Definition at line 276 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and modules().

int32_t HGCalDDDConstants::maxWafersPerLayer_
private

Definition at line 277 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and maxModulesPerLayer().

const HGCalGeometryMode::GeometryMode HGCalDDDConstants::mode_
private
int32_t HGCalDDDConstants::modHalf_
private

Definition at line 274 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and maxModules().

double HGCalDDDConstants::rmax_
private
double HGCalDDDConstants::rmaxT_
private

Definition at line 273 of file HGCalDDDConstants.h.

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

const double HGCalDDDConstants::sqrt3_
private

Definition at line 269 of file HGCalDDDConstants.h.

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

constexpr double HGCalDDDConstants::tan30deg_ = 0.5773502693
staticprivate
std::array<uint32_t, 2> HGCalDDDConstants::tot_layers_
private

Definition at line 275 of file HGCalDDDConstants.h.

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

int32_t HGCalDDDConstants::tot_wafers_
private

Definition at line 274 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants().

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

Definition at line 280 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and isValidHex8().

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

Definition at line 278 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and wafers().

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

Definition at line 279 of file HGCalDDDConstants.h.

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