CMS 3D CMS Logo

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

#include <HGCalDDDConstants.h>

Public Member Functions

std::pair< int, int > assignCell (float x, float y, int lay, int subSec, bool reco) const
 
std::pair< int, int > assignCellHexagon (float x, float y) const
 
double cellSizeHex (int type) const
 
HGCalGeometryMode::GeometryMode geomMode () const
 
std::pair< int, float > getIndex (int lay, bool reco) const
 
HGCalParameters::hgtrap getModule (unsigned int k, bool hexType, bool reco) const
 
std::vector< HGCalParameters::hgtrapgetModules () const
 
HGCalParameters::hgtrform getTrForm (unsigned int k) const
 
unsigned int getTrFormN () const
 
std::vector< HGCalParameters::hgtrformgetTrForms () const
 
 HGCalDDDConstants (const HGCalParameters *hp, const std::string &name)
 
bool isHalfCell (int waferType, int cell) const
 
bool isValid (int lay, int mod, int cell, bool reco) const
 
bool isValidCell (int layindex, int wafer, int cell) const
 
unsigned int layers (bool reco) const
 
unsigned int layersInit (bool reco) const
 
int levelTop () const
 
std::pair< float, float > locateCell (int cell, int lay, int type, bool reco) const
 
std::pair< float, float > locateCellHex (int cell, int wafer, bool reco) const
 
int maxCells (bool reco) const
 
int maxCells (int lay, bool reco) const
 
int maxModules () const
 
int maxRows (int lay, bool reco) const
 
double minSlope () const
 
int modules (int lay, bool reco) const
 
int modulesInit (int lay, bool reco) const
 
std::vector< int > numberCells (int lay, bool reco) const
 
int numberCellsHexagon (int wafer) 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
 
bool waferInLayer (int wafer, int lay, bool reco) const
 
int waferMax () const
 
int waferMin () const
 
std::pair< double, double > waferPosition (int wafer, bool reco=true) const
 
int wafers () const
 
int wafers (int layer, int type) const
 
int waferToCopy (int wafer) const
 
int waferTypeL (int wafer) const
 
int waferTypeT (int wafer) 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
 
bool waferInLayer (int wafer, int lay) const
 

Private Attributes

double hexside_
 
const HGCalParametershgpar_
 
Simrecovecs max_modules_layer_
 
HGCalGeometryMode::GeometryMode mode_
 
int32_t modHalf_
 
double rmax_
 
std::array< uint32_t, 2 > tot_layers_
 
int32_t tot_wafers_
 
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 91 of file HGCalDDDConstants.h.

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

Definition at line 90 of file HGCalDDDConstants.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file HGCalDDDConstants.cc.

