CMS 3D CMS Logo

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

#include <HGCalDDDConstants.h>

Public Types

enum  CellType {
  CellType::UndefinedType = -1, CellType::CentralType = 0, CellType::BottomLeftEdge = 1, CellType::LeftEdge = 2,
  CellType::TopLeftEdge = 3, CellType::TopRightEdge = 4, CellType::RightEdge = 5, CellType::BottomRightEdge = 6,
  CellType::BottomCorner = 11, CellType::BottomLeftCorner = 12, CellType::TopLeftCorner = 13, CellType::TopCorner = 14,
  CellType::TopRightCorner = 15, CellType::BottomRightCorner = 16
}
 

Public Member Functions

std::pair< int, int > assignCell (float x, float y, int lay, int subSec, bool reco) const
 
std::array< int, 5 > assignCellHex (float x, float y, int lay, bool reco) const
 
std::array< int, 3 > assignCellTrap (float x, float y, float z, int lay, bool reco) const
 
std::pair< double, double > cellEtaPhiTrap (int type, int irad) const
 
bool cellInLayer (int waferU, int waferV, int cellU, int cellV, int lay, bool reco) const
 
double cellSizeHex (int type) const
 
std::pair< double, double > cellSizeTrap (int type, int irad) const
 
double cellThickness (int layer, int waferU, int waferV) const
 
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
 
HGCalParameters::hgtrap getModule (unsigned int k, bool hexType, bool reco) const
 
std::vector< HGCalParameters::hgtrapgetModules () const
 
const HGCalParametersgetParameter () const
 
int getPhiBins (int lay) const
 
const std::vector< double > & getRadiusLayer (int layer) const
 
std::pair< int, int > getREtaRange (int lay) const
 
HGCalParameters::hgtrform getTrForm (unsigned int k) const
 
unsigned int getTrFormN () const
 
std::vector< HGCalParameters::hgtrformgetTrForms () const
 
int getTypeHex (int layer, int waferU, int waferV) const
 
int getTypeTrap (int layer) const
 
int getUVMax (int type) const
 
 HGCalDDDConstants (const HGCalParameters *hp, const std::string &name)
 
bool isHalfCell (int waferType, int cell) const
 
bool isValidHex (int lay, int mod, int cell, bool reco) const
 
bool isValidHex8 (int lay, int modU, int modV, int cellU, int cellV) const
 
bool isValidTrap (int lay, int ieta, int iphi) const
 
int lastLayer (bool reco) const
 
int layerIndex (int lay, bool reco) const
 
unsigned int layers (bool reco) const
 
unsigned int layersInit (bool reco) const
 
int levelTop (int ind=0) const
 
std::pair< float, float > locateCell (int cell, int lay, int type, bool reco) const
 
std::pair< float, float > locateCell (int lay, int waferU, int waferV, int cellU, int cellV, bool reco, bool all, bool debug=false) const
 
std::pair< float, float > locateCellHex (int cell, int wafer, bool reco) const
 
std::pair< float, float > locateCellTrap (int lay, int ieta, int iphi, bool reco) const
 
bool maskCell (const DetId &id, int corners) const
 
int maxCells (bool reco) const
 
int maxCells (int lay, bool reco) const
 
int maxCellUV () const
 
int maxModules () const
 
int maxModulesPerLayer () const
 
int maxRows (int lay, bool reco) const
 
double minSlope () const
 
int modifyUV (int uv, int type1, int type2) const
 
int modules (int lay, bool reco) const
 
int modulesInit (int lay, bool reco) const
 
double mouseBite (bool reco) const
 
int numberCells (bool reco) const
 
std::vector< int > numberCells (int lay, bool reco) const
 
int numberCellsHexagon (int 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 > 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
 
unsigned int volumes () const
 
int waferCount (const int type) 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 debug=false) const
 
bool waferFullInLayer (int wafer, int lay, bool reco) const
 
bool waferInLayer (int wafer, int lay, bool reco) const
 
int waferMax () const
 
int waferMin () const
 
std::pair< double, double > waferPosition (int wafer, bool reco) const
 
std::pair< double, double > waferPosition (int waferU, int waferV, bool reco) const
 
int wafers () const
 
int wafers (int layer, int type) const
 
double waferSepar (bool reco) const
 
double waferSize (bool reco) const
 
int waferToCopy (int wafer) const
 
int waferType (DetId const &id) const
 
int waferTypeL (int wafer) 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 debug=false) const
 
std::pair< int, float > getIndex (int lay, bool reco) const
 
bool isValidCell (int layindex, int wafer, int cell) const
 
bool waferInLayerTest (int wafer, int lay, bool full) const
 

Private Attributes

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

Static Private Attributes

static double tan30deg_ = 0.5773502693
 

Detailed Description

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

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

Definition at line 23 of file HGCalDDDConstants.h.

Member Typedef Documentation

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

Definition at line 192 of file HGCalDDDConstants.h.

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

Definition at line 191 of file HGCalDDDConstants.h.

Member Enumeration Documentation

Enumerator
UndefinedType 
CentralType 
BottomLeftEdge 
LeftEdge 
TopLeftEdge 
TopRightEdge 
RightEdge 
BottomRightEdge 
BottomCorner 
BottomLeftCorner 
TopLeftCorner 
TopCorner 
TopRightCorner 
BottomRightCorner 

Definition at line 28 of file HGCalDDDConstants.h.

28  {
29  UndefinedType = -1,
30  CentralType = 0,
31  BottomLeftEdge = 1,
32  LeftEdge = 2,
33  TopLeftEdge = 3,
34  TopRightEdge = 4,
35  RightEdge = 5,
36  BottomRightEdge = 6,
37  BottomCorner = 11,
38  BottomLeftCorner = 12,
39  TopLeftCorner = 13,
40  TopCorner = 14,
41  TopRightCorner = 15,
42  BottomRightCorner = 16
43  };

Constructor & Destructor Documentation

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

Definition at line 24 of file HGCalDDDConstants.cc.

References HGCalParameters::cellSize_, funct::cos(), getIndex(), getTrForm(), getTrFormN(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::HexagonFull, hexside_, hgpar_, mps_fire::i, HGCalParameters::k_ScaleFromDDD, HGCalParameters::hgtrform::lay, layers(), layersInit(), SiStripPI::max, max_modules_layer_, maxCells(), maxWafersPerLayer_, HGCalParameters::mode_, mode_, modHalf_, modulesInit(), rmax_, sectors(), tan30deg_, tot_layers_, tot_wafers_, HGCalParameters::waferCopy_, waferIn_, HGCalWaferIndex::waferIndex(), waferInLayer(), waferLayer_, waferMax_, HGCalParameters::waferR_, wafers(), HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

26  : hgpar_(hp), sqrt3_(std::sqrt(3.0)) {
27  mode_ = hgpar_->mode_;
33  std::cos(30._deg));
34  hexside_ = 2.0 * rmax_ * tan30deg_;
35 #ifdef EDM_ML_DEBUG
36  edm::LogVerbatim("HGCalGeom")
37  << "rmax_ " << rmax_ << ":" << hexside_ << " CellSize "
40 #endif
41  }
42  // init maps and constants
43  modHalf_ = 0;
45  for (int simreco = 0; simreco < 2; ++simreco) {
46  tot_layers_[simreco] = layersInit((bool)simreco);
47  max_modules_layer_[simreco].resize(tot_layers_[simreco] + 1);
48  for (unsigned int layer = 1; layer <= tot_layers_[simreco]; ++layer) {
49  max_modules_layer_[simreco][layer] = modulesInit(layer, (bool)simreco);
50  if (simreco == 1) {
51  modHalf_ += max_modules_layer_[simreco][layer];
54 #ifdef EDM_ML_DEBUG
55  edm::LogVerbatim("HGCalGeom") << "Layer " << layer << " with "
56  << max_modules_layer_[simreco][layer]
57  << ":" << modHalf_ << " modules";
58 #endif
59  }
60  }
61  }
62  tot_wafers_ = wafers();
63 
64 #ifdef EDM_ML_DEBUG
65  edm::LogVerbatim("HGCalGeom")
66  << "HGCalDDDConstants initialized for " << name << " with "
67  << layers(false) << ":" << layers(true) << " layers, " << wafers() << ":"
68  << 2 * modHalf_ << " wafers with maximum " << maxWafersPerLayer_
69  << " per layer and "
70  << "maximum of " << maxCells(false) << ":" << maxCells(true) << " cells";
71 #endif
76  int wminT(9999999), wmaxT(-9999999), kount1(0), kount2(0);
77  for (unsigned int i = 0; i < getTrFormN(); ++i) {
78  int lay0 = getTrForm(i).lay;
79  int wmin(9999999), wmax(-9999999), kount(0);
80  for (int wafer = 0; wafer < sectors(); ++wafer) {
81  bool waferIn = waferInLayer(wafer, lay0, true);
84  int kndx = HGCalWaferIndex::waferIndex(
87  waferIn_[kndx] = waferIn;
88  }
89  if (waferIn) {
90  int waferU =
93  ? wafer
95  if (waferU < wmin) wmin = waferU;
96  if (waferU > wmax) wmax = waferU;
97  ++kount;
98  }
99  }
100  if (wminT > wmin) wminT = wmin;
101  if (wmaxT < wmax) wmaxT = wmax;
102  if (kount1 < kount) kount1 = kount;
103  kount2 += kount;
104 #ifdef EDM_ML_DEBUG
105  int lay1 = getIndex(lay0, true).first;
106  edm::LogVerbatim("HGCalGeom")
107  << "Index " << i << " Layer " << lay0 << ":" << lay1 << " Wafer "
108  << wmin << ":" << wmax << ":" << kount;
109 #endif
110  HGCWaferParam a1{{wmin, wmax, kount}};
111  waferLayer_[lay0] = a1;
112  }
113  waferMax_ = std::array<int, 4>{{wminT, wmaxT, kount1, kount2}};
114 #ifdef EDM_ML_DEBUG
115  edm::LogVerbatim("HGCalGeom")
116  << "Overall wafer statistics: " << wminT << ":" << wmaxT << ":"
117  << kount1 << ":" << kount2;
118 #endif
119  }
120 }
HGCalParameters::hgtrform getTrForm(unsigned int k) const
Simrecovecs max_modules_layer_
unsigned int layersInit(bool reco) const
static int32_t waferV(const int32_t index)
std::unordered_map< int32_t, bool > waferIn_
int modulesInit(int lay, bool reco) const
HGCalGeometryMode::GeometryMode mode_
HGCalGeometryMode::GeometryMode mode_
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:18
std::pair< int, float > getIndex(int lay, bool reco) const
static double k_ScaleFromDDD
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static int32_t waferU(const int32_t index)
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
std::array< int, 4 > waferMax_
std::array< int, 3 > HGCWaferParam
std::vector< int > waferCopy_
std::array< uint32_t, 2 > tot_layers_
const HGCalParameters * hgpar_
int maxCells(bool reco) const
static double tan30deg_
bool waferInLayer(int wafer, int lay, bool reco) const
HGCalDDDConstants::~HGCalDDDConstants ( )

Definition at line 122 of file HGCalDDDConstants.cc.

122 {}

Member Function Documentation

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

