CMS 3D CMS Logo

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

#include <HGCalParametersFromDD.h>

Public Member Functions

bool build (const cms::DDCompactView *cpv, HGCalParameters &php, const std::string &name, const std::string &namew, const std::string &namec, const std::string &namet, const std::string &name2)
 
bool build (const DDCompactView *cpv, HGCalParameters &php, const std::string &name, const std::string &namew, const std::string &namec, const std::string &namet)
 
 HGCalParametersFromDD ()
 
virtual ~HGCalParametersFromDD ()
 

Private Member Functions

void getCellPosition (HGCalParameters &php, int type)
 
std::vector< double > getDDDArray (const char *s, const DDsvalues_type &sv)
 
double getDDDValue (const char *s, const DDsvalues_type &sv)
 

Static Private Attributes

constexpr static double tan30deg_ = 0.5773502693
 

Detailed Description

Definition at line 12 of file HGCalParametersFromDD.h.

Constructor & Destructor Documentation

◆ HGCalParametersFromDD()

HGCalParametersFromDD::HGCalParametersFromDD ( )
inline

Definition at line 14 of file HGCalParametersFromDD.h.

14 {}

◆ ~HGCalParametersFromDD()

virtual HGCalParametersFromDD::~HGCalParametersFromDD ( )
inlinevirtual

Definition at line 15 of file HGCalParametersFromDD.h.

15 {}

Member Function Documentation

◆ build() [1/2]

bool HGCalParametersFromDD::build ( const cms::DDCompactView cpv,
HGCalParameters php,
const std::string &  name,
const std::string &  namew,
const std::string &  namec,
const std::string &  namet,
const std::string &  name2 
)

Definition at line 234 of file HGCalParametersFromDD.cc.

