CMS 3D CMS Logo

List of all members | Public Member Functions
MuonGeometryConstantsBuild Class Reference

#include <MuonGeometryConstantsBuild.h>

Public Member Functions

bool build (const cms::DDCompactView *cpv, MuonGeometryConstants &php)
 
bool build (const DDCompactView *cpv, MuonGeometryConstants &php)
 
 MuonGeometryConstantsBuild ()
 

Detailed Description

Definition at line 11 of file MuonGeometryConstantsBuild.h.

Constructor & Destructor Documentation

◆ MuonGeometryConstantsBuild()

MuonGeometryConstantsBuild::MuonGeometryConstantsBuild ( )
inline

Definition at line 13 of file MuonGeometryConstantsBuild.h.

13 {}

Member Function Documentation

◆ build() [1/2]

bool MuonGeometryConstantsBuild::build ( const cms::DDCompactView cpv,
MuonGeometryConstants php 
)

Definition at line 54 of file MuonGeometryConstantsBuild.cc.

54  {
55 #ifdef EDM_ML_DEBUG
56  edm::LogVerbatim("MuonGeom")
57  << "MuonGeometryConstantsBuild;:build (const cms::DDCompactView* cpv, MuonGeometryConstants& php)";
58 #endif
59  cms::DDSpecParRegistry const& registry = cpv->specpars();
60  auto it = registry.specpars.find("MuonCommonNumbering");
61  if (it != end(registry.specpars)) {
62  for (const auto& l : it->second.spars) {
63  if (l.first == "OnlyForMuonNumbering") {
64  for (const auto& k : it->second.numpars) {
65  for (const auto& ik : k.second) {
66  php.addValue(k.first, static_cast<int>(ik));
67 #ifdef EDM_ML_DEBUG
68  edm::LogVerbatim("MuonGeom") << "MuonGeometryConstantsBuild::adding DDConstant of " << k.first << " = "
69  << static_cast<int>(ik);
70 #endif
71  }
72  }
73  }
74  }
75  }
76 
77  return true;
78 }

References MuonGeometryConstants::addValue(), mps_fire::end, dqmdumpme::k, cmsLHEtoEOSManager::l, and cms::DDCompactView::specpars().

◆ build() [2/2]

bool MuonGeometryConstantsBuild::build ( const DDCompactView cpv,
MuonGeometryConstants php 
)

Definition at line 13 of file MuonGeometryConstantsBuild.cc.

13  {
14 #ifdef EDM_ML_DEBUG
15  edm::LogVerbatim("MuonGeom")
16  << "MuonGeometryConstantsBuild;:build (const DDCompactView* cpv, MuonGeometryConstants& php)";
17 #endif
18  std::string attribute = "OnlyForMuonNumbering";
19 
21  DDFilteredView fview((*cpv), filter);
22 
23  DDValue val2("level");
24  const DDsvalues_type params(fview.mergedSpecifics());
25 
26  fview.firstChild();
27 
28  const DDsvalues_type mySpecs(fview.mergedSpecifics());
29 #ifdef EDM_ML_DEBUG
30  edm::LogVerbatim("MuonGeom") << "MuonGeometryConstantsBuild::mySpecs.size() = " << mySpecs.size();
31 #endif
32  if (mySpecs.size() < 25) {
33  edm::LogError("MuonGeometryConstantsBuild")
34  << " MuonGeometryConstantsBuild: Missing SpecPars from DetectorDescription.";
36  "MuonGeometryConstantsBuild does not have the appropriate number of SpecPars associated with the part //MUON.";
37  throw cms::Exception("GeometryBuildFailure", msg);
38  }
39 
40  DDsvalues_type::const_iterator bit = mySpecs.begin();
41  DDsvalues_type::const_iterator eit = mySpecs.end();
42  for (; bit != eit; ++bit) {
43  if (bit->second.isEvaluated()) {
44  php.addValue(bit->second.name(), static_cast<int>(bit->second.doubles()[0]));
45 #ifdef EDM_ML_DEBUG
46  edm::LogVerbatim("MuonGeom") << "MuonGeometryConstantsBuild::adding DDConstant of " << bit->second.name() << " = "
47  << static_cast<int>(bit->second.doubles()[0]);
48 #endif
49  }
50  }
51  return true;
52 }

References MuonGeometryConstants::addValue(), Exception, ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), DDFilteredView::mergedSpecifics(), mps_check::msg, CalibrationSummaryClient_cfi::params, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by MuonGeometryConstantsESModule::produce().

CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
MuonGeometryConstants::addValue
void addValue(const std::string &name, const int &value)
Definition: MuonGeometryConstants.cc:25
mps_check.msg
tuple msg
Definition: mps_check.py:285
cms::DDSpecParRegistry
dd4hep::SpecParRegistry DDSpecParRegistry
Definition: DDCompactView.h:28
mps_fire.end
end
Definition: mps_fire.py:242
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
DDSpecificsHasNamedValueFilter
Definition: DDFilter.h:60
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cms::DDCompactView::specpars
DDSpecParRegistry const & specpars() const
Definition: DDCompactView.h:35
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
DDValue
Definition: DDValue.h:22
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Exception
Definition: hltDiff.cc:245
DDFilteredView
Definition: DDFilteredView.h:20
DDsvalues_type
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12