References HGCalParameters::cellSize_, funct::cos(), gather_cfg::cout, getIndex(), getTrForm(), getTrFormN(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hexside_, hgpar_, mps_fire::i, k_ScaleFromDDD, HGCalParameters::hgtrform::lay, layers(), layersInit(), max_modules_layer_, maxCells(), mode_, HGCalParameters::mode_, modHalf_, modulesInit(), rmax_, sectors(), tan30deg_, tot_layers_, tot_wafers_, waferInLayer(), waferLayer_, waferMax_, HGCalParameters::waferR_, and wafers().

16  : hgpar_(hp) {
17  mode_ = hgpar_->mode_;
20  rmax_ = k_ScaleFromDDD * (hgpar_->waferR_) * std::cos(30.0*CLHEP::deg);
21  hexside_ = 2.0 * rmax_ * tan30deg_;
22 #ifdef EDM_ML_DEBUG
23  std::cout << "rmax_ " << rmax_ << ":" << hexside_ << " CellSize "
24  << 0.5*k_ScaleFromDDD*hgpar_->cellSize_[0] << ":"
25  << 0.5*k_ScaleFromDDD*hgpar_->cellSize_[1] << std::endl;
26 #endif
27  // init maps and constants
28  modHalf_ = 0;
29  for (int simreco = 0; simreco < 2; ++simreco) {
30  tot_layers_[simreco] = layersInit((bool)simreco);
31  max_modules_layer_[simreco].resize(tot_layers_[simreco]+1);
32  for (unsigned int layer=1; layer <= tot_layers_[simreco]; ++layer) {
33  max_modules_layer_[simreco][layer] = modulesInit(layer,(bool)simreco);
34  if (simreco == 1) {
35  modHalf_ += max_modules_layer_[simreco][layer];
36 #ifdef EDM_ML_DEBUG
37  std::cout << "Layer " << layer << " with " << max_modules_layer_[simreco][layer] << ":" << modHalf_ << " modules\n";
38 #endif
39  }
40  }
41  }
42  tot_wafers_ = wafers();
43 
44  edm::LogInfo("HGCalGeom") << "HGCalDDDConstants initialized for " << name
45  << " with " << layers(false) << ":"
46  << layers(true) << " layers, " << wafers()
47  << ":" << 2*modHalf_ << " wafers and "
48  << "maximum of " << maxCells(false) << ":"
49  << maxCells(true) << " cells";
50 
51 #ifdef EDM_ML_DEBUG
52  std::cout << "HGCalDDDConstants initialized for " << name << " with "
53  << layers(false) << ":" << layers(true) << " layers, "
54  << wafers() << " wafers and " << "maximum of " << maxCells(false)
55  << ":" << maxCells(true) << " cells" << std::endl;
56 #endif
57 
58  }
59 
60  int wminT(9999999), wmaxT(0), kount1(0), kount2(0);
61  for (unsigned int i=0; i<getTrFormN(); ++i) {
62  int lay0 = getTrForm(i).lay;
63  int wmin(9999999), wmax(0), kount(0);
64  for (int wafer=0; wafer<sectors(); ++wafer) {
65  if (waferInLayer(wafer,lay0,true)) {
66  if (wafer < wmin) wmin = wafer;
67  if (wafer > wmax) wmax = wafer;
68  ++kount;
69  }
70  }
71  if (wminT > wmin) wminT = wmin;
72  if (wmaxT < wmax) wmaxT = wmax;
73  if (kount1 < kount) kount1= kount;
74  kount2 += kount;
75 #ifdef EDM_ML_DEBUG
76  int lay1 = getIndex(lay0,true).first;
77  std::cout << "Index " << i << " Layer " << lay0 << ":" << lay1
78  << " Wafer " << wmin << ":" << wmax << ":" << kount << std::endl;
79 #endif
80  HGCWaferParam a1{ {wmin,wmax,kount} };
81  waferLayer_[lay0] = a1;
82  }
83  waferMax_ = std::array<int,4>{ {wminT,wmaxT,kount1,kount2} };
84 #ifdef EDM_ML_DEBUG
85  std::cout << "Overall wafer statistics: " << wminT << ":" << wmaxT << ":"
86  << kount1 << ":" << kount2 << std::endl;
87 #endif
88 }
std::array< uint32_t, 2 > tot_layers_
std::map< int, HGCWaferParam > waferLayer_
HGCalParameters::hgtrform getTrForm(unsigned int k) const
Simrecovecs max_modules_layer_
unsigned int layersInit(bool reco) const
std::array< int, 4 > waferMax_
int modulesInit(int lay, bool reco) const
HGCalGeometryMode::GeometryMode mode_
HGCalGeometryMode::GeometryMode mode_
unsigned int getTrFormN() const
unsigned int layers(bool reco) const
std::vector< double > cellSize_
std::pair< int, float > getIndex(int lay, bool reco) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
int sectors() const
double k_ScaleFromDDD
const HGCalParameters * hgpar_
int maxCells(bool reco) const
static double tan30deg_
std::array< int, 3 > HGCWaferParam
bool waferInLayer(int wafer, int lay, bool reco) const
HGCalDDDConstants::~HGCalDDDConstants ( )

Definition at line 90 of file HGCalDDDConstants.cc.

90 {}

Member Function Documentation

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

Definition at line 92 of file HGCalDDDConstants.cc.

References assignCellHexagon(), getIndex(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, mps_fire::i, k_ScaleFromDDD, mode_, trackingPlots::reco, geometryCSVtoXML::xx, and geometryCSVtoXML::yy.

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

93  {
94  std::pair<int,float> index = getIndex(lay, reco);
95  std::pair<int,int> cellAssignment(-1,-1);
96  int i = index.first;
97  if (i < 0) return cellAssignment;
100  float xx = (reco) ? x : k_ScaleFromDDD*x;
101  float yy = (reco) ? y : k_ScaleFromDDD*y;
102  cellAssignment = assignCellHexagon(xx,yy);
103  }
104  return cellAssignment;
105 }
HGCalGeometryMode::GeometryMode mode_
std::pair< int, int > assignCellHexagon(float x, float y) const
std::pair< int, float > getIndex(int lay, bool reco) const
fixed size matrix
double k_ScaleFromDDD
std::pair< int, int > HGCalDDDConstants::assignCellHexagon ( float  x,
float  y 
) const

Definition at line 107 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, cellHex(), HGCalParameters::cellSize_, hgpar_, k_ScaleFromDDD, rmax_, HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferTypeT_, geometryCSVtoXML::xx, and geometryCSVtoXML::yy.

Referenced by assignCell().

108  {
109  double xx(x), yy(y);
110  //First the wafer
111  int wafer = cellHex(xx, yy, rmax_, hgpar_->waferPosX_, hgpar_->waferPosY_);
112  // Now the cell
113  xx -= hgpar_->waferPosX_[wafer];
114  yy -= hgpar_->waferPosY_[wafer];
115  int cell(0);
116  if (hgpar_->waferTypeT_[wafer] == 1)
118  else
120  return std::pair<int,int>(wafer,cell);
121 }
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_
std::vector< double > cellFineX_
double k_ScaleFromDDD
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
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 526 of file HGCalDDDConstants.cc.

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

Referenced by assignCellHexagon(), getTrForm(), and waferFromPosition().