240  {
241 #ifdef EDM_ML_DEBUG
242  edm::LogVerbatim("HGCalGeom") << "HGCalParametersFromDD (DD4Hep)::build called with "
243  << "names " << name << ":" << namew << ":" << namec << ":" << namet;
244 #endif
245  cms::DDVectorsMap vmap = cpv->detector()->vectors();
246  const cms::DDFilter filter("Volume", name);
247  cms::DDFilteredView fv((*cpv), filter);
248  std::vector<std::string> tempS;
249  std::vector<double> tempD;
250  bool ok = fv.firstChild();
251  tempS = fv.get<std::vector<std::string> >(name2, "GeometryMode");
252  if (tempS.empty())
253  tempS = fv.get<std::vector<std::string> >(name, "GeometryMode");
254  std::string sv = (!tempS.empty()) ? tempS[0] : "HGCalGeometryMode::Hexagon8Full";
256 
257  if (ok) {
258  php.mode_ = getGeometryMode(sv);
259 #ifdef EDM_ML_DEBUG
260  edm::LogVerbatim("HGCalGeom") << "GeometryMode " << php.mode_ << ":" << HGCalGeometryMode::Hexagon << ":"
264 #endif
265  php.levelZSide_ = 3; // Default level for ZSide
266  php.detectorType_ = 0; // These two parameters are
267  php.firstMixedLayer_ = -1; // defined for post TDR geometry
268  std::unique_ptr<HGCalGeomParameters> geom = std::make_unique<HGCalGeomParameters>();
270  tempS = fv.get<std::vector<std::string> >(namet, "WaferMode");
271  std::string sv2 = (!tempS.empty()) ? tempS[0] : "HGCalGeometryMode::Polyhedra";
272  mode = getGeometryWaferMode(sv2);
273 #ifdef EDM_ML_DEBUG
274  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
276 #endif
277  php.minTileSize_ = 0;
278  php.waferMaskMode_ = 0;
279  }
281  php.levelT_ = dbl_to_int(fv.get<std::vector<double> >(name, "LevelTop"));
282  tempD = fv.get<std::vector<double> >(name, "LevelZSide");
283  php.levelZSide_ = static_cast<int>(tempD[0]);
284  php.nCellsFine_ = php.nCellsCoarse_ = 0;
285  php.firstLayer_ = 1;
286  tempD = fv.get<std::vector<double> >(name, "FirstMixedLayer");
287  php.firstMixedLayer_ = static_cast<int>(tempD[0]);
288  tempD = fv.get<std::vector<double> >(name, "DetectorType");
289  php.detectorType_ = static_cast<int>(tempD[0]);
290  php.minTileSize_ = 0;
291  tempD = fv.get<std::vector<double> >(name, "WaferMaskMode");
292  php.waferMaskMode_ = static_cast<int>(tempD[0]);
293 #ifdef EDM_ML_DEBUG
294  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " ZSide Level "
295  << php.levelZSide_ << " first layers " << php.firstLayer_ << ":"
296  << php.firstMixedLayer_ << " Det Type " << php.detectorType_ << " Wafer Mask Mode "
297  << php.waferMaskMode_;
298  ;
299 #endif
300 
301  tempS = fv.get<std::vector<std::string> >(namet, "WaferMode");
302  std::string sv2 = (!tempS.empty()) ? tempS[0] : "HGCalGeometryMode::ExtrudedPolygon";
303  mode = getGeometryWaferMode(sv2);
304  tempD = fv.get<std::vector<double> >(namet, "NumberOfCellsFine");
305  php.nCellsFine_ = static_cast<int>(tempD[0]);
306  tempD = fv.get<std::vector<double> >(namet, "NumberOfCellsCoarse");
307  php.nCellsCoarse_ = static_cast<int>(tempD[0]);
308  tempD = fv.get<std::vector<double> >(namet, "WaferSize");
310  tempD = fv.get<std::vector<double> >(namet, "WaferThickness");
312  tempD = fv.get<std::vector<double> >(namet, "SensorSeparation");
314  tempD = fv.get<std::vector<double> >(namet, "MouseBite");
317  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsFine_);
318  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsCoarse_);
319 #ifdef EDM_ML_DEBUG
320  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
321  << HGCalGeometryMode::ExtrudedPolygon << " # of cells|size for fine/coarse "
322  << php.nCellsFine_ << ":" << php.cellSize_[0] << ":" << php.nCellsCoarse_ << ":"
323  << php.cellSize_[1] << " wafer Params " << php.waferSize_ << ":" << php.waferR_
324  << ":" << php.waferThick_ << ":" << php.sensorSeparation_ << ":" << php.mouseBite_
325  << ":" << php.waferR_;
326 #endif
327  for (int k = 0; k < 2; ++k)
328  getCellPosition(php, k);
329  }
330  if (php.mode_ == HGCalGeometryMode::Hexagon) {
331  // Load the SpecPars
332  php.firstLayer_ = 1;
333  geom->loadSpecParsHexagon(fv, php, name, namew, namec, name2);
334  // Load the Geometry parameters
335  geom->loadGeometryHexagon(cpv, php, name, namew, namec, mode);
336  // Load cell parameters
337  geom->loadCellParsHexagon(vmap, php);
338  // Set complete fill mode
339  php.defineFull_ = false;
340  } else if (php.mode_ == HGCalGeometryMode::HexagonFull) {
341  // Load the SpecPars
342  php.firstLayer_ = 1;
343  geom->loadSpecParsHexagon(fv, php, name, namew, namec, name2);
344  // Load the Geometry parameters
345  geom->loadGeometryHexagon(cpv, php, name, namew, namec, mode);
346  // Modify some constants
347  geom->loadWaferHexagon(php);
348  // Load cell parameters
349  geom->loadCellParsHexagon(vmap, php);
350  // Set complete fill mode
351  php.defineFull_ = true;
352  } else if (php.mode_ == HGCalGeometryMode::Hexagon8) {
353  // Load the SpecPars
354  geom->loadSpecParsHexagon8(fv, vmap, php, name);
355  // Load Geometry parameters
356  geom->loadGeometryHexagon8(cpv, php, name, 1);
357  // Set complete fill mode
358  php.defineFull_ = false;
359  // Load wafer positions
360  geom->loadWaferHexagon8(php);
361  } else if (php.mode_ == HGCalGeometryMode::Hexagon8Full) {
362  // Load the SpecPars
363  geom->loadSpecParsHexagon8(fv, vmap, php, name);
364  // Load Geometry parameters
365  geom->loadGeometryHexagon8(cpv, php, name, 1);
366  // Set complete fill mode
367  php.defineFull_ = true;
368  // Load wafer positions
369  geom->loadWaferHexagon8(php);
370  } else if (php.mode_ == HGCalGeometryMode::Trapezoid) {
371  // Load maximum eta & top level
372  php.levelT_ = dbl_to_int(fv.get<std::vector<double> >(name, "LevelTop"));
373  tempD = fv.get<std::vector<double> >(name, "LevelZSide");
374  php.levelZSide_ = static_cast<int>(tempD[0]);
375  php.nCellsFine_ = php.nCellsCoarse_ = 0;
376  tempD = fv.get<std::vector<double> >(name, "FirstLayer");
377  php.firstLayer_ = static_cast<int>(tempD[0]);
378  tempD = fv.get<std::vector<double> >(name, "FirstMixedLayer");
379  php.firstMixedLayer_ = static_cast<int>(tempD[0]);
380  tempD = fv.get<std::vector<double> >(name, "DetectorType");
381  php.detectorType_ = static_cast<int>(tempD[0]);
382  tempD = fv.get<std::vector<double> >(name, "WaferThickness");
384  tempD = fv.get<std::vector<double> >(name, "MinimumTileSize");
386  php.waferSize_ = php.waferR_ = 0;
387  php.sensorSeparation_ = php.mouseBite_ = 0;
388  tempD = fv.get<std::vector<double> >(name, "WaferMaskMode");
389  php.waferMaskMode_ = static_cast<int>(tempD[0]);
390 #ifdef EDM_ML_DEBUG
391  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " first layers "
392  << php.firstLayer_ << ":" << php.firstMixedLayer_ << " Det Type "
393  << php.detectorType_ << " thickenss " << php.waferThick_ << " min tile size "
394  << php.minTileSize_ << " Tile Mask Mode " << php.waferMaskMode_;
395  ;
396 #endif
397  // Load the SpecPars
398  geom->loadSpecParsTrapezoid(fv, vmap, php, name);
399  // Load Geometry parameters
400  geom->loadGeometryHexagon8(cpv, php, name, php.firstLayer_);
401  // Load cell positions
402  geom->loadCellTrapezoid(php);
403  } else {
404  edm::LogError("HGCalGeom") << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew
405  << ":" << namec;
406  throw cms::Exception("DDException")
407  << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew << ":" << namec;
408  }
409  } else {
410  edm::LogError("HGCalGeom") << " Attribute Volume:" << name << " not found but needed.";
411  throw cms::Exception("DDException") << "Attribute Volume:" << name << " not found but needed.";
412  }
413 #ifdef EDM_ML_DEBUG
414  edm::LogVerbatim("HGCalGeom") << "Return from HGCalParametersFromDD::build"
415  << " with flag " << ok;
416 #endif
417  return ok;
418 }

