CMS 3D CMS Logo

MuonDDDConstants.cc
Go to the documentation of this file.
2 
5 
8 
9 //#define LOCAL_DEBUG
10 
12 #ifdef LOCAL_DEBUG
13  edm::LogVerbatim("Geometry") << "MuonDDDConstants;:MuonDDDConstants ( const DDCompactView& cpv ) constructor ";
14 #endif
15  std::string attribute = "OnlyForMuonNumbering";
16 
18  DDFilteredView fview(cpv, filter);
19 
20  DDValue val2("level");
21  const DDsvalues_type params(fview.mergedSpecifics());
22 
23  fview.firstChild();
24 
25  const DDsvalues_type mySpecs(fview.mergedSpecifics());
26 #ifdef LOCAL_DEBUG
27  edm::LogVerbatim("Geometry") << "MuonDDDConstants::mySpecs.size() = " << mySpecs.size();
28 #endif
29  if (mySpecs.size() < 25) {
30  edm::LogError("MuonDDDConstants") << " MuonDDDConstants: Missing SpecPars from DetectorDescription.";
32  "MuonDDDConstants does not have the appropriate number of SpecPars associated with the part //MUON.";
33  throw cms::Exception("GeometryBuildFailure", msg);
34  }
35 
36  DDsvalues_type::const_iterator bit = mySpecs.begin();
37  DDsvalues_type::const_iterator eit = mySpecs.end();
38  for (; bit != eit; ++bit) {
39  if (bit->second.isEvaluated()) {
40  this->addValue(bit->second.name(), int(bit->second.doubles()[0]));
41 #ifdef LOCAL_DEBUG
42  edm::LogVerbatim("Geometry") << "MuonDDDConstants::adding DDConstant of " << bit->second.name() << " = "
43  << int(bit->second.doubles()[0]);
44 #endif
45  }
46  }
47 }
48 
50 #ifdef LOCAL_DEBUG
51  edm::LogVerbatim("Geometry") << "about to look for ... " << name << std::endl;
52 #endif
53  if (namesAndValues_.empty()) {
54  edm::LogWarning("Geometry") << "MuonDDDConstants::getValue HAS NO VALUES!";
55  throw cms::Exception("GeometryBuildFailure", "MuonDDDConstants does not have requested value for " + name);
56  }
57 
58  std::map<std::string, int>::const_iterator findIt = namesAndValues_.find(name);
59 
60  if (findIt == namesAndValues_.end()) {
61  edm::LogWarning("Geometry") << "MuonDDDConstants::getValue was asked for " << name << " and had NO clue!";
62  throw cms::Exception("GeometryBuildFailure", "MuonDDDConstants does not have requested value for " + name);
63  }
64 #ifdef LOCAL_DEBUG
65  edm::LogVerbatim("Geometry") << "MuonDDDConstants::Value for " << name << " is " << findIt->second;
66 #endif
67  return findIt->second;
68 }
69 
MuonDDDConstants.h
MessageLogger.h
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
DDFilteredView::mergedSpecifics
DDsvalues_type mergedSpecifics() const
Definition: DDFilteredView.cc:42
mps_check.msg
tuple msg
Definition: mps_check.py:285
MuonDDDConstants::getValue
int getValue(const std::string &name) const
Definition: MuonDDDConstants.cc:49
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
DDFilteredView.h
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
DDValue.h
MuonDDDConstants::namesAndValues_
std::map< std::string, int > namesAndValues_
Definition: MuonDDDConstants.h:31
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
edm::LogError
Definition: MessageLogger.h:183
createfilelist.int
int
Definition: createfilelist.py:10
DDSpecificsHasNamedValueFilter
Definition: DDFilter.h:60
value
Definition: value.py:1
edm::LogVerbatim
Definition: MessageLogger.h:297
MuonDDDConstants::addValue
void addValue(const std::string &name, const int &value)
Definition: MuonDDDConstants.cc:70
DDValue
Definition: DDValue.h:21
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:246
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
Exception.h
DDFilteredView
Definition: DDFilteredView.h:20
MuonDDDConstants::MuonDDDConstants
MuonDDDConstants()=delete
DDsvalues_type
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12