529  {
530  int num(0);
531  const double tol(0.00001);
532  double cellY = 2.0*cellR*tan30deg_;
533  for (unsigned int k=0; k<posX.size(); ++k) {
534  double dx = std::abs(xx - posX[k]);
535  double dy = std::abs(yy - posY[k]);
536  if (dx <= (cellR+tol) && dy <= (cellY+tol)) {
537  double xmax = (dy<=0.5*cellY) ? cellR : (cellR-(dy-0.5*cellY)/tan30deg_);
538  if (dx <= (xmax+tol)) {
539  num = k;
540  break;
541  }
542  }
543  }
544  return num;
545 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int k[5][pyjets_maxn]
static double tan30deg_
double HGCalDDDConstants::cellSizeHex ( int  type) const

Definition at line 123 of file HGCalDDDConstants.cc.

References HGCalParameters::cellSize_, hgpar_, and k_ScaleFromDDD.

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

123  {
124  int indx = (type == 1) ? 0 : 1;
125  double cell = (0.5*k_ScaleFromDDD*hgpar_->cellSize_[indx]);
126  return cell;
127 }
type
Definition: HCALResponse.h:21
std::vector< double > cellSize_
double k_ScaleFromDDD
const HGCalParameters * hgpar_
HGCalGeometryMode::GeometryMode HGCalDDDConstants::geomMode ( ) const
inline
std::pair< int, float > HGCalDDDConstants::getIndex ( int  lay,
bool  reco 
) const

Definition at line 547 of file HGCalDDDConstants.cc.

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

Referenced by assignCell(), getTrForm(), HGCalDDDConstants(), locateCell(), maxCells(), maxRows(), modules(), modulesInit(), numberCells(), simToReco(), waferInLayer(), and waferZ().

547  {
548 
549  if (lay<1 || lay>(int)(hgpar_->layerIndex_.size())) return std::pair<int,float>(-1,0);
550  if (reco && lay>(int)(hgpar_->depthIndex_.size())) return std::pair<int,float>(-1,0);
551  int indx(0);
552  float cell(0);
555  indx = (reco ? hgpar_->depthLayerF_[lay-1] : hgpar_->layerIndex_[lay-1]);
556  cell = (reco ? hgpar_->moduleCellR_[0] : hgpar_->moduleCellS_[0]);
557  }
558  return std::pair<int,float>(indx,cell);
559 }
std::vector< int > depthLayerF_
std::vector< double > moduleCellR_
HGCalGeometryMode::GeometryMode mode_
std::vector< int > layerIndex_
std::vector< double > moduleCellS_
fixed size matrix
std::vector< int > depthIndex_
const HGCalParameters * hgpar_
HGCalParameters::hgtrap HGCalDDDConstants::getModule ( unsigned int  k,
bool  hexType,
bool  reco 
) const

Definition at line 129 of file HGCalDDDConstants.cc.

References HGCalParameters::getModule(), hgpar_, reco::if(), and HGCalParameters::waferTypeL_.

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

131  {
132 
134  if (hexType) {
135  unsigned int type = (indx < hgpar_->waferTypeL_.size()) ?
136  hgpar_->waferTypeL_[indx] : 3;
137  if (type > 0) --type;
138  mytr = hgpar_->getModule(type, true);
139  } else {
140  if (reco) mytr = hgpar_->getModule(indx,true);
141  else mytr = hgpar_->getModule(indx,false);
142  }
143  return mytr;
144 }
type
Definition: HCALResponse.h:21
hgtrap getModule(unsigned int k, bool reco) const
fixed size matrix
if(dp >Float(M_PI)) dp-
const HGCalParameters * hgpar_
std::vector< int > waferTypeL_
std::vector< HGCalParameters::hgtrap > HGCalDDDConstants::getModules ( ) const

Definition at line 146 of file HGCalDDDConstants.cc.

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

146  {
147 
148  std::vector<HGCalParameters::hgtrap> mytrs;
149  for (unsigned int k=0; k<hgpar_->moduleLayR_.size(); ++k)
150  mytrs.emplace_back(hgpar_->getModule(k,true));
151  return mytrs;
152 }
std::vector< int > moduleLayR_
hgtrap getModule(unsigned int k, bool reco) const
int k[5][pyjets_maxn]
const HGCalParameters * hgpar_
HGCalParameters::hgtrform HGCalDDDConstants::getTrForm ( unsigned int  k) const
inline
unsigned int HGCalDDDConstants::getTrFormN ( ) const
inline

Definition at line 78 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::trformIndex_.

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

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

Definition at line 154 of file HGCalDDDConstants.cc.

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

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

154  {
155 
156  std::vector<HGCalParameters::hgtrform> mytrs;
157  for (unsigned int k=0; k<hgpar_->trformIndex_.size(); ++k)
158  mytrs.emplace_back(hgpar_->getTrForm(k));
159  return mytrs;
160 }
std::vector< uint32_t > trformIndex_
hgtrform getTrForm(unsigned int k) const
int k[5][pyjets_maxn]
const HGCalParameters * hgpar_
bool HGCalDDDConstants::isHalfCell ( int  waferType,
int  cell 
) const