References HGCalParameters::cellSize_, dbl_to_int(), HGCalParameters::defineFull_, cms::DDCompactView::detector(), HGCalParameters::detectorType_, Exception, HGCalGeometryMode::ExtrudedPolygon, ALCARECOTkAlBeamHalo_cff::filter, cms::DDFilteredView::firstChild(), HGCalParameters::firstLayer_, HGCalParameters::firstMixedLayer_, relativeConstraints::geom, cms::DDFilteredView::get(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::HexagonFull, dqmdumpme::k, HGCalParameters::k_ScaleFromDD4Hep, HGCalParameters::k_ScaleToDDD, HGCalParameters::levelT_, HGCalParameters::levelZSide_, HGCalParameters::minTileSize_, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, HGCalParameters::mode_, HGCalParameters::mouseBite_, Skims_PA_cff::name, hfnoseParametersInitialization_cfi::name2, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, convertSQLiteXML::ok, HGCalGeometryMode::Polyhedra, HGCalParameters::sensorSeparation_, AlCaHLTBitMon_QueryRunRegistry::string, pfDeepBoostedJetPreprocessParams_cfi::sv, HGCalGeometryMode::Trapezoid, cms::DDDetector::vectors(), HGCalParameters::waferMaskMode_, HGCalParameters::waferR_, HGCalParameters::waferSize_, and HGCalParameters::waferThick_.

◆ build() [2/2]

bool HGCalParametersFromDD::build ( const DDCompactView cpv,
HGCalParameters php,
const std::string &  name,
const std::string &  namew,
const std::string &  namec,
const std::string &  namet 
)

Definition at line 57 of file HGCalParametersFromDD.cc.

62  {
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HGCalGeom") << "HGCalParametersFromDD (DDD)::build called with "
65  << "names " << name << ":" << namew << ":" << namec << ":" << namet;
66 #endif
67 
68  // Special parameters at simulation level
69  std::string attribute = "Volume";
71  DDValue val(attribute, value, 0.0);
73  DDFilteredView fv(*cpv, filter);
74  bool ok = fv.firstChild();
76 
77  if (ok) {
78  DDsvalues_type sv(fv.mergedSpecifics());
79  php.mode_ = getGeometryMode("GeometryMode", sv);
80 #ifdef EDM_ML_DEBUG
81  edm::LogVerbatim("HGCalGeom") << "GeometryMode " << php.mode_ << ":" << HGCalGeometryMode::Hexagon << ":"
85 #endif
86  php.levelZSide_ = 3; // Default level for ZSide
87  php.detectorType_ = 0; // These two parameters are
88  php.firstMixedLayer_ = -1; // defined for post TDR geometry
89  std::unique_ptr<HGCalGeomParameters> geom = std::make_unique<HGCalGeomParameters>();
91  attribute = "OnlyForHGCalNumbering";
92  value = namet;
93  DDValue val2(attribute, value, 0.0);
94  DDSpecificsMatchesValueFilter filter2{val2};
95  DDFilteredView fv2(*cpv, filter2);
96  bool ok2 = fv2.firstChild();
97  if (ok2) {
98  DDsvalues_type sv2(fv2.mergedSpecifics());
99  mode = getGeometryWaferMode("WaferMode", sv2);
100 #ifdef EDM_ML_DEBUG
101  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
103 #endif
104  }
105  php.minTileSize_ = 0;
106  php.waferMaskMode_ = 0;
107  }
109  php.levelT_ = dbl_to_int(getDDDArray("LevelTop", sv));
110  php.levelZSide_ = static_cast<int>(getDDDValue("LevelZSide", sv));
111  php.nCellsFine_ = php.nCellsCoarse_ = 0;
112  php.firstLayer_ = 1;
113  php.firstMixedLayer_ = static_cast<int>(getDDDValue("FirstMixedLayer", sv));
114  php.detectorType_ = static_cast<int>(getDDDValue("DetectorType", sv));
115  php.minTileSize_ = 0;
116  php.waferMaskMode_ = static_cast<int>(getDDDValue("WaferMaskMode", sv));
117 #ifdef EDM_ML_DEBUG
118  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " ZSide Level "
119  << php.levelZSide_ << " first layers " << php.firstLayer_ << ":"
120  << php.firstMixedLayer_ << " Det Type " << php.detectorType_ << " Wafer Mask Mode "
121  << php.waferMaskMode_;
122 #endif
123  attribute = "OnlyForHGCalNumbering";
124  value = namet;
125  DDValue val2(attribute, value, 0.0);
126  DDSpecificsMatchesValueFilter filter2{val2};
127  DDFilteredView fv2(*cpv, filter2);
128  bool ok2 = fv2.firstChild();
129  if (ok2) {
130  DDsvalues_type sv2(fv2.mergedSpecifics());
131  mode = getGeometryWaferMode("WaferMode", sv2);
132  php.nCellsFine_ = static_cast<int>(getDDDValue("NumberOfCellsFine", sv2));
133  php.nCellsCoarse_ = static_cast<int>(getDDDValue("NumberOfCellsCoarse", sv2));
134  php.waferSize_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("WaferSize", sv2);
135  php.waferThick_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("WaferThickness", sv2);
136  php.sensorSeparation_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("SensorSeparation", sv2);
137  php.mouseBite_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("MouseBite", sv2);
139  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsFine_);
140  php.cellSize_.emplace_back(HGCalParameters::k_ScaleToDDD * php.waferSize_ / php.nCellsCoarse_);
141 #ifdef EDM_ML_DEBUG
142  edm::LogVerbatim("HGCalGeom") << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra << ":"
143  << HGCalGeometryMode::ExtrudedPolygon << " # of cells|size for fine/coarse "
144  << php.nCellsFine_ << ":" << php.cellSize_[0] << ":" << php.nCellsCoarse_ << ":"
145  << php.cellSize_[1] << " wafer Params " << php.waferSize_ << ":" << php.waferR_
146  << ":" << php.waferThick_ << ":" << php.sensorSeparation_ << ":" << php.mouseBite_
147  << ":" << php.waferR_;
148 #endif
149  for (int k = 0; k < 2; ++k)
150  getCellPosition(php, k);
151  }
152  }
153  if (php.mode_ == HGCalGeometryMode::Hexagon) {
154  // Load the SpecPars
155  php.firstLayer_ = 1;
156  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
157  // Load the Geometry parameters
158  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec, mode);
159  // Load cell parameters
160  geom->loadCellParsHexagon(cpv, php);
161  // Set complete fill mode
162  php.defineFull_ = false;
163  } else if (php.mode_ == HGCalGeometryMode::HexagonFull) {
164  // Load the SpecPars
165  php.firstLayer_ = 1;
166  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
167  // Load the Geometry parameters
168  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec, mode);
169  // Modify some constants
170  geom->loadWaferHexagon(php);
171  // Load cell parameters
172  geom->loadCellParsHexagon(cpv, php);
173  // Set complete fill mode
174  php.defineFull_ = true;
175  } else if (php.mode_ == HGCalGeometryMode::Hexagon8) {
176  // Load the SpecPars
177  geom->loadSpecParsHexagon8(fv, php);
178  // Load Geometry parameters
179  geom->loadGeometryHexagon8(fv, php, 1);
180  // Set complete fill mode
181  php.defineFull_ = false;
182  // Load wafer positions
183  geom->loadWaferHexagon8(php);
184  } else if (php.mode_ == HGCalGeometryMode::Hexagon8Full) {
185  // Load the SpecPars
186  geom->loadSpecParsHexagon8(fv, php);
187  // Load Geometry parameters
188  geom->loadGeometryHexagon8(fv, php, 1);
189  // Set complete fill mode
190  php.defineFull_ = true;
191  // Load wafer positions
192  geom->loadWaferHexagon8(php);
193  } else if (php.mode_ == HGCalGeometryMode::Trapezoid) {
194  // Load maximum eta & top level
195  php.levelT_ = dbl_to_int(getDDDArray("LevelTop", sv));
196  php.firstLayer_ = (int)(getDDDValue("FirstLayer", sv));
197  php.firstMixedLayer_ = (int)(getDDDValue("FirstMixedLayer", sv));
198  php.detectorType_ = (int)(getDDDValue("DetectorType", sv));
199  php.waferThick_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("WaferThickness", sv);
200  php.minTileSize_ = HGCalParameters::k_ScaleFromDDD * getDDDValue("MinimumTileSize", sv);
201  php.waferSize_ = php.waferR_ = 0;
202  php.sensorSeparation_ = php.mouseBite_ = 0;
203  php.waferMaskMode_ = static_cast<int>(getDDDValue("WaferMaskMode", sv));
204 #ifdef EDM_ML_DEBUG
205  edm::LogVerbatim("HGCalGeom") << "Top levels " << php.levelT_[0] << ":" << php.levelT_[1] << " first layers "
206  << php.firstLayer_ << ":" << php.firstMixedLayer_ << " Det Type "
207  << php.detectorType_ << " thickenss " << php.waferThick_ << " Tile Mask Mode "
208  << php.waferMaskMode_;
209  ;
210 #endif
211  // Load the SpecPars
212  geom->loadSpecParsTrapezoid(fv, php);
213  // Load Geometry parameters
214  geom->loadGeometryHexagon8(fv, php, php.firstLayer_);
215  // Load cell positions
216  geom->loadCellTrapezoid(php);
217  } else {
218  edm::LogError("HGCalGeom") << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew
219  << ":" << namec;
220  throw cms::Exception("DDException")
221  << "Unknown Geometry type " << php.mode_ << " for HGCal " << name << ":" << namew << ":" << namec;
222  }
223  } else {
224  edm::LogError("HGCalGeom") << " Attribute " << val << " not found but needed.";
225  throw cms::Exception("DDException") << "Attribute " << val << " not found but needed.";
226  }
227 #ifdef EDM_ML_DEBUG
228  edm::LogVerbatim("HGCalGeom") << "Return from HGCalParametersFromDD::build"
229  << " with flag " << ok;
230 #endif
231  return ok;
232 }

