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 (const DDCompactView &cpv)
 
 MuonDDDConstants ()=delete
 

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::MuonDDDConstants ( const DDCompactView cpv)

Definition at line 11 of file MuonDDDConstants.cc.

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

11  {
12 #ifdef LOCAL_DEBUG
13  edm::LogVerbatim("Geometry")
14  << "MuonDDDConstants;:MuonDDDConstants ( const DDCompactView& cpv ) constructor ";
15 #endif
16  std::string attribute = "OnlyForMuonNumbering";
17 
19  DDFilteredView fview(cpv,filter);
20 
21  DDValue val2("level");
22  const DDsvalues_type params(fview.mergedSpecifics());
23 
24  fview.firstChild();
25 
26  const DDsvalues_type mySpecs (fview.mergedSpecifics());
27 #ifdef LOCAL_DEBUG
28  edm::LogVerbatim("Geometry")
29  << "MuonDDDConstants::mySpecs.size() = " << mySpecs.size();
30 #endif
31  if ( mySpecs.size() < 25 ) {
32  edm::LogError("MuonDDDConstants")
33  << " MuonDDDConstants: Missing SpecPars from DetectorDescription.";
34  std::string msg = "MuonDDDConstants does not have the appropriate number of SpecPars associated with the part //MUON.";
35  throw cms::Exception("GeometryBuildFailure", msg);
36  }
37 
38  DDsvalues_type::const_iterator bit = mySpecs.begin();
39  DDsvalues_type::const_iterator eit = mySpecs.end();
40  for ( ; bit != eit; ++bit ) {
41  if ( bit->second.isEvaluated() ) {
42  this->addValue( bit->second.name(), int(bit->second.doubles()[0]) );
43 #ifdef LOCAL_DEBUG
44  edm::LogVerbatim("Geometry")
45  << "MuonDDDConstants::adding DDConstant of " << bit->second.name()
46  << " = " << int(bit->second.doubles()[0]);
47 #endif
48  }
49  }
50 }
void addValue(const std::string &name, const int &value)
tuple msg
Definition: mps_check.py:279
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
MuonDDDConstants::MuonDDDConstants ( )
delete

Member Function Documentation

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

Definition at line 74 of file MuonDDDConstants.cc.

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

Referenced by MuonDDDConstants().

74  {
76 }
std::map< std::string, int > namesAndValues_
int MuonDDDConstants::getValue ( const std::string &  name) const

Definition at line 52 of file MuonDDDConstants.cc.

References Exception, and namesAndValues_.

Referenced by GEMNumberingScheme::initMe(), ME0NumberingScheme::initMe(), CSCNumberingScheme::initMe(), RPCNumberingScheme::initMe(), DTNumberingScheme::initMe(), MuonDDDNumbering::MuonDDDNumbering(), MuonG4Numbering::MuonG4Numbering(), MuonGEMFrameRotation::MuonGEMFrameRotation(), MuonME0FrameRotation::MuonME0FrameRotation(), and MuonRPCFrameRotation::MuonRPCFrameRotation().

52  {
53 #ifdef LOCAL_DEBUG
54  edm::LogVerbatim("Geometry") << "about to look for ... " << name << std::endl;
55 #endif
56  if ( namesAndValues_.empty() ) {
57  edm::LogWarning("Geometry") << "MuonDDDConstants::getValue HAS NO VALUES!";
58  throw cms::Exception("GeometryBuildFailure", "MuonDDDConstants does not have requested value for " + name);
59  }
60 
61  std::map<std::string, int>::const_iterator findIt = namesAndValues_.find(name);
62 
63  if ( findIt == namesAndValues_.end() ) {
64  edm::LogWarning("Geometry") << "MuonDDDConstants::getValue was asked for " << name << " and had NO clue!";
65  throw cms::Exception("GeometryBuildFailure", "MuonDDDConstants does not have requested value for " + name);
66  }
67 #ifdef LOCAL_DEBUG
68  edm::LogVerbatim("Geometry")
69  << "MuonDDDConstants::Value for " << name << " is " << findIt->second;
70 #endif
71  return findIt->second;
72 }
std::map< std::string, int > namesAndValues_

Member Data Documentation

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

Definition at line 32 of file MuonDDDConstants.h.

Referenced by addValue(), and getValue().