Definition at line 521 of file HGCalDDDConstants.cc.

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

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

521  {
522  if( waferType < 1 || cell < 0) return false;
523  return waferType == 2 ? hgpar_->cellCoarseHalf_[cell] : hgpar_->cellFineHalf_[cell];
524 }
std::vector< bool > cellCoarseHalf_
std::vector< bool > cellFineHalf_
const HGCalParameters * hgpar_
bool HGCalDDDConstants::isValid ( int  lay,
int  mod,
int  cell,
bool  reco 
) const

Definition at line 162 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, HGCalParameters::copiesInLayers_, gather_cfg::cout, HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, createfilelist::int, isValidCell(), layers(), maxCells(), mod(), mode_, convertSQLiteXML::ok, HGCalParameters::waferCopy_, and HGCalParameters::waferTypeT_.

Referenced by ntupleDataFormat._Object::_checkIsValid(), geomMode(), HGCNumberingScheme::getUnitID(), core.AutoHandle.AutoHandle::ReallyLoad(), and HGCalTopology::valid().

162  {
163 
164  bool ok(false), okMod(false);
165  int cellmax(0);
168  int32_t copyNumber = hgpar_->waferCopy_[mod];
169  ok = ((lay > 0 && lay <= (int)(layers(reco))));
170  if (ok) {
171  const int32_t lay_idx = reco ? (lay-1)*3 + 1 : lay;
172  const auto& the_modules = hgpar_->copiesInLayers_[lay_idx];
173  auto moditr = the_modules.find(copyNumber);
174  ok = okMod = (moditr != the_modules.end());
175 #ifdef EDM_ML_DEBUG
176  if (!ok) std::cout << "HGCalDDDConstants: Layer " << lay << ":"
177  << lay_idx << " Copy " << copyNumber << ":" << mod
178  << " Flag " << ok << std::endl;
179 #endif
180  if (ok) {
181  if (moditr->second >= 0) {
182  cellmax = (hgpar_->waferTypeT_[mod]==1) ?
183  (int)(hgpar_->cellFineX_.size()) : (int)(hgpar_->cellCoarseX_.size());
184  ok = (cell >=0 && cell <= cellmax);
185  } else {
186  ok = isValidCell(lay_idx, mod, cell);
187  }
188  }
189  }
190  }
191 
192 #ifdef EDM_ML_DEBUG
193  if (!ok) std::cout << "HGCalDDDConstants: Layer " << lay << ":"
194  << (lay > 0 && (lay <= (int)(layers(reco)))) << " Module "
195  << mod << ":" << okMod << " Cell " << cell << ":"
196  << cellmax << ":" << (cell >=0 && cell <= cellmax)
197  << ":" << maxCells(reco) << std::endl;
198 #endif
199  return ok;
200 }
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::isValidCell ( int  layindex,
int  wafer,
int  cell 
) const

Definition at line 202 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, gather_cfg::cout, hgpar_, convertSQLiteXML::ok, HGCalParameters::rMaxLayHex_, HGCalParameters::rMinLayHex_, findQualityFiles::rr, mathSSE::sqrt(), HGCalParameters::waferPosX_, HGCalParameters::waferPosY_, HGCalParameters::waferTypeT_, x, and y.

Referenced by geomMode(), and isValid().

202  {
203 
204  // Calculate the position of the cell
205  double x = hgpar_->waferPosX_[wafer];
206  double y = hgpar_->waferPosY_[wafer];
207  if (hgpar_->waferTypeT_[wafer] == 1) {
208  x += hgpar_->cellFineX_[cell];
209  y += hgpar_->cellFineY_[cell];
210  } else {
211  x += hgpar_->cellCoarseX_[cell];
212  y += hgpar_->cellCoarseY_[cell];
213  }
214  double rr = sqrt(x*x+y*y);
215  bool ok = ((rr >= hgpar_->rMinLayHex_[lay-1]) &
216  (rr <= hgpar_->rMaxLayHex_[lay-1]));
217 #ifdef EDM_ML_DEBUG
218  if (!ok)
219  std::cout << "Input " << lay << ":" << wafer << ":" << cell << " Position "
220  << x << ":" << y << ":" << rr << " Compare Limits "
221  << hgpar_->rMinLayHex_[lay-1] << ":" <<hgpar_->rMaxLayHex_[lay-1]
222  << " Flag " << ok << std::endl;
223 #endif
224  return ok;
225 }
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_
unsigned int HGCalDDDConstants::layers ( bool  reco) const
unsigned int HGCalDDDConstants::layersInit ( bool  reco) const

Definition at line 231 of file HGCalDDDConstants.cc.

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

Referenced by geomMode(), and HGCalDDDConstants().