References HGCalParameters::cellSize_, dbl_to_int(), HGCalParameters::defineFull_, HGCalParameters::detectorType_, Exception, HGCalGeometryMode::ExtrudedPolygon, ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), HGCalParameters::firstLayer_, HGCalParameters::firstMixedLayer_, relativeConstraints::geom, HGCalGeometryMode::Hexagon, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, HGCalGeometryMode::HexagonFull, createfilelist::int, dqmdumpme::k, HGCalParameters::k_ScaleFromDDD, HGCalParameters::k_ScaleToDDD, HGCalParameters::levelT_, HGCalParameters::levelZSide_, DDFilteredView::mergedSpecifics(), HGCalParameters::minTileSize_, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, HGCalParameters::mode_, HGCalParameters::mouseBite_, Skims_PA_cff::name, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, convertSQLiteXML::ok, HGCalGeometryMode::Polyhedra, HGCalParameters::sensorSeparation_, AlCaHLTBitMon_QueryRunRegistry::string, pfDeepBoostedJetPreprocessParams_cfi::sv, HGCalGeometryMode::Trapezoid, heppy_batch::val, HGCalParameters::waferMaskMode_, HGCalParameters::waferR_, HGCalParameters::waferSize_, and HGCalParameters::waferThick_.

Referenced by PHGCalParametersDBBuilder::beginRun(), and HGCalParametersESModule::produce().

