test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.

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 DDFilteredView::addFilter(), gather_cfg::cout, equals, Exception, alcazmumu_cfi::filter, DDFilteredView::firstChild(), relativeConstraints::geom, Hexagon, HexagonFull, HGCalGeomParameters::loadCellParsHexagon(), HGCalGeomParameters::loadGeometryHexagon(), HGCalGeomParameters::loadGeometrySquare(), HGCalGeomParameters::loadSpecParsHexagon(), HGCalGeomParameters::loadSpecParsSquare(), HGCalGeomParameters::loadWaferHexagon(), DDFilteredView::mergedSpecifics(), HGCalParameters::mode_, mergeVDriftHistosByStation::name, convertSQLiteXML::ok, DDSpecificsFilter::setCriteria(), Square, AlCaHLTBitMon_QueryRunRegistry::string, SpecificationBuilder_cfi::val(), and relativeConstraints::value.

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

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);
54  DDFilteredView fv(*cpv);
55  fv.addFilter(filter);
56  bool ok = fv.firstChild();
57 
58  if (ok) {
59  DDsvalues_type sv(fv.mergedSpecifics());
60  php.mode_ = getGeometryMode("GeometryMode", sv);
62  if (php.mode_ == static_cast<int> (HGCalGeometryMode::Square)) {
63  //Load the SpecPars
64  geom->loadSpecParsSquare(fv, php);
65  //Load the Geometry parameters
66  geom->loadGeometrySquare(fv, php, name);
67  } else if (php.mode_ == static_cast<int> (HGCalGeometryMode::Hexagon)) {
68  //Load the SpecPars
69  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
70  //Load the Geometry parameters
71  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec);
72  //Load cell parameters
73  geom->loadCellParsHexagon(cpv, php);
74  } else if (php.mode_ == static_cast<int> (HGCalGeometryMode::HexagonFull)){
75  //Load the SpecPars
76  geom->loadSpecParsHexagon(fv, php, cpv, namew, namec);
77  //Load the Geometry parameters
78  geom->loadGeometryHexagon(fv, php, name, cpv, namew, namec);
79  //Modify some constants
80  geom->loadWaferHexagon(php);
81  //Load cell parameters
82  geom->loadCellParsHexagon(cpv, php);
83  } else {
84  edm::LogError("HGCalGeom") << "Unknown Geometry type " << php.mode_
85  << " for HGCal " << name << ":" << namew
86  << ":" << namec;
87  throw cms::Exception("DDException")
88  << "Unknown Geometry type " << php.mode_ << " for HGCal " << name
89  << ":" << namew << ":" << namec;
90  }
91  } else {
92  edm::LogError("HGCalGeom") << " Attribute " << val
93  << " not found but needed.";
94  throw cms::Exception("DDException") << "Attribute " << val
95  << " not found but needed.";
96  }
97 
98  edm::LogInfo("HGCalGeom") << "Return from HGCalParametersFromDD::build with "
99  << ok;
100  return ok;
101 }
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
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 &)
tuple cout
Definition: gather_cfg.py:145
void loadGeometrySquare(const DDFilteredView &, HGCalParameters &, const std::string &)
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
Definition: DDFilter.cc:253
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.
Definition: DDFilter.h:33