231  {
232  return (reco ? hgpar_->depthIndex_.size() : hgpar_->layerIndex_.size());
233 }
std::vector< int > layerIndex_
fixed size matrix
std::vector< int > depthIndex_
const HGCalParameters * hgpar_
int HGCalDDDConstants::levelTop ( ) const
inline

Definition at line 42 of file HGCalDDDConstants.h.

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

Referenced by HGCSD::update().

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

Definition at line 235 of file HGCalDDDConstants.cc.

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

Referenced by HGCalSimHitValidation::analyzeHits(), HGCalTBAnalyzer::analyzeSimHits(), geomMode(), and HGCNumberingScheme::getLocalCoords().

236  {
237  // type refers to wafer # for hexagon cell
238  float x(999999.), y(999999.);
239  std::pair<int,float> index = getIndex(lay, reco);
240  int i = index.first;
241  if (i < 0) return std::pair<float,float>(x,y);
244  x = hgpar_->waferPosX_[type];
245  y = hgpar_->waferPosY_[type];
246  if (hgpar_->waferTypeT_[type] == 1) {
247  x += hgpar_->cellFineX_[cell];
248  y += hgpar_->cellFineY_[cell];
249  } else {
250  x += hgpar_->cellCoarseX_[cell];
251  y += hgpar_->cellCoarseY_[cell];
252  }
253  if (!reco) {
254  x /= k_ScaleFromDDD;
255  y /= k_ScaleFromDDD;
256  }
257  }
258  return std::pair<float,float>(x,y);
259 }
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
std::vector< double > cellFineX_
fixed size matrix
double k_ScaleFromDDD
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
std::pair< float, float > HGCalDDDConstants::locateCellHex ( int  cell,
int  wafer,
bool  reco 
) const

Definition at line 261 of file HGCalDDDConstants.cc.

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

Referenced by geomMode(), HGCalGeometry::getCorners(), and HGCalGeometry::getPosition().

262  {
263  float x(0), y(0);
264  if (hgpar_->waferTypeT_[wafer] == 1) {
265  x = hgpar_->cellFineX_[cell];
266  y = hgpar_->cellFineY_[cell];
267  } else {
268  x = hgpar_->cellCoarseX_[cell];
269  y = hgpar_->cellCoarseY_[cell];
270  }
271  if (!reco) {
272  x /= k_ScaleFromDDD;
273  y /= k_ScaleFromDDD;
274  }
275  return std::pair<float,float>(x,y);
276 }
std::vector< double > cellFineY_
std::vector< double > cellCoarseX_
std::vector< double > cellFineX_
fixed size matrix
double k_ScaleFromDDD
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
int HGCalDDDConstants::maxCells ( bool  reco) const

Definition at line 278 of file HGCalDDDConstants.cc.

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

Referenced by HGCalDDDConstants(), HGCalTopology::HGCalTopology(), isValid(), and levelTop().

278  {
279 
280  int cells(0);
281  for (unsigned int i = 0; i<layers(reco); ++i) {
282  int lay = reco ? hgpar_->depth_[i] : hgpar_->layer_[i];
283  if (cells < maxCells(lay, reco)) cells = maxCells(lay, reco);
284  }
285  return cells;
286 }
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 288 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, getIndex(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, mps_fire::i, gen::k, mode_, waferInLayer(), and HGCalParameters::waferTypeT_.

288  {
289 
290  std::pair<int,float> index = getIndex(lay, reco);
291  int i = index.first;
292  if (i < 0) return 0;
295  unsigned int cells(0);
296  for (unsigned int k=0; k<hgpar_->waferTypeT_.size(); ++k) {
297  if (waferInLayer(k,index.first)) {
298  unsigned int cell = (hgpar_->waferTypeT_[k]==1) ?
299  (hgpar_->cellFineX_.size()) : (hgpar_->cellCoarseX_.size());
300  if (cell > cells) cells = cell;
301  }
302  }
303  return (int)(cells);
304  } else {
305  return 0;
306  }
307 }
HGCalGeometryMode::GeometryMode mode_
std::vector< double > cellCoarseX_
std::pair< int, float > getIndex(int lay, bool reco) const
int k[5][pyjets_maxn]
std::vector< double > cellFineX_
fixed size matrix
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
bool waferInLayer(int wafer, int lay, bool reco) const
int HGCalDDDConstants::maxModules ( ) const
inline

Definition at line 45 of file HGCalDDDConstants.h.

References maxRows(), and modHalf_.

45 {return modHalf_;}
int HGCalDDDConstants::maxRows ( int  lay,
bool  reco 
) const

Definition at line 309 of file HGCalDDDConstants.cc.

References getIndex(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, mps_fire::i, gen::k, mode_, HGCalParameters::waferCopy_, and waferInLayer().

Referenced by maxModules().

309  {
310 
311  int kymax(0);
312  std::pair<int,float> index = getIndex(lay, reco);
313  int i = index.first;
314  if (i < 0) return kymax;
317  for (unsigned int k=0; k<hgpar_->waferCopy_.size(); ++k) {
318  if (waferInLayer(k,i)) {
319  int ky = ((hgpar_->waferCopy_[k])/100)%100;
320  if (ky > kymax) kymax = ky;
321  }
322  }
323  }
324  return kymax;
325 }
HGCalGeometryMode::GeometryMode mode_
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_
bool waferInLayer(int wafer, int lay, bool reco) const
double HGCalDDDConstants::minSlope ( ) const
inline
int HGCalDDDConstants::modules ( int  lay,
bool  reco 
) const