Definition at line 124 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, cellHex(), HGCalParameters::cellSize_, getIndex(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, HGCalParameters::k_ScaleFromDDD, mode_, trackingPlots::reco, rmax_, findQualityFiles::size, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferTypeT_, geometryCSVtoXML::xx, and geometryCSVtoXML::yy.

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

125  {
126  const auto& index = getIndex(lay, reco);
127  if (index.first < 0) return std::make_pair(-1, -1);
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")
137  << "Wafer no. out of bound for " << wafer << ":"
138  << (hgpar_->waferTypeT_).size() << ":" << (hgpar_->waferPosX_).size()
139  << ":" << (hgpar_->waferPosY_).size() << " ***** ERROR *****";
140  return std::make_pair(-1, -1);
141  } else {
142  // Now the cell
143  xx -= hgpar_->waferPosX_[wafer];
144  yy -= hgpar_->waferPosY_[wafer];
145  if (hgpar_->waferTypeT_[wafer] == 1)
146  return std::make_pair(wafer,
147  cellHex(xx, yy,
149  hgpar_->cellSize_[0],
151  else
152  return std::make_pair(
153  wafer, cellHex(xx, yy,
155  hgpar_->cellSize_[1],
157  }
158  } else {
159  return std::make_pair(-1, -1);
160  }
161 }
size
Write out results.
std::vector< double > waferPosY_
std::vector< double > cellFineY_
HGCalGeometryMode::GeometryMode mode_
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
static double k_ScaleFromDDD
std::vector< double > cellFineX_
fixed size matrix
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::array< int, 5 > HGCalDDDConstants::assignCellHex ( float  x,
float  y,
int  lay,
bool  reco 
) const

Definition at line 163 of file HGCalDDDConstants.cc.

References HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCalParameters::k_ScaleToDDD, mode_, trackingPlots::reco, waferFromPosition(), waferType(), geometryCSVtoXML::xx, and geometryCSVtoXML::yy.

Referenced by HGCalGeometry::getClosestCell().

164  {
165  int waferU(0), waferV(0), waferType(-1), cellU(0), cellV(0);
168  double xx = (reco) ? HGCalParameters::k_ScaleToDDD * x : x;
169  double yy = (reco) ? HGCalParameters::k_ScaleToDDD * y : y;
170  double wt(1.0);
171  waferFromPosition(xx, yy, lay, waferU, waferV, cellU, cellV, waferType, wt);
172  }
173  return std::array<int, 5>{{waferU, waferV, waferType, cellU, cellV}};
174 }
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
HGCalGeometryMode::GeometryMode mode_
int waferType(DetId const &id) const
static double k_ScaleToDDD
std::array< int, 3 > HGCalDDDConstants::assignCellTrap ( float  x,
float  y,
float  z,
int  lay,
bool  reco 
) const

Definition at line 176 of file HGCalDDDConstants.cc.

References getIndex(), hgpar_, createfilelist::int, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, HGCalParameters::k_ScaleFromDDD, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, M_PI, SiStripPI::max, min(), phi, alignCSCRings::r, HGCalParameters::radiusLayer_, HGCalParameters::scintType(), mathSSE::sqrt(), and geometryCSVtoXML::xx.

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

178  {
179  int irad(-1), iphi(-1), type(-1);
180  const auto& indx = getIndex(layer, reco);
181  if (indx.first < 0) return std::array<int, 3>{{irad, iphi, type}};
182  double xx = (z > 0) ? x : -x;
183  double r =
184  (reco ? std::sqrt(x * x + y * y)
185  : HGCalParameters::k_ScaleFromDDD * std::sqrt(x * x + y * y));
186  double phi = (r == 0. ? 0. : std::atan2(y, xx));
187  if (phi < 0) phi += (2.0 * M_PI);
188  type = hgpar_->scintType(layer);
189  auto ir = std::lower_bound(hgpar_->radiusLayer_[type].begin(),
190  hgpar_->radiusLayer_[type].end(), r);
191  irad = (int)(ir - hgpar_->radiusLayer_[type].begin());
192  irad = std::min(std::max(irad, hgpar_->iradMinBH_[indx.first]),
193  hgpar_->iradMaxBH_[indx.first]);
194  iphi = 1 + (int)(phi / indx.second);
195 #ifdef EDM_ML_DEBUG
196  edm::LogVerbatim("HGCalGeom")
197  << "assignCellTrap Input " << x << ":" << y << ":" << z << ":" << layer
198  << ":" << reco << " x|r " << xx << ":" << r << " phi " << phi << " o/p "
199  << irad << ":" << iphi << ":" << type;
200 #endif
201  return std::array<int, 3>{{irad, iphi, type}};
202 }
std::vector< int > iradMaxBH_
type
Definition: HCALResponse.h:21
int scintType(const int layer) const
T sqrt(T t)
Definition: SSEVec.h:18
std::pair< int, float > getIndex(int lay, bool reco) const
T min(T a, T b)
Definition: MathUtil.h:58
#define M_PI
std::vector< int > iradMinBH_
fixed size matrix
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
std::pair< double, double > HGCalDDDConstants::cellEtaPhiTrap ( int  type,
int  irad 
) const

Definition at line 204 of file HGCalDDDConstants.cc.

References HGCalParameters::cellSize_, runTauDisplay::dr, hgpar_, mode_, alignCSCRings::r, HGCalParameters::radiusLayer_, and HGCalGeometryMode::Trapezoid.

205  {
206  double dr(0), df(0);
208  double r = 0.5*((hgpar_->radiusLayer_[type][irad-1] +
209  hgpar_->radiusLayer_[type][irad]));
210  dr = (hgpar_->radiusLayer_[type][irad] -
211  hgpar_->radiusLayer_[type][irad-1]);
212  df = r * hgpar_->cellSize_[type];
213  }
214  return std::make_pair(dr,df);
215 }
type
Definition: HCALResponse.h:21
HGCalGeometryMode::GeometryMode mode_
std::vector< double > cellSize_
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 1397 of file HGCalDDDConstants.cc.

References funct::abs(), PVValHelper::dx, PVValHelper::dy, gen::k, pileupDistInMC::num, tan30deg_, and TrackerOfflineValidation_Dqm_cff::xmax.

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

1399  {
1400  int num(0);
1401  const double tol(0.00001);
1402  double cellY = 2.0 * cellR * tan30deg_;
1403  for (unsigned int k = 0; k < posX.size(); ++k) {
1404  double dx = std::abs(xx - posX[k]);
1405  double dy = std::abs(yy - posY[k]);
1406  if (dx <= (cellR + tol) && dy <= (cellY + tol)) {
1407  double xmax = (dy <= 0.5 * cellY)
1408  ? cellR
1409  : (cellR - (dy - 0.5 * cellY) / tan30deg_);
1410  if (dx <= (xmax + tol)) {
1411  num = k;
1412  break;
1413  }
1414  }
1415  }
1416  return num;
1417 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int k[5][pyjets_maxn]
static double tan30deg_
void HGCalDDDConstants::cellHex ( double  xloc,
double  yloc,
int  cellType,
int &  cellU,
int &  cellV,
bool  debug = false 
) const
private

Definition at line 1419 of file HGCalDDDConstants.cc.

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

1425  {
1426  int N = (cellType == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1427  double Rc = 2 * rmax_ / (3 * N);
1428  double rc = 0.5 * Rc * sqrt3_;
1429  double v0 = ((xloc / Rc - 1.0) / 1.5);
1430  int cv0 = (v0 > 0) ? (N + (int)(v0 + 0.5)) : (N - (int)(-v0 + 0.5));
1431  double u0 = (0.5 * yloc / rc + 0.5 * cv0);
1432  int cu0 = (u0 > 0) ? (N / 2 + (int)(u0 + 0.5)) : (N / 2 - (int)(-u0 + 0.5));
1433  cu0 = std::max(0, std::min(cu0, 2 * N - 1));
1434  cv0 = std::max(0, std::min(cv0, 2 * N - 1));
1435  if (cv0 - cu0 >= N) cv0 = cu0 + N - 1;
1436 #ifdef EDM_ML_DEBUG
1437  if (debug)
1438  edm::LogVerbatim("HGCalGeom")
1439  << "cellHex: input " << xloc << ":" << yloc << ":" << cellType
1440  << " parameter " << rc << ":" << Rc << " u0 " << u0 << ":" << cu0
1441  << " v0 " << v0 << ":" << cv0;
1442 #endif
1443  bool found(false);
1444  static const int shift[3] = {0, 1, -1};
1445  for (int i1 = 0; i1 < 3; ++i1) {
1446  cellU = cu0 + shift[i1];
1447  for (int i2 = 0; i2 < 3; ++i2) {
1448  cellV = cv0 + shift[i2];
1449  if (((cellV - cellU) < N) && ((cellU - cellV) <= N) && (cellU >= 0) &&
1450  (cellV >= 0) && (cellU < 2 * N) && (cellV < 2 * N)) {
1451  double xc = (1.5 * (cellV - N) + 1.0) * Rc;
1452  double yc = (2 * cellU - cellV - N) * rc;
1453  if ((std::abs(yloc - yc) <= rc) && (std::abs(xloc - xc) <= Rc) &&
1454  ((std::abs(xloc - xc) <= 0.5 * Rc) ||
1455  (std::abs(yloc - yc) <= sqrt3_ * (Rc - std::abs(xloc - xc))))) {
1456 #ifdef EDM_ML_DEBUG
1457  if (debug)
1458  edm::LogVerbatim("HGCalGeom")
1459  << "cellHex: local " << xc << ":" << yc << " difference "
1460  << std::abs(xloc - xc) << ":" << std::abs(yloc - yc) << ":"
1461  << sqrt3_ * (Rc - std::abs(yloc - yc)) << " comparator " << rc
1462  << ":" << Rc << " (u,v) = (" << cellU << "," << cellV << ")";
1463 #endif
1464  found = true;
1465  break;
1466  }
1467  }
1468  }
1469  if (found) break;
1470  }
1471  if (!found) {
1472  cellU = cu0;
1473  cellV = cv0;
1474  }
1475 }
CellType cellType(int type, int waferU, int waferV) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
#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 217 of file HGCalDDDConstants.cc.

References getIndex(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::HexagonFull, hgpar_, locateCell(), mode_, HGCalParameters::rMinLayHex_, mathSSE::sqrt(), and geometryCSVtoXML::xy.

Referenced by HGCalGeometry::newCell().

218  {
219  const auto& indx = getIndex(lay, true);
220  if (indx.first >= 0) {
225  const auto& xy = (((mode_ == HGCalGeometryMode::Hexagon8) ||
227  ? locateCell(lay, waferU, waferV, cellU, cellV,
228  reco, true, false)
229  : locateCell(cellU, lay, waferU, reco));
230  double rpos = sqrt(xy.first * xy.first + xy.second * xy.second);
231  return ((rpos >= hgpar_->rMinLayHex_[indx.first]) &&
232  (rpos <= hgpar_->rMaxLayHex_[indx.first]));
233  } else {
234  return true;
235  }
236  } else {
237  return false;
238  }
239 }
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
HGCalGeometryMode::GeometryMode mode_
T sqrt(T t)
Definition: SSEVec.h:18
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< double > rMinLayHex_
fixed size matrix
const HGCalParameters * hgpar_
double HGCalDDDConstants::cellSizeHex ( int  type) const

Definition at line 262 of file HGCalDDDConstants.cc.

References HGCalParameters::cellSize_, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, hgpar_, HGCalParameters::k_ScaleFromDDD, mode_, and HGCalGeometryMode::Trapezoid.

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

262  {
263  int indx = (((mode_ == HGCalGeometryMode::Hexagon8) ||
265  ? ((type >= 1) ? 1 : 0)
266  : ((type == 1) ? 1 : 0));
267  double cell =
269  ? 0.5 * hgpar_->cellSize_[indx]
271  return cell;
272 }
type
Definition: HCALResponse.h:21
HGCalGeometryMode::GeometryMode mode_
std::vector< double > cellSize_
static double k_ScaleFromDDD
const HGCalParameters * hgpar_
std::pair<double, double> HGCalDDDConstants::cellSizeTrap ( int  type,
int  irad 
) const
inline

Definition at line 54 of file HGCalDDDConstants.h.

References cellThickness(), cellType(), distFromEdgeHex(), distFromEdgeTrap(), etaPhiFromPosition(), hgpar_, and HGCalParameters::radiusLayer_.

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

54  {
55  return std::make_pair(hgpar_->radiusLayer_[type][irad - 1],
56  hgpar_->radiusLayer_[type][irad]);
57  }
type
Definition: HCALResponse.h:21
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
double HGCalDDDConstants::cellThickness ( int  layer,
int  waferU,
int  waferV 
) const

Definition at line 241 of file HGCalDDDConstants.cc.

References HGCalParameters::cellThickness_, HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::HexagonFull, hgpar_, maxType, minType, mode_, HGCalParameters::typesInLayers_, HGCalWaferIndex::waferIndex(), and HGCalParameters::waferTypeL_.

Referenced by cellSizeTrap(), and hgcal::RecHitTools::getSiThickness().

242  {
243  double thick(-1);
246  auto itr = hgpar_->typesInLayers_.find(
247  HGCalWaferIndex::waferIndex(layer, waferU, waferV));
248  int type = ((itr == hgpar_->typesInLayers_.end()
249  ? maxType
250  : hgpar_->waferTypeL_[itr->second]));
251  thick = 10000.0 * hgpar_->cellThickness_[type]; // cm to micron
252  } else if ((mode_ == HGCalGeometryMode::Hexagon) ||
254  int type = (((waferU >= 0) && (waferU < (int)(hgpar_->waferTypeL_.size())))
255  ? hgpar_->waferTypeL_[waferU]
256  : minType);
257  thick = 100.0 * type; // type = 1,2,3 for 100,200,300 micron
258  }
259  return thick;
260 }
type
Definition: HCALResponse.h:21
HGCalGeometryMode::GeometryMode mode_
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
static const int maxType
std::vector< double > cellThickness_
wafer_map typesInLayers_
static const int minType
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
HGCalDDDConstants::CellType HGCalDDDConstants::cellType ( int  type,
int  waferU,
int  waferV 
) const

Definition at line 274 of file HGCalDDDConstants.cc.

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

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

275  {
276  // type=0: in the middle; 1..6: the edges clocwise from bottom left;
277  // =11..16: the corners clockwise from bottom
278  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
279  if (cellU == 0) {
280  if (cellV == 0)
282  else if (cellV - cellU == N - 1)
284  else
286  } else if (cellV == 0) {
287  if (cellU - cellV == N)
289  else
291  } else if (cellU - cellV == N) {
292  if (cellU == 2 * N - 1)
294  else
296  } else if (cellU == 2 * N - 1) {
297  if (cellV == 2 * N - 1)
299  else
301  } else if (cellV == 2 * N - 1) {
302  if (cellV - cellU == N - 1)
304  else
306  } else if (cellV - cellU == N - 1) {
308  } else if ((cellU > 2 * N - 1) || (cellV > 2 * N - 1) ||
309  (cellV >= (cellU + N)) || (cellU > (cellV + N))) {
311  } else {
313  }
314 }
type
Definition: HCALResponse.h:21
#define N
Definition: blowfish.cc:9
const HGCalParameters * hgpar_
double HGCalDDDConstants::distFromEdgeHex ( double  x,
double  y,
double  z 
) const

Definition at line 316 of file HGCalDDDConstants.cc.

References funct::abs(), PVValHelper::dx, PVValHelper::dy, hexside_, hgpar_, createfilelist::int, gen::k, HGCalParameters::k_ScaleFromDDD, HGCalParameters::k_ScaleToDDD, rmax_, sqrt3_, tan30deg_, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, x, geometryCSVtoXML::xx, y, and geometryCSVtoXML::yy.

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

316  {
317  // Assming the point is within a hexagonal plane of the wafer, calculate
318  // the shortest distance from the edge
319  if (z < 0) x = -x;
320  double dist(0);
321  // Input x, y in Geant4 unit and transformed to CMSSW standard
324  int sizew = (int)(hgpar_->waferPosX_.size());
325  int wafer = sizew;
326  // Transform to the local coordinate frame of the wafer first
327  for (int k = 0; k < sizew; ++k) {
328  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
329  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
330  if ((dx <= rmax_) && (dy <= hexside_) &&
331  ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy)))) {
332  wafer = k;
333  xx -= hgpar_->waferPosX_[k];
334  yy -= hgpar_->waferPosY_[k];
335  break;
336  }
337  }
338  // Look at only one quarter (both x,y are positive)
339  if (wafer < sizew) {
340  if (std::abs(yy) < 0.5 * hexside_) {
341  dist = rmax_ - std::abs(xx);
342  } else {
343  dist = 0.5 * ((rmax_ - std::abs(xx)) -
344  sqrt3_ * (std::abs(yy) - 0.5 * hexside_));
345  }
346  } else {
347  dist = 0;
348  }
350 #ifdef EDM_ML_DEBUG
351  edm::LogVerbatim("HGCalGeom")
352  << "DistFromEdgeHex: Local " << xx << ":" << yy << " wafer " << wafer
353  << " flag " << (wafer < sizew) << " Distance " << rmax_ << ":"
354  << (rmax_ - std::abs(xx)) << ":" << (std::abs(yy) - 0.5 * hexside_) << ":"
355  << 0.5 * hexside_ << ":" << dist;
356 #endif
357  return dist;
358 }
std::vector< double > waferPosY_
static double k_ScaleFromDDD
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int k[5][pyjets_maxn]
static double k_ScaleToDDD
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
static double tan30deg_
double HGCalDDDConstants::distFromEdgeTrap ( double  x,
double  y,
double  z 
) const

Definition at line 360 of file HGCalDDDConstants.cc.

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

Referenced by cellSizeTrap(), and HGCScintSD::isItinFidVolume().

360  {
361  // Assming the point is within the eta-phi plane of the scintillator tile,
362  // calculate the shortest distance from the edge
363  int lay = getLayer(z, false);
364  double xx = (z < 0) ? -x : x;
365  int indx = layerIndex(lay, false);
366  double r = HGCalParameters::k_ScaleFromDDD * std::sqrt(x * x + y * y);
367  double phi = (r == 0. ? 0. : std::atan2(y, xx));
368  if (phi < 0) phi += (2.0 * M_PI);
369  int type = hgpar_->scintType(lay);
370  double cell = hgpar_->scintCellSize(lay);
371  // Compare with the center of the tile find distances along R and also phi
372  // Take the smaller value
373  auto ir = std::lower_bound(hgpar_->radiusLayer_[type].begin(),
374  hgpar_->radiusLayer_[type].end(), r);
375  int irad = (int)(ir - hgpar_->radiusLayer_[type].begin());
376  if (irad < hgpar_->iradMinBH_[indx])
377  irad = hgpar_->iradMinBH_[indx];
378  else if (irad > hgpar_->iradMaxBH_[indx])
379  irad = hgpar_->iradMaxBH_[indx];
380  int iphi = 1 + (int)(phi / cell);
381  double dphi =
382  std::max(0.0, (0.5 * cell - std::abs(phi - (iphi - 0.5) * cell)));
383  double dist = std::min((r - hgpar_->radiusLayer_[type][irad - 1]),
384  (hgpar_->radiusLayer_[type][irad] - r));
385 #ifdef EDM_ML_DEBUG
386  edm::LogVerbatim("HGCalGeom")
387  << "DistFromEdgeTrap: Global " << x << ":" << y << ":" << z << " Layer "
388  << lay << " Index " << indx << ":" << type << " xx " << xx << " R " << r
389  << ":" << irad << ":" << hgpar_->radiusLayer_[type][irad - 1] << ":"
390  << hgpar_->radiusLayer_[type][irad] << " Phi " << phi << ":" << iphi
391  << ":" << (iphi - 0.5) * cell << " cell " << cell << " Dphi " << dphi
392  << " Dist " << dist << ":" << r * dphi;
393 #endif
394  return HGCalParameters::k_ScaleToDDD * std::min(r * dphi, dist);
395 }
std::vector< int > iradMaxBH_
type
Definition: HCALResponse.h:21
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:18
static double k_ScaleFromDDD
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 double k_ScaleToDDD
std::vector< int > iradMinBH_
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

Referenced by cellSizeTrap().

int HGCalDDDConstants::firstLayer ( ) const
inline
HGCalGeometryMode::GeometryMode HGCalDDDConstants::geomMode ( ) const
inline
std::pair< int, float > HGCalDDDConstants::getIndex ( int  lay,
bool  reco 
) const
private

Definition at line 1477 of file HGCalDDDConstants.cc.

References HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::HexagonFull, hgpar_, layerIndex(), mode_, HGCalParameters::moduleCellR_, HGCalParameters::moduleCellS_, and HGCalParameters::scintCellSize().

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

1477  {
1478  int indx = layerIndex(lay, reco);
1479  if (indx < 0) return std::make_pair(-1, 0);
1480  float cell(0);
1481  if ((mode_ == HGCalGeometryMode::Hexagon) ||
1483  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1484  } else {
1487  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
1488  } else {
1489  cell = hgpar_->scintCellSize(lay);
1490  }
1491  }
1492  return std::make_pair(indx, cell);
1493 }
std::vector< double > moduleCellR_
HGCalGeometryMode::GeometryMode mode_
double scintCellSize(const int layer) const
int layerIndex(int lay, bool reco) const
std::vector< double > moduleCellS_
fixed size matrix
const HGCalParameters * hgpar_
int HGCalDDDConstants::getLayer ( double  z,
bool  reco 
) const

