CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MuonDDDConstants Class Reference

#include <MuonDDDConstants.h>

Public Member Functions

void addValue (const std::string &name, const int &value)
 
int getValue (const std::string &name) const
 
 MuonDDDConstants ()=delete
 
 MuonDDDConstants (const DDCompactView &cpv)
 

Private Attributes

std::map< std::string, int > namesAndValues_
 

Detailed Description

this class reads the constant section of the muon-numbering xml-file

Author
Arno Straessner, CERN arno..nosp@m.stra.nosp@m.essne.nosp@m.r@ce.nosp@m.rn.ch modified by: Michael Case, micha.nosp@m.el.c.nosp@m.ase@c.nosp@m.ern..nosp@m.ch, 2006/10/05

Definition at line 21 of file MuonDDDConstants.h.

Constructor & Destructor Documentation

◆ MuonDDDConstants() [1/2]

MuonDDDConstants::MuonDDDConstants ( const DDCompactView cpv)

Definition at line 11 of file MuonDDDConstants.cc.

11  {
12 #ifdef EDM_ML_DEBUG
13  edm::LogVerbatim("MuonGeom") << "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 EDM_ML_DEBUG
27  edm::LogVerbatim("MuonGeom") << "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 EDM_ML_DEBUG
42  edm::LogVerbatim("MuonGeom") << "MuonDDDConstants::adding DDConstant of " << bit->second.name() << " = "
43  << int(bit->second.doubles()[0]);
44 #endif
45  }
46  }
47 }

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

◆ MuonDDDConstants() [2/2]

MuonDDDConstants::MuonDDDConstants ( )
delete

Member Function Documentation

◆ addValue()

void MuonDDDConstants::addValue ( const std::string &  name,
const int &  value 
)

Definition at line 70 of file MuonDDDConstants.cc.

References Skims_PA_cff::name, namesAndValues_, and relativeConstraints::value.

Referenced by MuonDDDConstants().

◆ getValue()

int MuonDDDConstants::getValue ( const std::string &  name) const

Definition at line 49 of file MuonDDDConstants.cc.

49  {
50 #ifdef EDM_ML_DEBUG
51  edm::LogVerbatim("MuonGeom") << "about to look for ... " << name << std::endl;
52 #endif
53  if (namesAndValues_.empty()) {
54  edm::LogWarning("MuonGeom") << "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("MuonGeom") << "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 EDM_ML_DEBUG
65  edm::LogVerbatim("MuonGeom") << "MuonDDDConstants::Value for " << name << " is " << findIt->second;
66 #endif
67  return findIt->second;
68 }

References Exception, Skims_PA_cff::name, and namesAndValues_.

Member Data Documentation

◆ namesAndValues_

std::map<std::string, int> MuonDDDConstants::namesAndValues_
private

Definition at line 31 of file MuonDDDConstants.h.

Referenced by addValue(), and getValue().

CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
MuonDDDConstants::namesAndValues_
std::map< std::string, int > namesAndValues_
Definition: MuonDDDConstants.h:31
createfilelist.int
int
Definition: createfilelist.py:10
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
MuonDDDConstants::addValue
void addValue(const std::string &name, const int &value)
Definition: MuonDDDConstants.cc:70
DDValue
Definition: DDValue.h:22
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Exception
Definition: hltDiff.cc:245
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDFilteredView
Definition: DDFilteredView.h:20
DDsvalues_type
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12