Definition at line 327 of file HGCalDDDConstants.cc.

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

Referenced by minSlope(), and wafers().

327  {
328  if( getIndex(lay,reco).first < 0 ) return 0;
329  return max_modules_layer_[(int)reco][lay];
330 }
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 332 of file HGCalDDDConstants.cc.

References getIndex(), hgpar_, gen::k, waferInLayer(), and HGCalParameters::waferPosX_.

Referenced by HGCalDDDConstants(), and minSlope().

332  {
333  int nmod(0);
334  std::pair<int,float> index = getIndex(lay, reco);
335  if (index.first < 0) return nmod;
336  for (unsigned int k=0; k<hgpar_->waferPosX_.size(); ++k) {
337  if (waferInLayer(k,index.first)) ++nmod;
338  }
339  return nmod;
340 }
std::pair< int, float > getIndex(int lay, bool reco) const
int k[5][pyjets_maxn]
fixed size matrix
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
bool waferInLayer(int wafer, int lay, bool reco) const
std::vector< int > HGCalDDDConstants::numberCells ( int  lay,
bool  reco 
) const

Definition at line 342 of file HGCalDDDConstants.cc.

References HGCalParameters::cellCoarseX_, HGCalParameters::cellFineX_, getIndex(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, mps_fire::i, gen::k, mode_, waferInLayer(), and HGCalParameters::waferTypeT_.

Referenced by minSlope().

342  {
343 
344  std::pair<int,float> index = getIndex(lay, reco);
345  int i = index.first;
346  std::vector<int> ncell;
347  if (i >= 0) {
350  for (unsigned int k=0; k<hgpar_->waferTypeT_.size(); ++k) {
351  if (waferInLayer(k,i)) {
352  unsigned int cell = (hgpar_->waferTypeT_[k]==1) ?
353  (hgpar_->cellFineX_.size()) : (hgpar_->cellCoarseX_.size());
354  ncell.emplace_back((int)(cell));
355  }
356  }
357  }
358  }
359  return ncell;
360 }
HGCalGeometryMode::GeometryMode mode_
std::vector< double > cellCoarseX_
std::pair< int, float > getIndex(int lay, bool reco) const
int k[5][pyjets_maxn]
std::vector< double > cellFineX_
fixed size matrix
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
bool waferInLayer(int wafer, int lay, bool reco) const
int HGCalDDDConstants::numberCellsHexagon ( int  wafer) const

Definition at line 362 of file HGCalDDDConstants.cc.

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

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

362  {
363 
364  int ncell(0);
365  if (wafer >= 0 && wafer < (int)(hgpar_->waferTypeT_.size())) {
366  if (hgpar_->waferTypeT_[wafer]==1)
367  ncell = (int)(hgpar_->cellFineX_.size());
368  else
369  ncell = (int)(hgpar_->cellCoarseX_.size());
370  }
371  return ncell;
372 }
std::vector< double > cellCoarseX_
std::vector< double > cellFineX_
std::vector< int > waferTypeT_
const HGCalParameters * hgpar_
std::pair< int, int > HGCalDDDConstants::rowColumnWafer ( const int  wafer) const

Definition at line 374 of file HGCalDDDConstants.cc.

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

Referenced by minSlope().

374  {
375  int row(0), col(0);
376  if (wafer < (int)(hgpar_->waferCopy_.size())) {
377  int copy = hgpar_->waferCopy_[wafer];
378  col = copy%100;
379  if ((copy/10000)%10 != 0) col = -col;
380  row = (copy/100)%100;
381  if ((copy/100000)%10 != 0) row = -row;
382  }
383  return std::pair<int,int>(row,col);
384 }
def copy(args, dbName)
std::vector< int > waferCopy_
col
Definition: cuy.py:1008
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 386 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_, and HGCalParameters::waferTypeL_.

Referenced by HGCalTimingAnalyzer::analyzeSimHits(), HGCalTBAnalyzer::analyzeSimHits(), CaloTruthAccumulator::fillSimHits(), HGCalTriggerBackend::HGCalTriggerSimCluster< FECODEC, DATA >::run(), sectors(), HGCalTriggerNtupleHGCTriggerCells::simhits(), and HGCalTriggerNtupleHGCDigis::simhits().

387  {
388 
389  std::pair<int,float> index = getIndex(lay, false);
390  int i = index.first;
391  if (i < 0) {
392  return std::pair<int,int>(-1,-1);
393  }
394  int kx(-1), depth(-1);
397  kx = cell;
398  int type = hgpar_->waferTypeL_[mod];
399  if (type == 1) {
401  } else if (type == 2) {
403  } else {
405  }
406  }
407  return std::pair<int,int>(kx,depth);
408 }
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