Definition at line 397 of file HGCalDDDConstants.cc.

References funct::abs(), HGCalParameters::firstLayer_, HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, gen::k, HGCalParameters::k_ScaleFromDDD, HGCalParameters::layerGroup_, layerIndex(), mode_, trackingPlots::reco, HGCalParameters::zLayerHex_, and geometryCSVtoXML::zz.

Referenced by distFromEdgeTrap(), geomMode(), and HGCalGeometry::getClosestCell().

397  {
398  // Get the layer # from the gloabl z coordinate
399  unsigned int k = 0;
400  double zz =
401  (reco ? std::abs(z) : HGCalParameters::k_ScaleFromDDD * std::abs(z));
402  const auto& zLayerHex = hgpar_->zLayerHex_;
403  auto itr = std::find_if(zLayerHex.begin() + 1, zLayerHex.end(),
404  [&k, &zz, &zLayerHex](double zLayer) {
405  ++k;
406  return zz < 0.5 * (zLayerHex[k-1] + zLayerHex[k]);
407  });
408  int lay = (itr == zLayerHex.end()) ? static_cast<int>(zLayerHex.size()) : k;
409  if (((mode_ == HGCalGeometryMode::Hexagon) ||
411  reco) {
412  int indx = layerIndex(lay, false);
413  if (indx >= 0) lay = hgpar_->layerGroup_[indx];
414  } else {
415  lay += (hgpar_->firstLayer_ - 1);
416  }
417  return lay;
418 }
HGCalGeometryMode::GeometryMode mode_
int layerIndex(int lay, bool reco) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< double > zLayerHex_
int k[5][pyjets_maxn]
std::vector< int > layerGroup_
fixed size matrix
const HGCalParameters * hgpar_
HGCalParameters::hgtrap HGCalDDDConstants::getModule ( unsigned int  k,
bool  hexType,
bool  reco 
) const

Definition at line 420 of file HGCalDDDConstants.cc.

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

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

422  {
424  if (hexType) {
425  if (indx >= hgpar_->waferTypeL_.size())
426  edm::LogWarning("HGCalGeom")
427  << "Wafer no. out bound for index " << indx << ":"
428  << (hgpar_->waferTypeL_).size() << ":" << (hgpar_->waferPosX_).size()
429  << ":" << (hgpar_->waferPosY_).size() << " ***** ERROR *****";
430  unsigned int type =
431  ((indx < hgpar_->waferTypeL_.size()) ? hgpar_->waferTypeL_[indx] : 3);
432  if (type > 0) --type;
433  mytr = hgpar_->getModule(type, reco);
434  } else {
435  mytr = hgpar_->getModule(indx, reco);
436  }
437  return mytr;
438 }
size
Write out results.
std::vector< double > waferPosY_
type
Definition: HCALResponse.h:21
hgtrap getModule(unsigned int k, bool reco) const
fixed size matrix
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::vector< int > waferTypeL_
std::vector< HGCalParameters::hgtrap > HGCalDDDConstants::getModules ( ) const

Definition at line 440 of file HGCalDDDConstants.cc.

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

Referenced by geomMode().

440  {
441  std::vector<HGCalParameters::hgtrap> mytrs;
442  for (unsigned int k = 0; k < hgpar_->moduleLayR_.size(); ++k)
443  mytrs.emplace_back(hgpar_->getModule(k, true));
444  return mytrs;
445 }
std::vector< int > moduleLayR_
hgtrap getModule(unsigned int k, bool reco) const
int k[5][pyjets_maxn]
const HGCalParameters * hgpar_
const HGCalParameters* HGCalDDDConstants::getParameter ( ) const
inline

Definition at line 71 of file HGCalDDDConstants.h.

References getPhiBins(), getREtaRange(), and hgpar_.

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

71 { return hgpar_; }
const HGCalParameters * hgpar_
int HGCalDDDConstants::getPhiBins ( int  lay) const

Definition at line 447 of file HGCalDDDConstants.cc.

References hgpar_, mode_, HGCalParameters::scintCells(), and HGCalGeometryMode::Trapezoid.

Referenced by getParameter().

447  {
449  : 0);
450 }
HGCalGeometryMode::GeometryMode mode_
int scintCells(const int layer) const
const HGCalParameters * hgpar_
const std::vector<double>& HGCalDDDConstants::getRadiusLayer ( int  layer) const
inline