◆ getCellPosition()

void HGCalParametersFromDD::getCellPosition ( HGCalParameters php,
int  type 
)
private

Definition at line 420 of file HGCalParametersFromDD.cc.

420  {
421  if (type == 1) {
422  php.cellCoarseX_.clear();
423  php.cellCoarseY_.clear();
424  } else {
425  php.cellFineX_.clear();
426  php.cellFineY_.clear();
427  }
428  HGCalParameters::wafer_map cellIndex;
429 #ifdef EDM_ML_DEBUG
430  std::vector<int> indtypes;
431 #endif
432  int N = (type == 1) ? php.nCellsCoarse_ : php.nCellsFine_;
433  double R = php.waferSize_ / (3 * N);
434  double r = 0.5 * R * sqrt(3.0);
435  int n2 = N / 2;
436  int ipos(0);
437  for (int u = 0; u < 2 * N; ++u) {
438  for (int v = 0; v < 2 * N; ++v) {
439  if (((v - u) < N) && (u - v) <= N) {
440  double yp = (u - 0.5 * v - n2) * 2 * r;
441  double xp = (1.5 * (v - N) + 1.0) * R;
442  int id = v * 100 + u;
443 #ifdef EDM_ML_DEBUG
444  indtypes.emplace_back(id);
445 #endif
446  if (type == 1) {
447  php.cellCoarseX_.emplace_back(xp);
448  php.cellCoarseY_.emplace_back(yp);
449  } else {
450  php.cellFineX_.emplace_back(xp);
451  php.cellFineY_.emplace_back(yp);
452  }
453  cellIndex[id] = ipos;
454  ++ipos;
455  }
456  }
457  }
458  if (type == 1)
459  php.cellCoarseIndex_ = cellIndex;
460  else
461  php.cellFineIndex_ = cellIndex;
462 #ifdef EDM_ML_DEBUG
463  if (type == 1) {
464  edm::LogVerbatim("HGCalGeom") << "CellPosition for type " << type << " for " << php.cellCoarseX_.size()
465  << " cells";
466  for (unsigned int k = 0; k < php.cellCoarseX_.size(); ++k) {
467  int id = indtypes[k];
468  edm::LogVerbatim("HGCalGeom") << "[" << k << "] ID " << id << ":" << php.cellCoarseIndex_[id] << " X "
469  << php.cellCoarseX_[k] << " Y " << php.cellCoarseY_[k];
470  }
471  } else {
472  edm::LogVerbatim("HGCalGeom") << "CellPosition for type " << type << " for " << php.cellFineX_.size() << " cells";
473  for (unsigned int k = 0; k < php.cellFineX_.size(); ++k) {
474  int id = indtypes[k];
475  edm::LogVerbatim("HGCalGeom") << "[" << k << "] ID " << id << ":" << php.cellFineIndex_[k] << " X "
476  << php.cellFineX_[k] << " Y " << php.cellFineY_[k];
477  }
478  }
479 #endif
480 }