Definition at line 55 of file HGCalDDDConstants.h.

References popcon2dropbox::copy(), hgpar_, HGCalParameters::moduleLayR_, waferFromCopy(), waferFromPosition(), and waferInLayer().

Referenced by HGCalGeometryLoader::build().

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

Definition at line 61 of file HGCalDDDConstants.h.

References waferMax_.

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

Definition at line 410 of file HGCalDDDConstants.cc.

References gather_cfg::cout, hgpar_, gen::k, convertSQLiteXML::ok, and HGCalParameters::waferCopy_.

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

410  {
411  const int ncopies = hgpar_->waferCopy_.size();
412  int wafer(ncopies);
413 #ifdef EDM_ML_DEBUG
414  bool ok(false);
415 #endif
416  for (int k=0; k<ncopies; ++k) {
417  if (copy == hgpar_->waferCopy_[k]) {
418  wafer = k;
419 #ifdef EDM_ML_DEBUG
420  ok = true;
421 #endif
422  break;
423  }
424  }
425 #ifdef EDM_ML_DEBUG
426  if (!ok) {
427  std::cout << "Cannot find " << copy << " in a list of " << ncopies << "\n";
428  for (int k=0; k<ncopies; ++k) std::cout << " " << hgpar_->waferCopy_[k];
429  std::cout << std::endl;
430  }
431 #endif
432  return wafer;
433 }
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 435 of file HGCalDDDConstants.cc.

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

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