Definition at line 74 of file HGCalDDDConstants.h.

References hgpar_, mode_, HGCalParameters::radiusLayer_, HGCalParameters::scintType(), and HGCalGeometryMode::Trapezoid.

74  {
76  hgpar_->scintType(layer) : 0);
77  return hgpar_->radiusLayer_[type];
78  }
type
Definition: HCALResponse.h:21
int scintType(const int layer) const
HGCalGeometryMode::GeometryMode mode_
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
std::pair< int, int > HGCalDDDConstants::getREtaRange ( int  lay) const

Definition at line 452 of file HGCalDDDConstants.cc.

References hgpar_, HGCalParameters::iradMaxBH_, HGCalParameters::iradMinBH_, layerIndex(), mode_, and HGCalGeometryMode::Trapezoid.

Referenced by getParameter().

452  {
453  int irmin(0), irmax(0);
455  int indx = layerIndex(lay, false);
456  if ((indx >= 0) && (indx < static_cast<int>(hgpar_->iradMinBH_.size()))) {
457  irmin = hgpar_->iradMinBH_[indx];
458  irmax = hgpar_->iradMaxBH_[indx];
459  }
460  }
461  return std::make_pair(irmin, irmax);
462 }
std::vector< int > iradMaxBH_
HGCalGeometryMode::GeometryMode mode_
int layerIndex(int lay, bool reco) const
std::vector< int > iradMinBH_
const HGCalParameters * hgpar_
HGCalParameters::hgtrform HGCalDDDConstants::getTrForm ( unsigned int  k) const
inline

Definition at line 79 of file HGCalDDDConstants.h.

References HGCalParameters::getTrForm(), and hgpar_.

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

79  {
80  return hgpar_->getTrForm(k);
81  }
hgtrform getTrForm(unsigned int k) const
int k[5][pyjets_maxn]
const HGCalParameters * hgpar_
unsigned int HGCalDDDConstants::getTrFormN ( ) const
inline

Definition at line 82 of file HGCalDDDConstants.h.

References getTrForms(), getTypeHex(), getTypeTrap(), hgpar_, and HGCalParameters::trformIndex_.

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

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

Definition at line 464 of file HGCalDDDConstants.cc.

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

Referenced by HGCalTrackCollectionProducer::beginLuminosityBlock(), and getTrFormN().

464  {
465  std::vector<HGCalParameters::hgtrform> mytrs;
466  for (unsigned int k = 0; k < hgpar_->trformIndex_.size(); ++k)
467  mytrs.emplace_back(hgpar_->getTrForm(k));
468  return mytrs;
469 }
std::vector< uint32_t > trformIndex_
hgtrform getTrForm(unsigned int k) const
int k[5][pyjets_maxn]
const HGCalParameters * hgpar_
int HGCalDDDConstants::getTypeHex ( int  layer,
int  waferU,
int  waferV 
) const

Definition at line 480 of file HGCalDDDConstants.cc.

References HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, hgpar_, mode_, HGCalParameters::typesInLayers_, HGCalWaferIndex::waferIndex(), and HGCalParameters::waferTypeL_.

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

480  {
481  // Get the module type for a silicon wafer
484  auto itr = hgpar_->typesInLayers_.find(
485  HGCalWaferIndex::waferIndex(layer, waferU, waferV));
486  return ((itr == hgpar_->typesInLayers_.end()
487  ? 2
488  : hgpar_->waferTypeL_[itr->second]));
489  } else {
490  return -1;
491  }
492 }
HGCalGeometryMode::GeometryMode mode_
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
wafer_map typesInLayers_
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
int HGCalDDDConstants::getTypeTrap ( int  layer) const

Definition at line 471 of file HGCalDDDConstants.cc.

References hgpar_, mode_, HGCalParameters::scintType(), and HGCalGeometryMode::Trapezoid.

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

471  {
472  // Get the module type for scinitllator
474  return hgpar_->scintType(layer);
475  } else {
476  return -1;
477  }
478 }
int scintType(const int layer) const
HGCalGeometryMode::GeometryMode mode_
const HGCalParameters * hgpar_
int HGCalDDDConstants::getUVMax ( int  type) const
inline
bool HGCalDDDConstants::isHalfCell ( int  waferType,
int  cell 
) const

Definition at line 494 of file HGCalDDDConstants.cc.

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

Referenced by getUVMax(), and hgcal::RecHitTools::isHalfCell().

494  {
495  if (waferType < 1 || cell < 0) return false;
496  return waferType == 2 ? hgpar_->cellCoarseHalf_[cell]
497  : hgpar_->cellFineHalf_[cell];
498 }
std::vector< bool > cellCoarseHalf_
std::vector< bool > cellFineHalf_
int waferType(DetId const &id) const
const HGCalParameters * hgpar_
bool HGCalDDDConstants::isValidCell ( int  layindex,
int  wafer,
int  cell 
) const
private

Definition at line 1495 of file HGCalDDDConstants.cc.

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

Referenced by isValidHex(), and waferUVMax().

1495  {
1496  // Calculate the position of the cell
1497  // Works for options HGCalHexagon/HGCalHexagonFull
1498  double x = hgpar_->waferPosX_[wafer];
1499  double y = hgpar_->waferPosY_[wafer];
1500  if (hgpar_->waferTypeT_[wafer] == 1) {
1501  x += hgpar_->cellFineX_[cell];
1502  y += hgpar_->cellFineY_[cell];
1503  } else {
1504  x += hgpar_->cellCoarseX_[cell];
1505  y += hgpar_->cellCoarseY_[cell];
1506  }
1507  double rr = sqrt(x * x + y * y);
1508  bool result = ((rr >= hgpar_->rMinLayHex_[lay - 1]) &&
1509  (rr <= hgpar_->rMaxLayHex_[lay - 1]) &&
1510  (wafer < (int)(hgpar_->waferPosX_.size())));
1511 #ifdef EDM_ML_DEBUG
1512  if (!result)
1513  edm::LogVerbatim("HGCalGeom")
1514  << "Input " << lay << ":" << wafer << ":" << cell << " Position " << x
1515  << ":" << y << ":" << rr << " Compare Limits "
1516  << hgpar_->rMinLayHex_[lay - 1] << ":" << hgpar_->rMaxLayHex_[lay - 1]
1517  << " Flag " << result;
1518 #endif
1519  return result;
1520 }
std::vector< double > waferPosY_
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
T sqrt(T t)
Definition: SSEVec.h:18
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::isValidHex ( int  lay,
int  mod,
int  cell,
bool  reco 
) const

Definition at line 500 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, HGCalParameters::copiesInLayers_, HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, createfilelist::int, isValidCell(), layers(), maxCells(), mod(), mode_, mps_fire::result, findQualityFiles::size, HGCalParameters::waferCopy_, and HGCalParameters::waferTypeT_.

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

501  {
502  // Check validity for a layer|wafer|cell of pre-TDR version
503  bool result(false), resultMod(false);
504  int cellmax(0);
507  int32_t copyNumber = hgpar_->waferCopy_[mod];
508  result = ((lay > 0 && lay <= (int)(layers(reco))));
509  if (result) {
510  const int32_t lay_idx = reco ? (lay - 1) * 3 + 1 : lay;
511  const auto& the_modules = hgpar_->copiesInLayers_[lay_idx];
512  auto moditr = the_modules.find(copyNumber);
513  result = resultMod = (moditr != the_modules.end());
514 #ifdef EDM_ML_DEBUG
515  if (!result)
516  edm::LogVerbatim("HGCalGeom")
517  << "HGCalDDDConstants: Layer " << lay << ":" << lay_idx << " Copy "
518  << copyNumber << ":" << mod << " Flag " << result;
519 #endif
520  if (result) {
521  if (moditr->second >= 0) {
522  if (mod >= (int)(hgpar_->waferTypeT_.size()))
523  edm::LogWarning("HGCalGeom")
524  << "Module no. out of bound for " << mod
525  << " to be compared with " << (hgpar_->waferTypeT_).size()
526  << " ***** ERROR *****";
527  cellmax = ((hgpar_->waferTypeT_[mod] == 1)
528  ? (int)(hgpar_->cellFineX_.size())
529  : (int)(hgpar_->cellCoarseX_.size()));
530  result = (cell >= 0 && cell <= cellmax);
531  } else {
532  result = isValidCell(lay_idx, mod, cell);
533  }
534  }
535  }
536  }
537 
538 #ifdef EDM_ML_DEBUG
539  if (!result)
540  edm::LogVerbatim("HGCalGeom")
541  << "HGCalDDDConstants: Layer " << lay << ":"
542  << (lay > 0 && (lay <= (int)(layers(reco)))) << " Module " << mod << ":"
543  << resultMod << " Cell " << cell << ":" << cellmax << ":"
544  << (cell >= 0 && cell <= cellmax) << ":" << maxCells(reco);
545 #endif
546  return result;
547 }
size
Write out results.
layer_map copiesInLayers_
HGCalGeometryMode::GeometryMode mode_
std::vector< double > cellCoarseX_
unsigned int layers(bool reco) const
bool isValidCell(int layindex, int wafer, int cell) const
std::vector< double > cellFineX_
fixed size matrix
std::vector< int > waferCopy_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
int maxCells(bool reco) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
bool HGCalDDDConstants::isValidHex8 ( int  lay,
int  modU,
int  modV,
int  cellU,
int  cellV 
) const

Definition at line 549 of file HGCalDDDConstants.cc.

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

Referenced by HGCalTopology::addHGCSiliconId(), getUVMax(), and HGCalTopology::valid().

550  {
551  // Check validity for a layer|wafer|cell of post-TDR version
552  int indx = HGCalWaferIndex::waferIndex(layer, modU, modV);
553  auto itr = hgpar_->typesInLayers_.find(indx);
554 #ifdef EDM_ML_DEBUG
555  edm::LogVerbatim("HGCalGeom")
556  << "HGCalDDDConstants::isValidHex8:WaferType " << layer << ":" << modU
557  << ":" << modV << ":" << indx << " Test "
558  << (itr == hgpar_->typesInLayers_.end());
559 #endif
560  if (itr == hgpar_->typesInLayers_.end()) return false;
561  auto jtr = waferIn_.find(indx);
562 #ifdef EDM_ML_DEBUG
563  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants::isValidHex8:WaferIn "
564  << jtr->first << ":" << jtr->second;
565 #endif
566  if (!(jtr->second)) return false;
567  int N = ((hgpar_->waferTypeL_[itr->second] == 0) ? hgpar_->nCellsFine_
568  : hgpar_->nCellsCoarse_);
569 #ifdef EDM_ML_DEBUG
570  edm::LogVerbatim("HGCalGeom")
571  << "HGCalDDDConstants::isValidHex8:Cell " << cellU << ":" << cellV << ":"
572  << N << " Tests " << (cellU >= 0) << ":" << (cellU < 2 * N) << ":"
573  << (cellV >= 0) << ":" << (cellV < 2 * N) << ":" << ((cellV - cellU) < N)
574  << ":" << ((cellU - cellV) <= N);
575 #endif
576  if ((cellU >= 0) && (cellU < 2 * N) && (cellV >= 0) && (cellV < 2 * N)) {
577  return (((cellV - cellU) < N) && ((cellU - cellV) <= N));
578  } else {
579  return false;
580  }
581 }
std::unordered_map< int32_t, bool > waferIn_
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
#define N
Definition: blowfish.cc:9
wafer_map typesInLayers_
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
bool HGCalDDDConstants::isValidTrap ( int  lay,
int  ieta,
int  iphi 
) const

Definition at line 583 of file HGCalDDDConstants.cc.

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

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

