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 37 of file HGCalParametersFromDD.cc.

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

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

41  {
42 
43 #ifdef EDM_ML_DEBUG
44  std::cout << "HGCalParametersFromDD::build called with names " << name << ":"
45  << namew << ":" << namec << std::endl;
46 #endif
47 
48  //Special parameters at simulation level
49  std::string attribute = "Volume";
51  DDValue val(attribute, value, 0.0);
53  DDFilteredView fv(*cpv,filter);
54  bool ok = fv.firstChild();
55 
56  if (ok) {
57  DDsvalues_type sv(fv.mergedSpecifics());
58  php.mode_ = getGeometryMode("GeometryMode", sv);
60  if (php.mode_ == static_cast<int> (HGCalGeometryMode::Square)) {
61  //Load the SpecPars
62  geom->loadSpecParsSquare(fv, php);
63  //Load the Geometry parameters
64  geom->loadGeometrySquare(fv, php, name);
65  } else if (php.mode_ == static_cast<int> (HGCalGeometryMode::Hexagon)) {
66  //Load the SpecPars
67  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
68  //Load the Geometry parameters
69  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec);
70  //Load cell parameters
71  geom->loadCellParsHexagon(cpv, php);
72  } else if (php.mode_ == static_cast<int> (HGCalGeometryMode::HexagonFull)){
73  //Load the SpecPars
74  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
75  //Load the Geometry parameters
76  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec);
77  //Modify some constants
78  geom->loadWaferHexagon(php);
79  //Load cell parameters
80  geom->loadCellParsHexagon(cpv, php);
81  } else {
82  edm::LogError("HGCalGeom") << "Unknown Geometry type " << php.mode_
83  << " for HGCal " << name << ":" << namew
84  << ":" << namec;
85  throw cms::Exception("DDException")
86  << "Unknown Geometry type " << php.mode_ << " for HGCal " << name
87  << ":" << namew << ":" << namec;
88  }
89  } else {
90  edm::LogError("HGCalGeom") << " Attribute " << val
91  << " not found but needed.";
92  throw cms::Exception("DDException") << "Attribute " << val
93  << " not found but needed.";
94  }
95 
96  edm::LogInfo("HGCalGeom") << "Return from HGCalParametersFromDD::build with "
97  << ok;
98  return ok;
99 }
void loadSpecParsHexagon(const DDFilteredView &, HGCalParameters &, const DDCompactView *, const std::string &, const std::string &)
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 loadGeometryHexagon(const DDFilteredView &, HGCalParameters &, const std::string &, const DDCompactView *, const std::string &, const std::string &)
void loadGeometrySquare(const DDFilteredView &, HGCalParameters &, const std::string &)