References HGCalParameters::cellCoarseIndex_, HGCalParameters::cellCoarseX_, HGCalParameters::cellCoarseY_, HGCalParameters::cellFineIndex_, HGCalParameters::cellFineX_, HGCalParameters::cellFineY_, triggerObjects_cff::id, dqmdumpme::k, N, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, dttmaxenums::R, alignCSCRings::r, mathSSE::sqrt(), findQualityFiles::v, and HGCalParameters::waferSize_.

◆ getDDDArray()

std::vector< double > HGCalParametersFromDD::getDDDArray ( const char *  s,
const DDsvalues_type sv 
)
private

Definition at line 495 of file HGCalParametersFromDD.cc.

495  {
496  DDValue val(s);
497  if (DDfetch(&sv, val)) {
498  const std::vector<double>& fvec = val.doubles();
499  if (fvec.empty()) {
500  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag.";
501  }
502  return fvec;
503  } else {
504  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag";
505  }
506 }

References DDfetch(), Exception, alignCSCRings::s, pfDeepBoostedJetPreprocessParams_cfi::sv, and heppy_batch::val.

◆ getDDDValue()

double HGCalParametersFromDD::getDDDValue ( const char *  s,
const DDsvalues_type sv 
)
private

Definition at line 482 of file HGCalParametersFromDD.cc.