583  {
584  // Check validity for a layer|eta|phi of scintillator
585  const auto& indx = getIndex(layer, true);
586  if (indx.first < 0) return false;
587  return ((irad >= hgpar_->iradMinBH_[indx.first]) &&
588  (irad <= hgpar_->iradMaxBH_[indx.first]) && (iphi > 0) &&
589  (iphi <= hgpar_->scintCells(layer)));
590 }
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< int > iradMinBH_
const HGCalParameters * hgpar_
int HGCalDDDConstants::lastLayer ( bool  reco) const

Definition at line 592 of file HGCalDDDConstants.cc.

References HGCalParameters::firstLayer_, hgpar_, and tot_layers_.

Referenced by getUVMax(), and HGCalGeometry::neighborZ().

592  {
593  return (hgpar_->firstLayer_ + tot_layers_[(int)reco] - 1);
594 }
fixed size matrix
std::array< uint32_t, 2 > tot_layers_
const HGCalParameters * hgpar_
int HGCalDDDConstants::layerIndex ( int  lay,
bool  reco 
) const

Definition at line 600 of file HGCalDDDConstants.cc.

References HGCalParameters::depthIndex_, HGCalParameters::depthLayerF_, HGCalParameters::firstLayer_, HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, HGCalParameters::layerIndex_, and mode_.

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

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

Definition at line 612 of file HGCalDDDConstants.cc.

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

Referenced by getUVMax(), and HGCalDDDConstants().

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

Definition at line 105 of file HGCalDDDConstants.h.

References hgpar_, HGCalParameters::levelT_, and maskCell().

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

105 { return hgpar_->levelT_[ind]; }
std::vector< int > levelT_
const HGCalParameters * hgpar_
std::pair< float, float > HGCalDDDConstants::locateCell ( int  cell,
int  lay,
int  type,
bool  reco 
) const

Definition at line 616 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, getIndex(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, mps_fire::i, HGCalParameters::k_ScaleToDDD, mode_, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferTypeT_, x, and y.

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

618  {
619  // type refers to wafer # for hexagon cell
620  float x(999999.), y(999999.);
621  const auto& index = getIndex(lay, reco);
622  int i = index.first;
623  if (i < 0) return std::make_pair(x, y);
626  x = hgpar_->waferPosX_[type];
627  y = hgpar_->waferPosY_[type];
628  if (hgpar_->waferTypeT_[type] == 1) {
629  x += hgpar_->cellFineX_[cell];
630  y += hgpar_->cellFineY_[cell];
631  } else {
632  x += hgpar_->cellCoarseX_[cell];
633  y += hgpar_->cellCoarseY_[cell];
634  }
635  if (!reco) {
638  }
639  }
640  return std::make_pair(x, y);
641 }
std::vector< double > waferPosY_
type
Definition: HCALResponse.h:21
std::vector< double > cellFineY_
HGCalGeometryMode::GeometryMode mode_
std::vector< double > cellCoarseX_
std::pair< int, float > getIndex(int lay, bool reco) const
static double k_ScaleToDDD
std::vector< double > cellFineX_
fixed size matrix
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
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 643 of file HGCalDDDConstants.cc.

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

651  {
652 
653  float x(0), y(0);
654  int indx = HGCalWaferIndex::waferIndex(lay, waferU, waferV);
655  auto itr = hgpar_->typesInLayers_.find(indx);
656  int type = ((itr == hgpar_->typesInLayers_.end())
657  ? 2
658  : hgpar_->waferTypeL_[itr->second]);
659 #ifdef EDM_ML_DEBUG
660  if (debug)
661  edm::LogVerbatim("HGCalGeom")
662  << "LocateCell " << lay << ":" << waferU << ":" << waferV << ":" << indx
663  << ":" << (itr == hgpar_->typesInLayers_.end()) << ":" << type;
664 #endif
665  int kndx = cellV * 100 + cellU;
666  if (type == 0) {
667  auto ktr = hgpar_->cellFineIndex_.find(kndx);
668  if (ktr != hgpar_->cellFineIndex_.end()) {
669  x = hgpar_->cellFineX_[ktr->second];
670  y = hgpar_->cellFineY_[ktr->second];
671  }
672 #ifdef EDM_ML_DEBUG
673  if (debug)
674  edm::LogVerbatim("HGCalGeom")
675  << "Fine " << cellU << ":" << cellV << ":" << kndx << ":" << x << ":"
676  << y << ":" << (ktr != hgpar_->cellFineIndex_.end());
677 #endif
678  } else {
679  auto ktr = hgpar_->cellCoarseIndex_.find(kndx);
680  if (ktr != hgpar_->cellCoarseIndex_.end()) {
681  x = hgpar_->cellCoarseX_[ktr->second];
682  y = hgpar_->cellCoarseY_[ktr->second];
683  }
684 #ifdef EDM_ML_DEBUG
685  if (debug)
686  edm::LogVerbatim("HGCalGeom")
687  << "Coarse " << cellU << ":" << cellV << ":" << kndx << ":" << x
688  << ":" << y << ":" << (ktr != hgpar_->cellCoarseIndex_.end());
689 #endif
690  }
691  if (!reco) {
694  }
695  if (all) {
696  const auto& xy = waferPosition(waferU, waferV, reco);
697  x += xy.first;
698  y += xy.second;
699 #ifdef EDM_ML_DEBUG
700  if (debug)
701  edm::LogVerbatim("HGCalGeom") << "With wafer " << x << ":" << y << ":"
702  << xy.first << ":" << xy.second;
703 #endif
704  }
705  return std::make_pair(x, y);
706 }
type
Definition: HCALResponse.h:21
wafer_map cellFineIndex_
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
#define debug
Definition: HDRShower.cc:19
static double k_ScaleToDDD
wafer_map cellCoarseIndex_
std::vector< double > cellFineX_
wafer_map typesInLayers_
fixed size matrix
std::pair< double, double > waferPosition(int wafer, bool reco) const
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
std::pair< float, float > HGCalDDDConstants::locateCellHex ( int  cell,
int  wafer,
bool  reco 
) const

Definition at line 708 of file HGCalDDDConstants.cc.

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

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

709  {
710  float x(0), y(0);
711  if (hgpar_->waferTypeT_[wafer] == 1) {
712  x = hgpar_->cellFineX_[cell];
713  y = hgpar_->cellFineY_[cell];
714  } else {
715  x = hgpar_->cellCoarseX_[cell];
716  y = hgpar_->cellCoarseY_[cell];
717  }
718  if (!reco) {
721  }
722  return std::make_pair(x, y);
723 }
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
static double k_ScaleToDDD
std::vector< double > cellFineX_
fixed size matrix
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 725 of file HGCalDDDConstants.cc.

References funct::abs(), funct::cos(), getIndex(), hgpar_, HGCalParameters::k_ScaleToDDD, SiStripPI::max, min(), phi, alignCSCRings::r, HGCalParameters::radiusLayer_, rangeR(), HGCalParameters::scintType(), funct::sin(), x, y, z, and HGCalParameters::zLayerHex_.

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

727  {
728  float x(0), y(0);
729  const auto& indx = getIndex(lay, reco);
730  if (indx.first >= 0) {
731  int ir = std::abs(irad);
732  int type = hgpar_->scintType(lay);
733  double phi = (iphi - 0.5) * indx.second;
734  double z = hgpar_->zLayerHex_[indx.first];
735  double r = 0.5 * (hgpar_->radiusLayer_[type][ir - 1] +
736  hgpar_->radiusLayer_[type][ir]);
737  std::pair<double, double> range = rangeR(z, true);
738  r = std::max(range.first, std::min(r, range.second));
739  x = r * std::cos(phi);
740  y = r * std::sin(phi);
741  if (irad < 0) x = -x;
742  }
743  if (!reco) {
746  }
747  return std::make_pair(x, y);
748 }
type
Definition: HCALResponse.h:21
int scintType(const int layer) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
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 double k_ScaleToDDD
fixed size matrix
std::vector< double > radiusLayer_[2]
const HGCalParameters * hgpar_
bool HGCalDDDConstants::maskCell ( const DetId id,
int  corners 
) const

Definition at line 750 of file HGCalDDDConstants.cc.

References DetId::det(), plotBeamSpotDB::first, DetId::Forward, getUVMax(), HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, hgpar_, triggerObjects_cff::id, HGCalParameters::k_CornerSize, RecoTauDiscriminantConfiguration::mask, mode_, N, edm::second(), findQualityFiles::v, HGCalWaferIndex::waferIndex(), and HGCalParameters::waferTypes_.

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

750  {
751  bool mask(false);
752  if (corners > 2 && corners < (int)(HGCalParameters::k_CornerSize)) {
755  int N(0), layer(0), waferU(0), waferV(0), u(0), v(0);
756  if (detId.det() == DetId::Forward) {
757  HFNoseDetId id(detId);
758  N = getUVMax(id.type());
759  layer = id.layer();
760  waferU = id.waferU();
761  waferV = id.waferV();
762  u = id.cellU();
763  v = id.cellV();
764  } else {
765  HGCSiliconDetId id(detId);
766  N = getUVMax(id.type());
767  layer = id.layer();
768  waferU = id.waferU();
769  waferV = id.waferV();
770  u = id.cellU();
771  v = id.cellV();
772  }
773  int wl = HGCalWaferIndex::waferIndex(layer, waferU, waferV);
774  auto itr = hgpar_->waferTypes_.find(wl);
775 #ifdef EDM_ML_DEBUG
776  edm::LogVerbatim("HGCalGeom")
777  << "MaskCell: Layer " << layer << " Wafer " << waferU << ":" << waferV
778  << " Index " << wl << ":" << (itr != hgpar_->waferTypes_.end());
779 #endif
780  if (itr != hgpar_->waferTypes_.end()) {
781  int ncor = (itr->second).first;
782  int fcor = (itr->second).second;
783  if (ncor < corners) {
784  mask = true;
785  } else {
786  if (ncor == 4) {
787  switch (fcor) {
788  case (0): {
789  mask = (v >= N);
790  break;
791  }
792  case (1): {
793  mask = (u >= N);
794  break;
795  }
796  case (2): {
797  mask = (u <= v);
798  break;
799  }
800  case (3): {
801  mask = (v < N);
802  break;
803  }
804  case (4): {
805  mask = (u < N);
806  break;
807  }
808  default: {
809  mask = (u > v);
810  break;
811  }
812  }
813  } else {
814  switch (fcor) {
815  case (0): {
816  if (ncor == 3) {
817  mask = !((u > 2 * v) && (v < N));
818  } else {
819  mask = ((u >= N) && (v >= N) && ((u + v) > (3 * N - 2)));
820  }
821  break;
822  }
823  case (1): {
824  if (ncor == 3) {
825  mask = !((u + v) < N);
826  } else {
827  mask = ((u >= N) && (u > v) && ((2 * u - v) > 2 * N));
828  }
829  break;
830  }
831  case (2): {
832  if (ncor == 3) {
833  mask = !((u < N) && (v > u) && (v > (2 * u - 1)));
834  } else {
835  mask = ((u > 2 * v) && (v < N));
836  }
837  break;
838  }
839  case (3): {
840  if (ncor == 3) {
841  mask = !((v >= u) && ((2 * v - u) > (2 * N - 2)));
842  } else {
843  mask = ((u + v) < N);
844  }
845  break;
846  }
847  case (4): {
848  if (ncor == 3) {
849  mask = !((u >= N) && (v >= N) && ((u + v) > (3 * N - 2)));
850  } else {
851  mask = ((u < N) && (v > u) && (v > (2 * u - 1)));
852  }
853  break;
854  }
855  default: {
856  if (ncor == 3) {
857  mask = !((u >= N) && (u > v) && ((2 * u - v) > 2 * N));
858  } else {
859  mask = ((v >= u) && ((2 * v - u) > (2 * N - 2)));
860  }
861  break;
862  }
863  }
864  }
865 #ifdef EDM_ML_DEBUG
866  edm::LogVerbatim("HGCalGeom")
867  << "Corners: " << ncor << ":" << fcor << " N " << N << " u " << u
868  << " v " << v << " Mask " << mask;
869 #endif
870  }
871  }
872  }
873  }
874  return mask;
875 }
type
Definition: HCALResponse.h:21
HGCalGeometryMode::GeometryMode mode_
U second(std::pair< T, U > const &p)
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
waferT_map waferTypes_
static uint32_t k_CornerSize
#define N
Definition: blowfish.cc:9
const HGCalParameters * hgpar_
int getUVMax(int type) const
int HGCalDDDConstants::maxCells ( bool  reco) const