437  {
438 
439  double xx(k_ScaleFromDDD*x), yy(k_ScaleFromDDD*y);
440  int size_ = (int)(hgpar_->waferCopy_.size());
441  wafer = size_;
442  for (int k=0; k<size_; ++k) {
443  double dx = std::abs(xx-hgpar_->waferPosX_[k]);
444  double dy = std::abs(yy-hgpar_->waferPosY_[k]);
445  if (dx <= rmax_ && dy <= hexside_) {
446  if ((dy <= 0.5*hexside_) || (dx <= (2.*rmax_-dy/tan30deg_))) {
447  wafer = k;
448  celltyp = hgpar_->waferTypeT_[k];
449  xx -= hgpar_->waferPosX_[k];
450  yy -= hgpar_->waferPosY_[k];
451  break;
452  }
453  }
454  }
455  if (wafer < size_) {
456  if (celltyp == 1)
457  icell = cellHex(xx, yy, 0.5*k_ScaleFromDDD*hgpar_->cellSize_[0],
459  else
460  icell = cellHex(xx, yy, 0.5*k_ScaleFromDDD*hgpar_->cellSize_[1],
462  }
463 #ifdef EDM_ML_DEBUG
464  std::cout << "Position " << x << ":" << y << " Wafer " << wafer << ":"
465  << size_ << " XX " << xx << ":" << yy << " Cell " << icell
466  << " Type " << celltyp << std::endl;
467 #endif
468 }
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_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int k[5][pyjets_maxn]
std::vector< double > cellFineX_
std::vector< int > waferCopy_
double k_ScaleFromDDD
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
static double tan30deg_
bool HGCalDDDConstants::waferInLayer ( int  wafer,
int  lay,
bool  reco 
) const

Definition at line 470 of file HGCalDDDConstants.cc.

References getIndex().

Referenced by HGCalGeometryLoader::build(), HGCalGeometry::getSummary(), getTrForm(), HGCalDDDConstants(), maxCells(), maxRows(), modulesInit(), numberCells(), and volumes().

470  {
471 
472  std::pair<int,float> indx = getIndex(lay, reco);
473  if (indx.first < 0) return false;
474  return waferInLayer(wafer,indx.first);
475 }
std::pair< int, float > getIndex(int lay, bool reco) const
fixed size matrix
bool waferInLayer(int wafer, int lay, bool reco) const
bool HGCalDDDConstants::waferInLayer ( int  wafer,
int  lay 
) const
private

Definition at line 561 of file HGCalDDDConstants.cc.

References HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgpar_, recoMuon::in, gen::k, HGCalParameters::mode_, rmax_, HGCalParameters::rMinLayHex_, findQualityFiles::rr, mathSSE::sqrt(), tan30deg_, HGCalParameters::waferPosX_, and HGCalParameters::waferPosY_.

561  {
562 
563  const double rr = 2*rmax_*tan30deg_;
564  const double waferX = hgpar_->waferPosX_[wafer];
565  const double waferY = hgpar_->waferPosY_[wafer];
566  double xc[6], yc[6];
567  xc[0] = waferX+rmax_; yc[0] = waferY-0.5*rr;
568  xc[1] = waferX+rmax_; yc[1] = waferY+0.5*rr;
569  xc[2] = waferX; yc[2] = waferY+rr;
570  xc[3] = waferX-rmax_; yc[3] = waferY+0.5*rr;
571  xc[4] = waferX+rmax_; yc[4] = waferY-0.5*rr;
572  xc[5] = waferX; yc[5] = waferY-rr;
573  bool cornerOne(false), cornerAll(true);
574  for (int k=0; k<6; ++k) {
575  double rpos = std::sqrt(xc[k]*xc[k]+yc[k]*yc[k]);
576  if ((rpos >= hgpar_->rMinLayHex_[lay]) &&
577  (rpos <= hgpar_->rMaxLayHex_[lay])) cornerOne = true;
578  else cornerAll = false;
579  }
580  bool in(false);
582  in = cornerAll;
584  in = cornerOne;
585  return in;
586 }
std::vector< double > waferPosY_
HGCalGeometryMode::GeometryMode mode_
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< double > rMinLayHex_
int k[5][pyjets_maxn]
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
static double tan30deg_
int HGCalDDDConstants::waferMax ( ) const
inline

Definition at line 62 of file HGCalDDDConstants.h.

References waferMax_.

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

Definition at line 63 of file HGCalDDDConstants.h.

References waferMax_, waferPosition(), and wafers().

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

Definition at line 477 of file HGCalDDDConstants.cc.

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

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

478  {
479 
480  double xx(0), yy(0);
481  if (wafer >= 0 && wafer < (int)(hgpar_->waferPosX_.size())) {
482  xx = hgpar_->waferPosX_[wafer];
483  yy = hgpar_->waferPosY_[wafer];
484  }
485  if (!reco) {
486  xx /= k_ScaleFromDDD;
487  yy /= k_ScaleFromDDD;
488  }
489  std::pair<double,double> xy(xx,yy);
490  return xy;
491 }
std::vector< double > waferPosY_
fixed size matrix
double k_ScaleFromDDD
const HGCalParameters * hgpar_
std::vector< double > waferPosX_
int HGCalDDDConstants::wafers ( ) const

Definition at line 500 of file HGCalDDDConstants.cc.

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

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

500  {
501 
502  int wafer(0);
503  for (unsigned int i = 0; i<layers(true); ++i) {
504  int lay = hgpar_->depth_[i];
505  wafer += modules(lay, true);
506  }
507  return wafer;
508 }
std::vector< int > depth_
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 510 of file HGCalDDDConstants.cc.

References waferLayer_.

510  {
511 
512  int wafer(0);
513  auto itr = waferLayer_.find(layer);
514  if (itr != waferLayer_.end()) {
515  unsigned ity = (type > 0 && type <= 2) ? type : 0;
516  wafer = (itr->second)[ity];
517  }
518  return wafer;
519 }
type
Definition: HCALResponse.h:21
std::map< int, HGCWaferParam > waferLayer_
int HGCalDDDConstants::waferToCopy ( int  wafer) const
inline

Definition at line 67 of file HGCalDDDConstants.h.

References hgpar_, and HGCalParameters::waferCopy_.

67 {return ((wafer>=0)&&(wafer< (int)(hgpar_->waferCopy_.size()))) ? hgpar_->waferCopy_[wafer] : (int)(hgpar_->waferCopy_.size());}
std::vector< int > waferCopy_
const HGCalParameters * hgpar_
int HGCalDDDConstants::waferTypeL ( int  wafer) const
inline
int HGCalDDDConstants::waferTypeT ( int  wafer) const
inline
double HGCalDDDConstants::waferZ ( int  layer,
bool  reco 
) const

Definition at line 493 of file HGCalDDDConstants.cc.

References getIndex(), hgpar_, mps_fire::i, and HGCalParameters::zLayerHex_.

Referenced by HGCalSimHitValidation::analyzeHits(), HGCalTBAnalyzer::analyzeRecHits(), HGCalTBAnalyzer::analyzeSimHits(), CaloTruthAccumulator::beginLuminosityBlock(), and HGCalTriggerTools::getLayerZ().

493  {
494  std::pair<int,float> index = getIndex(lay, reco);
495  int i = index.first;
496  if (i < 0) return 0;
497  else return hgpar_->zLayerHex_[i];
498 }
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< double > zLayerHex_
fixed size matrix
const HGCalParameters * hgpar_

Member Data Documentation

double HGCalDDDConstants::hexside_
private

Definition at line 94 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and waferFromPosition().

const HGCalParameters* HGCalDDDConstants::hgpar_
private
Simrecovecs HGCalDDDConstants::max_modules_layer_
private

Definition at line 98 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and modules().

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

Definition at line 96 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and maxModules().

double HGCalDDDConstants::rmax_
private
double HGCalDDDConstants::tan30deg_ = 0.5773502693
staticprivate

Definition at line 93 of file HGCalDDDConstants.h.

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

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

Definition at line 97 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and layers().

int32_t HGCalDDDConstants::tot_wafers_
private

Definition at line 96 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants().

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

Definition at line 99 of file HGCalDDDConstants.h.

Referenced by HGCalDDDConstants(), and wafers().

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

Definition at line 100 of file HGCalDDDConstants.h.

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