CMS 3D CMS Logo

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

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

12  {
13 #ifdef LOCAL_DEBUG
14  std::cout << "MuonDDDConstants;:MuonDDDConstants ( const DDCompactView& cpv ) constructor " << std::endl;
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  std::cout << "mySpecs.size() = " << mySpecs.size() << std::endl;
29 #endif
30  if ( mySpecs.size() < 25 ) {
31  edm::LogError("MuonDDDConstants") << " MuonDDDConstants: Missing SpecPars from DetectorDescription." << std::endl;
32  std::string msg = "MuonDDDConstants does not have the appropriate number of SpecPars associated";
33  msg+= " with the part //MUON.";
34  throw cms::Exception("GeometryBuildFailure", msg);
35  }
36 
37  DDsvalues_type::const_iterator bit = mySpecs.begin();
38  DDsvalues_type::const_iterator eit = mySpecs.end();
39  for ( ; bit != eit; ++bit ) {
40  if ( bit->second.isEvaluated() ) {
41  this->addValue( bit->second.name(), int(bit->second.doubles()[0]) );
42 #ifdef LOCAL_DEBUG
43  std::cout << "adding DDConstant of " << bit->second.name() << " = " << int(bit->second.doubles()[0]) << std::endl;
44 #endif
45  }
46  }
47 }
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 addValue(const std::string &name, const int &value)
tuple msg
Definition: mps_check.py:277
MuonDDDConstants::MuonDDDConstants ( )
delete

Member Function Documentation

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

Definition at line 70 of file MuonDDDConstants.cc.

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

Referenced by MuonDDDConstants().

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

Definition at line 49 of file MuonDDDConstants.cc.

References gather_cfg::cout, 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().

49  {
50 #ifdef LOCAL_DEBUG
51  std::cout << "about to look for ... " << name << std::endl;
52 #endif
53  if ( namesAndValues_.empty() ) {
54  std::cout << "MuonDDDConstants::getValue HAS NO VALUES!" << std::endl;
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  std::cout << "MuonDDDConstants::getValue was asked for " << name << " and had NO clue!" << std::endl;
62  throw cms::Exception("GeometryBuildFailure", "MuonDDDConstants does not have requested value for " + name);
63  }
64 #ifdef LOCAL_DEBUG
65  std::cout << "Value for " << name << " is " << findIt->second << std::endl;
66 #endif
67  return findIt->second;
68 }
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().