Definition at line 877 of file HGCalDDDConstants.cc.

References postprocess-scan-build::cells, HGCalParameters::depth_, hgpar_, mps_fire::i, HGCalParameters::layer_, and layers().

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

877  {
878  int cells(0);
879  for (unsigned int i = 0; i < layers(reco); ++i) {
880  int lay = reco ? hgpar_->depth_[i] : hgpar_->layer_[i];
881  if (cells < maxCells(lay, reco)) cells = maxCells(lay, reco);
882  }
883  return cells;
884 }
std::vector< int > layer_
std::vector< int > depth_
unsigned int layers(bool reco) const
fixed size matrix
const HGCalParameters * hgpar_
int maxCells(bool reco) const
int HGCalDDDConstants::maxCells ( int  lay,
bool  reco 
) const

Definition at line 886 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, postprocess-scan-build::cells, HGCalParameters::defineFull_, HGCalParameters::firstLayer_, getIndex(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::HexagonFull, hgpar_, gen::k, SiStripPI::max, mode_, N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, HGCalParameters::scintCells(), HGCalGeometryMode::Trapezoid, HGCalParameters::typesInLayers_, HGCalParameters::waferCopy_, HGCalWaferIndex::waferIndex(), waferInLayerTest(), HGCalParameters::waferTypeL_, HGCalParameters::waferTypeT_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

886  {
887  const auto& index = getIndex(lay, reco);
888  if (index.first < 0) return 0;
891  unsigned int cells(0);
892  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
893  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
894  unsigned int cell = (hgpar_->waferTypeT_[k] == 1)
895  ? (hgpar_->cellFineX_.size())
896  : (hgpar_->cellCoarseX_.size());
897  if (cell > cells) cells = cell;
898  }
899  }
900  return (int)(cells);
901  } else if ((mode_ == HGCalGeometryMode::Hexagon8) ||
903  int cells(0);
904  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
905  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
909  int type = ((itr == hgpar_->typesInLayers_.end())
910  ? 2
911  : hgpar_->waferTypeL_[itr->second]);
912  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
913  cells = std::max(cells, 3 * N * N);
914  }
915  }
916  return cells;
917  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
918  return hgpar_->scintCells(index.first + hgpar_->firstLayer_);
919  } else {
920  return 0;
921  }
922 }
type
Definition: HCALResponse.h:21
static int32_t waferV(const int32_t index)
bool waferInLayerTest(int wafer, int lay, bool full) const
HGCalGeometryMode::GeometryMode mode_
std::vector< double > cellCoarseX_
std::pair< int, float > getIndex(int lay, bool reco) const
int scintCells(const int layer) const
static int32_t waferU(const int32_t index)
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
int k[5][pyjets_maxn]
#define N
Definition: blowfish.cc:9
std::vector< double > cellFineX_
wafer_map typesInLayers_
fixed size matrix
std::vector< int > waferCopy_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
int HGCalDDDConstants::maxCellUV ( ) const
inline

Definition at line 107 of file HGCalDDDConstants.h.

References hgpar_, maxCells(), mode_, HGCalParameters::nCellsFine_, and HGCalGeometryMode::Trapezoid.

Referenced by HGCalTopology::HGCalTopology().

107  {
109  : 2 * hgpar_->nCellsFine_);
110  }
HGCalGeometryMode::GeometryMode mode_
const HGCalParameters * hgpar_
int HGCalDDDConstants::maxModules ( ) const
inline

Definition at line 113 of file HGCalDDDConstants.h.

References modHalf_.

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

Definition at line 114 of file HGCalDDDConstants.h.

References maxRows(), and maxWafersPerLayer_.

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

Definition at line 924 of file HGCalDDDConstants.cc.

References HGCalParameters::defineFull_, getIndex(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::HexagonFull, hgpar_, mps_fire::i, gen::k, mode_, HGCalParameters::waferCopy_, waferInLayerTest(), and HGCalParameters::waferUVMaxLayer_.

Referenced by maxModulesPerLayer().

924  {
925  int kymax(0);
926  const auto& index = getIndex(lay, reco);
927  int i = index.first;
928  if (i < 0) return kymax;
931  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
932  if (waferInLayerTest(k, i, hgpar_->defineFull_)) {
933  int ky = ((hgpar_->waferCopy_[k]) / 100) % 100;
934  if (ky > kymax) kymax = ky;
935  }
936  }
937  } else if ((mode_ == HGCalGeometryMode::Hexagon8) ||
939  kymax = 1 + 2 * hgpar_->waferUVMaxLayer_[index.first];
940  }
941  return kymax;
942 }
bool waferInLayerTest(int wafer, int lay, bool full) const
HGCalGeometryMode::GeometryMode mode_
std::vector< int > waferUVMaxLayer_
std::pair< int, float > getIndex(int lay, bool reco) const
int k[5][pyjets_maxn]
fixed size matrix
std::vector< int > waferCopy_
const HGCalParameters * hgpar_
double HGCalDDDConstants::minSlope ( ) const
inline
int HGCalDDDConstants::modifyUV ( int  uv,
int  type1,
int  type2 
) const

Definition at line 944 of file HGCalDDDConstants.cc.

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

944  {
945  // Modify u/v for transition of type1 to type2
946  return (((type1 == type2) || (type1 * type2 != 0))
947  ? uv
948  : ((type1 == 0) ? (2 * uv + 1) / 3 : (3 * uv) / 2));
949 }
int HGCalDDDConstants::modules ( int  lay,
bool  reco 
) const

Definition at line 951 of file HGCalDDDConstants.cc.

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

Referenced by minSlope(), and wafers().

951  {
952  if (getIndex(lay, reco).first < 0)
953  return 0;
954  else
955  return max_modules_layer_[(int)reco][lay];
956 }
Simrecovecs max_modules_layer_
std::pair< int, float > getIndex(int lay, bool reco) const
fixed size matrix
int HGCalDDDConstants::modulesInit ( int  lay,
bool  reco 
) const

Definition at line 958 of file HGCalDDDConstants.cc.

References HGCalParameters::defineFull_, HGCalParameters::firstModule_, getIndex(), hgpar_, gen::k, HGCalParameters::lastModule_, mode_, HGCalGeometryMode::Trapezoid, waferInLayerTest(), and HGCalParameters::waferPosX_.

Referenced by HGCalDDDConstants(), and minSlope().

958  {
959  int nmod(0);
960  const auto& index = getIndex(lay, reco);
961  if (index.first < 0) return nmod;
963  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
964  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) ++nmod;
965  }
966  } else {
967  nmod = 1 + hgpar_->lastModule_[index.first] -
968  hgpar_->firstModule_[index.first];
969  }
970  return nmod;
971 }
bool waferInLayerTest(int wafer, int lay, bool full) const
HGCalGeometryMode::GeometryMode mode_
std::vector< int > firstModule_
std::pair< int, float > getIndex(int lay, bool reco) const
int k[5][pyjets_maxn]
std::vector< int > lastModule_
fixed size matrix
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
double HGCalDDDConstants::mouseBite ( bool  reco) const

Definition at line 973 of file HGCalDDDConstants.cc.

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

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

973  {
974  return (reco ? hgpar_->mouseBite_
976 }
static double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_
int HGCalDDDConstants::numberCells ( bool  reco) const

Definition at line 978 of file HGCalDDDConstants.cc.

References postprocess-scan-build::cells, HGCalParameters::depth_, hgpar_, gen::k, HGCalParameters::layer_, and trackingPlots::reco.

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

978  {
979  int cells(0);
980  unsigned int nlayer = (reco) ? hgpar_->depth_.size() : hgpar_->layer_.size();
981  for (unsigned k = 0; k < nlayer; ++k) {
982  std::vector<int> ncells =
983  numberCells(((reco) ? hgpar_->depth_[k] : hgpar_->layer_[k]), reco);
984  cells = std::accumulate(ncells.begin(), ncells.end(), cells);
985  }
986  return cells;
987 }
std::vector< int > layer_
std::vector< int > depth_
int k[5][pyjets_maxn]
int numberCells(bool reco) const
fixed size matrix
const HGCalParameters * hgpar_
std::vector< int > HGCalDDDConstants::numberCells ( int  lay,
bool  reco 
) const

Definition at line 989 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, HGCalParameters::defineFull_, HGCalParameters::firstModule_, getIndex(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, mps_fire::i, gen::k, mode_, numberCellsHexagon(), HGCalParameters::scintCells(), HGCalGeometryMode::Trapezoid, HGCalParameters::waferCopy_, waferInLayerTest(), HGCalParameters::waferTypeT_, HGCalWaferIndex::waferU(), and HGCalWaferIndex::waferV().

989  {
990  const auto& index = getIndex(lay, reco);
991  int i = index.first;
992  std::vector<int> ncell;
993  if (i >= 0) {
996  for (unsigned int k = 0; k < hgpar_->waferTypeT_.size(); ++k) {
997  if (waferInLayerTest(k, i, hgpar_->defineFull_)) {
998  unsigned int cell = (hgpar_->waferTypeT_[k] == 1)
999  ? (hgpar_->cellFineX_.size())
1000  : (hgpar_->cellCoarseX_.size());
1001  ncell.emplace_back((int)(cell));
1002  }
1003  }
1004  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
1005  int nphi = hgpar_->scintCells(lay);
1006  for (int k = hgpar_->firstModule_[i]; k <= hgpar_->lastModule_[i]; ++k)
1007  ncell.emplace_back(nphi);
1008  } else {
1009  for (unsigned int k = 0; k < hgpar_->waferCopy_.size(); ++k) {
1010  if (waferInLayerTest(k, index.first, hgpar_->defineFull_)) {
1011  int cell = numberCellsHexagon(
1014  ncell.emplace_back(cell);
1015  }
1016  }
1017  }
1018  }
1019  return ncell;
1020 }
static int32_t waferV(const int32_t index)
bool waferInLayerTest(int wafer, int lay, bool full) const
HGCalGeometryMode::GeometryMode mode_
std::vector< double > cellCoarseX_
std::vector< int > firstModule_
int numberCellsHexagon(int wafer) const
std::pair< int, float > getIndex(int lay, bool reco) const
int scintCells(const int layer) const
static int32_t waferU(const int32_t index)
int k[5][pyjets_maxn]
std::vector< double > cellFineX_
fixed size matrix
std::vector< int > waferCopy_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
int HGCalDDDConstants::numberCellsHexagon ( int  wafer) const

Definition at line 1022 of file HGCalDDDConstants.cc.

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

Referenced by HGCalTriggerGeometryHexImp1::fillMaps(), minSlope(), HGCalGeometry::newCell(), and numberCells().

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

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

1034  {
1035  auto itr = hgpar_->typesInLayers_.find(
1036  HGCalWaferIndex::waferIndex(lay, waferU, waferV));
1037  int type = ((itr == hgpar_->typesInLayers_.end())
1038  ? 2
1039  : hgpar_->waferTypeL_[itr->second]);
1040  int N = (type == 0) ? hgpar_->nCellsFine_ : hgpar_->nCellsCoarse_;
1041  if (flag)
1042  return (3 * N * N);
1043  else
1044  return N;
1045 }
type
Definition: HCALResponse.h:21
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
#define N
Definition: blowfish.cc:9
wafer_map typesInLayers_
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
std::pair< double, double > HGCalDDDConstants::rangeR ( double  z,
bool  reco 
) const

Definition at line 1047 of file HGCalDDDConstants.cc.

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

Referenced by HGCalNumberingScheme::checkPosition(), HGCDigitizer::checkPosition(), locateCellTrap(), minSlope(), and HGCalGeometry::neighborZ().

1047  {
1048  double rmin(0), rmax(0), zz(0);
1049  if (hgpar_->detectorType_ > 0) {
1050  zz = (reco ? std::abs(z) : HGCalParameters::k_ScaleFromDDD * std::abs(z));
1051  if (hgpar_->detectorType_ <= 2) {
1053  hgpar_->slopeMin_);
1054  } else {
1057  hgpar_->zLayerHex_,
1059  }
1060  if ((hgpar_->detectorType_ == 2) &&
1061  (zz >= hgpar_->zLayerHex_[hgpar_->firstMixedLayer_ - 1])) {
1064  hgpar_->zLayerHex_,
1066  } else {
1068  hgpar_->rMaxFront_,
1069  hgpar_->slopeTop_);
1070  }
1071  }
1072  if (!reco) {
1075  }
1076 #ifdef EDM_ML_DEBUG
1077  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeR: " << z << ":"
1078  << zz << " R " << rmin << ":" << rmax;
1079 #endif
1080  return std::make_pair(rmin, rmax);
1081 }
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_
std::vector< double > radiusMixBoundary_
static double k_ScaleToDDD
std::vector< double > rMinFront_
fixed size matrix
std::vector< double > zFrontTop_
const HGCalParameters * hgpar_
std::pair< double, double > HGCalDDDConstants::rangeZ ( bool  reco) const

