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::loadSpecParsHexagon(), HGCalGeomParameters::loadWaferHexagon(), DDFilteredView::mergedSpecifics(), ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, HGCalParameters::mode_, dataset::name, convertSQLiteXML::ok, HGCalGeometryMode::Polyhedra, AlCaHLTBitMon_QueryRunRegistry::string, 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_
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::Hexagon) {
99  //Load the SpecPars
100  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
101  //Load the Geometry parameters
102  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec, mode);
103  //Load cell parameters
104  geom->loadCellParsHexagon(cpv, php);
105  } else if (php.mode_ == HGCalGeometryMode::HexagonFull) {
106  //Load the SpecPars
107  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
108  //Load the Geometry parameters
109  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec, mode);
110  //Modify some constants
111  geom->loadWaferHexagon(php);
112  //Load cell parameters
113  geom->loadCellParsHexagon(cpv, php);
114  } else {
115  edm::LogError("HGCalGeom") << "Unknown Geometry type " << php.mode_
116  << " for HGCal " << name << ":" << namew
117  << ":" << namec;
118  throw cms::Exception("DDException")
119  << "Unknown Geometry type " << php.mode_ << " for HGCal " << name
120  << ":" << namew << ":" << namec;
121  }
122  } else {
123  edm::LogError("HGCalGeom") << " Attribute " << val
124  << " not found but needed.";
125  throw cms::Exception("DDException") << "Attribute " << val
126  << " not found but needed.";
127  }
128 
129  edm::LogInfo("HGCalGeom") << "Return from HGCalParametersFromDD::build with "
130  << ok;
131  return ok;
132 }
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 loadGeometryHexagon(const DDFilteredView &, HGCalParameters &, const std::string &, const DDCompactView *, const std::string &, const std::string &, HGCalGeometryMode::WaferMode)