482  {
483  DDValue val(s);
484  if (DDfetch(&sv, val)) {
485  const std::vector<double>& fvec = val.doubles();
486  if (fvec.empty()) {
487  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag.";
488  }
489  return fvec[0];
490  } else {
491  throw cms::Exception("HGCalGeom") << "Failed to get " << s << " tag";
492  }
493 }

References DDfetch(), Exception, alignCSCRings::s, pfDeepBoostedJetPreprocessParams_cfi::sv, and heppy_batch::val.

Member Data Documentation

◆ tan30deg_

constexpr static double HGCalParametersFromDD::tan30deg_ = 0.5773502693
staticconstexprprivate

Definition at line 35 of file HGCalParametersFromDD.h.

HGCalParameters::firstLayer_
int firstLayer_
Definition: HGCalParameters.h:166
HGCalParametersFromDD::tan30deg_
constexpr static double tan30deg_
Definition: HGCalParametersFromDD.h:35
cms::DDVectorsMap
tbb::concurrent_unordered_map< std::string, tbb::concurrent_vector< double > > DDVectorsMap
Definition: DDNamespace.h:14
HGCalParameters::levelZSide_
int levelZSide_
Definition: HGCalParameters.h:130
HGCalParameters::cellFineY_
std::vector< double > cellFineY_
Definition: HGCalParameters.h:115
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
HGCalParameters::nCellsCoarse_
int nCellsCoarse_
Definition: HGCalParameters.h:137
HGCalParameters::waferSize_
double waferSize_
Definition: HGCalParameters.h:138
cms::DDFilteredView
Definition: DDFilteredView.h:65
findQualityFiles.v
v
Definition: findQualityFiles.py:179
dbl_to_int
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.h:7
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
HGCalParameters::sensorSeparation_
double sensorSeparation_
Definition: HGCalParameters.h:140
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HGCalGeometryMode::Trapezoid
Definition: HGCalGeometryMode.h:25
cms::DDFilter
Definition: DDFilteredView.h:54
HGCalParameters::wafer_map
std::unordered_map< int32_t, int32_t > wafer_map
Definition: HGCalParameters.h:25
HGCalGeometryMode::WaferMode
WaferMode
Definition: HGCalGeometryMode.h:26
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:226
N
#define N
Definition: blowfish.cc:9
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
DDfetch
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCalParameters::cellSize_
std::vector< double > cellSize_
Definition: HGCalParameters.h:69
HGCalParameters::mouseBite_
double mouseBite_
Definition: HGCalParameters.h:141
HGCalParameters::nCellsFine_
int nCellsFine_
Definition: HGCalParameters.h:136
edm::LogError
Definition: MessageLogger.h:183
HGCalParameters::cellFineIndex_
wafer_map cellFineIndex_
Definition: HGCalParameters.h:116
HGCalParameters::mode_
HGCalGeometryMode::GeometryMode mode_
Definition: HGCalParameters.h:131
HGCalParameters::cellCoarseY_
std::vector< double > cellCoarseY_
Definition: HGCalParameters.h:119
HGCalGeometryMode::Hexagon8Full
Definition: HGCalGeometryMode.h:25
HGCalParametersFromDD::getDDDValue
double getDDDValue(const char *s, const DDsvalues_type &sv)
Definition: HGCalParametersFromDD.cc:482
createfilelist.int
int
Definition: createfilelist.py:10
value
Definition: value.py:1
edm::LogVerbatim
Definition: MessageLogger.h:297
HGCalParametersFromDD::getDDDArray
std::vector< double > getDDDArray(const char *s, const DDsvalues_type &sv)
Definition: HGCalParametersFromDD.cc:495
HGCalParameters::waferR_
double waferR_
Definition: HGCalParameters.h:128
HGCalParametersFromDD::getCellPosition
void getCellPosition(HGCalParameters &php, int type)
Definition: HGCalParametersFromDD.cc:420
HGCalParameters::waferThick_
double waferThick_
Definition: HGCalParameters.h:139
HGCalGeometryMode::Hexagon
Definition: HGCalGeometryMode.h:25
HGCalParameters::k_ScaleFromDDD
static constexpr double k_ScaleFromDDD
Definition: HGCalParameters.h:30
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HGCalParameters::k_ScaleToDDD
static constexpr double k_ScaleToDDD
Definition: HGCalParameters.h:31
HGCalParameters::k_ScaleFromDD4Hep
static constexpr double k_ScaleFromDD4Hep
Definition: HGCalParameters.h:34
HGCalGeometryMode::HexagonFull
Definition: HGCalGeometryMode.h:25
type
type
Definition: HCALResponse.h:21
heppy_batch.val
val
Definition: heppy_batch.py:351
HGCalParameters::detectorType_
int detectorType_
Definition: HGCalParameters.h:66
HGCalParameters::waferMaskMode_
int waferMaskMode_
Definition: HGCalParameters.h:173
HGCalParameters::defineFull_
bool defineFull_
Definition: HGCalParameters.h:144
DDValue
Definition: DDValue.h:21
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
HGCalGeometryMode::Polyhedra
Definition: HGCalGeometryMode.h:26
Exception
Definition: hltDiff.cc:246
HGCalGeometryMode::ExtrudedPolygon
Definition: HGCalGeometryMode.h:26
HGCalParameters::cellFineX_
std::vector< double > cellFineX_
Definition: HGCalParameters.h:114
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
HGCalParameters::firstMixedLayer_
int firstMixedLayer_
Definition: HGCalParameters.h:167
HGCalParameters::minTileSize_
double minTileSize_
Definition: HGCalParameters.h:159
HGCalGeometryMode::Hexagon8
Definition: HGCalGeometryMode.h:25
DDFilteredView
Definition: DDFilteredView.h:20
HGCalParameters::cellCoarseX_
std::vector< double > cellCoarseX_
Definition: HGCalParameters.h:118
HGCalParameters::cellCoarseIndex_
wafer_map cellCoarseIndex_
Definition: HGCalParameters.h:120
hfnoseParametersInitialization_cfi.name2
name2
Definition: hfnoseParametersInitialization_cfi.py:8
DDsvalues_type
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
dttmaxenums::R
Definition: DTTMax.h:29
cms::DDDetector::vectors
DDVectorsMap const & vectors() const
Definition: DDDetector.h:22
HGCalParameters::levelT_
std::vector< int > levelT_
Definition: HGCalParameters.h:129
cms::DDCompactView::detector
const cms::DDDetector * detector() const
Definition: DDCompactView.h:32