Definition at line 1083 of file HGCalDDDConstants.cc.

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

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

1083  {
1084  double zmin = (hgpar_->zLayerHex_[0] - hgpar_->waferThick_);
1085  double zmax =
1086  (hgpar_->zLayerHex_[hgpar_->zLayerHex_.size() - 1] + hgpar_->waferThick_);
1087 #ifdef EDM_ML_DEBUG
1088  edm::LogVerbatim("HGCalGeom") << "HGCalDDDConstants:rangeZ: " << zmin << ":"
1089  << zmax << ":" << hgpar_->waferThick_;
1090 #endif
1091  if (!reco) {
1094  }
1095  return std::make_pair(zmin, zmax);
1096 }
std::vector< double > zLayerHex_
static double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_
std::pair< int, int > HGCalDDDConstants::rowColumnWafer ( const int  wafer) const

Definition at line 1098 of file HGCalDDDConstants.cc.

References cuy::col, popcon2dropbox::copy(), hgpar_, and HGCalParameters::waferCopy_.

Referenced by minSlope().

1098  {
1099  int row(0), col(0);
1100  if (wafer < (int)(hgpar_->waferCopy_.size())) {
1101  int copy = hgpar_->waferCopy_[wafer];
1102  col = copy % 100;
1103  if ((copy / 10000) % 10 != 0) col = -col;
1104  row = (copy / 100) % 100;
1105  if ((copy / 100000) % 10 != 0) row = -row;
1106  }
1107  return std::make_pair(row, col);
1108 }
def copy(args, dbName)
std::vector< int > waferCopy_
col
Definition: cuy.py:1010
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 1110 of file HGCalDDDConstants.cc.

References egammaForCoreTracking_cff::depth, getIndex(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, mps_fire::i, HGCalParameters::layerGroup_, HGCalParameters::layerGroupM_, HGCalParameters::layerGroupO_, mod(), mode_, findQualityFiles::size, and HGCalParameters::waferTypeL_.

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

1111  {
1112  if ((mode_ != HGCalGeometryMode::Hexagon) &&
1114  return std::make_pair(cell, lay);
1115  } else {
1116  const auto& index = getIndex(lay, false);
1117  int i = index.first;
1118  if (i < 0) {
1119  edm::LogWarning("HGCalGeom")
1120  << "Wrong Layer # " << lay << " not in the list ***** ERROR *****";
1121  return std::make_pair(-1, -1);
1122  }
1123  if (mod >= (int)(hgpar_->waferTypeL_).size()) {
1124  edm::LogWarning("HGCalGeom")
1125  << "Invalid Wafer # " << mod << "should be < "
1126  << (hgpar_->waferTypeL_).size() << " ***** ERROR *****";
1127  return std::make_pair(-1, -1);
1128  }
1129  int depth(-1);
1130  int kx = cell;
1131  int type = hgpar_->waferTypeL_[mod];
1132  if (type == 1) {
1133  depth = hgpar_->layerGroup_[i];
1134  } else if (type == 2) {
1135  depth = hgpar_->layerGroupM_[i];
1136  } else {
1137  depth = hgpar_->layerGroupO_[i];
1138  }
1139  return std::make_pair(kx, depth);
1140  }
1141 }
size
Write out results.
type
Definition: HCALResponse.h:21
std::vector< int > layerGroupM_
HGCalGeometryMode::GeometryMode mode_
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< int > layerGroup_
std::vector< int > layerGroupO_
const HGCalParameters * hgpar_
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< int > waferTypeL_
unsigned int HGCalDDDConstants::volumes ( ) const
inline
int HGCalDDDConstants::waferCount ( const int  type) const
inline

Definition at line 139 of file HGCalDDDConstants.h.

References waferMax_.

139  {
140  return ((type == 0) ? waferMax_[2] : waferMax_[3]);
141  }
type
Definition: HCALResponse.h:21
std::array< int, 4 > waferMax_
int HGCalDDDConstants::waferFromCopy ( int  copy) const

Definition at line 1143 of file HGCalDDDConstants.cc.

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

Referenced by HGCNumberingScheme::getUnitID(), and volumes().

1143  {
1144  const int ncopies = hgpar_->waferCopy_.size();
1145  int wafer(ncopies);
1146  bool result(false);
1147  for (int k = 0; k < ncopies; ++k) {
1148  if (copy == hgpar_->waferCopy_[k]) {
1149  wafer = k;
1150  result = true;
1151  break;
1152  }
1153  }
1154  if (!result) {
1155  wafer = -1;
1156 #ifdef EDM_ML_DEBUG
1157  edm::LogVerbatim("HGCalGeom")
1158  << "Cannot find " << copy << " in a list of " << ncopies << " members";
1159  for (int k = 0; k < ncopies; ++k)
1160  edm::LogVerbatim("HGCalGeom")
1161  << "[" << k << "] " << hgpar_->waferCopy_[k];
1162 #endif
1163  }
1164  return wafer;
1165 }
def copy(args, dbName)
int k[5][pyjets_maxn]
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 1167 of file HGCalDDDConstants.cc.

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

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

1169  {
1170  // Input x, y in Geant4 unit and transformed to CMSSW standard
1173  int size_ = (int)(hgpar_->waferCopy_.size());
1174  wafer = size_;
1175  for (int k = 0; k < size_; ++k) {
1176  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1177  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1178  if (dx <= rmax_ && dy <= hexside_) {
1179  if ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy))) {
1180  wafer = k;
1181  celltyp = hgpar_->waferTypeT_[k];
1182  xx -= hgpar_->waferPosX_[k];
1183  yy -= hgpar_->waferPosY_[k];
1184  break;
1185  }
1186  }
1187  }
1188  if (wafer < size_) {
1189  if (celltyp == 1)
1190  icell = cellHex(
1191  xx, yy, 0.5 * HGCalParameters::k_ScaleFromDDD * hgpar_->cellSize_[0],
1193  else
1194  icell = cellHex(
1195  xx, yy, 0.5 * HGCalParameters::k_ScaleFromDDD * hgpar_->cellSize_[1],
1197  } else {
1198  wafer = -1;
1199 #ifdef EDM_ML_DEBUG
1200  edm::LogWarning("HGCalGeom") << "Cannot get wafer type corresponding to "
1201  << x << ":" << y << " " << xx << ":" << yy;
1202 #endif
1203  }
1204 #ifdef EDM_ML_DEBUG
1205  edm::LogVerbatim("HGCalGeom")
1206  << "Position " << x << ":" << y << " Wafer " << wafer << ":" << size_
1207  << " XX " << xx << ":" << yy << " Cell " << icell << " Type " << celltyp;
1208 #endif
1209 }
std::vector< double > waferPosY_
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_
static double k_ScaleFromDDD
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int k[5][pyjets_maxn]
std::vector< double > cellFineX_
std::vector< int > waferCopy_
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
static double tan30deg_
void HGCalDDDConstants::waferFromPosition ( const double  x,
const double  y,
const int  layer,
int &  waferU,
int &  waferV,
int &  cellU,
int &  cellV,
int &  celltype,
double &  wt,
bool  debug = false 
) const

Definition at line 1211 of file HGCalDDDConstants.cc.

References funct::abs(), cellHex(), HGCalParameters::cellThickness_, debug, PVValHelper::dx, PVValHelper::dy, EDM_ML_DEBUG, hexside_, hgpar_, gen::k, HGCalParameters::k_ScaleFromDDD, HGCalParameters::nCellsFine_, rmax_, tan30deg_, HGCalParameters::typesInLayers_, HGCalParameters::waferCopy_, HGCalWaferIndex::waferIndex(), HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferThick_, HGCalParameters::waferTypeL_, HGCalWaferIndex::waferU(), HGCalParameters::waferUVMax_, HGCalWaferIndex::waferV(), globals_cff::x1, geometryCSVtoXML::xx, and geometryCSVtoXML::yy.

1219  {
1220 
1223  waferU = waferV = 1 + hgpar_->waferUVMax_;
1224  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1225  double dx = std::abs(xx - hgpar_->waferPosX_[k]);
1226  double dy = std::abs(yy - hgpar_->waferPosY_[k]);
1227  if (dx <= rmax_ && dy <= hexside_) {
1228  if ((dy <= 0.5 * hexside_) || (dx * tan30deg_ <= (hexside_ - dy))) {
1231  auto itr = hgpar_->typesInLayers_.find(
1232  HGCalWaferIndex::waferIndex(layer, waferU, waferV));
1233  celltype = ((itr == hgpar_->typesInLayers_.end())
1234  ? 2
1235  : hgpar_->waferTypeL_[itr->second]);
1236 #ifdef EDM_ML_DEBUG
1237  if (debug)
1238  edm::LogVerbatim("HGCalGeom")
1239  << "WaferFromPosition:: Input " << xx << ":" << yy
1240  << " compared with " << hgpar_->waferPosX_[k] << ":"
1241  << hgpar_->waferPosY_[k] << " difference " << dx << ":" << dy
1242  << ":" << dx * tan30deg_ << ":" << (hexside_ - dy)
1243  << " comparator " << rmax_ << ":" << hexside_ << " wafer "
1244  << waferU << ":" << waferV << ":" << celltype;
1245 #endif
1246  xx -= hgpar_->waferPosX_[k];
1247  yy -= hgpar_->waferPosY_[k];
1248  break;
1249  }
1250  }
1251  }
1252  if (std::abs(waferU) <= hgpar_->waferUVMax_) {
1253  cellHex(xx, yy, celltype, cellU, cellV
1254 #ifdef EDM_ML_DEBUG
1255  ,
1256  debug
1257 #endif
1258  );
1259  wt = ((celltype < 2)
1260  ? (hgpar_->cellThickness_[celltype] / hgpar_->waferThick_)
1261  : 1.0);
1262  } else {
1263  cellU = cellV = 2 * hgpar_->nCellsFine_;
1264  wt = 1.0;
1265  celltype = -1;
1266  }
1267 #ifdef EDM_ML_DEBUG
1268  if (celltype < 0) {
1270  double y1(HGCalParameters::k_ScaleFromDDD * y);
1271  edm::LogVerbatim("HGCalGeom")
1272  << "waferFromPosition: Bad type for X " << x << ":" << x1 << ":" << xx
1273  << " Y " << y << ":" << y1 << ":" << yy << " Wafer " << waferU << ":"
1274  << waferV << " Cell " << cellU << ":" << cellV;
1275  for (unsigned int k = 0; k < hgpar_->waferPosX_.size(); ++k) {
1276  double dx = std::abs(x1 - hgpar_->waferPosX_[k]);
1277  double dy = std::abs(y1 - hgpar_->waferPosY_[k]);
1278  edm::LogVerbatim("HGCalGeom")
1279  << "Wafer [" << k << "] Position (" << hgpar_->waferPosX_[k] << ", "
1280  << hgpar_->waferPosY_[k] << ") difference " << dx << ":" << dy << ":"
1281  << dx * tan30deg_ << ":" << hexside_ - dy << " Paramerers " << rmax_
1282  << ":" << hexside_;
1283  }
1284  }
1285 #endif
1286 }
std::vector< double > waferPosY_
static int32_t waferV(const int32_t index)
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
static double k_ScaleFromDDD
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static int32_t waferU(const int32_t index)
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
int k[5][pyjets_maxn]
#define debug
Definition: HDRShower.cc:19
std::vector< double > cellThickness_
wafer_map typesInLayers_
std::vector< int > waferCopy_
#define EDM_ML_DEBUG
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::vector< int > waferTypeL_
static double tan30deg_
bool HGCalDDDConstants::waferFullInLayer ( int  wafer,
int  lay,
bool  reco 
) const

