CMS 3D CMS Logo

List of all members | Public Member Functions
HGCalParametersFromDD Class Reference

#include <HGCalParametersFromDD.h>

Public Member Functions

bool build (const DDCompactView *, HGCalParameters &, const std::string &, const std::string &, const std::string &)
 
 HGCalParametersFromDD ()
 
virtual ~HGCalParametersFromDD ()
 

Detailed Description

Definition at line 9 of file HGCalParametersFromDD.h.

Constructor & Destructor Documentation

HGCalParametersFromDD::HGCalParametersFromDD ( )
inline

Definition at line 11 of file HGCalParametersFromDD.h.

11 {}
virtual HGCalParametersFromDD::~HGCalParametersFromDD ( )
inlinevirtual

Definition at line 12 of file HGCalParametersFromDD.h.

References build(), and AlCaHLTBitMon_QueryRunRegistry::string.

12 {}

Member Function Documentation

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

Definition at line 52 of file HGCalParametersFromDD.cc.

References gather_cfg::cout, Exception, HGCalGeometryMode::ExtrudedPolygon, ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), relativeConstraints::geom, HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, HGCalGeomParameters::loadCellParsHexagon(), HGCalGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadGeometrySquare(), HGCalGeomParameters::loadSpecParsHexagon(), HGCalGeomParameters::loadSpecParsSquare(), HGCalGeomParameters::loadWaferHexagon(), DDFilteredView::mergedSpecifics(), ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, HGCalParameters::mode_, dataset::name, convertSQLiteXML::ok, HGCalGeometryMode::Polyhedra, HGCalGeometryMode::Square, AlCaHLTBitMon_QueryRunRegistry::string, pfDeepBoostedJetPreprocessParams_cfi::sv, and heppy_batch::val.

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

56  {
57 
58 #ifdef EDM_ML_DEBUG
59  std::cout << "HGCalParametersFromDD::build called with names " << name << ":"
60  << namew << ":" << namec << std::endl;
61 #endif
62 
63  //Special parameters at simulation level
64  std::string attribute = "Volume";
66  DDValue val(attribute, value, 0.0);
68  DDFilteredView fv(*cpv,filter);
69  bool ok = fv.firstChild();
71 
72  if (ok) {
73  DDsvalues_type sv(fv.mergedSpecifics());
74  php.mode_ = getGeometryMode("GeometryMode", sv);
75 #ifdef EDM_ML_DEBUG
76  std::cout << "GeometryMode " << php.mode_ <<":" << HGCalGeometryMode::Square
77  << ":" << HGCalGeometryMode::Hexagon << ":"
78  << HGCalGeometryMode::HexagonFull << std::endl;
79 #endif
81  if ((php.mode_ == HGCalGeometryMode::Hexagon) ||
83  attribute = "OnlyForHGCalNumbering";
84  value = "HGCal";
85  DDValue val2(attribute, value, 0.0);
86  DDSpecificsMatchesValueFilter filter2{val2};
87  DDFilteredView fv2(*cpv,filter2);
88  bool ok2 = fv2.firstChild();
89  if (ok2) {
90  DDsvalues_type sv2(fv2.mergedSpecifics());
91  mode = getGeometryWaferMode("WaferMode", sv2);
92 #ifdef EDM_ML_DEBUG
93  std::cout << "WaferMode " << mode << ":" << HGCalGeometryMode::Polyhedra
94  << ":" << HGCalGeometryMode::ExtrudedPolygon << std::endl;
95 #endif
96  }
97  }
98  if (php.mode_ == HGCalGeometryMode::Square) {
99  //Load the SpecPars
100  geom->loadSpecParsSquare(fv, php);
101  //Load the Geometry parameters
102  geom->loadGeometrySquare(fv, php, name);
103  } else if (php.mode_ == HGCalGeometryMode::Hexagon) {
104  //Load the SpecPars
105  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
106  //Load the Geometry parameters
107  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec, mode);
108  //Load cell parameters
109  geom->loadCellParsHexagon(cpv, php);
110  } else if (php.mode_ == HGCalGeometryMode::HexagonFull) {
111  //Load the SpecPars
112  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
113  //Load the Geometry parameters
114  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec, mode);
115  //Modify some constants
116  geom->loadWaferHexagon(php);
117  //Load cell parameters
118  geom->loadCellParsHexagon(cpv, php);
119  } else {
120  edm::LogError("HGCalGeom") << "Unknown Geometry type " << php.mode_
121  << " for HGCal " << name << ":" << namew
122  << ":" << namec;
123  throw cms::Exception("DDException")
124  << "Unknown Geometry type " << php.mode_ << " for HGCal " << name
125  << ":" << namew << ":" << namec;
126  }
127  } else {
128  edm::LogError("HGCalGeom") << " Attribute " << val
129  << " not found but needed.";
130  throw cms::Exception("DDException") << "Attribute " << val
131  << " not found but needed.";
132  }
133 
134  edm::LogInfo("HGCalGeom") << "Return from HGCalParametersFromDD::build with "
135  << ok;
136  return ok;
137 }
void loadSpecParsHexagon(const DDFilteredView &, HGCalParameters &, const DDCompactView *, const std::string &, const std::string &)
HGCalGeometryMode::GeometryMode mode_
void loadCellParsHexagon(const DDCompactView *cpv, HGCalParameters &php)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:20
Definition: value.py:1
void loadWaferHexagon(HGCalParameters &php)
void loadSpecParsSquare(const DDFilteredView &, HGCalParameters &)
void loadGeometrySquare(const DDFilteredView &, HGCalParameters &, const std::string &)
void loadGeometryHexagon(const DDFilteredView &, HGCalParameters &, const std::string &, const DDCompactView *, const std::string &, const std::string &, HGCalGeometryMode::WaferMode)