Definition at line 1294 of file HGCalDDDConstants.cc.

References getIndex(), and waferInLayerTest().

Referenced by volumes().

1294  {
1295  const auto& indx = getIndex(lay, reco);
1296  if (indx.first < 0) return false;
1297  return waferInLayerTest(wafer, indx.first, false);
1298 }
bool waferInLayerTest(int wafer, int lay, bool full) const
std::pair< int, float > getIndex(int lay, bool reco) const
fixed size matrix
bool HGCalDDDConstants::waferInLayer ( int  wafer,
int  lay,
bool  reco 
) const

Definition at line 1288 of file HGCalDDDConstants.cc.

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

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

1288  {
1289  const auto& indx = getIndex(lay, reco);
1290  if (indx.first < 0) return false;
1291  return waferInLayerTest(wafer, indx.first, hgpar_->defineFull_);
1292 }
bool waferInLayerTest(int wafer, int lay, bool full) const
std::pair< int, float > getIndex(int lay, bool reco) const
fixed size matrix
const HGCalParameters * hgpar_
bool HGCalDDDConstants::waferInLayerTest ( int  wafer,
int  lay,
bool  full 
) const
private

Definition at line 1522 of file HGCalDDDConstants.cc.

References TCMET_cfi::corner, RemoveAddSevLevel::flag, HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hexside_, hgpar_, recoMuon::in, HGCalParameters::k_CornerSize, mode_, rmax_, HGCalParameters::rMaxLayHex_, HGCalParameters::rMinLayHex_, HGCalGeomTools::waferCorner(), HGCalParameters::waferPosX_, and HGCalParameters::waferPosY_.

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

1522  {
1523  bool flag = ((mode_ == HGCalGeometryMode::Hexagon) ||
1525  ? true
1526  : false;
1527  std::pair<int, int> corner = HGCalGeomTools::waferCorner(
1528  hgpar_->waferPosX_[wafer], hgpar_->waferPosY_[wafer], rmax_, hexside_,
1529  hgpar_->rMinLayHex_[lay], hgpar_->rMaxLayHex_[lay], flag);
1530  bool in = (full ? (corner.first > 0)
1531  : (corner.first == (int)(HGCalParameters::k_CornerSize)));
1532 #ifdef EDM_ML_DEBUG
1533  edm::LogVerbatim("HGCalGeom")
1534  << "WaferInLayerTest: Layer " << lay << " wafer " << wafer << " R-limits "
1535  << hgpar_->rMinLayHex_[lay] << ":" << hgpar_->rMaxLayHex_[lay]
1536  << " Corners " << corner.first << ":" << corner.second << " In " << in;
1537 #endif
1538  return in;
1539 }
std::vector< double > waferPosY_
HGCalGeometryMode::GeometryMode mode_
static std::pair< int32_t, int32_t > waferCorner(double xpos, double ypos, double r, double R, double rMin, double rMax, bool oldBug=false)
Definition: GenABIO.cc:168
std::vector< double > rMinLayHex_
std::vector< double > rMaxLayHex_
static uint32_t k_CornerSize
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
int HGCalDDDConstants::waferMax ( ) const
inline

Definition at line 142 of file HGCalDDDConstants.h.

References waferMax_.

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

Definition at line 143 of file HGCalDDDConstants.h.

References waferMax_, and waferPosition().

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

Definition at line 1300 of file HGCalDDDConstants.cc.

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

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

1301  {
1302  double xx(0), yy(0);
1303  if (wafer >= 0 && wafer < (int)(hgpar_->waferPosX_.size())) {
1304  xx = hgpar_->waferPosX_[wafer];
1305  yy = hgpar_->waferPosY_[wafer];
1306  }
1307  if (!reco) {
1310  }
1311  return std::make_pair(xx, yy);
1312 }
std::vector< double > waferPosY_
static double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::pair< double, double > HGCalDDDConstants::waferPosition ( int  waferU,
int  waferV,
bool  reco 
) const

Definition at line 1314 of file HGCalDDDConstants.cc.

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

1316  {
1317  double xx(0), yy(0);
1318  int indx = HGCalWaferIndex::waferIndex(0, waferU, waferV);
1319  auto itr = hgpar_->wafersInLayers_.find(indx);
1320  if (itr != hgpar_->wafersInLayers_.end()) {
1321  xx = hgpar_->waferPosX_[itr->second];
1322  yy = hgpar_->waferPosY_[itr->second];
1323  }
1324  if (!reco) {
1327  }
1328  return std::make_pair(xx, yy);
1329 }
std::vector< double > waferPosY_
wafer_map wafersInLayers_
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
static double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
int HGCalDDDConstants::wafers ( ) const

Definition at line 1368 of file HGCalDDDConstants.cc.

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

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

1368  {
1369  int wafer(0);
1371  for (unsigned int i = 0; i < layers(true); ++i) {
1372  int lay = hgpar_->depth_[i];
1373  wafer += modules(lay, true);
1374  }
1375  } else {
1376  wafer = (int)(hgpar_->moduleLayR_.size());
1377  }
1378  return wafer;
1379 }
std::vector< int > depth_
std::vector< int > moduleLayR_
HGCalGeometryMode::GeometryMode mode_
int modules(int lay, bool reco) const
unsigned int layers(bool reco) const
const HGCalParameters * hgpar_
int HGCalDDDConstants::wafers ( int  layer,
int  type 
) const

Definition at line 1381 of file HGCalDDDConstants.cc.

References HGCalParameters::firstModule_, getIndex(), hgpar_, HGCalParameters::lastModule_, mode_, HGCalGeometryMode::Trapezoid, and waferLayer_.

1381  {
1382  int wafer(0);
1384  auto itr = waferLayer_.find(layer);
1385  if (itr != waferLayer_.end()) {
1386  unsigned ity = (type > 0 && type <= 2) ? type : 0;
1387  wafer = (itr->second)[ity];
1388  }
1389  } else {
1390  const auto& index = getIndex(layer, true);
1391  wafer = 1 + hgpar_->lastModule_[index.first] -
1392  hgpar_->firstModule_[index.first];
1393  }
1394  return wafer;
1395 }
type
Definition: HCALResponse.h:21
HGCalGeometryMode::GeometryMode mode_
std::map< int, HGCWaferParam > waferLayer_
std::vector< int > firstModule_
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< int > lastModule_
const HGCalParameters * hgpar_
double HGCalDDDConstants::waferSepar ( bool  reco) const
inline

Definition at line 147 of file HGCalDDDConstants.h.

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

147  {
148  return (reco ? hgpar_->sensorSeparation_
150  }
static double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_
double HGCalDDDConstants::waferSize ( bool  reco) const
inline

Definition at line 151 of file HGCalDDDConstants.h.

References hgpar_, HGCalParameters::k_ScaleToDDD, wafers(), and HGCalParameters::waferSize_.

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

151  {
152  return (reco ? hgpar_->waferSize_
154  }
static double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_
int HGCalDDDConstants::waferToCopy ( int  wafer) const
inline

Definition at line 157 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferCopy_.

157  {
158  return ((wafer >= 0) && (wafer < (int)(hgpar_->waferCopy_.size())))
159  ? hgpar_->waferCopy_[wafer]
160  : (int)(hgpar_->waferCopy_.size());
161  }
std::vector< int > waferCopy_
const HGCalParameters * hgpar_
int HGCalDDDConstants::waferType ( DetId const &  id) const

Definition at line 1331 of file HGCalDDDConstants.cc.

References DetId::Forward, HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::HexagonFull, mode_, HGCSiliconDetId::type(), HFNoseDetId::type(), and waferTypeL().

Referenced by hgc_digi_utils::addCellMetadata(), assignCellHex(), getUVMax(), and HGCalUncalibRecHitRecWeightsAlgo< HGCDataFrame >::makeRecHit().

1331  {
1332  int type(1);
1335  type = ((id.det() != DetId::Forward) ? (1 + HGCSiliconDetId(id).type())
1336  : (1 + HFNoseDetId(id).type()));
1337  } else if ((mode_ == HGCalGeometryMode::Hexagon) ||
1339  type = waferTypeL(HGCalDetId(id).wafer());
1340  }
1341  return type;
1342 }
type
Definition: HCALResponse.h:21
int type() const
get the type
Definition: HFNoseDetId.h:52
HGCalGeometryMode::GeometryMode mode_
int type() const
get the type
int waferTypeL(int wafer) const
int HGCalDDDConstants::waferTypeL ( int  wafer) const
inline

Definition at line 169 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferTypeL_.

Referenced by HGCalTriggerTools::sensorCellThicknessV8(), and waferType().

169  {
170  return ((wafer >= 0) && (wafer < (int)(hgpar_->waferTypeL_.size())))
171  ? hgpar_->waferTypeL_[wafer]
172  : 0;
173  }
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
int HGCalDDDConstants::waferTypeT ( int  wafer) const
inline
int HGCalDDDConstants::waferUVMax ( ) const
inline
bool HGCalDDDConstants::waferVirtual ( int  layer,
int  waferU,
int  waferV 
) const

Definition at line 1344 of file HGCalDDDConstants.cc.

References HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::HexagonFull, hgpar_, mode_, HGCalWaferIndex::waferIndex(), and HGCalParameters::waferTypes_.

Referenced by waferUVMax().

1344  {
1345  bool type(false);
1348  int wl = HGCalWaferIndex::waferIndex(layer, waferU, waferV, false);
1349  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1350  } else if ((mode_ == HGCalGeometryMode::Hexagon) ||
1352  int wl = HGCalWaferIndex::waferIndex(layer, waferU, 0, true);
1353  type = (hgpar_->waferTypes_.find(wl) != hgpar_->waferTypes_.end());
1354  }
1355  return type;
1356 }
type
Definition: HCALResponse.h:21
HGCalGeometryMode::GeometryMode mode_
static int32_t waferIndex(int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
waferT_map waferTypes_
const HGCalParameters * hgpar_
double HGCalDDDConstants::waferZ ( int  layer,
bool  reco 
) const

Definition at line 1358 of file HGCalDDDConstants.cc.

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

Referenced by HGCalSimHitValidation::analyzeHits(), HGCalTBAnalyzer::analyzeRecHits(), HGCalTBAnalyzer::analyzeSimHits(), HGCalNumberingScheme::checkPosition(), HGCalTriggerTools::getLayerZ(), hgcal::RecHitTools::getPositionLayer(), HGCalGeometry::neighborZ(), and waferUVMax().

1358  {
1359  const auto& index = getIndex(lay, reco);
1360  if (index.first < 0)
1361  return 0;
1362  else
1363  return (reco ? hgpar_->zLayerHex_[index.first]
1365  hgpar_->zLayerHex_[index.first]);
1366 }
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< double > zLayerHex_
static double k_ScaleToDDD
fixed size matrix
const HGCalParameters * hgpar_

Member Data Documentation

const float HGCalDDDConstants::dPhiMin = 0.02
private

Definition at line 190 of file HGCalDDDConstants.h.

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

Definition at line 189 of file HGCalDDDConstants.h.

Simrecovecs HGCalDDDConstants::max_modules_layer_
private

Definition at line 200 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and modules().

int32_t HGCalDDDConstants::maxWafersPerLayer_
private

Definition at line 201 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and maxModulesPerLayer().

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

Definition at line 198 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and maxModules().

double HGCalDDDConstants::rmax_
private
const double HGCalDDDConstants::sqrt3_
private

Definition at line 195 of file HGCalDDDConstants.h.

Referenced by cellHex(), and distFromEdgeHex().

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

Definition at line 199 of file HGCalDDDConstants.h.

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

int32_t HGCalDDDConstants::tot_wafers_
private

Definition at line 198 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants().

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

Definition at line 204 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and isValidHex8().

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

Definition at line 202 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and wafers().

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

Definition at line 203 of file HGCalDDDConstants.h.

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